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.0.7.orig/CHANGELOG
+++ autofs-5.0.7/CHANGELOG
@@ -350,6 +350,7 @@
 - use local getmntent_r() in get_mnt_list().
 - use local getmntent_r() in tree_make_mnt_list().
 - fix missing initialization of autofs_point flags.
+- also use strictexpire for offsets.
 
 25/07/2012 autofs-5.0.7
 =======================
--- autofs-5.0.7.orig/daemon/direct.c
+++ autofs-5.0.7/daemon/direct.c
@@ -685,6 +685,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);