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

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