Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP5:GA
autofs.6209
autofs-5-1-1-make-find_dc_server-return-a-statu...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File autofs-5-1-1-make-find_dc_server-return-a-status.patch of Package autofs.6209
From: Ian Kent <raven@themaw.net> Subject: autofs-5.1.1 - make find_dc_server() return a status Git-repo: git://git.kernel.org/pub/scm/linux/storage/autofs/autofs.git Git-commit: 1f9687f0228bfefceca6216867d9989e1806d93d Patch-mainline: Queued in subsystem maintainer repo In the ldap lookup module the do_reconnect() call doesn't distinguish between no entry found and service unavailable. If service unavailable gets returned from a master map read it results in autofs not updating the mounts. A notfound return doesn't because it indicates the map doesn't exist so updating the mounts isn't a problem as it can be when the source is unavailable. Next step in the update of do_reconnect() is to make find_dc_server() return a status instead of an LDAP handle and pass back the LDAP handle via a function parameter. Signed-off-by: Ian Kent <raven@themaw.net> Acked-by: Jeff Mahoney <jeffm@suse.com> --- modules/lookup_ldap.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/modules/lookup_ldap.c b/modules/lookup_ldap.c index 776c174..02d9ca9 100644 --- a/modules/lookup_ldap.c +++ b/modules/lookup_ldap.c @@ -839,33 +839,36 @@ static int connect_to_server(unsigned logopt, LDAP **ldap, return ret; } -static LDAP *find_dc_server(unsigned logopt, const char *uri, struct lookup_context *ctxt) +static int find_dc_server(unsigned logopt, LDAP **ldap, + const char *uri, struct lookup_context *ctxt) { char *str, *tok, *ptr = NULL; - LDAP *ldap = NULL; + int ret = NSS_STATUS_UNAVAIL; str = strdup(uri); if (!str) - return NULL; + return ret; tok = strtok_r(str, " ", &ptr); while (tok) { const char *this = (const char *) tok; - int ret; + int rv; debug(logopt, "trying server uri %s", this); - ret = connect_to_server(logopt, &ldap, this, ctxt); - if (ret == NSS_STATUS_SUCCESS) { + rv = connect_to_server(logopt, ldap, this, ctxt); + if (rv == NSS_STATUS_SUCCESS) { info(logopt, "connected to uri %s", this); free(str); - return ldap; + return rv; } + if (rv == NSS_STATUS_NOTFOUND) + ret = NSS_STATUS_NOTFOUND; tok = strtok_r(NULL, " ", &ptr); } free(str); - return NULL; + return ret; } static LDAP *find_server(unsigned logopt, struct lookup_context *ctxt) @@ -917,8 +920,8 @@ static LDAP *find_server(unsigned logopt, struct lookup_context *ctxt) dclist = tmp; uri = strdup(dclist->uri); } - ldap = find_dc_server(logopt, uri, ctxt); - if (ldap) { + ret = find_dc_server(logopt, &ldap, uri, ctxt); + if (ret == NSS_STATUS_SUCCESS) { free(uri); break; } @@ -972,8 +975,8 @@ static LDAP *do_reconnect(unsigned logopt, struct lookup_context *ctxt) } if (ctxt->dclist) { - ldap = find_dc_server(logopt, ctxt->dclist->uri, ctxt); - if (ldap) + ret = find_dc_server(logopt, &ldap, ctxt->dclist->uri, ctxt); + if (ret == NSS_STATUS_SUCCESS) return ldap; }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor