Blame SOURCES/autofs-5.1.5-also-use-strictexpire-for-offsets.patch

135b98
autofs-5.1.5 - also use strictexpire for offsets
135b98
135b98
From: Ian Kent <raven@themaw.net>
135b98
135b98
Map entries with offsets should use the "strictexpire" option when
135b98
mounting offsets if the option is set for the owner mount.
135b98
135b98
Signed-off-by: Ian Kent <raven@themaw.net>
135b98
---
135b98
 CHANGELOG       |    1 +
135b98
 daemon/direct.c |   10 ++++++++++
135b98
 2 files changed, 11 insertions(+)
135b98
135b98
--- autofs-5.1.4.orig/CHANGELOG
135b98
+++ autofs-5.1.4/CHANGELOG
135b98
@@ -53,6 +53,7 @@ xx/xx/2018 autofs-5.1.5
135b98
 - make expire remaining log level debug.
135b98
 - allow period following macro in selector value.
135b98
 - fix macro expansion in selector values.
135b98
+- also use strictexpire for offsets.
135b98
 
135b98
 19/12/2017 autofs-5.1.4
135b98
 - fix spec file url.
135b98
--- autofs-5.1.4.orig/daemon/direct.c
135b98
+++ autofs-5.1.4/daemon/direct.c
135b98
@@ -743,6 +743,16 @@ int mount_autofs_offset(struct autofs_po
135b98
 		mp->options = make_options_string(ap->path, ap->kpipefd, str_offset);
135b98
 		if (!mp->options)
135b98
 			return MOUNT_OFFSET_OK;
135b98
+
135b98
+		if ((ap->flags & MOUNT_FLAG_STRICTEXPIRE) &&
135b98
+		    ((get_kver_major() == 5 && get_kver_minor() > 3) ||
135b98
+		     (get_kver_major() > 5))) {
135b98
+			char *tmp = realloc(mp->options, strlen(mp->options) + 12);
135b98
+			if (tmp) {
135b98
+				strcat(tmp, ",strictexpire");
135b98
+				mp->options = tmp;
135b98
+			}
135b98
+		}
135b98
 	}
135b98
 
135b98
 	strcpy(mountpoint, root);