]> git.ipfire.org Git - thirdparty/util-linux.git/commit
mount: sanitize paths from non-root users
authorKarel Zak <kzak@redhat.com>
Mon, 26 Nov 2012 13:30:22 +0000 (14:30 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 12 Dec 2012 10:15:04 +0000 (11:15 +0100)
commitb79ac1f007c8672d7fb18d535333cb9e1f59e1b2
tree57244b6bc4de9590fc75d6b73a41de4fe9b86e1a
parentd342b443d5daec2c55734e93ba3b81a60ae6075f
mount: sanitize paths from non-root users

 $ mount /root/.ssh/../../dev/sda2
 mount: only root can mount UUID=17bc65ec-4125-4e7c-8a7d-e2795064c736 on /boot

this is too promiscuous. It seems better to ignore on command line
specified paths which are not resolve-able for non-root users.

Fixed version:

  $ mount /root/.ssh/../../dev/sda2
  mount: /root/.ssh/../../dev/sda2: Permission denied

  $ mount /dev/sda2
  mount: only root can mount UUID=17bc65ec-4125-4e7c-8a7d-e2795064c736 on /boot

Note that this bug has no relation to mount(2) permissions evaluation
in suid mode. The way how non-root user specifies paths on command
line is completely irrelevant for comparison with fstab entries.

Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/mount.c