[Fedora-directory-commits] adminserver/admserv/newinst/src AdminMigration.pm.in, 1.1, 1.2 AdminServer.pm.in, 1.4, 1.5 AdminUtil.pm.in, 1.7, 1.8 migrate-ds-admin.pl.in, 1.1, 1.2 register_server.pl.in, 1.3, 1.4 setup-ds-admin.pl.in, 1.6, 1.7

Richard Allen Megginson (rmeggins) fedora-directory-commits at redhat.com
Wed Jul 4 01:31:35 UTC 2007


Author: rmeggins

Update of /cvs/dirsec/adminserver/admserv/newinst/src
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv30934/adminserver/admserv/newinst/src

Modified Files:
	AdminMigration.pm.in AdminServer.pm.in AdminUtil.pm.in 
	migrate-ds-admin.pl.in register_server.pl.in 
	setup-ds-admin.pl.in 
Log Message:
Resolves: bug 246683
Bug Description: Reimplement ds_create without setuputil code
Reviewed by: nhosoi (Thanks!)
Fix Description: ds_create was a CGI program that would create a new instance, set it up to be managed by console, and register it with the config ds.  The new ds_create CGI perl script does just that.  One tricky part was that, rather than enabling the pass through auth plugin and having to restart the server, the new server is created without being started, then the modification is done to the new server dse.ldif file directly, using the new FileConn.pm module, which simulates a Mozilla::LDAP::Conn on an LDIF file.  This also allows us to create a new instance with a pre-hashed rootdn password, rather than having to send the cleartext password.
I had to move around some code in AdminServer and AdminUtil so that I could use it from ds_create.  I also implemented support for the admin server PASSWORD_PIPE in perl so we could use it in other CGI perl scripts.
Finally, the error handling was not consistent in our code, so I made explicit the passing of error messages up and down the stack.  Oh how I wish we could just do this in python and use exception handling . . .
I added a test for ds_create.
Platforms tested: RHEL4
Flag Day: Yes - autotool changes
Doc impact: No.  Should work the same way as the old ds_create.



Index: AdminMigration.pm.in
===================================================================
RCS file: /cvs/dirsec/adminserver/admserv/newinst/src/AdminMigration.pm.in,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AdminMigration.pm.in	29 Jun 2007 21:29:05 -0000	1.1
+++ AdminMigration.pm.in	4 Jul 2007 01:31:33 -0000	1.2
@@ -160,7 +160,7 @@
 # This is how we extract the sie and isie as the as entries are
 # being added
 sub migratecb {
-	my ($context, $entry) = @_;
+	my ($context, $entry, $errs) = @_;
 
     my @arycontext = ($context);
     # always replace the tasks and commands with the new ones
@@ -170,7 +170,7 @@
         push @arycontext, 1; # means to delete any existing entries first
     }
 
-    my $rc = check_and_add_entry(\@arycontext, $entry);
+    my $rc = check_and_add_entry(\@arycontext, $entry, $errs);
 
     return $rc;
 }
@@ -207,21 +207,29 @@
 
     my $mapper = new Inf("@infdir@/asmigrate.map");
 
-    $mapper = process_maptbl($mapper, ($inf, $admininf, $setupinf));
+    $mapper = process_maptbl($mapper, \@errs, $inf, $admininf, $setupinf);
     if (!$mapper) {
         $conn->close();
+        $mig->msg(@errs);
         $mig->msg($FATAL, 'error_creating_asmigration_maptbl');
         return 0;
     }
 
     # update isie and sie
-    getMappedEntries($mapper, \@ldiffiles, \&migratecb, $conn);
+    getMappedEntries($mapper, \@ldiffiles, \@errs, \&migratecb, $conn);
+    if (@errs) {
+        $conn->close();
+        $mig->msg(@errs);
+        return 0;
+    }
+
     my $localconf = "$configdir/local.conf";
     my $isnew;
     if (! -f $localconf) {
         $isnew = 1;
     }
     if (!open(LOCALCONF, ">$localconf")) {
+        $conn->close();
         $mig->msg($FATAL, 'error_updating_localconf', $localconf, $!);
         return 0;
     }


Index: AdminServer.pm.in
===================================================================
RCS file: /cvs/dirsec/adminserver/admserv/newinst/src/AdminServer.pm.in,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- AdminServer.pm.in	29 Jun 2007 21:29:05 -0000	1.4
+++ AdminServer.pm.in	4 Jul 2007 01:31:33 -0000	1.5
@@ -39,12 +39,12 @@
 package AdminServer;
 require Exporter;
 @ISA       = qw(Exporter);
