diff options
author | David Jeffery <djeffery@redhat.com> | 2017-02-09 09:20:59 +0800 |
---|---|---|
committer | Ian Kent <raven@themaw.net> | 2017-04-24 11:46:47 +0800 |
commit | 2bd859aa0fc32d927af7413d6c06dd782c06aa99 (patch) | |
tree | 1009e7f09de89bc4b32f220dd7f34b2e2b0a6329 /modules | |
parent | 979ff4ee902898bd89a7b836a80d38875b4f12a1 (diff) | |
download | autofs-2bd859aa0fc32d927af7413d6c06dd782c06aa99.tar.gz |
autofs-5.1.2 - honor last rw in mount options when doing a bind mount
mount(8) will use the last ro/rw option in its options list.
e.g. "mount -o ro,rw" will make a read-write mount while
"mount -o rw,ro" will make a read-only mount.
The patch changes the option parsing for mount_mount() in
modules/mount_nfs.c to clear the ro variable when a "rw"
option is seen. This will handle occurrences of both "ro"
and "rw" options, resulting in a read-only option being
passed to a bind mount only if the option order would also
have resulted in an nfs mount being read-only.
Signed-off-by: David Jeffery <djeffery@redhat.com>
Signed-off-by: Ian Kent <raven@themaw.net>
Diffstat (limited to 'modules')
-rw-r--r-- | modules/mount_nfs.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/mount_nfs.c b/modules/mount_nfs.c index 27121406..c558a738 100644 --- a/modules/mount_nfs.c +++ b/modules/mount_nfs.c @@ -180,6 +180,8 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, int with bind mounts */ else if (_strncmp("ro", cp, o_len) == 0) ro = 1; + else if (_strncmp("rw", cp, o_len) == 0) + ro = 0; /* and jump over trailing white space */ memcpy(nfsp, cp, comma - cp + 1); nfsp += comma - cp + 1; |