File autofs-5.1.0-dont-pass-sloppy-option-for-other-than-nfs-mounts.patch of Package autofs.2291

autofs-5.1.0 - dont pass sloppy option for other than nfs mounts

From: Ian Kent <ikent@redhat.com>

Historically autofs added an option to mounts, called the sloppy
option, meant to allow mount(8) to ignore invalid mount options.
This was done so that mount map entries for sites that needed to
use different mount options for some machines would still work.
It was needed for nfs mounts in particular.

Recent changes to mount(8) cause the sloppy option to be passed on
for all mounts when it is given.

Previously mount(8) only passed on the option to nfs mounts so now,
for other than nfs mounts, the mount will fail if the file system
doesn't understand the sloppy option.

Since the option was not passed on to other than nfs mounts before
it seems sensible for autofs to not add it for other than nfs mounts
now.

Signed-off-by: Ian Kent <ikent@redhat.com>
---
 CHANGELOG               |    1 +
 modules/mount_bind.c    |    9 ++++-----
 modules/mount_changer.c |    6 +++---
 modules/mount_ext2.c    |    6 +++---
 modules/mount_generic.c |    4 ++--
 5 files changed, 13 insertions(+), 13 deletions(-)

--- a/modules/mount_bind.c
+++ b/modules/mount_bind.c
@@ -158,13 +158,12 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, int
 		if (!status)
 			existed = 0;
 
-		debug(ap->logopt,
-		      MODPREFIX
-		      "calling mount --bind " SLOPPY " -o %s %s %s",
+		debug(ap->logopt, MODPREFIX
+		      "calling mount --bind -o %s %s %s",
 		      options, what, fullpath);
 
-		err = spawn_bind_mount(ap->logopt,
-			     SLOPPYOPT "-o", options, what, fullpath, NULL);
+		err = spawn_bind_mount(ap->logopt, "-o",
+				       options, what, fullpath, NULL);
 
 		if (err) {
 			if (ap->type != LKP_INDIRECT)
diff --git a/modules/mount_changer.c b/modules/mount_changer.c
index d7bfa09..5e2b47c 100644
--- a/modules/mount_changer.c
+++ b/modules/mount_changer.c
@@ -103,12 +103,12 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, int
 	}
 
 	if (options && options[0]) {
-		debug(ap->logopt,
-		      MODPREFIX "calling mount -t %s " SLOPPY "-o %s %s %s",
+		debug(ap->logopt, MODPREFIX
+		      "calling mount -t %s -o %s %s %s",
 		      fstype, options, what, fullpath);
 
 		err = spawn_mount(ap->logopt, "-t", fstype,
-			     SLOPPYOPT "-o", options, what, fullpath, NULL);
+			          "-o", options, what, fullpath, NULL);
 	} else {
 		debug(ap->logopt,
 		      MODPREFIX "calling mount -t %s %s %s",
diff --git a/modules/mount_ext2.c b/modules/mount_ext2.c
index 1bc429d..3c87512 100644
--- a/modules/mount_ext2.c
+++ b/modules/mount_ext2.c
@@ -116,11 +116,11 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, int
 	}
 
 	if (options) {
-		debug(ap->logopt,
-		      MODPREFIX "calling mount -t %s " SLOPPY "-o %s %s %s",
+		debug(ap->logopt, MODPREFIX
+		      "calling mount -t %s -o %s %s %s",
 		      fstype, options, what, fullpath);
 		err = spawn_mount(ap->logopt, "-t", fstype,
-			     SLOPPYOPT "-o", options, what, fullpath, NULL);
+			          "-o", options, what, fullpath, NULL);
 	} else {
 		debug(ap->logopt,
 		      MODPREFIX "calling mount -t %s %s %s",
diff --git a/modules/mount_generic.c b/modules/mount_generic.c
index 79e3d32..2473b80 100644
--- a/modules/mount_generic.c
+++ b/modules/mount_generic.c
@@ -97,11 +97,11 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, int
 
 	if (options && options[0]) {
 		debug(ap->logopt,
-		      MODPREFIX "calling mount -t %s " SLOPPY "-o %s %s %s",
+		      MODPREFIX "calling mount -t %s -o %s %s %s",
 		      fstype, options, loc, fullpath);
 
 		err = spawn_mount(ap->logopt, "-t", fstype,
-			     SLOPPYOPT "-o", options, loc, fullpath, NULL);
+				  "-o", options, loc, fullpath, NULL);
 	} else {
 		debug(ap->logopt, MODPREFIX "calling mount -t %s %s %s",
 		      fstype, loc, fullpath);


openSUSE Build Service is sponsored by