]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/modify.c
fix Release configuration
[openldap] / servers / slapd / modify.c
index daca60d6e16372d59093e7fdc7cae59f4c278cd5..c3b5fc9cc84629c5d1f6961ddbb5bd2a8f45c56f 100644 (file)
@@ -206,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 );
 
@@ -244,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;
 
-       ldap_pvt_thread_mutex_lock( &currenttime_mutex );
+       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 );
@@ -258,13 +259,14 @@ add_lastmods( Operation *op, LDAPModList **modlist )
        ltm = localtime( &currenttime );
        strftime( buf, sizeof(buf), "%y%m%d%H%M%SZ", ltm );
 #endif
-       ldap_pvt_thread_mutex_unlock( &currenttime_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;