]> git.sur5r.net Git - openldap/commitdiff
move to more appropriate file ...
authorPierangelo Masarati <ando@openldap.org>
Mon, 7 Apr 2003 17:18:42 +0000 (17:18 +0000)
committerPierangelo Masarati <ando@openldap.org>
Mon, 7 Apr 2003 17:18:42 +0000 (17:18 +0000)
servers/slapd/back-ldap/add.c
servers/slapd/back-ldap/map.c

index f4cf8af1e9ac6e18650289e751b9a107b8dfd287..3a26ef68cb4395adc9ff1284137db1e006dcb095 100644 (file)
@@ -149,46 +149,3 @@ ldap_back_add(
        return ldap_back_op_result( lc, op, rs, msgid, 1 ) != LDAP_SUCCESS;
 }
 
-int
-ldap_dnattr_rewrite(
-       dncookie                *dc,
-       BerVarray               a_vals
-)
-{
-       struct berval   bv;
-       int             i, last;
-
-       for ( last = 0; a_vals[last].bv_val != NULL; last++ );
-       last--;
-
-       for ( i = 0; a_vals[i].bv_val != NULL; i++ ) {
-               switch ( ldap_back_dn_massage( dc, &a_vals[i], &bv ) ) {
-               case LDAP_SUCCESS:
-               case LDAP_OTHER:        /* ? */
-               default:                /* ??? */
-                       /* leave attr untouched if massage failed */
-                       if ( bv.bv_val && bv.bv_val != a_vals[i].bv_val ) {
-                               ch_free( a_vals[i].bv_val );
-                               a_vals[i] = bv;
-                       }
-                       break;
-
-               case LDAP_UNWILLING_TO_PERFORM:
-                       /*
-                        * FIXME: need to check if it may be considered 
-                        * legal to trim values when adding/modifying;
-                        * it should be when searching (see ACLs).
-                        */
-                       ch_free( a_vals[i].bv_val );
-                       if (last > i ) {
-                               a_vals[i] = a_vals[last];
-                       }
-                       a_vals[last].bv_len = 0;
-                       a_vals[last].bv_val = NULL;
-                       last--;
-                       break;
-               }
-       }
-       
-       return 0;
-}
index b08ca5539e77956c4f96574471529752fe151b65..c74eee875e27b1a6df4916d85a7ada4bc88c6a22 100644 (file)
@@ -468,3 +468,47 @@ ldap_back_filter_map_rewrite(
        return 0;
 }
 
+int
+ldap_dnattr_rewrite(
+       dncookie                *dc,
+       BerVarray               a_vals
+)
+{
+       struct berval   bv;
+       int             i, last;
+
+       for ( last = 0; a_vals[last].bv_val != NULL; last++ );
+       last--;
+
+       for ( i = 0; a_vals[i].bv_val != NULL; i++ ) {
+               switch ( ldap_back_dn_massage( dc, &a_vals[i], &bv ) ) {
+               case LDAP_SUCCESS:
+               case LDAP_OTHER:        /* ? */
+               default:                /* ??? */
+                       /* leave attr untouched if massage failed */
+                       if ( bv.bv_val && bv.bv_val != a_vals[i].bv_val ) {
+                               ch_free( a_vals[i].bv_val );
+                               a_vals[i] = bv;
+                       }
+                       break;
+
+               case LDAP_UNWILLING_TO_PERFORM:
+                       /*
+                        * FIXME: need to check if it may be considered 
+                        * legal to trim values when adding/modifying;
+                        * it should be when searching (see ACLs).
+                        */
+                       ch_free( a_vals[i].bv_val );
+                       if (last > i ) {
+                               a_vals[i] = a_vals[last];
+                       }
+                       a_vals[last].bv_len = 0;
+                       a_vals[last].bv_val = NULL;
+                       last--;
+                       break;
+               }
+       }
+       
+       return 0;
+}
+