Blame SOURCES/autofs-5.0.9-amd-lookup-try-to-use-external-mounts-for-real-mounts.patch

306fa1
autofs-5.0.9 - amd lookup try to use external mounts for real mounts
306fa1
306fa1
From: Ian Kent <ikent@redhat.com>
306fa1
306fa1
When using generic type mounts they may point to user mounted
306fa1
external mounts which doesn't need to be mounted or umounted.
306fa1
306fa1
The current usage doesn't always use external mounts which isn't
306fa1
quite right so, if option fs is defined use, an external.
306fa1
---
306fa1
 modules/parse_amd.c |    9 +++++++--
306fa1
 1 file changed, 7 insertions(+), 2 deletions(-)
306fa1
306fa1
diff --git a/modules/parse_amd.c b/modules/parse_amd.c
306fa1
index 410f6ff..790f25e 100644
306fa1
--- a/modules/parse_amd.c
306fa1
+++ b/modules/parse_amd.c
306fa1
@@ -970,7 +970,7 @@ static int do_generic_mount(struct autofs_point *ap, const char *name,
306fa1
 	unsigned int umount = 0;
306fa1
 	int ret = 0;
306fa1
 
306fa1
-	if (!entry->sublink) {
306fa1
+	if (!entry->fs) {
306fa1
 		ret = do_mount(ap, ap->path, name, strlen(name),
306fa1
 			       target, entry->type, entry->opts);
306fa1
 	} else {
306fa1
@@ -986,7 +986,7 @@ static int do_generic_mount(struct autofs_point *ap, const char *name,
306fa1
 				goto out;
306fa1
 			umount = 1;
306fa1
 		}
306fa1
-		/* We might be using an external mount */
306fa1
+		/* We have an external mount */
306fa1
 		ext_mount_add(&entry->ext_mount, entry->fs, umount);
306fa1
 		ret = do_link_mount(ap, name, entry, flags);
306fa1
 	}
306fa1
@@ -1237,6 +1237,11 @@ static unsigned int validate_generic_options(unsigned int logopt,
306fa1
 			return 0;
306fa1
 		}
306fa1
 	}
306fa1
+	if (entry->sublink && !entry->fs) {
306fa1
+		error(logopt, MODPREFIX
306fa1
+		      "%s: sublink option requires option fs");
306fa1
+		return 0;
306fa1
+	}
306fa1
 	return 1;
306fa1
 }
306fa1