diff --git a/servers/slapd/slapacl.c b/servers/slapd/slapacl.c index a6b7ccd883..9ffde3b85a 100644 --- a/servers/slapd/slapacl.c +++ b/servers/slapd/slapacl.c @@ -112,7 +112,10 @@ slapacl( int argc, char **argv ) if ( access == ACL_INVALID_ACCESS ) { fprintf( stderr, "unknown access \"%s\" for attribute \"%s\"\n", accessstr, argv[0] ); - continue; + if ( continuemode ) { + continue; + } + break; } } @@ -120,10 +123,13 @@ slapacl( int argc, char **argv ) if ( rc != LDAP_SUCCESS ) { fprintf( stderr, "slap_str2ad(%s) failed %d (%s)\n", argv[0], rc, ldap_err2string( rc ) ); - continue; + if ( continuemode ) { + continue; + } + break; } - rc = access_allowed_mask( &op, &e, desc, &val, access, + (void)access_allowed_mask( &op, &e, desc, &val, access, NULL, &mask ); fprintf( stderr, "%s%s%s: %s\n", diff --git a/servers/slapd/slapauth.c b/servers/slapd/slapauth.c index a01933b4b5..04d35afcd9 100644 --- a/servers/slapd/slapauth.c +++ b/servers/slapd/slapauth.c @@ -130,9 +130,11 @@ slapauth( int argc, char **argv ) fprintf( stderr, "authzID: <%s> check failed %d (%s)\n", authzID.bv_val, rc, ldap_err2string( rc ) ); - rc = 1; + rc = -1; BER_BVZERO( &authzID ); - goto destroy; + if ( !continuemode ) { + goto destroy; + } } authzID = authzdn; @@ -142,7 +144,7 @@ slapauth( int argc, char **argv ) op.o_tmpfree( authzID.bv_val, op.o_tmpmemctx ); BER_BVZERO( &authzID ); - if ( rc ) { + if ( rc && !continuemode ) { goto destroy; } } @@ -157,7 +159,7 @@ slapauth( int argc, char **argv ) rc = do_check( &conn, &op, &id ); - if ( rc ) { + if ( rc && !continuemode ) { goto destroy; } } diff --git a/servers/slapd/slapdn.c b/servers/slapd/slapdn.c index 7eb4b823cd..e0a40d6541 100644 --- a/servers/slapd/slapdn.c +++ b/servers/slapd/slapdn.c @@ -37,7 +37,7 @@ int slapdn( int argc, char **argv ) { - int rc = EXIT_SUCCESS; + int rc = 0; const char *progname = "slapdn"; #ifdef NEW_LOGGING @@ -59,7 +59,10 @@ slapdn( int argc, char **argv ) fprintf( stderr, "DN: <%s> check failed %d (%s)\n", dn.bv_val, rc, ldap_err2string( rc ) ); - rc = 1; + if ( !continuemode ) { + rc = -1; + break; + } } else { fprintf( stderr, "DN: <%s> check succeeded\n" @@ -69,7 +72,6 @@ slapdn( int argc, char **argv ) ndn.bv_val, pdn.bv_val ); ch_free( ndn.bv_val ); ch_free( pdn.bv_val ); - rc = 0; } }