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

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