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

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