1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00
samba-mirror/client
Jeff Layton cc7b62269e mount.cifs: properly check for mount being in fstab when running setuid root (try#3)
This is the third attempt to clean up the checks when a setuid
mount.cifs is run by an unprivileged user. The main difference in this
patch from the last one is that it fixes a bug where the mount might
have failed if unnecessarily if CIFS_LEGACY_SETUID_CHECK was set.

When mount.cifs is installed setuid root and run as an unprivileged
user, it does some checks to limit how the mount is used. It checks that
the mountpoint is owned by the user doing the mount.

These checks however do not match those that /bin/mount does when it is
called by an unprivileged user. When /bin/mount is called by an
unprivileged user to do a mount, it checks that the mount in question is
in /etc/fstab, that it has the "user" option set, etc.

This means that it's currently not possible to set up user mounts the
standard way (by the admin, in /etc/fstab) and simultaneously protect
from an unprivileged user calling mount.cifs directly to mount a share
on any directory that that user owns.

Fix this by making the checks in mount.cifs match those of /bin/mount
itself. This is a necessary step to make mount.cifs safe to be installed
as a setuid binary, but not sufficient. For that, we'd need to give
mount.cifs a proper security audit.

Since some users may be depending on the legacy behavior, this patch
also adds the ability to build mount.cifs with the older behavior.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
2009-06-06 19:46:24 -04:00
..
cifs_spnego.h Move mount.cifs/umount.cifs to the top level and remove the outdated copy 2009-06-02 23:24:33 +02:00
cifs.upcall.c Move mount.cifs/umount.cifs to the top level and remove the outdated copy 2009-06-02 23:24:33 +02:00
mount.cifs.c mount.cifs: properly check for mount being in fstab when running setuid root (try#3) 2009-06-06 19:46:24 -04:00
mount.h Move mount.cifs/umount.cifs to the top level and remove the outdated copy 2009-06-02 23:24:33 +02:00
mtab.c Move mount.cifs/umount.cifs to the top level and remove the outdated copy 2009-06-02 23:24:33 +02:00
umount.cifs.c Move mount.cifs/umount.cifs to the top level and remove the outdated copy 2009-06-02 23:24:33 +02:00