ltm = gmtime( &t );
n = snprintf( buf, len, "%4d%02d%02d%02d:%02d:%02dZ#0x%04x#%d#%04x",
- ltm->tm_year + 1900, ltm->tm_mon, ltm->tm_mday, ltm->tm_hour,
+ ltm->tm_year + 1900, ltm->tm_mon + 1, ltm->tm_mday, ltm->tm_hour,
ltm->tm_min, ltm->tm_sec, op, replica, mod );
if( n < 0 ) return 0;
char textbuf[SLAP_TEXT_BUFLEN] = { '\0' };
size_t textlen = sizeof textbuf;
+ struct berval name, timestamp, csn;
+ char timebuf[22];
+ char csnbuf[64];
+
#ifdef NEW_LOGGING
lutil_log_initialize(argc, argv );
#endif
}
}
+ if ( SLAP_LASTMOD(be) ) {
+ struct tm *ltm;
+ time_t now = slap_get_time();
+
+ ltm = gmtime(&now);
+ lutil_gentime( timebuf, sizeof(timebuf), ltm );
+
+ csn.bv_len = lutil_csnstr( csnbuf, sizeof( csnbuf ), 0, 0 );
+ csn.bv_val = csnbuf;
+
+ timestamp.bv_val = timebuf;
+ timestamp.bv_len = strlen(timebuf);
+
+ if ( be->be_rootndn.bv_len == 0 ) {
+ name.bv_val = SLAPD_ANONYMOUS;
+ name.bv_len = sizeof(SLAPD_ANONYMOUS) - 1;
+ } else {
+ name = be->be_rootndn;
+ }
+ }
+
if( global_schemacheck ) {
/* check schema */
}
}
+ if ( SLAP_LASTMOD(be) ) {
+ char uuidbuf[40];
+ struct berval vals[2];
+
+ vals[0].bv_len = lutil_uuidstr( uuidbuf, sizeof( uuidbuf ) );
+ vals[0].bv_val = uuidbuf;
+ vals[1].bv_len = 0;
+ vals[1].bv_val = NULL;
+ attr_merge( e, slap_schema.si_ad_entryUUID, vals );
+
+ ber_dupbv( &vals[0], &name );
+ vals[1].bv_len = 0;
+ vals[1].bv_val = NULL;
+ attr_merge( e, slap_schema.si_ad_creatorsName, vals);
+
+ ber_dupbv( &vals[0], &name );
+ vals[1].bv_len = 0;
+ vals[1].bv_val = NULL;
+ attr_merge( e, slap_schema.si_ad_modifiersName, vals);
+
+ ber_dupbv( &vals[0], ×tamp );
+ vals[1].bv_len = 0;
+ vals[1].bv_val = NULL;
+ attr_merge( e, slap_schema.si_ad_createTimestamp, vals );
+
+ ber_dupbv( &vals[0], ×tamp );
+ vals[1].bv_len = 0;
+ vals[1].bv_val = NULL;
+ attr_merge( e, slap_schema.si_ad_modifyTimestamp, vals );
+
+ ber_dupbv( &vals[0], &csn );
+ vals[1].bv_len = 0;
+ vals[1].bv_val = NULL;
+ attr_merge( e, slap_schema.si_ad_entryCSN, vals );
+ }
+
if (!dryrun) {
ID id = be->be_entry_put( be, e, &bvtext );
if( id == NOID ) {