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

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