]> git.sur5r.net Git - openldap/commitdiff
cleanup
authorKurt Zeilenga <kurt@openldap.org>
Fri, 25 Apr 2003 00:14:54 +0000 (00:14 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Fri, 25 Apr 2003 00:14:54 +0000 (00:14 +0000)
servers/slapd/add.c
servers/slapd/modify.c

index c1557adf8e37d99aaa8a402371074722048c0b6d..b9ce04c16ac24f89c0bbdb5b72450b1f825e0916 100644 (file)
@@ -133,7 +133,8 @@ do_add( Operation *op, SlapReply *rs )
                        Debug( LDAP_DEBUG_ANY, "no values for type %s\n",
                                tmp.sml_type.bv_val, 0, 0 );
 #endif
-                       send_ldap_error( op, rs, LDAP_PROTOCOL_ERROR, "no values for attribute type" );
+                       send_ldap_error( op, rs, LDAP_PROTOCOL_ERROR,
+                               "no values for attribute type" );
                        goto done;
                }
 
@@ -172,7 +173,8 @@ do_add( Operation *op, SlapReply *rs )
        } 
 
        if ( modlist == NULL ) {
-               send_ldap_error( op, rs, LDAP_PROTOCOL_ERROR, "no attributes provided" );
+               send_ldap_error( op, rs, LDAP_PROTOCOL_ERROR,
+                       "no attributes provided" );
                goto done;
        }
 
@@ -181,11 +183,13 @@ do_add( Operation *op, SlapReply *rs )
 
        if( e->e_nname.bv_len == 0 ) {
                /* protocolError may be a more appropriate error */
-               send_ldap_error( op, rs, LDAP_ALREADY_EXISTS, "root DSE already exists" );
+               send_ldap_error( op, rs, LDAP_ALREADY_EXISTS,
+                       "root DSE already exists" );
                goto done;
 
        } else if ( bvmatch( &e->e_nname, &global_schemandn ) ) {
-               send_ldap_error( op, rs, LDAP_ALREADY_EXISTS, "subschema subentry already exists" );
+               send_ldap_error( op, rs, LDAP_ALREADY_EXISTS,
+                       "subschema subentry already exists" );
                goto done;
        }
 
@@ -205,7 +209,9 @@ do_add( Operation *op, SlapReply *rs )
                        rs->sr_err = LDAP_REFERRAL;
                        send_ldap_result( op, rs );
 
-                       if ( rs->sr_ref != default_referral ) ber_bvarray_free( rs->sr_ref );
+                       if ( rs->sr_ref != default_referral ) {
+                               ber_bvarray_free( rs->sr_ref );
+                       }
                } else {
                        send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
                                        "referral missing" );
@@ -337,9 +343,9 @@ do_add( Operation *op, SlapReply *rs )
 #ifdef LDAP_SLAPI
            rs->sr_err = doPreAddPluginFNs( op );
            if ( rs->sr_err != LDAP_SUCCESS ) {
-               /* plugin will have sent result */
-               goto done;
-           }
+                       /* plugin will have sent result */
+                       goto done;
+               }
 #endif
 #ifdef NEW_LOGGING
            LDAP_LOG( OPERATION, INFO, 
@@ -348,7 +354,7 @@ do_add( Operation *op, SlapReply *rs )
            Debug( LDAP_DEBUG_ARGS, "    do_add: no backend support\n", 0, 0, 0 );
 #endif
            send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
-                             "operation not supported within namingContext" );
+                       "operation not supported within namingContext" );
        }
 
 #ifdef LDAP_SLAPI
index a04d49a61c1708f623768b596cedc9283bd18c73..df5c60d6e810eec0e9a156a4cbf62aee3bc97c08 100644 (file)
@@ -150,7 +150,8 @@ do_modify(
                default: {
 #ifdef NEW_LOGGING
                                LDAP_LOG( OPERATION, ERR, 
-                                       "do_modify: invalid modify operation (%ld)\n", (long)mop, 0, 0 );
+                                       "do_modify: invalid modify operation (%ld)\n",
+                                       (long)mop, 0, 0 );
 #else
                                Debug( LDAP_DEBUG_ANY,
                                        "do_modify: invalid modify operation (%ld)\n",
@@ -177,7 +178,8 @@ do_modify(
                goto cleanup;
        }
 
-       rs->sr_err = dnPrettyNormal( NULL, &dn, &op->o_req_dn, &op->o_req_ndn, op->o_tmpmemctx );
+       rs->sr_err = dnPrettyNormal( NULL, &dn, &op->o_req_dn, &op->o_req_ndn,
+               op->o_tmpmemctx );
        if( rs->sr_err != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
                LDAP_LOG( OPERATION, INFO, "do_modify: conn %d  invalid dn (%s)\n",
@@ -296,7 +298,8 @@ do_modify(
         * appropriate one, or send a referral to our "referral server"
         * if we don't hold it.
         */
-       if ( (op->o_bd = select_backend( &op->o_req_ndn, manageDSAit, 0 )) == NULL ) {
+       op->o_bd = select_backend( &op->o_req_ndn, manageDSAit, 0 );
+       if ( op->o_bd == NULL ) {
                rs->sr_ref = referral_rewrite( default_referral,
                        NULL, &op->o_req_dn, LDAP_SCOPE_DEFAULT );
                if (!rs->sr_ref) rs->sr_ref = default_referral;
@@ -628,7 +631,9 @@ int slap_mods_check(
                        if( nvals && ad->ad_type->sat_equality &&
                                ad->ad_type->sat_equality->smr_normalize )
                        {
-                               ml->sml_nvalues = ber_memalloc_x( (nvals+1)*sizeof(struct berval), ctx );
+                               ml->sml_nvalues = ber_memalloc_x(
+                                       (nvals+1)*sizeof(struct berval), ctx );
+
                                for( nvals = 0; ml->sml_values[nvals].bv_val; nvals++ ) {
                                        rc = ad->ad_type->sat_equality->smr_normalize(
                                                0,
@@ -652,6 +657,7 @@ int slap_mods_check(
                                                return rc;
                                        }
                                }
+
                                ml->sml_nvalues[nvals].bv_val = NULL;
                                ml->sml_nvalues[nvals].bv_len = 0;
                        }