File autofs-5-1-2-fix-file-map-changed-check.patch of Package autofs.14028

From: Ian Kent <raven@themaw.net>
Subject: autofs-5.1.2 - fix file map changed check
X-Git-repo: git://git.kernel.org/pub/scm/linux/storage/autofs/autofs.git
X-Git-commit: 63334358919d0b7c700aa48e207e8abde396dfdd
Patch-mainline: Not in this form.  This is a bare-minimum backport.

The CLOCK_MONOTONIC time cannot be used to file status times, time(2)
must be used instead.

Signed-off-by: Ian Kent <raven@themaw.net>
Acked-by: Jeff Mahoney <jeffm@suse.com>
---

 modules/lookup_file.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/modules/lookup_file.c
+++ b/modules/lookup_file.c
@@ -45,6 +45,7 @@ struct lookup_context {
 	const char *mapname;
 	int opts_argc;
 	const char **opts_argv;
+	time_t last_read;
 	struct parse_mod *parse;
 };
 
@@ -718,6 +719,7 @@ int lookup_read_map(struct autofs_point
 	}
 
 	source->age = age;
+	ctxt->last_read = time(NULL);
 
 	fclose(f);
 
@@ -1020,7 +1022,7 @@ int lookup_mount(struct autofs_point *ap
 
 		cache_readlock(mc);
 		me = cache_lookup_first(mc);
-		if (me && st.st_mtime <= me->age) {
+		if (st.st_mtime <= ctxt->last_read) {
 			/*
 			 * If any map instances are present for this source
 			 * then either we have plus included entries or we
openSUSE Build Service is sponsored by