Blame SOURCES/autofs-5.1.6-use-mapname-in-sss-context-for-setautomntent.patch

1b50e3
autofs-5.1.6 - use mapname in sss context for setautomntent()
1b50e3
1b50e3
From: Ian Kent <raven@themaw.net>
1b50e3
1b50e3
There's no need to pass mapname seperately when calling setautomntent().
1b50e3
1b50e3
Signed-off-by: Ian Kent <raven@themaw.net>
1b50e3
---
1b50e3
 CHANGELOG            |    1 +
1b50e3
 modules/lookup_sss.c |   18 +++++++-----------
1b50e3
 2 files changed, 8 insertions(+), 11 deletions(-)
1b50e3
1b50e3
diff --git a/CHANGELOG b/CHANGELOG
1b50e3
index 2a45829..1830730 100644
1b50e3
--- a/CHANGELOG
1b50e3
+++ b/CHANGELOG
1b50e3
@@ -95,6 +95,7 @@ xx/xx/2018 autofs-5.1.5
1b50e3
 - fix typo in open_sss_lib().
1b50e3
 - fix sss_master_map_wait timing.
1b50e3
 - add sss ECONREFUSED return handling.
1b50e3
+- use mapname in sss context for setautomntent().
1b50e3
 
1b50e3
 19/12/2017 autofs-5.1.4
1b50e3
 - fix spec file url.
1b50e3
diff --git a/modules/lookup_sss.c b/modules/lookup_sss.c
1b50e3
index c393296..c44c55d 100644
1b50e3
--- a/modules/lookup_sss.c
1b50e3
+++ b/modules/lookup_sss.c
1b50e3
@@ -206,10 +206,9 @@ int lookup_reinit(const char *mapfmt,
1b50e3
 }
1b50e3
 
1b50e3
 static int setautomntent(unsigned int logopt,
1b50e3
-			 struct lookup_context *ctxt, const char *mapname,
1b50e3
-			 void **sss_ctxt)
1b50e3
+			 struct lookup_context *ctxt, void **sss_ctxt)
1b50e3
 {
1b50e3
-	int ret = ctxt->setautomntent(mapname, sss_ctxt);
1b50e3
+	int ret = ctxt->setautomntent(ctxt->mapname, sss_ctxt);
1b50e3
 	if (ret) {
1b50e3
 		char buf[MAX_ERR_BUF];
1b50e3
 		char *estr = strerror_r(ret, buf, MAX_ERR_BUF);
1b50e3
@@ -222,7 +221,6 @@ static int setautomntent(unsigned int logopt,
1b50e3
 
1b50e3
 static int setautomntent_wait(unsigned int logopt,
1b50e3
 			      struct lookup_context *ctxt,
1b50e3
-			      const char *mapname,
1b50e3
 			      void **sss_ctxt, unsigned int retries)
1b50e3
 {
1b50e3
 	unsigned int retry = 0;
1b50e3
@@ -234,7 +232,7 @@ static int setautomntent_wait(unsigned int logopt,
1b50e3
 		struct timespec t = { SSS_WAIT_INTERVAL, 0 };
1b50e3
 		struct timespec r;
1b50e3
 
1b50e3
-		ret = ctxt->setautomntent(mapname, sss_ctxt);
1b50e3
+		ret = ctxt->setautomntent(ctxt->mapname, sss_ctxt);
1b50e3
 		if (ret != ENOENT)
1b50e3
 			break;
1b50e3
 
1b50e3
@@ -293,7 +291,7 @@ int lookup_read_master(struct master *master, time_t age, void *context)
1b50e3
 	char *value = NULL;
1b50e3
 	int count, ret;
1b50e3
 
1b50e3
-	ret = setautomntent(logopt, ctxt, ctxt->mapname, &sss_ctxt);
1b50e3
+	ret = setautomntent(logopt, ctxt, &sss_ctxt);
1b50e3
 	if (ret) {
1b50e3
 		unsigned int retries;
1b50e3
 
1b50e3
@@ -307,9 +305,7 @@ int lookup_read_master(struct master *master, time_t age, void *context)
1b50e3
 		if (retries <= 0)
1b50e3
 			return NSS_STATUS_NOTFOUND;
1b50e3
 
1b50e3
-		ret = setautomntent_wait(logopt,
1b50e3
-					 ctxt, ctxt->mapname, &sss_ctxt,
1b50e3
-					 retries);
1b50e3
+		ret = setautomntent_wait(logopt, ctxt, &sss_ctxt, retries);
1b50e3
 		if (ret) {
1b50e3
 			if (ret == ECONNREFUSED)
1b50e3
 				return NSS_STATUS_UNKNOWN;
1b50e3
@@ -418,7 +414,7 @@ int lookup_read_map(struct autofs_point *ap, time_t age, void *context)
1b50e3
 		return NSS_STATUS_SUCCESS;
1b50e3
 	}
1b50e3
 
1b50e3
-	ret = setautomntent(ap->logopt, ctxt, ctxt->mapname, &sss_ctxt);
1b50e3
+	ret = setautomntent(ap->logopt, ctxt, &sss_ctxt);
1b50e3
 	if (ret) {
1b50e3
 		if (ret == ECONNREFUSED)
1b50e3
 			return NSS_STATUS_UNKNOWN;
1b50e3
@@ -530,7 +526,7 @@ static int lookup_one(struct autofs_point *ap,
1b50e3
 
1b50e3
 	mc = source->mc;
1b50e3
 
1b50e3
-	ret = setautomntent(ap->logopt, ctxt, ctxt->mapname, &sss_ctxt);
1b50e3
+	ret = setautomntent(ap->logopt, ctxt, &sss_ctxt);
1b50e3
 	if (ret) {
1b50e3
 		if (ret == ECONNREFUSED)
1b50e3
 			return NSS_STATUS_UNKNOWN;