]> git.ipfire.org Git - thirdparty/util-linux.git/commit
mount: append inverting options for mount.<type>
authorKarel Zak <kzak@redhat.com>
Mon, 2 Jan 2012 10:08:17 +0000 (11:08 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 2 Jan 2012 10:08:17 +0000 (11:08 +0100)
commita4c0cc75ff9744299f108c259efab1bd30c8007a
tree4edd3d65abbc5aa377a2a61498b4e8ba89f7b126
parent3ed8b5363d527a612e3180e96785e7604beb0282
mount: append inverting options for mount.<type>

 fstab:
server://foo   /mnt/foo    nfs    user,exec

The mount(8) does not append the option "exec" to /sbin/mount.<type>
helper's command line. This is no problem when executed by non-root
user as it reads the options from fstab only.

.. but when executed by root (UID=0) then the mount.<type> helper
follows the command where the "exec" option is missing. This is bug.

original version (strace output):

 execve("/sbin/mount.nfs", ["/sbin/mount.nfs",
        "sr.net.home:/mnt/store", "/mnt/store", "-o",
        "rw,nosuid,nodev,noauto,user"], [/* 21 vars */]) = 0

fixed version:

 execve("/sbin/mount.nfs", ["/sbin/mount.nfs",
        "sr.net.home:/mnt/store", "/mnt/store", "-o",
        "rw,nosuid,nodev,noauto,user,exec"], [/* 21 vars */]) = 0
                                    ^^^^^

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