Bug 525007

Summary: ldif2db replaces existing modify/create name and timestamps
Product: [Retired] 389 Reporter: Ulf Weltman <ulf.weltman>
Component: Database - Import/ExportAssignee: Noriko Hosoi <nhosoi>
Status: CLOSED CURRENTRELEASE QA Contact: Viktor Ashirov <vashirov>
Severity: medium Docs Contact:
Priority: low    
Version: 1.2.0CC: jgalipea, rmeggins
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-07 17:11:36 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 434914, 519216    
Attachments:
Description Flags
trivial fix proposal
none
New trivial fix proposal
none
git style patch file for ldap/servers/slapd/back-ldbm/import-threads.c none

Description Ulf Weltman 2009-09-23 00:11:03 UTC
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.

Comment 1 Ulf Weltman 2009-09-23 00:13:35 UTC
Created attachment 362155 [details]
trivial fix proposal

Comment 2 Ulf Weltman 2009-09-23 00:22:08 UTC
Created attachment 362157 [details]
New trivial fix proposal

Oops, I had some incorrect logic from an earlier version of the fix.

Comment 3 Noriko Hosoi 2009-09-23 16:58:09 UTC
Hi Ulf,

Your fix looks good.

To follow the review process, could you send out your review request containing the description and the diff to 389-devel@redhat.com?  Having multiple reviewers is always good... :)

Thanks!
--noriko

Comment 4 Noriko Hosoi 2009-09-25 18:12:51 UTC
Created attachment 362704 [details]
git style patch file for ldap/servers/slapd/back-ldbm/import-threads.c

$ git merge work
Updating b5b57df..467df90
Fast forward
 ldap/servers/slapd/back-ldbm/import-threads.c |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)
$ git push
Counting objects: 13, done.
Delta compression using 2 threads.
Compressing objects: 100% (7/7), done.
Writing objects: 100% (7/7), 1.17 KiB, done.
Total 7 (delta 5), reused 0 (delta 0)
To ssh://git.fedorahosted.org/git/389/ds.git
   b5b57df..467df90  master -> master

Comment 5 Jenny Severance 2010-06-07 14:17:46 UTC
verified - RHEL 4

version:
redhat-ds-base-8.2.0-2010060704.el4dsrv


1. Added user and modified user as Directory Manager

# entry-id: 10
dn: uid=john.doe,ou=People,dc=example,dc=com
uid: john.doe
sn: Doe
givenName: John
cn: DOE John
objectClass: inetorgperson
objectClass: organizationalPerson
objectClass: person
objectClass: top
creatorsName: cn=directory manager
modifiersName: cn=directory manager
createTimestamp: 20100607140355Z
modifyTimestamp: 20100607140402Z
nsUniqueId: 7e2f3a01-1dd211b2-ac1b8690-64170000
description: This is a new description.

2.  ran db2ldif

3.  deleted user, added user back and modified user as admin

# entry-id: 11
dn: uid=john.doe,ou=People,dc=example,dc=com
uid: john.doe
givenName: John
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: inetorgperson
sn: Doe
cn: DOE John
creatorsName: uid=admin,ou=administrators,ou=topologymanagement,o=netscaperoot
modifiersName: uid=admin,ou=administrators,ou=topologymanagement,o=netscaperoo
 t
createTimestamp: 20100607140937Z
modifyTimestamp: 20100607141014Z
nsUniqueId: 30ff9802-1dd211b2-ac1c8690-64170000
description: This is another new description.

4. ran ldif2db

# entry-id: 10
dn: uid=john.doe,ou=People,dc=example,dc=com
nsUniqueId: 7e2f3a01-1dd211b2-ac1b8690-64170000
uid: john.doe
sn: Doe
givenName: John
cn: DOE John
objectClass: inetorgperson
objectClass: organizationalPerson
objectClass: person
objectClass: top
creatorsName: cn=directory manager
modifiersName: cn=directory manager
createTimestamp: 20100607140355Z
modifyTimestamp: 20100607140402Z
description: This is a new description.