Blame SOURCES/autofs-5.1.5-use-ignore-option-for-offset-mounts-as-well.patch

306fa1
autofs-5.1.5 - use ignore option for offset mounts as well
306fa1
306fa1
From: Ian Kent <raven@themaw.net>
306fa1
306fa1
The pseudo option "ignore" (that's used as a hint that applications
306fa1
should ignore this mount when reporting a list of mounts) has been
306fa1
added to direct and indirect mounts but hasn't been added to offset
306fa1
mounts.
306fa1
306fa1
Signed-off-by: Ian Kent <raven@themaw.net>
306fa1
---
306fa1
 CHANGELOG       |    1 +
306fa1
 daemon/direct.c |   10 ++++++++++
306fa1
 2 files changed, 11 insertions(+)
306fa1
306fa1
--- autofs-5.0.7.orig/CHANGELOG
306fa1
+++ autofs-5.0.7/CHANGELOG
306fa1
@@ -335,6 +335,7 @@
306fa1
 - fix amd entry memory leak.
306fa1
 - fix unlink_mount_tree() not umounting mounts.
306fa1
 - add ignore mount option.
306fa1
+- use ignore option for offset mounts as well.
306fa1
 
306fa1
 25/07/2012 autofs-5.0.7
306fa1
 =======================
306fa1
--- autofs-5.0.7.orig/daemon/direct.c
306fa1
+++ autofs-5.0.7/daemon/direct.c
306fa1
@@ -433,6 +433,16 @@ int do_mount_autofs_direct(struct autofs
306fa1
 				mp->options = tmp;
306fa1
 			}
306fa1
 		}
306fa1
+
306fa1
+		if ((ap->flags & MOUNT_FLAG_IGNORE) &&
306fa1
+		    ((get_kver_major() == 5 && get_kver_minor() > 4) ||
306fa1
+		     (get_kver_major() > 5))) {
306fa1
+			char *tmp = realloc(mp->options, strlen(mp->options) + 7);
306fa1
+			if (tmp) {
306fa1
+				strcat(tmp, ",ignore");
306fa1
+				mp->options = tmp;
306fa1
+			}
306fa1
+		}
306fa1
 	}
306fa1
 
306fa1
 	/* In case the directory doesn't exist, try to mkdir it */