diff options
author | Noriko Hosoi <nhosoi@jiji.localdomain> | 2009-09-25 11:08:36 -0700 |
---|---|---|
committer | Noriko Hosoi <nhosoi@jiji.localdomain> | 2009-09-25 11:08:36 -0700 |
commit | 467df90a6ed7ac6c1a0d4588ee14ebe79f2c22c2 (patch) | |
tree | 0af6a6a8f8b94113bd1db33fb9a16713f0609547 /ldap | |
parent | b5b57df80f5a01774f85d174979dc1deea4f5724 (diff) | |
download | ds-467df90a6ed7ac6c1a0d4588ee14ebe79f2c22c2.tar.gz ds-467df90a6ed7ac6c1a0d4588ee14ebe79f2c22c2.tar.xz ds-467df90a6ed7ac6c1a0d4588ee14ebe79f2c22c2.zip |
525007 ldif2db replaces existing modify/create name and timestamps
Fix contributed by Ulf Weltman (ulf.weltman@hp.com)
Description From Ulf Weltman (ulf.weltman@hp.com)
In previous releases, if LDIF being imported contained createTimestamp,
creatorsName, modifyTimestamp, or modifiersName, those values would be kept in
the imported entries. BZ# 462922 added code to insert those attributes during
import but it clobbers any values existing in the LDIF being imported. I think
the imported values should take precedence, this would be useful during
migration for example.
If anyone wants to take advantage of the new behavior where the server
provisions new values, they can strip out the values from the LDIF before
importing or they can set nsslapd-exclude-from-export to not export those
attributes before importing.
See also https://bugzilla.redhat.com/show_bug.cgi?id=525007
Reviewed by richm, nkinder, and nhosoi
Diffstat (limited to 'ldap')
-rw-r--r-- | ldap/servers/slapd/back-ldbm/import-threads.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/ldap/servers/slapd/back-ldbm/import-threads.c b/ldap/servers/slapd/back-ldbm/import-threads.c index 1e07147d..ebb3b56a 100644 --- a/ldap/servers/slapd/back-ldbm/import-threads.c +++ b/ldap/servers/slapd/back-ldbm/import-threads.c @@ -322,8 +322,12 @@ import_add_created_attrs(Slapi_Entry *e) bv.bv_val = ""; bv.bv_len = 0; - slapi_entry_attr_replace(e, "creatorsname", bvals); - slapi_entry_attr_replace(e, "modifiersname", bvals); + if ( !attrlist_find(e->e_attrs,"creatorsname") ) { + slapi_entry_attr_replace(e, "creatorsname", bvals); + } + if ( !attrlist_find(e->e_attrs,"modifiersname") ) { + slapi_entry_attr_replace(e, "modifiersname", bvals); + } curtime = current_time(); #ifdef _WIN32 @@ -339,11 +343,12 @@ import_add_created_attrs(Slapi_Entry *e) bv.bv_val = buf; bv.bv_len = strlen(bv.bv_val); - slapi_entry_attr_replace(e, "createtimestamp", bvals); - - bv.bv_val = buf; - bv.bv_len = strlen(bv.bv_val); - slapi_entry_attr_replace(e, "modifytimestamp", bvals); + if ( !attrlist_find(e->e_attrs,"createtimestamp") ) { + slapi_entry_attr_replace(e, "createtimestamp", bvals); + } + if ( !attrlist_find(e->e_attrs,"modifytimestamp") ) { + slapi_entry_attr_replace(e, "modifytimestamp", bvals); + } } /* producer thread: |