Are file permissions in files on external devices silly?

Chris Coulson chrisccoulson at googlemail.com
Fri Nov 21 18:48:57 UTC 2008


On Fri, 2008-11-21 at 19:33 +0100, Martin Pitt wrote:
> Jesse Ruffin [2008-11-21 11:46 -0500]:
> > The real answer is to use mount options.
> 
> Exactly.
> 
> > ADFS, AFFS, FAT (and variants), HFS, HPFS, ISO9660, and UDF all
> > support the 'gid' option. Combine that with the 'users' option
> 
> You mean the "uid" option, like the vfat and ntfs file systems have.
> 
> > As for doing this automatically, it could be included in the fstab
> > for fixed devices, such as floppy drives and CD/DVD drives.
> > Removable devices are a little harder
> 
> No, actually not. The hard part are drives in /etc/fstab, since we
> cannot automatically change them during upgrades. However, that
> shouldn't be a concern because hardly any removable USB device is in
> fstab, except for CD-ROMs for historical reasons (which expose this
> very problem with UDF).
> 
> For removable drives, once the kernel supports uid=/gid= options for
> hfs+ (Mac) and ext3 (other Linuxes), they can be trivially applied
> automatically in hal if a device is detected as removable. The hard
> part is to get kernel support for it.
There could be another way around getting the kernel to support the
uid=/gid= options for EXT3 and other filesystems. Bindfs [1] allows you
to bind mount directories and alter permissions/ownership of files on
the mirrored filesystems (leaving the underlying filesystem unchanged).
Perhaps this could be adopted when it becomes more stable, and get HAL
to bind mount the removable media? I'm currently using this filesystem
on my desktop to implement shared folders.
> 
> > Doing this by default seems safe to me, but it would need more
> > thought and consensus before change.
> 
> I mostly agree. I know systems which use USB hard drives as their main
> storage, where enforcing file system permissions is absolutely
> required. However, on such configurations, these drives are in fstab
> (for / or /home, etc.) and thus won't have the uid=/gid= options
> applied.
> 
> I don't think any user will expect enforced file permissions on an
> automount in /media/.
> 
> Martin

Regards,
Chris

[1] - http://code.google.com/p/bindfs/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <https://lists.ubuntu.com/archives/ubuntu-devel-discuss/attachments/20081121/1dc55d87/attachment.sig>


More information about the Ubuntu-devel-discuss mailing list