[wplug] Permissions question

James O'Kane jo2y at midnightlinux.com
Sat Jul 9 11:25:46 EDT 2005


On Fri, 8 Jul 2005, Brad Hoover wrote:
> Thank you for you quick assistance.  I added the uid
> line to my fstab file and it works fine now.  I must
> say I am a bit confused though.  Once the drive was
> mounted to a specific directory, I would tend to think
> it would be no different than any other directory,
> thus, that's why I was trying to change it's
> permissions -- but I guess it *is* different somehow.

The user, group and the permission bits you see from ls (drwxrwxrwx) are a 
property of the filesystem. ext3, reiserfs and other unix filesystems 
support them the way you've observed. NTFS stores permissions differently 
and FAT32 doesn't have them at all.

Since it's ultimately the responsibilty of the filesystem driver and the 
kernel to enforce these permissions, the vfat driver needs to know how to 
fake the permissions. That's what the uid and gid arguments do. It tells 
the drive to pretend that all files on that filesystem are owned by that 
user and group. Otherwise it defaults to root. I don't have a setup where 
I can check, but my guess is that when you mounted it without those flags, 
it defaulted to root and to a fairly restrictive permission set. Ie. No 
read access for 'other'.

I also think that if you were to try and chmod a file within the mounted 
FAT partition, it the vfat driver would claim that it worked but ignore 
it. (/mount/windows is not on the mounted drive so that obeys the unix 
permissions.)

If you really want to confuse yourself, take a look at AFS's permission 
ssetup. Permissions are done on a per-directory basis and are more finely 
tuned. You can give someone the ability to create a file, but not delete 
it. Or delete but not read a file. The margin of this page is too small to 
contain a full explaination.

-james



More information about the wplug mailing list