Blame SOURCES/autofs-5.1.0-beta1-fix-out-of-order-amd-timestamp-lookup.patch

6bbd11
autofs-5.1.0-beta1 - fix out of order amd timestamp lookup
6bbd11
6bbd11
From: Ian Kent <ikent@redhat.com>
6bbd11
6bbd11
The call in ->lookup_init() for an ldap source tries to get the amd
6bbd11
ldap entry timestamp whether or not the map is amd format.
6bbd11
---
6bbd11
 CHANGELOG             |    1 +
6bbd11
 modules/lookup_ldap.c |    7 +++++--
6bbd11
 2 files changed, 6 insertions(+), 2 deletions(-)
6bbd11
6bbd11
--- autofs-5.0.7.orig/CHANGELOG
6bbd11
+++ autofs-5.0.7/CHANGELOG
6bbd11
@@ -110,6 +110,7 @@
6bbd11
 - extend fix for crash due to thread unsafe use of libldap.
6bbd11
 - add amd map format parser.
6bbd11
 - fix wildcard key lookup.
6bbd11
+- fix out of order amd timestamp lookup.
6bbd11
 
6bbd11
 25/07/2012 autofs-5.0.7
6bbd11
 =======================
6bbd11
--- autofs-5.0.7.orig/modules/lookup_ldap.c
6bbd11
+++ autofs-5.0.7/modules/lookup_ldap.c
6bbd11
@@ -1621,6 +1621,7 @@ static void validate_uris(struct list_he
6bbd11
  */
6bbd11
 int lookup_init(const char *mapfmt, int argc, const char *const *argv, void **context)
6bbd11
 {
6bbd11
+	unsigned int is_amd_format;
6bbd11
 	struct lookup_context *ctxt;
6bbd11
 	char buf[MAX_ERR_BUF];
6bbd11
 	int ret;
6bbd11
@@ -1647,6 +1648,7 @@ int lookup_init(const char *mapfmt, int
6bbd11
 	if (mapfmt == NULL)
6bbd11
 		mapfmt = MAPFMT_DEFAULT;
6bbd11
 	if (!strcmp(mapfmt, "amd")) {
6bbd11
+		is_amd_format = 1;
6bbd11
 		ctxt->format = MAP_FLAG_FORMAT_AMD;
6bbd11
 		ctxt->check_defaults = 1;
6bbd11
 	}
6bbd11
@@ -1654,7 +1656,7 @@ int lookup_init(const char *mapfmt, int
6bbd11
 	ctxt->timeout = defaults_get_ldap_timeout();
6bbd11
 	ctxt->network_timeout = defaults_get_ldap_network_timeout();
6bbd11
 
6bbd11
-	if (!(ctxt->format & MAP_FLAG_FORMAT_AMD)) {
6bbd11
+	if (!is_amd_format) {
6bbd11
 		/*
6bbd11
 		 * Parse out the server name and base dn, and fill them
6bbd11
 		 * into the proper places in the lookup context structure.
6bbd11
@@ -1746,7 +1748,8 @@ int lookup_init(const char *mapfmt, int
6bbd11
 	}
6bbd11
 #endif
6bbd11
 
6bbd11
-	ctxt->timestamp = get_amd_timestamp(ctxt);
6bbd11
+	if (is_amd_format)
6bbd11
+		ctxt->timestamp = get_amd_timestamp(ctxt);
6bbd11
 
6bbd11
 	/* Open the parser, if we can. */
6bbd11
 	ctxt->parse = open_parse(mapfmt, MODPREFIX, argc - 1, argv + 1);