From patchwork Thu Jan 2 20:27:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 306267 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 5EFEC2C0091 for ; Fri, 3 Jan 2014 07:27:52 +1100 (EST) Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id s02KRnUQ017043 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 2 Jan 2014 20:27:49 GMT Received: from oss.oracle.com (oss-external.oracle.com [137.254.96.51]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s02KRm9p018709 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 2 Jan 2014 20:27:49 GMT Received: from localhost ([127.0.0.1] helo=oss.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1Vyors-0006it-LH; Thu, 02 Jan 2014 12:27:48 -0800 Received: from acsinet22.oracle.com ([141.146.126.238]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1Vyork-0006iI-GW for fedfs-utils-devel@oss.oracle.com; Thu, 02 Jan 2014 12:27:40 -0800 Received: from userp1020.oracle.com (userp1020.oracle.com [156.151.31.79]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s02KRd8m018436 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 2 Jan 2014 20:27:40 GMT Received: from mail-yh0-f48.google.com (mail-yh0-f48.google.com [209.85.213.48]) by userp1020.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id s02KRcLF030315 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Thu, 2 Jan 2014 20:27:39 GMT Received: by mail-yh0-f48.google.com with SMTP id f73so2970606yha.21 for ; Thu, 02 Jan 2014 12:27:38 -0800 (PST) X-Received: by 10.236.125.230 with SMTP id z66mr51729yhh.104.1388694458263; Thu, 02 Jan 2014 12:27:38 -0800 (PST) Received: from seurat.1015granger.net ([2604:8800:100:81fc:20c:29ff:fe44:ec31]) by mx.google.com with ESMTPSA id h23sm78537201yhc.0.2014.01.02.12.27.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Jan 2014 12:27:37 -0800 (PST) To: fedfs-utils-devel@oss.oracle.com From: Chuck Lever Date: Thu, 02 Jan 2014 15:27:37 -0500 Message-ID: <20140102202737.2964.72166.stgit@seurat.1015granger.net> In-Reply-To: <20140102202359.2964.95143.stgit@seurat.1015granger.net> References: <20140102202359.2964.95143.stgit@seurat.1015granger.net> User-Agent: StGit/0.16 MIME-Version: 1.0 X-Flow-Control-Info: class=Pass-to-MM reputation=ipRisk-All ip=209.85.213.48 ct-class=R5 ct-vol1=-97 ct-vol2=7 ct-vol3=7 ct-risk=56 ct-spam1=92 ct-spam2=7 ct-bulk=2 rcpts=1 size=21087 X-Sendmail-CM-Score: 0.00% X-Sendmail-CM-Analysis: v=2.1 cv=Ttjf2lnh c=1 sm=1 tr=0 a=E9dxO/xx8UVwONjmS1fuJg==:117 a=dzsqy3y4QnMA:10 a=-d925YnEUz0A:10 a=dPGociXpb70A:10 a=IkcTkHD0fZMA:10 a=xqWC_Br6kY4A:10 a=yPCof4ZbAAAA:8 a=Lb1rMZzfAAAA:8 a=1XWaLZrsAAAA:8 a=IUImX0e4H2YA:10 a=hZvt5smhEYa-d hIEM9gA:9 a=QEXdDO2ut3YA:10 a=7DSvI1NPTFQA:10 X-Sendmail-CT-Classification: not spam X-Sendmail-CT-RefID: str=0001.0A090201.52C5CBBB.0057, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 Subject: [fedfs-utils] [PATCH 05/17] libnsdb: Remove *ldaperr argument from nsdb_open_nsdb() X-BeenThere: fedfs-utils-devel@oss.oracle.com X-Mailman-Version: 2.1.9 Precedence: list Reply-To: fedfs-utils Developers List-Id: fedfs-utils Developers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: fedfs-utils-devel-bounces@oss.oracle.com Errors-To: fedfs-utils-devel-bounces@oss.oracle.com X-Source-IP: acsinet22.oracle.com [141.146.126.238] Simplify nsdb_open_nsdb() by removing the *ldaperr argument. Instead, the ldaperr value can be extracted with the new nsdb_ldaperr() function when it is needed. Signed-off-by: Chuck Lever --- src/fedfsd/svc.c | 2 +- src/include/nsdb.h | 3 +-- src/libnsdb/fileserver.c | 6 ++++-- src/libnsdb/nsdb.c | 12 ++++++------ src/nfsref/add.c | 7 +++---- src/nfsref/lookup.c | 4 ++-- src/nfsref/remove.c | 6 +++--- src/nsdbc/nsdb-annotate.c | 6 +++--- src/nsdbc/nsdb-create-fsl.c | 6 +++--- src/nsdbc/nsdb-create-fsn.c | 6 +++--- src/nsdbc/nsdb-delete-fsl.c | 6 +++--- src/nsdbc/nsdb-delete-fsn.c | 6 +++--- src/nsdbc/nsdb-delete-nsdb.c | 6 +++--- src/nsdbc/nsdb-describe.c | 6 +++--- src/nsdbc/nsdb-list.c | 4 ++-- src/nsdbc/nsdb-nces.c | 4 ++-- src/nsdbc/nsdb-remove-nci.c | 6 +++--- src/nsdbc/nsdb-resolve-fsn.c | 4 ++-- src/nsdbc/nsdb-simple-nce.c | 6 +++--- src/nsdbc/nsdb-update-fsl.c | 6 +++--- src/nsdbc/nsdb-update-nci.c | 6 +++--- src/plug-ins/nfs-plugin.c | 4 ++-- 22 files changed, 61 insertions(+), 61 deletions(-) diff --git a/src/fedfsd/svc.c b/src/fedfsd/svc.c index 391583b..3aa4314 100644 --- a/src/fedfsd/svc.c +++ b/src/fedfsd/svc.c @@ -918,7 +918,7 @@ again: case FEDFS_RESOLVE_NONE: break; case FEDFS_RESOLVE_NSDB: - result.status = nsdb_open_nsdb(host, NULL, NULL, &ldap_err); + result.status = nsdb_open_nsdb(host, NULL, NULL); if (result.status != FEDFS_OK) break; diff --git a/src/include/nsdb.h b/src/include/nsdb.h index d1aafe1..56a26a2 100644 --- a/src/include/nsdb.h +++ b/src/include/nsdb.h @@ -244,8 +244,7 @@ FedFsStatus nsdb_delete_nsdb(const char *hostname, * Connect an nsdb_t object to the server it represents */ FedFsStatus nsdb_open_nsdb(nsdb_t host, const char *binddn, - const char *passwd, - unsigned int *ldap_err); + const char *passwd); /** * Finish a previously opened connection diff --git a/src/libnsdb/fileserver.c b/src/libnsdb/fileserver.c index 872d10c..f6a6e53 100644 --- a/src/libnsdb/fileserver.c +++ b/src/libnsdb/fileserver.c @@ -2038,9 +2038,11 @@ nsdb_ping_s(const char *hostname, const unsigned short port, if (retval != FEDFS_OK) return retval; - retval = nsdb_open_nsdb(host, NULL, NULL, ldap_err); - if (retval != FEDFS_OK) + retval = nsdb_open_nsdb(host, NULL, NULL); + if (retval != FEDFS_OK) { + *ldap_err = (unsigned int)nsdb_ldaperr(host); goto out_free; + } retval = nsdb_ping_nsdb_s(host, ldap_err); nsdb_close_nsdb(host); diff --git a/src/libnsdb/nsdb.c b/src/libnsdb/nsdb.c index 31cf5ce..7320b05 100644 --- a/src/libnsdb/nsdb.c +++ b/src/libnsdb/nsdb.c @@ -1505,7 +1505,6 @@ nsdb_delete_nsdb(const char *hostname, const unsigned short port) * @param host an initialized nsdb_t object * @param binddn NUL-terminated UTF-8 C string containing DN to which to bind * @param passwd NUL-terminated UTF-8 C string containing bind password - * @param ldap_err OUT: possibly an LDAP error code * @return a FedFsStatus code * * This function may ask for a password on stdin if "binddn" is @@ -1514,13 +1513,13 @@ nsdb_delete_nsdb(const char *hostname, const unsigned short port) * When false is returned, the nsdb_t object remains closed. */ FedFsStatus -nsdb_open_nsdb(nsdb_t host, const char *binddn, const char *passwd, - unsigned int *ldap_err) +nsdb_open_nsdb(nsdb_t host, const char *binddn, const char *passwd) { FedFsStatus retval; LDAP *ld; - retval = nsdb_open(host->fn_hostname, host->fn_port, &ld, ldap_err); + retval = nsdb_open(host->fn_hostname, host->fn_port, &ld, + &host->fn_ldaperr); if (retval != FEDFS_OK) return retval; @@ -1528,7 +1527,8 @@ nsdb_open_nsdb(nsdb_t host, const char *binddn, const char *passwd, case FEDFS_SEC_NONE: break; case FEDFS_SEC_TLS: - retval = nsdb_start_tls(ld, nsdb_certfile(host), ldap_err); + retval = nsdb_start_tls(ld, nsdb_certfile(host), + &host->fn_ldaperr); if (retval != FEDFS_OK) goto out_unbind; break; @@ -1539,7 +1539,7 @@ nsdb_open_nsdb(nsdb_t host, const char *binddn, const char *passwd, goto out_unbind; } - retval = nsdb_bind(ld, binddn, passwd, ldap_err); + retval = nsdb_bind(ld, binddn, passwd, &host->fn_ldaperr); if (retval != FEDFS_OK) goto out_unbind; diff --git a/src/nfsref/add.c b/src/nfsref/add.c index 8e925cc..4d527da 100644 --- a/src/nfsref/add.c +++ b/src/nfsref/add.c @@ -559,7 +559,6 @@ nfsref_add_nfs_fedfs(const char *junct_path, char **argv, int optind) { char *binddn, *nsdbname, *nce; unsigned short nsdbport; - unsigned int ldap_err; FedFsStatus retval; nsdb_t host = NULL; int status = EXIT_FAILURE; @@ -600,7 +599,7 @@ nfsref_add_nfs_fedfs(const char *junct_path, char **argv, int optind) goto out_free; } - retval = nsdb_open_nsdb(host, binddn, NULL, &ldap_err); + retval = nsdb_open_nsdb(host, binddn, NULL); switch (retval) { case FEDFS_OK: break; @@ -616,7 +615,7 @@ nfsref_add_nfs_fedfs(const char *junct_path, char **argv, int optind) "NSDB %s:%u", nsdbname, nsdbport); goto out_free; case FEDFS_ERR_NSDB_LDAP_VAL: - switch (ldap_err) { + switch (nsdb_ldaperr(host)) { case LDAP_INVALID_CREDENTIALS: xlog(L_ERROR, "Incorrect password for DN %s", binddn); @@ -624,7 +623,7 @@ nfsref_add_nfs_fedfs(const char *junct_path, char **argv, int optind) default: xlog(L_ERROR, "Failed to bind to NSDB %s:%u: %s", nsdbname, nsdbport, - ldap_err2string(ldap_err)); + nsdb_ldaperr2string(host)); } goto out_free; default: diff --git a/src/nfsref/lookup.c b/src/nfsref/lookup.c index 1271e3d..273663b 100644 --- a/src/nfsref/lookup.c +++ b/src/nfsref/lookup.c @@ -353,7 +353,7 @@ nfsref_lookup_resolve_fsn(const char *fsn_uuid, nsdb_t host) __func__, fsn_uuid, nsdb_hostname(host), nsdb_port(host)); again: - retval = nsdb_open_nsdb(host, NULL, NULL, &ldap_err); + retval = nsdb_open_nsdb(host, NULL, NULL); switch (retval) { case FEDFS_OK: break; @@ -368,7 +368,7 @@ again: case FEDFS_ERR_NSDB_LDAP_VAL: xlog(L_ERROR, "Failed to bind to NSDB %s:%u: %s", nsdb_hostname(host), nsdb_port(host), - ldap_err2string(ldap_err)); + nsdb_ldaperr2string(host)); return status; default: xlog(L_ERROR, "Failed to open NSDB %s:%u: %s", diff --git a/src/nfsref/remove.c b/src/nfsref/remove.c index b4394c1..aa8249e 100644 --- a/src/nfsref/remove.c +++ b/src/nfsref/remove.c @@ -136,7 +136,7 @@ nfsref_remove_delete_fsn(const char *junct_path) goto out_free; } - retval = nsdb_open_nsdb(host, binddn, NULL, &ldap_err); + retval = nsdb_open_nsdb(host, binddn, NULL); switch (retval) { case FEDFS_OK: break; @@ -152,7 +152,7 @@ nfsref_remove_delete_fsn(const char *junct_path) "to NSDB %s:%u", nsdb_hostname(host), nsdb_port(host)); goto out_free; case FEDFS_ERR_NSDB_LDAP_VAL: - switch (ldap_err) { + switch (nsdb_ldaperr(host)) { case LDAP_INVALID_CREDENTIALS: xlog(L_ERROR, "Incorrect password for DN %s", binddn); @@ -160,7 +160,7 @@ nfsref_remove_delete_fsn(const char *junct_path) default: xlog(L_ERROR, "Failed to bind to NSDB %s:%u: %s", nsdb_hostname(host), nsdb_port(host), - ldap_err2string(ldap_err)); + nsdb_ldaperr2string(host)); } goto out_free; default: diff --git a/src/nsdbc/nsdb-annotate.c b/src/nsdbc/nsdb-annotate.c index d35c7a4..6d10465 100644 --- a/src/nsdbc/nsdb-annotate.c +++ b/src/nsdbc/nsdb-annotate.c @@ -244,7 +244,7 @@ main(int argc, char **argv) goto out_free; } - retval = nsdb_open_nsdb(host, binddn, NULL, &ldap_err); + retval = nsdb_open_nsdb(host, binddn, NULL); switch (retval) { case FEDFS_OK: break; @@ -260,14 +260,14 @@ main(int argc, char **argv) "to NSDB %s:%u\n", nsdbname, nsdbport); goto out_free; case FEDFS_ERR_NSDB_LDAP_VAL: - switch (ldap_err) { + switch (nsdb_ldaperr(host)) { case LDAP_INVALID_CREDENTIALS: fprintf(stderr, "Incorrect password for DN %s\n", binddn); break; default: fprintf(stderr, "Failed to bind to NSDB %s:%u: %s\n", - nsdbname, nsdbport, ldap_err2string(ldap_err)); + nsdbname, nsdbport, nsdb_ldaperr2string(host)); } goto out_free; default: diff --git a/src/nsdbc/nsdb-create-fsl.c b/src/nsdbc/nsdb-create-fsl.c index 06134e9..a538eb1 100644 --- a/src/nsdbc/nsdb-create-fsl.c +++ b/src/nsdbc/nsdb-create-fsl.c @@ -248,7 +248,7 @@ main(int argc, char **argv) goto out_free; } - retval = nsdb_open_nsdb(host, binddn, NULL, &ldap_err); + retval = nsdb_open_nsdb(host, binddn, NULL); switch (retval) { case FEDFS_OK: break; @@ -264,14 +264,14 @@ main(int argc, char **argv) "to NSDB %s:%u\n", nsdbname, nsdbport); goto out_free; case FEDFS_ERR_NSDB_LDAP_VAL: - switch (ldap_err) { + switch (nsdb_ldaperr(host)) { case LDAP_INVALID_CREDENTIALS: fprintf(stderr, "Incorrect password for DN %s\n", binddn); break; default: fprintf(stderr, "Failed to bind to NSDB %s:%u: %s\n", - nsdbname, nsdbport, ldap_err2string(ldap_err)); + nsdbname, nsdbport, nsdb_ldaperr2string(host)); } goto out_free; default: diff --git a/src/nsdbc/nsdb-create-fsn.c b/src/nsdbc/nsdb-create-fsn.c index d6c39ea..8c99b26 100644 --- a/src/nsdbc/nsdb-create-fsn.c +++ b/src/nsdbc/nsdb-create-fsn.c @@ -224,7 +224,7 @@ main(int argc, char **argv) goto out_free; } - retval = nsdb_open_nsdb(host, binddn, NULL, &ldap_err); + retval = nsdb_open_nsdb(host, binddn, NULL); switch (retval) { case FEDFS_OK: break; @@ -240,14 +240,14 @@ main(int argc, char **argv) "to NSDB %s:%u\n", nsdbname, nsdbport); goto out_free; case FEDFS_ERR_NSDB_LDAP_VAL: - switch (ldap_err) { + switch (nsdb_ldaperr(host)) { case LDAP_INVALID_CREDENTIALS: fprintf(stderr, "Incorrect password for DN %s\n", binddn); break; default: fprintf(stderr, "Failed to bind to NSDB %s:%u: %s\n", - nsdbname, nsdbport, ldap_err2string(ldap_err)); + nsdbname, nsdbport, nsdb_ldaperr2string(host)); } goto out_free; default: diff --git a/src/nsdbc/nsdb-delete-fsl.c b/src/nsdbc/nsdb-delete-fsl.c index f64a8fd..5e19e8d 100644 --- a/src/nsdbc/nsdb-delete-fsl.c +++ b/src/nsdbc/nsdb-delete-fsl.c @@ -206,7 +206,7 @@ main(int argc, char **argv) goto out_free; } - retval = nsdb_open_nsdb(host, binddn, NULL, &ldap_err); + retval = nsdb_open_nsdb(host, binddn, NULL); switch (retval) { case FEDFS_OK: break; @@ -222,14 +222,14 @@ main(int argc, char **argv) "to NSDB %s:%u\n", nsdbname, nsdbport); goto out_free; case FEDFS_ERR_NSDB_LDAP_VAL: - switch (ldap_err) { + switch (nsdb_ldaperr(host)) { case LDAP_INVALID_CREDENTIALS: fprintf(stderr, "Incorrect password for DN %s\n", binddn); break; default: fprintf(stderr, "Failed to bind to NSDB %s:%u: %s\n", - nsdbname, nsdbport, ldap_err2string(ldap_err)); + nsdbname, nsdbport, nsdb_ldaperr2string(host)); } goto out_free; default: diff --git a/src/nsdbc/nsdb-delete-fsn.c b/src/nsdbc/nsdb-delete-fsn.c index 3060c24..42073e8 100644 --- a/src/nsdbc/nsdb-delete-fsn.c +++ b/src/nsdbc/nsdb-delete-fsn.c @@ -208,7 +208,7 @@ main(int argc, char **argv) goto out_free; } - retval = nsdb_open_nsdb(host, binddn, NULL, &ldap_err); + retval = nsdb_open_nsdb(host, binddn, NULL); switch (retval) { case FEDFS_OK: break; @@ -224,14 +224,14 @@ main(int argc, char **argv) "to NSDB %s:%u\n", nsdbname, nsdbport); goto out_free; case FEDFS_ERR_NSDB_LDAP_VAL: - switch (ldap_err) { + switch (nsdb_ldaperr(host)) { case LDAP_INVALID_CREDENTIALS: fprintf(stderr, "Incorrect password for DN %s\n", binddn); break; default: fprintf(stderr, "Failed to bind to NSDB %s:%u: %s\n", - nsdbname, nsdbport, ldap_err2string(ldap_err)); + nsdbname, nsdbport, nsdb_ldaperr2string(host)); } goto out_free; default: diff --git a/src/nsdbc/nsdb-delete-nsdb.c b/src/nsdbc/nsdb-delete-nsdb.c index 2e793bf..673170f 100644 --- a/src/nsdbc/nsdb-delete-nsdb.c +++ b/src/nsdbc/nsdb-delete-nsdb.c @@ -181,7 +181,7 @@ main(int argc, char **argv) goto out_free; } - retval = nsdb_open_nsdb(host, binddn, NULL, &ldap_err); + retval = nsdb_open_nsdb(host, binddn, NULL); switch (retval) { case FEDFS_OK: break; @@ -197,14 +197,14 @@ main(int argc, char **argv) "to NSDB %s:%u\n", nsdbname, nsdbport); goto out_free; case FEDFS_ERR_NSDB_LDAP_VAL: - switch (ldap_err) { + switch (nsdb_ldaperr(host)) { case LDAP_INVALID_CREDENTIALS: fprintf(stderr, "Incorrect password for DN %s\n", binddn); break; default: fprintf(stderr, "Failed to bind to NSDB %s:%u: %s\n", - nsdbname, nsdbport, ldap_err2string(ldap_err)); + nsdbname, nsdbport, nsdb_ldaperr2string(host)); } goto out_free; default: diff --git a/src/nsdbc/nsdb-describe.c b/src/nsdbc/nsdb-describe.c index ec060be..eca70b1 100644 --- a/src/nsdbc/nsdb-describe.c +++ b/src/nsdbc/nsdb-describe.c @@ -201,7 +201,7 @@ main(int argc, char **argv) goto out_free; } - retval = nsdb_open_nsdb(host, binddn, NULL, &ldap_err); + retval = nsdb_open_nsdb(host, binddn, NULL); switch (retval) { case FEDFS_OK: break; @@ -217,14 +217,14 @@ main(int argc, char **argv) "to NSDB %s:%u\n", nsdbname, nsdbport); goto out_free; case FEDFS_ERR_NSDB_LDAP_VAL: - switch (ldap_err) { + switch (nsdb_ldaperr(host)) { case LDAP_INVALID_CREDENTIALS: fprintf(stderr, "Incorrect password for DN %s\n", binddn); break; default: fprintf(stderr, "Failed to bind to NSDB %s:%u: %s\n", - nsdbname, nsdbport, ldap_err2string(ldap_err)); + nsdbname, nsdbport, nsdb_ldaperr2string(host)); } goto out_free; default: diff --git a/src/nsdbc/nsdb-list.c b/src/nsdbc/nsdb-list.c index e6de357..5cc20a7 100644 --- a/src/nsdbc/nsdb-list.c +++ b/src/nsdbc/nsdb-list.c @@ -361,7 +361,7 @@ main(int argc, char **argv) } again: - retval = nsdb_open_nsdb(host, NULL, NULL, &ldap_err); + retval = nsdb_open_nsdb(host, NULL, NULL); switch (retval) { case FEDFS_OK: break; @@ -375,7 +375,7 @@ again: goto out_free; case FEDFS_ERR_NSDB_LDAP_VAL: fprintf(stderr, "Failed to bind to NSDB %s:%u: %s\n", - nsdbname, nsdbport, ldap_err2string(ldap_err)); + nsdbname, nsdbport, nsdb_ldaperr2string(host)); goto out_free; default: fprintf(stderr, "Failed to open NSDB %s:%u: %s\n", diff --git a/src/nsdbc/nsdb-nces.c b/src/nsdbc/nsdb-nces.c index c67fd18..f7b405c 100644 --- a/src/nsdbc/nsdb-nces.c +++ b/src/nsdbc/nsdb-nces.c @@ -166,7 +166,7 @@ main(int argc, char **argv) goto out; } - retval = nsdb_open_nsdb(host, NULL, NULL, &ldap_err); + retval = nsdb_open_nsdb(host, NULL, NULL); switch (retval) { case FEDFS_OK: break; @@ -180,7 +180,7 @@ main(int argc, char **argv) goto out_free; case FEDFS_ERR_NSDB_LDAP_VAL: fprintf(stderr, "Failed to bind to NSDB %s:%u: %s\n", - nsdbname, nsdbport, ldap_err2string(ldap_err)); + nsdbname, nsdbport, nsdb_ldaperr2string(host)); goto out_free; default: fprintf(stderr, "Failed to open NSDB %s:%u: %s\n", diff --git a/src/nsdbc/nsdb-remove-nci.c b/src/nsdbc/nsdb-remove-nci.c index f6b58c9..d5d44a2 100644 --- a/src/nsdbc/nsdb-remove-nci.c +++ b/src/nsdbc/nsdb-remove-nci.c @@ -176,7 +176,7 @@ main(int argc, char **argv) if (binddn == NULL) binddn = (char *)nsdb_default_binddn(host); - retval = nsdb_open_nsdb(host, binddn, NULL, &ldap_err); + retval = nsdb_open_nsdb(host, binddn, NULL); switch (retval) { case FEDFS_OK: break; @@ -192,14 +192,14 @@ main(int argc, char **argv) "to NSDB %s:%u\n", nsdbname, nsdbport); goto out_free; case FEDFS_ERR_NSDB_LDAP_VAL: - switch (ldap_err) { + switch (nsdb_ldaperr(host)) { case LDAP_INVALID_CREDENTIALS: fprintf(stderr, "Incorrect password for DN %s\n", binddn); break; default: fprintf(stderr, "Failed to bind to NSDB %s:%u: %s\n", - nsdbname, nsdbport, ldap_err2string(ldap_err)); + nsdbname, nsdbport, nsdb_ldaperr2string(host)); } goto out_free; default: diff --git a/src/nsdbc/nsdb-resolve-fsn.c b/src/nsdbc/nsdb-resolve-fsn.c index 1230e6d..6baac28 100644 --- a/src/nsdbc/nsdb-resolve-fsn.c +++ b/src/nsdbc/nsdb-resolve-fsn.c @@ -335,7 +335,7 @@ main(int argc, char **argv) } again: - retval = nsdb_open_nsdb(host, NULL, NULL, &ldap_err); + retval = nsdb_open_nsdb(host, NULL, NULL); switch (retval) { case FEDFS_OK: break; @@ -349,7 +349,7 @@ again: goto out_free; case FEDFS_ERR_NSDB_LDAP_VAL: fprintf(stderr, "Failed to bind to NSDB %s:%u: %s\n", - nsdbname, nsdbport, ldap_err2string(ldap_err)); + nsdbname, nsdbport, nsdb_ldaperr2string(host)); goto out_free; default: fprintf(stderr, "Failed to open NSDB %s:%u: %s\n", diff --git a/src/nsdbc/nsdb-simple-nce.c b/src/nsdbc/nsdb-simple-nce.c index 75c0386..dce4b31 100644 --- a/src/nsdbc/nsdb-simple-nce.c +++ b/src/nsdbc/nsdb-simple-nce.c @@ -176,7 +176,7 @@ main(int argc, char **argv) if (binddn == NULL) binddn = (char *)nsdb_default_binddn(host); - retval = nsdb_open_nsdb(host, binddn, NULL, &ldap_err); + retval = nsdb_open_nsdb(host, binddn, NULL); switch (retval) { case FEDFS_OK: break; @@ -192,14 +192,14 @@ main(int argc, char **argv) "to NSDB %s:%u\n", nsdbname, nsdbport); goto out_free; case FEDFS_ERR_NSDB_LDAP_VAL: - switch (ldap_err) { + switch (nsdb_ldaperr(host)) { case LDAP_INVALID_CREDENTIALS: fprintf(stderr, "Incorrect password for DN %s\n", binddn); break; default: fprintf(stderr, "Failed to bind to NSDB %s:%u: %s\n", - nsdbname, nsdbport, ldap_err2string(ldap_err)); + nsdbname, nsdbport, nsdb_ldaperr2string(host)); } goto out_free; default: diff --git a/src/nsdbc/nsdb-update-fsl.c b/src/nsdbc/nsdb-update-fsl.c index f5a4cb9..17514c2 100644 --- a/src/nsdbc/nsdb-update-fsl.c +++ b/src/nsdbc/nsdb-update-fsl.c @@ -217,7 +217,7 @@ main(int argc, char **argv) if (nce == NULL) nce = (char *)nsdb_default_nce(host); - retval = nsdb_open_nsdb(host, binddn, NULL, &ldap_err); + retval = nsdb_open_nsdb(host, binddn, NULL); switch (retval) { case FEDFS_OK: break; @@ -233,14 +233,14 @@ main(int argc, char **argv) "to NSDB %s:%u\n", nsdbname, nsdbport); goto out_free; case FEDFS_ERR_NSDB_LDAP_VAL: - switch (ldap_err) { + switch (nsdb_ldaperr(host)) { case LDAP_INVALID_CREDENTIALS: fprintf(stderr, "Incorrect password for DN %s\n", binddn); break; default: fprintf(stderr, "Failed to bind to NSDB %s:%u: %s\n", - nsdbname, nsdbport, ldap_err2string(ldap_err)); + nsdbname, nsdbport, nsdb_ldaperr2string(host)); } goto out_free; default: diff --git a/src/nsdbc/nsdb-update-nci.c b/src/nsdbc/nsdb-update-nci.c index 2da0aa1..f2b0295 100644 --- a/src/nsdbc/nsdb-update-nci.c +++ b/src/nsdbc/nsdb-update-nci.c @@ -184,7 +184,7 @@ main(int argc, char **argv) if (binddn == NULL) binddn = (char *)nsdb_default_binddn(host); - retval = nsdb_open_nsdb(host, binddn, NULL, &ldap_err); + retval = nsdb_open_nsdb(host, binddn, NULL); switch (retval) { case FEDFS_OK: break; @@ -200,14 +200,14 @@ main(int argc, char **argv) "to NSDB %s:%u\n", nsdbname, nsdbport); goto out_free; case FEDFS_ERR_NSDB_LDAP_VAL: - switch (ldap_err) { + switch (nsdb_ldaperr(host)) { case LDAP_INVALID_CREDENTIALS: fprintf(stderr, "Incorrect password for DN %s\n", binddn); break; default: fprintf(stderr, "Failed to bind to NSDB %s:%u: %s\n", - nsdbname, nsdbport, ldap_err2string(ldap_err)); + nsdbname, nsdbport, nsdb_ldaperr2string(host)); } goto out_free; default: diff --git a/src/plug-ins/nfs-plugin.c b/src/plug-ins/nfs-plugin.c index dbe84d9..25e97e2 100644 --- a/src/plug-ins/nfs-plugin.c +++ b/src/plug-ins/nfs-plugin.c @@ -395,7 +395,7 @@ nfs_jp_resolve_fsn(const char *fsn_uuid, nsdb_t host, int fsn_ttl; again: - retval = nsdb_open_nsdb(host, NULL, NULL, &ldap_err); + retval = nsdb_open_nsdb(host, NULL, NULL); switch (retval) { case FEDFS_OK: break; @@ -410,7 +410,7 @@ again: case FEDFS_ERR_NSDB_LDAP_VAL: nfs_jp_debug("%s: Failed to bind to NSDB %s:%u: %s\n", nsdb_hostname(host), nsdb_port(host), - ldap_err2string(ldap_err)); + nsdb_ldaperr2string(host)); return JP_NSDBLOCAL; default: nfs_jp_debug("%s: Failed to open NSDB %s:%u: %s\n",