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

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