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

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