]> git.sur5r.net Git - openldap/commitdiff
minor improvements
authorPierangelo Masarati <ando@openldap.org>
Mon, 26 Apr 2004 00:17:58 +0000 (00:17 +0000)
committerPierangelo Masarati <ando@openldap.org>
Mon, 26 Apr 2004 00:17:58 +0000 (00:17 +0000)
servers/slapd/slapacl.c
servers/slapd/slapauth.c
servers/slapd/slapdn.c

index a6b7ccd883fdbb3bb5a0f8bfe6e827256a6907a8..9ffde3b85a7e07faa12d82b4fc5faf25e88307fb 100644 (file)
@@ -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",
index a01933b4b58d0a3b1bf0e3e5644c448f764d3793..04d35afcd91cdba2aaab8976c219e3cd52d7ed88 100644 (file)
@@ -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;
                }
        }
index 7eb4b823cd3cc05b1991363b412e348343ffd9d0..e0a40d6541de3de79c80a2d6ddce77b7dc16b1d5 100644 (file)
@@ -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;
                }
        }