@@ -300,6 +300,10 @@ main(int argc, char **argv)
break;
case FEDFS_ERR_NSDB_LDAP_VAL:
switch (ldap_err) {
+ case LDAP_REFERRAL:
+ fprintf(stderr, "Encountered LDAP referral on %s:%u\n",
+ nsdbname, nsdbport);
+ break;
case LDAP_NO_SUCH_ATTRIBUTE:
fprintf(stderr, "Annotation \"%s\" = \"%s\" not found\n",
keyword, value);
@@ -289,6 +289,11 @@ main(int argc, char **argv)
fprintf(stderr, "NCE %s does not exist\n", nce);
break;
case FEDFS_ERR_NSDB_LDAP_VAL:
+ if (ldap_err == LDAP_REFERRAL) {
+ fprintf(stderr, "Encountered LDAP referral on %s:%u\n",
+ nsdbname, nsdbport);
+ break;
+ }
fprintf(stderr, "Failed to create FSL %s: %s\n",
fsl_uuid, ldap_err2string(ldap_err));
break;
@@ -266,6 +266,11 @@ main(int argc, char **argv)
fprintf(stderr, "NCE %s does not exist\n", nce);
break;
case FEDFS_ERR_NSDB_LDAP_VAL:
+ if (ldap_err == LDAP_REFERRAL) {
+ fprintf(stderr, "Encountered LDAP referral on %s:%u\n",
+ nsdbname, nsdbport);
+ break;
+ }
fprintf(stderr, "Failed to create FSN: %s\n",
ldap_err2string(ldap_err));
break;
@@ -252,6 +252,11 @@ main(int argc, char **argv)
nsdbname, nsdbport, fsl_uuid);
break;
case FEDFS_ERR_NSDB_LDAP_VAL:
+ if (ldap_err == LDAP_REFERRAL) {
+ fprintf(stderr, "Encountered LDAP referral on %s:%u\n",
+ nsdbname, nsdbport);
+ break;
+ }
fprintf(stderr, "Failed to delete FSL %s: %s\n",
fsl_uuid, ldap_err2string(ldap_err));
break;
@@ -261,6 +261,11 @@ main(int argc, char **argv)
fprintf(stderr, "FSN %s still has FSL entries\n", fsn_uuid);
break;
case FEDFS_ERR_NSDB_LDAP_VAL:
+ if (ldap_err == LDAP_REFERRAL) {
+ fprintf(stderr, "Encountered LDAP referral on %s:%u\n",
+ nsdbname, nsdbport);
+ break;
+ }
/* XXX: "Operation not allowed on non-leaf" means
* this FSN still has children FSLs. */
fprintf(stderr, "Failed to delete FSN %s: %s\n",
@@ -218,6 +218,11 @@ main(int argc, char **argv)
fprintf(stderr, "NCE %s does not exist\n", nce);
break;
case FEDFS_ERR_NSDB_LDAP_VAL:
+ if (ldap_err == LDAP_REFERRAL) {
+ fprintf(stderr, "Encountered LDAP referral on %s:%u\n",
+ nsdbname, nsdbport);
+ break;
+ }
fprintf(stderr, "Failed to remove NCE %s: %s\n",
nce, ldap_err2string(ldap_err));
break;
@@ -243,6 +243,10 @@ main(int argc, char **argv)
break;
case FEDFS_ERR_NSDB_LDAP_VAL:
switch (ldap_err) {
+ case LDAP_REFERRAL:
+ fprintf(stderr, "Encountered LDAP referral on %s:%u\n",
+ nsdbname, nsdbport);
+ break;
case LDAP_NO_SUCH_OBJECT:
fprintf(stderr, "Entry \"%s\" not found\n", entry);
break;
@@ -199,6 +199,11 @@ main(int argc, char **argv)
case FEDFS_OK:
break;
case FEDFS_ERR_NSDB_LDAP_VAL:
+ if (ldap_err == LDAP_REFERRAL) {
+ fprintf(stderr, "Encountered LDAP referral on %s:%u\n",
+ nsdbname, nsdbport);
+ break;
+ }
fprintf(stderr, "Failed to list NCEs: %s\n",
ldap_err2string(ldap_err));
goto out_close;
@@ -215,6 +215,11 @@ main(int argc, char **argv)
fprintf(stderr, "NCE %s does not exist\n", nce);
break;
case FEDFS_ERR_NSDB_LDAP_VAL:
+ if (ldap_err == LDAP_REFERRAL) {
+ fprintf(stderr, "Encountered LDAP referral on %s:%u\n",
+ nsdbname, nsdbport);
+ break;
+ }
fprintf(stderr, "Failed to remove NCI for NCE %s: %s\n",
nce, ldap_err2string(ldap_err));
break;
@@ -229,6 +229,11 @@ main(int argc, char **argv)
"for this NSDB\n", nce);
break;
case FEDFS_ERR_NSDB_LDAP_VAL:
+ if (ldap_err == LDAP_REFERRAL) {
+ fprintf(stderr, "Encountered LDAP referral on %s:%u\n",
+ nsdbname, nsdbport);
+ break;
+ }
fprintf(stderr, "Failed to update NCI: %s\n",
ldap_err2string(ldap_err));
break;
@@ -260,6 +260,11 @@ main(int argc, char **argv)
fprintf(stderr, "NCE %s does not exist\n", nce);
break;
case FEDFS_ERR_NSDB_LDAP_VAL:
+ if (ldap_err == LDAP_REFERRAL) {
+ fprintf(stderr, "Encountered LDAP referral on %s:%u\n",
+ nsdbname, nsdbport);
+ break;
+ }
fprintf(stderr, "Failed to update FSL %s: %s\n",
fsl_uuid, ldap_err2string(ldap_err));
break;
@@ -234,6 +234,11 @@ main(int argc, char **argv)
"for this NSDB\n", nce);
break;
case FEDFS_ERR_NSDB_LDAP_VAL:
+ if (ldap_err == LDAP_REFERRAL) {
+ fprintf(stderr, "Encountered LDAP referral on %s:%u\n",
+ nsdbname, nsdbport);
+ break;
+ }
fprintf(stderr, "Failed to update NCI: %s\n",
ldap_err2string(ldap_err));
break;
NSDB tools that perform administrative operations are not ever allowed to follow LDAP referrals. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> --- src/nsdbc/nsdb-annotate.c | 4 ++++ src/nsdbc/nsdb-create-fsl.c | 5 +++++ src/nsdbc/nsdb-create-fsn.c | 5 +++++ src/nsdbc/nsdb-delete-fsl.c | 5 +++++ src/nsdbc/nsdb-delete-fsn.c | 5 +++++ src/nsdbc/nsdb-delete-nsdb.c | 5 +++++ src/nsdbc/nsdb-describe.c | 4 ++++ src/nsdbc/nsdb-nces.c | 5 +++++ src/nsdbc/nsdb-remove-nci.c | 5 +++++ src/nsdbc/nsdb-simple-nce.c | 5 +++++ src/nsdbc/nsdb-update-fsl.c | 5 +++++ src/nsdbc/nsdb-update-nci.c | 5 +++++ 12 files changed, 58 insertions(+), 0 deletions(-)