Commit 2919bc09 authored by Pierangelo Masarati's avatar Pierangelo Masarati
Browse files

minor improvements

parent ff0df4b6
......@@ -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",
......
......@@ -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;
}
}
......
......@@ -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;
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment