Blame SOURCES/autofs-5.1.2-honor-last-rw-in-mount-options-when-doing-a-bind-mount.patch

306fa1
autofs-5.1.2 - honor last rw in mount options when doing a bind mount
306fa1
306fa1
From: David Jeffery <djeffery@redhat.com>
306fa1
306fa1
mount(8) will use the last ro/rw option in its options list.
306fa1
e.g. "mount -o ro,rw" will make a read-write mount while
306fa1
"mount -o rw,ro" will make a read-only mount.
306fa1
306fa1
The patch changes the option parsing for mount_mount() in
306fa1
modules/mount_nfs.c to clear the ro variable when a "rw"
306fa1
option is seen. This will handle occurrences of both "ro"
306fa1
and "rw" options, resulting in a read-only option being
306fa1
passed to a bind mount only if the option order would also
306fa1
have resulted in an nfs mount being read-only.
306fa1
306fa1
Signed-off-by: David Jeffery <djeffery@redhat.com>
306fa1
Signed-off-by: Ian Kent <raven@themaw.net>
306fa1
---
306fa1
 CHANGELOG           |    1 +
306fa1
 modules/mount_nfs.c |    2 ++
306fa1
 2 files changed, 3 insertions(+)
306fa1
306fa1
--- autofs-5.0.7.orig/CHANGELOG
306fa1
+++ autofs-5.0.7/CHANGELOG
306fa1
@@ -216,6 +216,7 @@
306fa1
 - make set_direct_mount_catatonic() more general.
306fa1
 - set autofs mounts catatonic at exit.
306fa1
 - check NFS server availability on local mount fallback.
306fa1
+- honor last rw in mount options when doing a bind mount.
306fa1
 
306fa1
 25/07/2012 autofs-5.0.7
306fa1
 =======================
306fa1
--- autofs-5.0.7.orig/modules/mount_nfs.c
306fa1
+++ autofs-5.0.7/modules/mount_nfs.c
306fa1
@@ -180,6 +180,8 @@ int mount_mount(struct autofs_point *ap,
306fa1
 				   with bind mounts */
306fa1
 				else if (_strncmp("ro", cp, o_len) == 0)
306fa1
 					ro = 1;
306fa1
+				else if (_strncmp("rw", cp, o_len) == 0)
306fa1
+					ro = 0;
306fa1
 				/* and jump over trailing white space */
306fa1
 				memcpy(nfsp, cp, comma - cp + 1);
306fa1
 				nfsp += comma - cp + 1;