@@ -562,7 +562,7 @@ nsdb_bind(LDAP *ld, const char *binddn, const char *passwd,
secret = nsdb_get_pw();
if (secret == NULL) {
xlog(D_GENERAL, "No password provided");
- return FEDFS_ERR_NSDB_AUTH;
+ return FEDFS_ERR_INVAL;
}
}
@@ -604,6 +604,9 @@ nfsref_add_nfs_fedfs(const char *junct_path, char **argv, int optind)
switch (retval) {
case FEDFS_OK:
break;
+ case FEDFS_ERR_INVAL:
+ xlog(L_ERROR, "Missing or invalid password");
+ goto out_free;
case FEDFS_ERR_NSDB_CONN:
xlog(L_ERROR, "Failed to connect to NSDB %s:%u",
nsdbname, nsdbport);
@@ -179,6 +179,9 @@ nfsref_remove_delete_fsn(const char *junct_path)
switch (retval) {
case FEDFS_OK:
break;
+ case FEDFS_ERR_INVAL:
+ xlog(L_ERROR, "Missing or invalid password");
+ goto out_free;
case FEDFS_ERR_NSDB_CONN:
xlog(L_ERROR, "Failed to connect to NSDB %s:%u",
nsdb_hostname(host), nsdb_port(host));
@@ -254,6 +254,9 @@ main(int argc, char **argv)
switch (retval) {
case FEDFS_OK:
break;
+ case FEDFS_ERR_INVAL:
+ fprintf(stderr, "Missing or invalid password\n");
+ goto out_free;
case FEDFS_ERR_NSDB_CONN:
fprintf(stderr, "Failed to connect to NSDB %s:%u\n",
nsdbname, nsdbport);
@@ -257,6 +257,9 @@ main(int argc, char **argv)
switch (retval) {
case FEDFS_OK:
break;
+ case FEDFS_ERR_INVAL:
+ fprintf(stderr, "Missing or invalid password\n");
+ goto out_free;
case FEDFS_ERR_NSDB_CONN:
fprintf(stderr, "Failed to connect to NSDB %s:%u\n",
nsdbname, nsdbport);
@@ -234,6 +234,9 @@ main(int argc, char **argv)
switch (retval) {
case FEDFS_OK:
break;
+ case FEDFS_ERR_INVAL:
+ fprintf(stderr, "Missing or invalid password\n");
+ goto out_free;
case FEDFS_ERR_NSDB_CONN:
fprintf(stderr, "Failed to connect to NSDB %s:%u\n",
nsdbname, nsdbport);
@@ -216,6 +216,9 @@ main(int argc, char **argv)
switch (retval) {
case FEDFS_OK:
break;
+ case FEDFS_ERR_INVAL:
+ fprintf(stderr, "Missing or invalid password\n");
+ goto out_free;
case FEDFS_ERR_NSDB_CONN:
fprintf(stderr, "Failed to connect to NSDB %s:%u\n",
nsdbname, nsdbport);
@@ -218,6 +218,9 @@ main(int argc, char **argv)
switch (retval) {
case FEDFS_OK:
break;
+ case FEDFS_ERR_INVAL:
+ fprintf(stderr, "Missing or invalid password\n");
+ goto out_free;
case FEDFS_ERR_NSDB_CONN:
fprintf(stderr, "Failed to connect to NSDB %s:%u\n",
nsdbname, nsdbport);
@@ -191,6 +191,9 @@ main(int argc, char **argv)
switch (retval) {
case FEDFS_OK:
break;
+ case FEDFS_ERR_INVAL:
+ fprintf(stderr, "Missing or invalid password\n");
+ goto out_free;
case FEDFS_ERR_NSDB_CONN:
fprintf(stderr, "Failed to connect to NSDB %s:%u\n",
nsdbname, nsdbport);
@@ -211,6 +211,9 @@ main(int argc, char **argv)
switch (retval) {
case FEDFS_OK:
break;
+ case FEDFS_ERR_INVAL:
+ fprintf(stderr, "Missing or invalid password\n");
+ goto out_free;
case FEDFS_ERR_NSDB_CONN:
fprintf(stderr, "Failed to connect to NSDB %s:%u\n",
nsdbname, nsdbport);
@@ -186,6 +186,9 @@ main(int argc, char **argv)
switch (retval) {
case FEDFS_OK:
break;
+ case FEDFS_ERR_INVAL:
+ fprintf(stderr, "Missing or invalid password\n");
+ goto out_free;
case FEDFS_ERR_NSDB_CONN:
fprintf(stderr, "Failed to connect to NSDB %s:%u\n",
nsdbname, nsdbport);
@@ -186,6 +186,9 @@ main(int argc, char **argv)
switch (retval) {
case FEDFS_OK:
break;
+ case FEDFS_ERR_INVAL:
+ fprintf(stderr, "Missing or invalid password\n");
+ goto out_free;
case FEDFS_ERR_NSDB_CONN:
fprintf(stderr, "Failed to connect to NSDB %s:%u\n",
nsdbname, nsdbport);
@@ -227,6 +227,9 @@ main(int argc, char **argv)
switch (retval) {
case FEDFS_OK:
break;
+ case FEDFS_ERR_INVAL:
+ fprintf(stderr, "Missing or invalid password\n");
+ goto out_free;
case FEDFS_ERR_NSDB_CONN:
fprintf(stderr, "Failed to connect to NSDB %s:%u\n",
nsdbname, nsdbport);
@@ -194,6 +194,9 @@ main(int argc, char **argv)
switch (retval) {
case FEDFS_OK:
break;
+ case FEDFS_ERR_INVAL:
+ fprintf(stderr, "Missing or invalid password\n");
+ goto out_free;
case FEDFS_ERR_NSDB_CONN:
fprintf(stderr, "Failed to connect to NSDB %s:%u\n",
nsdbname, nsdbport);
FEDFS_ERR_NSDB_AUTH means our NSDB client could not authenticate the NSDB. That authentication is done with an x.509 certificate. A user-provided password plays no part. A missing password is a user input error, thus FEDFS_ERR_INVAL is the correct error return. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> --- src/libnsdb/ldap.c | 2 +- src/nfsref/add.c | 3 +++ src/nfsref/remove.c | 3 +++ src/nsdbc/nsdb-annotate.c | 3 +++ src/nsdbc/nsdb-create-fsl.c | 3 +++ src/nsdbc/nsdb-create-fsn.c | 3 +++ src/nsdbc/nsdb-delete-fsl.c | 3 +++ src/nsdbc/nsdb-delete-fsn.c | 3 +++ src/nsdbc/nsdb-delete-nsdb.c | 3 +++ src/nsdbc/nsdb-describe.c | 3 +++ src/nsdbc/nsdb-remove-nci.c | 3 +++ src/nsdbc/nsdb-simple-nce.c | 3 +++ src/nsdbc/nsdb-update-fsl.c | 3 +++ src/nsdbc/nsdb-update-nci.c | 3 +++ 14 files changed, 40 insertions(+), 1 deletions(-)