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