Re: About /etc/mtab and /proc/mounts

Olaf Dietsche
2003-02-26T13:29:53Z

mru@users.sourceforge.net (Måns Rullgård) writes:

> Olaf Dietsche <olaf.dietsche@t-online.de> writes:
>
>> The 'user' option is in /etc/fstab, so this is not a problem. I can
>> mount _and_ umount /cdrom as a simple user.
>
> It's strange if you can. My mount (fairly recent) looks in fstab to
> determine whether a user should be allowed to mount a device.
> However, when unmounting it checks /etc/mtab to make sure it was you
> who mounted it in the first place, making it impossible to unmount
> someone else's cdrom. If you use the 'users' (note the 's') option
> instead any user can mount or unmount the device at any time, mtab
> being ignored.

I just verified it. I and anybody else can mount and umount /cdrom. If
I mounted /cdrom, someone else can umount it.

$ mount -V
mount: mount-2.11n

$ grep user /etc/fstab
/dev/hdb/0 /cdrom iso9660 defaults,ro,unhide,user,noauto,noexec,nosuid 0 2

$ ls -l /etc/mtab
lrwxrwxrwx 1 root root 12 2002-09-22 02:58 /etc/mtab -> /proc/mounts

When /etc/mtab is a regular file, it works as you described.

Regards, Olaf.