- at EXPORT    = qw(createAdminServer reconfigAdminServer registerDSWithConfigDS
+ at EXPORT    = qw(createAdminServer reconfigAdminServer
                 createASFilesAndDirs setFileOwnerPerms updateHttpConfFiles
-                startAdminServer registerManyDSWithConfigDS);
- at EXPORT_OK = qw(createAdminServer reconfigAdminServer registerDSWithConfigDS
+                startAdminServer);
+ at EXPORT_OK = qw(createAdminServer reconfigAdminServer
                 createASFilesAndDirs setFileOwnerPerms updateHttpConfFiles
-                startAdminServer registerManyDSWithConfigDS);
+                startAdminServer);
 
 use File::Path;
 # tempfiles
@@ -206,9 +206,9 @@
 # This is how we extract the sie and isie as the as entries are
 # being added
 sub registercb {
-	my ($context, $entry) = @_;
+	my ($context, $entry, $errs) = @_;
 
-    my $rc = check_and_add_entry([$context->{conn}], $entry);
+    my $rc = check_and_add_entry([$context->{conn}], $entry, $errs);
     my $setup = $context->{setup};
     if ($rc) {
         if ($entry->hasValue('objectclass', 'nsApplication', 1)) {
@@ -224,6 +224,7 @@
             }
         }
     } else {
+        $setup->msg(@{$errs});
         $setup->msg($FATAL, 'error_adding_adminserver_config_entry', $entry->getDN());
     }
 
@@ -258,9 +259,10 @@
 
     my $mapper = new Inf("@infdir@/adminserver.map");
 
-    $mapper = process_maptbl($mapper, ($inf, $admininf, $setupinf));
-    if (!$mapper) {
+    $mapper = process_maptbl($mapper, \@errs, $inf, $admininf, $setupinf);
+    if (!$mapper or @errs) {
         $conn->close();
+        $setup->msg(@errs);
         $setup->msg($FATAL, 'error_creating_adminserver_maptbl');
         return 0;
     }
@@ -276,7 +278,7 @@
         return 0;
     }
     my $context = {conn => $conn, localfh => \*LOCALCONF, setup => $setup};
-    getMappedEntries($mapper, \@ldiffiles, \&registercb, $context);
+    getMappedEntries($mapper, \@ldiffiles, \@errs, \&registercb, $context);
     close(LOCALCONF);
 
     if ($isnew) {
@@ -298,7 +300,7 @@
     }
 
     $conn->close();
-    return 1;
+    return @errs ? 0 : 1;
 }
 
 # update other config files - these are the fields which users typically want to
@@ -451,98 +453,3 @@
     my $setup = shift;
     return createAdminServer($setup, 1);
 }
