]> 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>
Mon, 26 Nov 2012 15:24:54 +0000 (16:24 +0100)
commit5ebbc3865d1e53ef42e5f121c41faab23dd59075
treec66387a40ab7d9e14f48ce508a11e9f6c665d8f9
parent33c5fd0c5a774458470c86f9d318d8c48a9c9ccb
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