Bug 448269 - migrate_base.pl creates extra suffix which causes error
migrate_base.pl creates extra suffix which causes error
Product: Fedora
Classification: Fedora
Component: migrationtools (Show other bugs)
All Linux
low Severity low
: ---
: ---
Assigned To: Jan Safranek
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2008-05-25 04:24 EDT by Kazutoshi Morioka
Modified: 2008-05-28 09:32 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-05-28 09:32:41 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Kazutoshi Morioka 2008-05-25 04:24:28 EDT
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

How reproducible:

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

Additional info:
I think that extra suffixes are not needed for any domain. Let's remove it
# diff -u /usr/share/migrationtools/migrate_base.pl.orig 
--- /usr/share/migrationtools/migrate_base.pl.orig	2008-05-25 16:54:19.000000000
+++ /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 09:32:41 EDT
I've sent the patch upstream some time ago:

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.