Bug 448269 - migrate_base.pl creates extra suffix which causes error
Summary: migrate_base.pl creates extra suffix which causes error
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: migrationtools
Version: 9
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Jan Safranek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-05-25 08:24 UTC by Kazutoshi Morioka
Modified: 2008-05-28 13:32 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-05-28 13:32:41 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Kazutoshi Morioka 2008-05-25 08:24:28 UTC
Description of problem:
When domain has components greater than two, migrate_base.pl creates extra
suffix objects.
For example, "dc=example,dc=com" was created for domain "foobar.example.com".
Another example, "dc=example,dc=co,dc=jp" and "dc=co,dc=jp" were created for
domain "foobar.example.co.jp".
These extra suffixes are not needed by slapd and cause an error when ldapadd or
slapadd.

How reproducible:
always

Steps to Reproduce:
1.export LDAP_BASEDN=foobar.example.com
2./usr/share/migrationtools/migrate_base.pl > base.ldif
3.ldapadd -f base.ldif
  
Actual results:
This extra suffix object "dc=example,dc=com" is created:

Expected results:
No extra prefix is created and all objects are created under
"dc=foobar,dc=example,dc=com".

Additional info:
I think that extra suffixes are not needed for any domain. Let's remove it
completely.
 
# diff -u /usr/share/migrationtools/migrate_base.pl.orig 
/usr/share/migrationtools/migrate_base.pl
--- /usr/share/migrationtools/migrate_base.pl.orig	2008-05-25 16:54:19.000000000
+0900
+++ /usr/share/migrationtools/migrate_base.pl	2008-05-25 16:56:56.000000000 +0900
@@ -58,14 +58,8 @@
 sub gen_suffix
 {
 	@dn_components = split(/,/, $DEFAULT_BASE);
-	if ($#dn_components == 0) {
-		$dnloc = 0;
-		&base_ldif;
-	} else {
-		for ($dnloc = ($#dn_components-1); $dnloc >= 0; $dnloc--) {
-			&base_ldif;
-		}
-	}
+	$dnloc = 0;
+	&base_ldif;
 }
 
 sub base_ldif

Comment 1 Jan Safranek 2008-05-28 13:32:41 UTC
I've sent the patch upstream some time ago:
http://bugzilla.padl.com/show_bug.cgi?id=236

Unfortunately it did not get much attention. You can nag the upstream bugzilla,
maybe it will get accepted if more users confirm that it's working.


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