-
-sub registerDSWithConfigDS {
-    my $setup = shift;
-    my $inf = shift || $setup->{inf};
-    my $configdir = shift || "$setup->{configdir}/admin-serv";
-    my @errs;
-
-    $setup->msg('registering_dirserver');
-    # open a connection to the configuration directory server
-    my $conn;
-    if (ref($configdir)) {
-        $conn = $configdir;
-    } else {
-        $conn = getConfigDSConn($inf->{General}->{ConfigDirectoryLdapURL},
-                                $inf->{General}->{ConfigDirectoryAdminID},
-                                $inf->{General}->{ConfigDirectoryAdminPwd},
-                                $configdir, \@errs);
-    }
-
-    if (@errs) {
-        $setup->msg($FATAL, @errs);
-        return 0;
-    }
-
-    # add the Admin Server configuration entries
-    my @ldiffiles = ("@ldifdir@/10dsdata.ldif.tmpl",
-                     "@ldifdir@/11dstasks.ldif.tmpl"
-                     );
-    my $setupinf = new Inf("@infdir@/setup.inf");
-    my $slapdinf = new Inf("@infdir@/slapd.inf");
-
-    my $mapper = new Inf("@infdir@/dirserver.map");
-
-    if (!$inf->{General}->{ConfigDirectoryLdapURL}) {
-        $inf->{General}->{ConfigDirectoryLdapURL} =
-            $setup->{inf}->{General}->{ConfigDirectoryLdapURL};
-    }
-
-    $mapper = process_maptbl($mapper, ($inf, $slapdinf, $setupinf));
-    if (!$mapper) {
-        $conn->close();
-        $setup->msg($FATAL, 'error_creating_dirserver_maptbl');
-        return 0;
-    }
-
-    my $context = [$conn];
-    getMappedEntries($mapper, \@ldiffiles, \&check_and_add_entry, $context);
-
-    if (!ref($configdir)) {
-        $conn->close();
-    }
-
-    return 1;
-}
-
-# this takes a list of DS instances and registers all of them
-# with the config DS
-sub registerManyDSWithConfigDS {
-    my $setup = shift;
-    my $configdir = shift;
-    my @instances = @_;
-    my @errs;
-    my $inf = $setup->{inf};
-
-    if (!@instances) {
-        return 1;
-    }
-
-    $setup->msg('registering_dirserver_instances');
-    # open a connection to the configuration directory server
-    my $conn = getConfigDSConn($inf->{General}->{ConfigDirectoryLdapURL},
-                               $inf->{General}->{ConfigDirectoryAdminID},
-                               $inf->{General}->{ConfigDirectoryAdminPwd},
-                               $configdir, \@errs);
-
-    if (@errs) {
-        $setup->msg($FATAL, @errs);
-        return 0;
-    }
-
-    my $admConf = getAdmConf($configdir);
-
-    for (@instances) {
-        my $instinf = createInfFromConfig("$setup->{configdir}/$_", $_);
-        $instinf->{General}->{AdminDomain} = $admConf->{AdminDomain};
-        unlink($instinf->{filename});
-        if (!registerDSWithConfigDS($setup, $instinf, $conn)) {
-            return 0;
-        }
-    }
-
-    $conn->close();
-
-    return 0;
-}


Index: AdminUtil.pm.in
===================================================================
RCS file: /cvs/dirsec/adminserver/admserv/newinst/src/AdminUtil.pm.in,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- AdminUtil.pm.in	29 Jun 2007 21:29:05 -0000	1.7
+++ AdminUtil.pm.in	4 Jul 2007 01:31:33 -0000	1.8
@@ -41,10 +41,12 @@
 @ISA       = qw(Exporter);
 @EXPORT    = qw(getAdmConf getConfigDSConn createConfigDS createSubDS
                 updateAdmConf updateAdmpw updateLocalConf importCACert
-                getLocalConfigDS getPset);
+                getLocalConfigDS getPset registerDSWithConfigDS
+                registerManyDSWithConfigDS createSubDSNoConn);
 @EXPORT_OK = qw(getAdmConf getConfigDSConn createConfigDS createSubDS 
                 updateAdmConf updateAdmpw updateLocalConf importCACert
-                getLocalConfigDS getPset);
+                getLocalConfigDS getPset registerDSWithConfigDS
+                registerManyDSWithConfigDS createSubDSNoConn);
 
 # load perldap
 use Mozilla::LDAP::Conn;
@@ -54,6 +56,7 @@
 
 use Util;
 use Inf;
+use FileConn;
 
 use strict;
 
@@ -264,34 +267,27 @@
     my $dsinf = new Inf("@infdir@/slapd.inf");
     my $mapper = new Inf("@infdir@/configdsroot.map");
 
