DASH Shell discussions
 help / color / mirror / Atom feed
From: Remi Broemeling <remi@nexopia.com>
To: dash@vger.kernel.org
Subject: dash test -w oddities
Date: Wed, 30 Apr 2008 15:05:07 -0600	[thread overview]
Message-ID: <4818DF03.3090003@nexopia.com> (raw)

Today I encountered some oddities using `test -w` as well as `[ -w`.  
The machine in question is an NFS-root (exported and mounted read-only) 
server running Ubuntu 8.04 LTS.

------
root@nexhost:~# mount
rootfs on / type rootfs (rw)
<snip non-relevant mounts>
192.168.10.60:/var/lib/tftpboot/netboot/default.r14599-amd64 on / type 
nfs 
(ro,relatime,vers=3,rsize=524288,wsize=524288,hard,nointr,nolock,proto=tcp,timeo=7,retrans=3,sec=sys,addr=192.168.10.60)
<snip non-relevant mounts>
------

If I try using -w in bash, things work as expected:
------
root@nexhost:~# bash
root@nexhost:~# [ -w / ] && echo Writable Root
root@nexhost:~# test -w / && echo Writable Root
root@nexhost:~# /usr/bin/[ -w / ] && echo Writable Root
root@nexhost:~# /usr/bin/test -w / && echo Writable Root
------

However, if I try using -w in dash, the builtin does not seem to work as 
I would expect:
------
# [ -w / ] && echo Writable Root
Writable Root
# test -w / && echo Writable Root
Writable Root
# /usr/bin/[ -w / ] && echo Writable Root
# /usr/bin/test -w / && echo Writable Root
------

I'm not sure if I am misunderstanding what is supposed to be happening 
with test/[, or if this is a bug in the dash built-ins, but I thought 
that I should at least mention it in case it is a bug.

Thanks.
-- 
Remi Broemeling

Sr System Administrator
Nexopia.com Inc.
P: 780.444.1250 X435
F: 780.487.0376
E: remi@nexopia.com
N: rbroemeling


There are two major products that come out of Berkeley: LSD and UNIX. We 
don't believe this to be a coincidence.
Jeremy S. Anderson

             reply	other threads:[~2008-04-30 21:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-30 21:05 Remi Broemeling [this message]
2008-04-30 22:38 ` dash test -w oddities Oleg Verych
2008-04-30 23:01   ` euidaccess() vs non suid /bin/sh (Re: dash test -w oddities) Oleg Verych
2008-04-30 22:52     ` H. Peter Anvin
2008-05-01  0:19       ` Oleg Verych
2008-05-01  6:03         ` H. Peter Anvin
2008-05-02 16:48     ` Oleg Verych

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4818DF03.3090003@nexopia.com \
    --to=remi@nexopia.com \
    --cc=dash@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox