X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fmodify.c;h=c3b5fc9cc84629c5d1f6961ddbb5bd2a8f45c56f;hb=af423fd393488947252da5fd6cd927edfd1bf110;hp=e03caca86ea4da0f06f956a1f330e762177e78bc;hpb=e2a15115b010b74ed5baf589614873994d9c36ec;p=openldap diff --git a/servers/slapd/modify.c b/servers/slapd/modify.c index e03caca86e..c3b5fc9cc8 100644 --- a/servers/slapd/modify.c +++ b/servers/slapd/modify.c @@ -145,7 +145,6 @@ do_modify( /* alias suffix if approp */ ndn = suffixAlias ( ndn, op, be ); - (void) dn_normalize_case( ndn ); /* * do the modify if 1 && (2 || 3) @@ -153,7 +152,7 @@ do_modify( * 2) this backend is master for what it holds; * 3) it's a replica and the dn supplied is the update_ndn. */ - if ( be->be_modify != NULL ) { + if ( be->be_modify ) { /* do the update here */ if ( be->be_update_ndn == NULL || strcmp( be->be_update_ndn, op->o_ndn ) == 0 ) @@ -207,6 +206,7 @@ add_lastmods( Operation *op, LDAPModList **modlist ) LDAPModList **m; LDAPModList *tmp; struct tm *ltm; + time_t currenttime; Debug( LDAP_DEBUG_TRACE, "add_lastmods\n", 0, 0, 0 ); @@ -245,13 +245,13 @@ add_lastmods( Operation *op, LDAPModList **modlist ) tmp = (LDAPModList *) ch_calloc( 1, sizeof(LDAPModList) ); tmp->ml_type = ch_strdup( "modifiersname" ); tmp->ml_op = LDAP_MOD_REPLACE; - tmp->ml_bvalues = (struct berval **) ch_calloc( 1, - 2 * sizeof(struct berval *) ); + tmp->ml_bvalues = (struct berval **) ch_calloc(2, sizeof(struct berval *)); tmp->ml_bvalues[0] = ber_bvdup( &bv ); tmp->ml_next = *modlist; *modlist = tmp; - pthread_mutex_lock( ¤ttime_mutex ); + currenttime = slap_get_time(); + ldap_pvt_thread_mutex_lock( &gmtime_mutex ); #ifndef LDAP_LOCALTIME ltm = gmtime( ¤ttime ); strftime( buf, sizeof(buf), "%Y%m%d%H%M%SZ", ltm ); @@ -259,13 +259,14 @@ add_lastmods( Operation *op, LDAPModList **modlist ) ltm = localtime( ¤ttime ); strftime( buf, sizeof(buf), "%y%m%d%H%M%SZ", ltm ); #endif - pthread_mutex_unlock( ¤ttime_mutex ); + ldap_pvt_thread_mutex_unlock( &gmtime_mutex ); + bv.bv_val = buf; bv.bv_len = strlen( bv.bv_val ); tmp = (LDAPModList *) ch_calloc( 1, sizeof(LDAPModList) ); tmp->ml_type = ch_strdup( "modifytimestamp" ); tmp->ml_op = LDAP_MOD_REPLACE; - tmp->ml_bvalues = (struct berval **) ch_calloc( 1, 2 * sizeof(struct berval *) ); + tmp->ml_bvalues = (struct berval **) ch_calloc(2, sizeof(struct berval *)); tmp->ml_bvalues[0] = ber_bvdup( &bv ); tmp->ml_next = *modlist; *modlist = tmp;