Blob Blame History Raw
autofs-5.1.5 - also use strictexpire for offsets

From: Ian Kent <raven@themaw.net>

Map entries with offsets should use the "strictexpire" option when
mounting offsets if the option is set for the owner mount.

Signed-off-by: Ian Kent <raven@themaw.net>
---
 CHANGELOG       |    1 +
 daemon/direct.c |   10 ++++++++++
 2 files changed, 11 insertions(+)

--- autofs-5.1.4.orig/CHANGELOG
+++ autofs-5.1.4/CHANGELOG
@@ -53,6 +53,7 @@ xx/xx/2018 autofs-5.1.5
 - make expire remaining log level debug.
 - allow period following macro in selector value.
 - fix macro expansion in selector values.
+- also use strictexpire for offsets.
 
 19/12/2017 autofs-5.1.4
 - fix spec file url.
--- autofs-5.1.4.orig/daemon/direct.c
+++ autofs-5.1.4/daemon/direct.c
@@ -743,6 +743,16 @@ int mount_autofs_offset(struct autofs_po
 		mp->options = make_options_string(ap->path, ap->kpipefd, str_offset);
 		if (!mp->options)
 			return MOUNT_OFFSET_OK;
+
+		if ((ap->flags & MOUNT_FLAG_STRICTEXPIRE) &&
+		    ((get_kver_major() == 5 && get_kver_minor() > 3) ||
+		     (get_kver_major() > 5))) {
+			char *tmp = realloc(mp->options, strlen(mp->options) + 12);
+			if (tmp) {
+				strcat(tmp, ",strictexpire");
+				mp->options = tmp;
+			}
+		}
 	}
 
 	strcpy(mountpoint, root);