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

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