mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-20 22:59:34 -05:00
Set modifiersname/timestamp upon creation.
Remove LDAP_LOCALTIME support.
This commit is contained in:
parent
c598c882fc
commit
37a25fa648
3 changed files with 3 additions and 28 deletions
|
|
@ -247,21 +247,18 @@ add_created_attrs( Operation *op, Entry *e )
|
||||||
bv.bv_len = strlen( bv.bv_val );
|
bv.bv_len = strlen( bv.bv_val );
|
||||||
}
|
}
|
||||||
attr_merge( e, "creatorsname", bvals );
|
attr_merge( e, "creatorsname", bvals );
|
||||||
|
attr_merge( e, "modifiersname", bvals );
|
||||||
|
|
||||||
currenttime = slap_get_time();
|
currenttime = slap_get_time();
|
||||||
ldap_pvt_thread_mutex_lock( &gmtime_mutex );
|
ldap_pvt_thread_mutex_lock( &gmtime_mutex );
|
||||||
#ifndef LDAP_LOCALTIME
|
|
||||||
ltm = gmtime( ¤ttime );
|
ltm = gmtime( ¤ttime );
|
||||||
strftime( buf, sizeof(buf), "%Y%m%d%H%M%SZ", ltm );
|
strftime( buf, sizeof(buf), "%Y%m%d%H%M%SZ", ltm );
|
||||||
#else
|
|
||||||
ltm = localtime( ¤ttime );
|
|
||||||
strftime( buf, sizeof(buf), "%y%m%d%H%M%SZ", ltm );
|
|
||||||
#endif
|
|
||||||
ldap_pvt_thread_mutex_unlock( &gmtime_mutex );
|
ldap_pvt_thread_mutex_unlock( &gmtime_mutex );
|
||||||
|
|
||||||
bv.bv_val = buf;
|
bv.bv_val = buf;
|
||||||
bv.bv_len = strlen( bv.bv_val );
|
bv.bv_len = strlen( bv.bv_val );
|
||||||
attr_merge( e, "createtimestamp", bvals );
|
attr_merge( e, "createtimestamp", bvals );
|
||||||
|
attr_merge( e, "modifytimestamp", bvals );
|
||||||
|
|
||||||
return LDAP_SUCCESS;
|
return LDAP_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -288,13 +288,8 @@ add_modified_attrs( Operation *op, LDAPModList **modlist )
|
||||||
|
|
||||||
currenttime = slap_get_time();
|
currenttime = slap_get_time();
|
||||||
ldap_pvt_thread_mutex_lock( &gmtime_mutex );
|
ldap_pvt_thread_mutex_lock( &gmtime_mutex );
|
||||||
#ifndef LDAP_LOCALTIME
|
|
||||||
ltm = gmtime( ¤ttime );
|
ltm = gmtime( ¤ttime );
|
||||||
strftime( buf, sizeof(buf), "%Y%m%d%H%M%SZ", ltm );
|
strftime( buf, sizeof(buf), "%Y%m%d%H%M%SZ", ltm );
|
||||||
#else
|
|
||||||
ltm = localtime( ¤ttime );
|
|
||||||
strftime( buf, sizeof(buf), "%y%m%d%H%M%SZ", ltm );
|
|
||||||
#endif
|
|
||||||
ldap_pvt_thread_mutex_unlock( &gmtime_mutex );
|
ldap_pvt_thread_mutex_unlock( &gmtime_mutex );
|
||||||
|
|
||||||
bv.bv_val = buf;
|
bv.bv_val = buf;
|
||||||
|
|
|
||||||
|
|
@ -105,19 +105,12 @@ monitor_info(
|
||||||
}
|
}
|
||||||
|
|
||||||
ldap_pvt_thread_mutex_lock( &gmtime_mutex );
|
ldap_pvt_thread_mutex_lock( &gmtime_mutex );
|
||||||
#ifndef LDAP_LOCALTIME
|
|
||||||
ltm = gmtime( &c->c_starttime );
|
ltm = gmtime( &c->c_starttime );
|
||||||
strftime( buf2, sizeof(buf2), "%Y%m%d%H%M%SZ", ltm );
|
strftime( buf2, sizeof(buf2), "%Y%m%d%H%M%SZ", ltm );
|
||||||
|
|
||||||
ltm = gmtime( &c->c_activitytime );
|
ltm = gmtime( &c->c_activitytime );
|
||||||
strftime( buf3, sizeof(buf2), "%Y%m%d%H%M%SZ", ltm );
|
strftime( buf3, sizeof(buf2), "%Y%m%d%H%M%SZ", ltm );
|
||||||
#else
|
|
||||||
ltm = localtime( &c->.c_starttime );
|
|
||||||
strftime( buf2, sizeof(buf2), "%y%m%d%H%M%SZ", ltm );
|
|
||||||
|
|
||||||
ltm = localtime( &c->c_activitytime );
|
|
||||||
strftime( buf3, sizeof(buf2), "%y%m%d%H%M%SZ", ltm );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ldap_pvt_thread_mutex_unlock( &gmtime_mutex );
|
ldap_pvt_thread_mutex_unlock( &gmtime_mutex );
|
||||||
|
|
||||||
|
|
@ -232,24 +225,14 @@ monitor_info(
|
||||||
currenttime = slap_get_time();
|
currenttime = slap_get_time();
|
||||||
|
|
||||||
ldap_pvt_thread_mutex_lock( &gmtime_mutex );
|
ldap_pvt_thread_mutex_lock( &gmtime_mutex );
|
||||||
#ifndef LDAP_LOCALTIME
|
|
||||||
ltm = gmtime( ¤ttime );
|
ltm = gmtime( ¤ttime );
|
||||||
strftime( buf, sizeof(buf), "%Y%m%d%H%M%SZ", ltm );
|
strftime( buf, sizeof(buf), "%Y%m%d%H%M%SZ", ltm );
|
||||||
#else
|
|
||||||
ltm = localtime( ¤ttime );
|
|
||||||
strftime( buf, sizeof(buf), "%y%m%d%H%M%SZ", ltm );
|
|
||||||
#endif
|
|
||||||
val.bv_val = buf;
|
val.bv_val = buf;
|
||||||
val.bv_len = strlen( buf );
|
val.bv_len = strlen( buf );
|
||||||
attr_merge( e, "currenttime", vals );
|
attr_merge( e, "currenttime", vals );
|
||||||
|
|
||||||
#ifndef LDAP_LOCALTIME
|
|
||||||
ltm = gmtime( &starttime );
|
ltm = gmtime( &starttime );
|
||||||
strftime( buf, sizeof(buf), "%Y%m%d%H%M%SZ", ltm );
|
strftime( buf, sizeof(buf), "%Y%m%d%H%M%SZ", ltm );
|
||||||
#else
|
|
||||||
ltm = localtime( &starttime );
|
|
||||||
strftime( buf, sizeof(buf), "%y%m%d%H%M%SZ", ltm );
|
|
||||||
#endif
|
|
||||||
ldap_pvt_thread_mutex_unlock( &gmtime_mutex );
|
ldap_pvt_thread_mutex_unlock( &gmtime_mutex );
|
||||||
|
|
||||||
val.bv_val = buf;
|
val.bv_val = buf;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue