Blame SOURCES/autofs-5.1.7-fix-nonstrict-offset-mount-fail-handling.patch

beb904
autofs-5.1.7 - fix nonstrict offset mount fail handling
beb904
beb904
From: Ian Kent <raven@themaw.net>
beb904
beb904
If a triggered offset mount fails automount is not handling nonstrict
beb904
mount failure correctly.
beb904
beb904
The nonstrict mount failure handling needs to convert an offset mount
beb904
failure to a success if the offset subtree below the failed mount is not
beb904
empty otherwise it must return the failure. The previous implementation
beb904
used -1 to indicate the subtree was empty and that was used to detect
beb904
when the mount should fail instead of converting the fail to a success.
beb904
beb904
Make the new implementation do the same.
beb904
beb904
Signed-off-by: Ian Kent <raven@themaw.net>
beb904
---
beb904
 CHANGELOG           |    1 +
beb904
 lib/mounts.c        |    2 +-
beb904
 modules/parse_sun.c |    2 +-
beb904
 3 files changed, 3 insertions(+), 2 deletions(-)
beb904
beb904
--- autofs-5.1.4.orig/CHANGELOG
beb904
+++ autofs-5.1.4/CHANGELOG
beb904
@@ -76,6 +76,7 @@
beb904
 - fix lookup_prune_one_cache() refactoring change.
beb904
 - add missing description of null map option.
beb904
 - fix empty mounts list return from unlink_mount_tree().
beb904
+- fix nonstrict offset mount fail handling.
beb904
 
beb904
 xx/xx/2018 autofs-5.1.5
beb904
 - fix flag file permission.
beb904
--- autofs-5.1.4.orig/lib/mounts.c
beb904
+++ autofs-5.1.4/lib/mounts.c
beb904
@@ -1616,7 +1616,7 @@ static int tree_mapent_traverse_subtree(
beb904
 {
beb904
 	struct traverse_subtree_context *ctxt = ptr;
beb904
 	struct mapent *oe = MAPENT(n);
beb904
-	int ret = 1;
beb904
+	int ret = -1;
beb904
 
beb904
 	if (n->left) {
beb904
 		ret = tree_mapent_traverse_subtree(n->left, work, ctxt);
beb904
--- autofs-5.1.4.orig/modules/parse_sun.c
beb904
+++ autofs-5.1.4/modules/parse_sun.c
beb904
@@ -1183,7 +1183,7 @@ static int mount_subtree(struct autofs_p
beb904
 		 * offsets to be mounted.
beb904
 		 */
beb904
 		rv = sun_mount(ap, name, name, namelen, loc, loclen, options, ctxt);
beb904
-		if (rv == 0) {
beb904
+		if (rv <= 0) {
beb904
 			ret = tree_mapent_mount_offsets(me, 1);
beb904
 			if (!ret) {
beb904
 				tree_mapent_cleanup_offsets(me);