Bug 525007 - ldif2db replaces existing modify/create name and timestamps
Summary: ldif2db replaces existing modify/create name and timestamps
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: 389
Classification: Retired
Component: Database - Import/Export
Version: 1.2.0
Hardware: All
OS: All
low
medium
Target Milestone: ---
Assignee: Noriko Hosoi
QA Contact: Viktor Ashirov
URL:
Whiteboard:
Depends On:
Blocks: 434914 389_1.2.3
TreeView+ depends on / blocked
 
Reported: 2009-09-23 00:11 UTC by Ulf Weltman
Modified: 2015-12-07 17:11 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-12-07 17:11:36 UTC


Attachments (Terms of Use)
trivial fix proposal (1.28 KB, patch)
2009-09-23 00:13 UTC, Ulf Weltman
no flags Details | Diff
New trivial fix proposal (1.28 KB, patch)
2009-09-23 00:22 UTC, Ulf Weltman
no flags Details | Diff
git style patch file for ldap/servers/slapd/back-ldbm/import-threads.c (2.53 KB, patch)
2009-09-25 18:12 UTC, Noriko Hosoi
no flags Details | Diff

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 Galipeau 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.


Note You need to log in before you can comment on or make changes to this bug.