[plug] Unix file permission problem (I think)

Steve Boak sboak at westnet.com.au
Thu Jul 7 23:10:20 WST 2005


On Thu, 7 Jul 2005 10:52 pm, Bernard Blackham wrote:
> On Thu, Jul 07, 2005 at 10:42:27PM +0800, Steve Boak wrote:
> > I have a funny feeling that I will regret asking this, as it will become
> > obvious to me as soon as I have pressed the send button...
> >
> > I am trying to create a directory 'Linux' on a basically empty partition
> > mounted on '/var/share/download', logged in as normal user 'steve'.
> >
> > Here's the error message:
> >
> > steve at min:/var/share/download$ mkdir Linux
> > mkdir: cannot create directory `Linux': Permission denied
> >
> > I've checked the directory permissions:
> > steve at min:/var/share/download$ ls -ld /var/share/download
> > drwxrwxr-x  3 root share 4096 Jul  7 21:56 /var/share/download
> >
> > I'm in the right group:
> >
> > steve at min:/var/share/download$ groups steve
> > steve : steve audio dip share
> >
> > What have I missed?
>
> Did you cd into the directory before mounting it? If so, then your
> shell will actually be in the old directory (which presumably has
> permissions that won't allow that) and you need to cd again :
>
> b at amidala:~$ cd /mnt
> b at amidala:/mnt$ ls -ld .
> drwxr-xr-x  3 root root 72 Mar 30 15:01 .
> b at amidala:/mnt$ mkdir this
> mkdir: cannot create directory `this': Permission denied
> b at amidala:/mnt$ ls -ld /space
> drwsrwsr-x  2 b b 48 Nov 24  2004 /space
> b at amidala:/mnt$ sudo mount --bind /space /mnt
> b at amidala:/mnt$ ls -ld .
> drwxr-xr-x  3 root root 72 Mar 30 15:01 .
> b at amidala:/mnt$ ls -ld /mnt
> drwsrwsr-x  2 b b 48 Nov 24  2004 /mnt
> b at amidala:/mnt$ mkdir this
> mkdir: cannot create directory `this': Permission denied
> b at amidala:/mnt$ cd /mnt
> b at amidala:/mnt$ mkdir this
> b at amidala:/mnt$ cd /
>
> Otherwise, I'm baffled for the time being...
>
> Bernard.

No, the partition is auto-mounted at boot time.

min:/var/share# cat /etc/fstab
[...]
/dev/hda8       /var/share/download     ext3    defaults        0       2

Just thought to check actual group numeric values in case something weird was 
going on here, but they look OK too:

steve at min:/var/share/download$ id steve
uid=1000(steve) gid=1000(steve) groups=1000(steve),29(audio),30(dip),1001
(share)

steve at min:/var/share/download$ ls -lnd /var/share/download
drwxrwxr-x  3 0 1001 4096 Jul  7 21:56 /var/share/download

Steve




More information about the plug mailing list