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

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