FS#36968 - [util-linux] umount as non-privileged user: mountpoint not found
Attached to Project:
Arch Linux
Opened by M. P. (mpausch) - Tuesday, 17 September 2013, 20:44 GMT
Last edited by Dave Reisner (falconindy) - Friday, 20 September 2013, 18:47 GMT
Opened by M. P. (mpausch) - Tuesday, 17 September 2013, 20:44 GMT
Last edited by Dave Reisner (falconindy) - Friday, 20 September 2013, 18:47 GMT
|
Details
Description:
- in /etc/fstab the entry for a filesystem is with option "user" to allow non-priv users to mount - mount as non-priv user works - umount as non-priv user shows error: "mountpoint not found" - umount as root works Additional info: * package version(s) * config and/or log files etc. ### fstab entry for my $ cat /etc/fstab [...] LABEL=mybackup /mnt auto user,noauto 0 0 [...] Steps to reproduce: - create a fstab entry with option "user" (to be able to mount the FS as non-priv user) - follow procedure: ### show which partition is labeled with mybackup $ ls -la /dev/disk/by-label/mybackup lrwxrwxrwx 1 root root 10 17. Sep 21:44 /dev/disk/by-label/manebackup -> ../../sdf1 ### mount the FS as non-priv user (-> works) $ mount /dev/disk/by-label/mybackup ### check, if mounted $ mount | grep mnt /dev/sdf1 on /mnt type ext4 (rw,nosuid,nodev,noexec,relatime,data=ordered,user=myuser) ### try to umount (-> does not work) $ umount /dev/disk/by-label/mybackup umount: /mnt: mountpoint not found ### also alternate umounts commands don't work: $ umount /dev/sdf1 umount: /mnt: mountpoint not found $ umount /mnt umount: /mnt: mountpoint not found ### umount as super-user works # umount /dev/disk/by-label/mybackup # mount | grep mnt # - umount as non-priv user worked in the past, but does not work since <unknown> days/weeks/months - other users seem to face the same issue: https://bbs.archlinux.org/viewtopic.php?pid=1324991 |
This task depends upon
Closed by Dave Reisner (falconindy)
Friday, 20 September 2013, 18:47 GMT
Reason for closing: Fixed
Additional comments about closing: https://github.com/karelzak/util-linux/c ommit/4e9f59d1ee293108cd1d577f7b1a182f5b 0ac9c0
Friday, 20 September 2013, 18:47 GMT
Reason for closing: Fixed
Additional comments about closing: https://github.com/karelzak/util-linux/c ommit/4e9f59d1ee293108cd1d577f7b1a182f5b 0ac9c0
Problem seems to be pretty clear via the debug output:
17760: libmount: CXT: [0x22890e0]: do umount
17760: libmount: UTILS: moving to /opt parent
17760: libmount: CXT: current directory moved to / [last_component='opt']
17760: libmount: CXT: [0x22890e0]: umount(2) [target='pt', flags=0x00000000]
http://marc.info/?l=util-linux-ng&m=137945227914961&w=2
Maybe it has never been supported, but it worked in former times.
And why the _same_ umount command works as root user but not as non-priv user?
Even if I try to unmount with "umount <mountpoint>" (instead of "umount <device-name>") it
does not work as non-priv user (but as root user).
Because it follows different code paths, of course. Unmounting as a non-privileged user causes mount/umount to chdir() for security reasons. mnt_chdir_to_parent() is where this chokes...