-    $mapper = process_maptbl($mapper, ($inf, $dsinf, $admininf, $setupinf));
-    if (!$mapper) {
+    $mapper = process_maptbl($mapper, $errs, $inf, $dsinf, $admininf, $setupinf);
+    if (!$mapper or @{$errs}) {
         $conn->close();
-        @{$errs} = ('error_creating_configds_maptbl');
+        if (!@{$errs}) {
+            @{$errs} = ('error_creating_configds_maptbl');
+        }
         return 0;
     }
 
-    getMappedEntries($mapper, \@ldiffiles, \&check_and_add_entry,
+    getMappedEntries($mapper, \@ldiffiles, $errs, \&check_and_add_entry,
                      [$conn]);
 
     $conn->close();
-    return 1;
+    return @{$errs} ? 0 : 1;
 }
 
-# Take the slapd server instance specified in the slapd section of the given inf
-# and make it into a subordinative directory server
-# (no o=netscaperoot, with PTA setup)
-sub createSubDS {
+sub internalCreateSubDS {
+    my $conn = shift;
     my $inf = shift;
     my $errs = shift;
 
-    # open a connection to the directory server
-    my $conn = new Mozilla::LDAP::Conn($inf->{General}->{FullMachineName},
-                                       $inf->{slapd}->{ServerPort},
-                                       $inf->{slapd}->{RootDN},
-                                       $inf->{slapd}->{RootDNPwd},
-                                       $inf->{General}->{certdir});
-
     # add the o=NetscapeRoot tree using the mapper and ldif templates
     my @ldiffiles = ('@ldifdir@/12dsconfig.mod.tmpl',
                      '@ldifdir@/13dsschema.mod.tmpl',
@@ -303,18 +299,50 @@
     my $dsinf = new Inf("@infdir@/slapd.inf");
     my $mapper = new Inf("@infdir@/dirserver.map");
 
-    $mapper = process_maptbl($mapper, ($inf, $dsinf, $admininf, $setupinf));
-    if (!$mapper) {
+    $mapper = process_maptbl($mapper, $errs, $inf, $dsinf, $admininf, $setupinf);
+    if (!$mapper or @{$errs}) {
         $conn->close();
-        @{$errs} = ('error_creating_configds_maptbl');
+        if (!@{$errs}) {
+            @{$errs} = ('error_creating_configds_maptbl');
+        }
         return 0;
     }
 
-    getMappedEntries($mapper, \@ldiffiles, \&check_and_add_entry,
+    getMappedEntries($mapper, \@ldiffiles, $errs, \&check_and_add_entry,
                      [$conn]);
 
     $conn->close();
-    return 1;
+    return @{$errs} ? 0 : 1;
+}
+
+# Take the slapd server instance specified in the slapd section of the given inf
+# and make it into a subordinative directory server
+# (no o=netscaperoot, with PTA setup)
+sub createSubDS {
+    my $inf = shift;
+    my $errs = shift;
+
+    # open a connection to the directory server
+    my $conn = new Mozilla::LDAP::Conn($inf->{General}->{FullMachineName},
+                                       $inf->{slapd}->{ServerPort},
+                                       $inf->{slapd}->{RootDN},
+                                       $inf->{slapd}->{RootDNPwd},
+                                       $inf->{General}->{certdir});
+
+    return internalCreateSubDS($conn, $inf, $errs);
+}
+
+# same as createSubDS but works directly on the dse.ldif file itself
+# this is suitable for use when creating a new DS instance on the local
+# machine,
+sub createSubDSNoConn {
+    my $inf = shift;
+    my $errs = shift;
+
+    my $dseldif = "@instconfigdir@/slapd-" . $inf->{slapd}->{ServerIdentifier} . "/dse.ldif";
+    my $conn = new FileConn($dseldif);
+
+    return internalCreateSubDS($conn, $inf, $errs);
 }
 
 sub updateAdmConf {
@@ -511,3 +539,173 @@
 
     return $inst;
 }
+
+# most admin server CGIs only use PASSWORD and USERDN
+sub getAuthCredentials {
+    if ($AdminUtil::USER) {
+        return ($AdminUtil::USER, $AdminUtil::PASSWORD,
+                $AdminUtil::AUTHORIZATION, $AdminUtil::USERDN,
+                $AdminUtil::SIEPWD);
+    }
+
+    if (!defined($ENV{PASSWORD_PIPE})) {
+        return ();
+    }
+
+    my $fh;
+    if (fileno(STDIN) == $ENV{PASSWORD_PIPE}) {
+        $fh = \*STDIN;
+    } else {
+        open(INPUT, "<&=$ENV{PASSWORD_PIPE}") or
+            die "Error: could not open PASSWORD_PIPE $ENV{PASSWORD_PIPE}: $!";
+        $fh = \*INPUT;
+    }
+    while (<$fh>) {
+        if (/^User: (.*)$/) {
+            $AdminUtil::USER = $1;
+        }
+        if (/^Password: (.*)$/) {
+            $AdminUtil::PASSWORD = $1;
+        }
+        if (/^Authorization: (.*)$/) {
+            $AdminUtil::AUTHORIZATION = $1;
+        }
+        if (/^UserDN: (.*)$/) {
+            $AdminUtil::USERDN = $1;
+        }
+        if (/^SIEPWD: (.*)$/) {
+            $AdminUtil::SIEPWD = $1;
+        }
+    }
+    if (fileno(STDIN) != $ENV{PASSWORD_PIPE}) {
+        close $fh;
+    }
+
+    return ($AdminUtil::USER, $AdminUtil::PASSWORD,
+            $AdminUtil::AUTHORIZATION, $AdminUtil::USERDN,
+            $AdminUtil::SIEPWD);
+}
+
+# this takes a list of DS instances and registers all of them
+# with the config DS
+sub registerManyDSWithConfigDS {
+    my $inf = shift;
+    my $errs = shift;
+    my $configdir = shift;
+    my @instances = @_;
+
+    if (!@instances) {
+        return 1; # no instances to register - just return ok
+    }
+
+    # open a connection to the configuration directory server
+    my $conn = getConfigDSConn($inf->{General}->{ConfigDirectoryLdapURL},
+                               $inf->{General}->{ConfigDirectoryAdminID},
+                               $inf->{General}->{ConfigDirectoryAdminPwd},
+                               "$configdir/admin-serv", $errs);
+
+    if (!$conn or @{$errs}) {
+        return 0;
+    }
+
+    my $admConf = getAdmConf("$configdir/admin-serv");
+
+    for my $inst (@instances) {
+        my $instinf = createInfFromConfig("$configdir/$inst", $inst);
+        unlink($instinf->{filename});
+        $instinf->{General}->{ConfigDirectoryLdapURL} = 
+            $inf->{General}->{ConfigDirectoryLdapURL};
+        if (!registerDSWithConfigDS($inst, $errs, $instinf,
+                                    $conn, $admConf, $configdir)) {
+            return 0;
+        }
+    }
+
+    $conn->close();
+
+    return 1
+}
+
+sub registerDSWithConfigDS {
+    my $servid = shift;
+    my $errs = shift;
+    my $inf = shift;
+    my $conn = shift;
+    my $admConf = shift;
+    my $configdir = shift || "@instconfigdir@";
+    my $inst;
+    my $needclose;
+
+    if ($servid =~ /^slapd-/) {
+        $inst = $servid;
+    } else {
+        $inst = "slapd-$servid";
+    }
+
+    my ($dummy1, $pwd, $dummy2, $userdn) = getAuthCredentials();
+
+    if (!$inf->{General}->{AdminDomain}) {
+        if (!$admConf) {
+            $admConf = getAdmConf("$configdir/admin-serv");
+        }
+        $inf->{General}->{AdminDomain} = $admConf->{AdminDomain};
+    }
+
+    # open a connection to the configuration directory server
+    if (!$conn) {
+        if (!$userdn) {
+            $userdn = $inf->{General}->{ConfigDirectoryAdminID};
+        }
+        if (!$pwd) {
+            $pwd = $inf->{General}->{ConfigDirectoryAdminPwd};
+        }
+            
+        $conn = getConfigDSConn($inf->{General}->{ConfigDirectoryLdapURL},
+                                $userdn, $pwd,
+                                "$configdir/admin-serv", $errs);
+        $needclose = 1;
+    }
+
+    if (!$conn or @{$errs}) {
+        return 0;
+    }
+
+    my $instinf;
+    # setup will usually supply everything, but ds_create will not
+    if (!$inf->{slapd}->{RootDNPwd}) {
+        $instinf = createInfFromConfig("$configdir/$inst", $inst, $errs);
+        if (!$instinf or @{$errs}) {
+            if ($needclose) {
+                $conn->close();
+            }
+            return 0;
+        }
+    }
+
+    # add the Admin Server configuration entries
+    my @ldiffiles = ("@ldifdir@/10dsdata.ldif.tmpl",
+                     "@ldifdir@/11dstasks.ldif.tmpl"
+                     );
+    my $setupinf = new Inf("@infdir@/setup.inf");
+    my $slapdinf = new Inf("@infdir@/slapd.inf");
+
+    my $mapper = new Inf("@infdir@/dirserver.map");
+
+    $mapper = process_maptbl($mapper, $errs, $inf, $instinf, $slapdinf, $setupinf);
+    if (!$mapper or @{$errs}) {
+        if ($needclose) {
+            $conn->close();
+        }
+        return 0;
+    }
+
+    my $context = [$conn];
+    getMappedEntries($mapper, \@ldiffiles, $errs, \&check_and_add_entry, $context);
+
+    if ($needclose) {
+        $conn->close();
+    }
+
+    return @{$errs} ? 0 : 1;
+}
+


Index: migrate-ds-admin.pl.in
===================================================================
RCS file: /cvs/dirsec/adminserver/admserv/newinst/src/migrate-ds-admin.pl.in,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- migrate-ds-admin.pl.in	29 Jun 2007 21:29:05 -0000	1.1
+++ migrate-ds-admin.pl.in	4 Jul 2007 01:31:33 -0000	1.2
@@ -47,6 +47,7 @@
 use Migration;
 use Resource;
 use DSMigration;
+use SetupLog;
 
 my $res = new Resource("@propertydir@/migrate-ds-admin.res",
                        "@propertydir@/migrate-ds.res",
@@ -83,7 +84,14 @@
 
 # next, register/update the new directory servers
 # in the config ds
-registerManyDSWithConfigDS($mig, "$mig->{configdir}/admin-serv", @{$mig->{instances}});
+$mig->msg('registering_dirserver_instances');
+my @errs;
+if (!registerManyDSWithConfigDS($mig->{inf}, \@errs,
+                                $mig->{configdir},
+                                @{$mig->{instances}})) {
+    $mig->msg($FATAL, @errs);
+    exit 1;
+}
 
 $mig->msg('end_dsadmin_migration');
 


Index: register_server.pl.in
===================================================================
RCS file: /cvs/dirsec/adminserver/admserv/newinst/src/register_server.pl.in,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- register_server.pl.in	18 Jun 2007 17:14:51 -0000	1.3
+++ register_server.pl.in	4 Jul 2007 01:31:33 -0000	1.4
@@ -186,17 +186,20 @@
 	my $mapper = new Inf($mapfile);
 	my $infdatum = new Inf($thisinf);
 	push(@infdata, ($infdatum));
-	$mapper = process_maptbl($mapper, @infdata);
+	my @errs;
+	$mapper = process_maptbl($mapper, \@errs, @infdata);
 	if ( NULL eq $mapper )
 	{
+		print "@errs\n";
 		print "ERROR: failed to generate mapper\n";
 		exit 1;
 	}
 
-	my @ents = getMappedEntries($mapper, \@ldiffiles, \&check_and_add_entry,
-                                [$conn, $confds_fresh, $confds_verbose]);
-	if ( @ents )
+	getMappedEntries($mapper, \@ldiffiles, \@errs, \&check_and_add_entry,
+                     [$conn, $confds_fresh, $confds_verbose]);
+	if ( @errs )
 	{
+		print "@errs\n";
 		print "ERROR: failed to register server info\n";
 		return 1;
 	}


Index: setup-ds-admin.pl.in
===================================================================
RCS file: /cvs/dirsec/adminserver/admserv/newinst/src/setup-ds-admin.pl.in,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- setup-ds-admin.pl.in	29 Jun 2007 21:29:05 -0000	1.6
+++ setup-ds-admin.pl.in	4 Jul 2007 01:31:33 -0000	1.7
@@ -145,8 +145,12 @@
 $setup->msg('create_dirserver');
 
 # create a directory server instance
-my ($rc, $output) = createDSInstance($setup->{inf});
+my @errs = ();
+my ($rc, $output) = createDSInstance($setup->{inf}, \@errs);
 if ($rc) {
+    if (@errs) {
+        $setup->msg(@errs);
+    }
     $setup->msg($FATAL, 'error_creating_dsinstance', $rc, $output);
     exit 1;
 } else {
@@ -155,7 +159,6 @@
 
 # setup directory server instance to be the configuration DS
 if ($createconfigds) {
-    my @errs = ();
     $setup->msg('create_configds');
     if (!createConfigDS($setup->{inf}, \@errs)) {
         $setup->msg($FATAL, @errs);
@@ -165,7 +168,6 @@
 }
 else
 {
-    my @errs = ();
     $setup->msg('create_configds');
     if (!createSubDS($setup->{inf}, \@errs)) {
         $setup->msg($FATAL, @errs);
@@ -175,7 +177,10 @@
 }
 
 # register ds instances with config DS
-if (!registerDSWithConfigDS($setup)) {
+if (!registerDSWithConfigDS($setup->{inf}->{slapd}->{ServerIdentifier},
+                            \@errs,
+                            $setup->{inf})) {
+    $setup->msg(@errs);
     $setup->msg($FATAL, 'error_register_dirserver');
     exit 1;
 }




More information about the Fedora-directory-commits mailing list