Patchwork [03/11] libnsdb: nsdb_open_nsdb() returns incorrect error code

login
register
mail settings
Submitter Chuck Lever
Date Jan. 24, 2013, 6:34 p.m.
Message ID <20130124183455.13601.34878.stgit@seurat.1015granger.net>
Download mbox | patch
Permalink /patch/215467/
State Accepted
Headers show

Comments

Chuck Lever - Jan. 24, 2013, 6:34 p.m.
The invalid security type here comes from our own NSDB connection
parameters database.  Thus it is a screw-up in fedfs-utils itself
that allows this invalid data.

FEDFS_ERR_NSDB_AUTH is marginally correct, since we can't authenticate
the NSDB using the provided security type, but FEDFS_ERR_NSDB_PARAMS
is a better indication of what's gone wrong.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---

 src/libnsdb/nsdb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/src/libnsdb/nsdb.c b/src/libnsdb/nsdb.c
index 94f9317..891c35b 100644
--- a/src/libnsdb/nsdb.c
+++ b/src/libnsdb/nsdb.c
@@ -1505,7 +1505,7 @@  nsdb_open_nsdb(nsdb_t host, const char *binddn, const char *passwd,
 	default:
 		xlog(D_GENERAL, "%s: Host contains invalid sectype",
 			__func__);
-		retval = FEDFS_ERR_NSDB_AUTH;
+		retval = FEDFS_ERR_NSDB_PARAMS;
 		goto out_unbind;
 	}