suid mount

DJ Lucas dj at lucasit.com
Mon Nov 10 17:37:54 PST 2003


Wanted to bring this up here, just in case I've overlooked something 
terribly obvious.  Is there a particular reason 'mount' is forced 
setuid?  Is the man page broken with regard to user/users or do I not 
understand correctly?  nosuid does not help either.  ntfs/vfat require 
root maybe?  Here look:

# The relevant line from /etc/fstab:
/dev/hde1       /mnt/windows    ntfs            ro,noauto,users    0 0

[dj at name1 mnt]# ls -l /dev/hde1
brw-rw----    1 root     disk      33,   1 Sep 13 11:48 /dev/hde1

# The user dj is part of the disk group...
disk:x:8:dj,<other id's snipped>

[dj at name1 mnt]# ls -ld /mnt/windows
drwxr-xr-x    2 root     root         4096 Sep 21 10:58 /mnt/windows
[dj at name1 mnt]# mount /mnt/windows
[dj at name1 mnt]# cd /mnt/windows
bash: cd: /mnt/windows: Permission denied
[dj at name1 mnt]# ls -ld /mnt/windows
dr-x------    1 root     root         8192 Nov  5 22:15 /mnt/windows
[dj at name1 mnt]# umount windows
[dj at name1 mnt]# cd windows
[dj at name1 windows]# cd ..
[dj at name1 mnt]# ls -ld /mnt/windows
drwxr-xr-x    2 root     root         4096 Sep 21 10:58 /mnt/windows
[dj at name1 mnt]# mount /mnt/windows
[dj at name1 mnt]# more /etc/mtab
/dev/hde1 /mnt/windows ntfs ro,noexec,nosuid,nodev 0 0
<sniped the rest>


# I don't see mention of user or users there....
# now...

[dj at name1 mnt]# su
Password:
[root at name1 mnt]# chmod 0755 /bin/mount
[root at name1 mnt]# ls -l /bin/mount
-rwxr-xr-x    1 root     root        64708 Sep 13 14:29 /bin/mount
[root at name1 mnt]# exit
exit
[dj at name1 mnt]# mount windows
mount: must be superuser to use mount

# Why?!?!?!?

Any explanation is much better than 'it seems like it's broken'.

Thanks.

-- DJ




More information about the lfs-support mailing list