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

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