From patchwork Fri Jan 20 21:21:31 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1/6] nsdbc: Exit with FEDFS_ERR_INVAL if default settings don't exist Date: Fri, 20 Jan 2012 11:21:31 -0000 From: Chuck Lever X-Patchwork-Id: 137112 Message-Id: <20120120212131.13737.14542.stgit@degas.1015granger.net> To: fedfs-utils-devel@oss.oracle.com Commit afc64d55 changed the NSDB client commands to exit with a FedFS status code. One case that was missed was when the commands can't find the value of the LDAP bind DN or NCE from the command line, from environment variables, nor from the local NSDB connection parameter database. In this case, the commands were exiting with FEDFS_OK. Change these commands to instead exit with FEDFS_ERR_INVAL (an invalid parameter was provided) in this case. Signed-off-by: Chuck Lever --- src/nsdbc/nsdb-annotate.c | 1 + src/nsdbc/nsdb-create-fsl.c | 1 + src/nsdbc/nsdb-create-fsn.c | 1 + src/nsdbc/nsdb-delete-fsl.c | 1 + src/nsdbc/nsdb-delete-fsn.c | 1 + src/nsdbc/nsdb-delete-nsdb.c | 1 + src/nsdbc/nsdb-describe.c | 1 + src/nsdbc/nsdb-update-fsl.c | 1 + 8 files changed, 8 insertions(+), 0 deletions(-) diff --git a/src/nsdbc/nsdb-annotate.c b/src/nsdbc/nsdb-annotate.c index 5247204..f875721 100644 --- a/src/nsdbc/nsdb-annotate.c +++ b/src/nsdbc/nsdb-annotate.c @@ -246,6 +246,7 @@ main(int argc, char **argv) nsdb_display_fedfsstatus(retval)); goto out; } + retval = FEDFS_ERR_INVAL; if (binddn == NULL) binddn = (char *)nsdb_default_binddn(host); if (binddn == NULL) { diff --git a/src/nsdbc/nsdb-create-fsl.c b/src/nsdbc/nsdb-create-fsl.c index 1e2ee59..7f9ad1e 100644 --- a/src/nsdbc/nsdb-create-fsl.c +++ b/src/nsdbc/nsdb-create-fsl.c @@ -238,6 +238,7 @@ main(int argc, char **argv) nsdb_display_fedfsstatus(retval)); goto out; } + retval = FEDFS_ERR_INVAL; if (binddn == NULL) binddn = (char *)nsdb_default_binddn(host); if (binddn == NULL) { diff --git a/src/nsdbc/nsdb-create-fsn.c b/src/nsdbc/nsdb-create-fsn.c index 90aef0c..e46f0b5 100644 --- a/src/nsdbc/nsdb-create-fsn.c +++ b/src/nsdbc/nsdb-create-fsn.c @@ -198,6 +198,7 @@ main(int argc, char **argv) nsdb_display_fedfsstatus(retval)); goto out; } + retval = FEDFS_ERR_INVAL; if (binddn == NULL) binddn = (char *)nsdb_default_binddn(host); if (binddn == NULL) { diff --git a/src/nsdbc/nsdb-delete-fsl.c b/src/nsdbc/nsdb-delete-fsl.c index 5fc191e..cd9e189 100644 --- a/src/nsdbc/nsdb-delete-fsl.c +++ b/src/nsdbc/nsdb-delete-fsl.c @@ -202,6 +202,7 @@ main(int argc, char **argv) nsdb_display_fedfsstatus(retval)); goto out; } + retval = FEDFS_ERR_INVAL; if (binddn == NULL) binddn = (char *)nsdb_default_binddn(host); if (binddn == NULL) { diff --git a/src/nsdbc/nsdb-delete-fsn.c b/src/nsdbc/nsdb-delete-fsn.c index fcd6c20..8fc5c7d 100644 --- a/src/nsdbc/nsdb-delete-fsn.c +++ b/src/nsdbc/nsdb-delete-fsn.c @@ -204,6 +204,7 @@ main(int argc, char **argv) nsdb_display_fedfsstatus(retval)); goto out; } + retval = FEDFS_ERR_INVAL; if (binddn == NULL) binddn = (char *)nsdb_default_binddn(host); if (binddn == NULL) { diff --git a/src/nsdbc/nsdb-delete-nsdb.c b/src/nsdbc/nsdb-delete-nsdb.c index 9214443..f86941b 100644 --- a/src/nsdbc/nsdb-delete-nsdb.c +++ b/src/nsdbc/nsdb-delete-nsdb.c @@ -183,6 +183,7 @@ main(int argc, char **argv) nsdb_display_fedfsstatus(retval)); goto out; } + retval = FEDFS_ERR_INVAL; if (binddn == NULL) binddn = (char *)nsdb_default_binddn(host); if (binddn == NULL) { diff --git a/src/nsdbc/nsdb-describe.c b/src/nsdbc/nsdb-describe.c index 2915f3b..a513e37 100644 --- a/src/nsdbc/nsdb-describe.c +++ b/src/nsdbc/nsdb-describe.c @@ -203,6 +203,7 @@ main(int argc, char **argv) nsdb_display_fedfsstatus(retval)); goto out; } + retval = FEDFS_ERR_INVAL; if (binddn == NULL) binddn = (char *)nsdb_default_binddn(host); if (binddn == NULL) { diff --git a/src/nsdbc/nsdb-update-fsl.c b/src/nsdbc/nsdb-update-fsl.c index e025a15..185435d 100644 --- a/src/nsdbc/nsdb-update-fsl.c +++ b/src/nsdbc/nsdb-update-fsl.c @@ -217,6 +217,7 @@ main(int argc, char **argv) nsdb_display_fedfsstatus(retval)); goto out; } + retval = FEDFS_ERR_INVAL; if (binddn == NULL) binddn = (char *)nsdb_default_binddn(host); if (binddn == NULL) {