]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/add.c
Per ITS#419, don't require SLAPD_RLOOKUPS when HAVE_TCPD
[openldap] / servers / slapd / add.c
index 388ad9d629960ca608cca10e26f7600babd74cc6..9bc2133841a79b5b2a7e623f862457f1199106a3 100644 (file)
@@ -23,6 +23,7 @@
 #include <ac/time.h>
 #include <ac/socket.h>
 
+#include "ldap_pvt.h"
 #include "slap.h"
 
 static int     add_created_attrs(Operation *op, Entry *e);
@@ -69,7 +70,7 @@ do_add( Connection *conn, Operation *op )
 
        ndn = ch_strdup( dn );
 
-       if ( dn_normalize_case( ndn ) == NULL ) {
+       if ( dn_normalize( ndn ) == NULL ) {
                Debug( LDAP_DEBUG_ANY, "do_add: invalid dn (%s)\n", dn, 0, 0 );
                send_ldap_result( conn, op, LDAP_INVALID_DN_SYNTAX, NULL,
                    "invalid DN", NULL, NULL );
@@ -146,6 +147,14 @@ do_add( Connection *conn, Operation *op )
                return rc;
        }
 
+       /* make sure this backend recongizes critical controls */
+       rc = backend_check_controls( be, conn, op ) ;
+
+       if( rc != LDAP_SUCCESS ) {
+               send_ldap_result( conn, op, rc,
+                       NULL, NULL, NULL, NULL );
+       }
+
        if ( global_readonly || be->be_readonly ) {
                Debug( LDAP_DEBUG_ANY, "do_add: database is read-only\n",
                       0, 0, 0 );
@@ -246,21 +255,18 @@ add_created_attrs( Operation *op, Entry *e )
                bv.bv_len = strlen( bv.bv_val );
        }
        attr_merge( e, "creatorsname", bvals );
+       attr_merge( e, "modifiersname", bvals );
 
        currenttime = slap_get_time();
        ldap_pvt_thread_mutex_lock( &gmtime_mutex );
-#ifndef LDAP_LOCALTIME
        ltm = gmtime( &currenttime );
        strftime( buf, sizeof(buf), "%Y%m%d%H%M%SZ", ltm );
-#else
-       ltm = localtime( &currenttime );
-       strftime( buf, sizeof(buf), "%y%m%d%H%M%SZ", ltm );
-#endif
        ldap_pvt_thread_mutex_unlock( &gmtime_mutex );
 
        bv.bv_val = buf;
        bv.bv_len = strlen( bv.bv_val );
        attr_merge( e, "createtimestamp", bvals );
+       attr_merge( e, "modifytimestamp", bvals );
 
        return LDAP_SUCCESS;
 }