Author: nhosoi
Update of /cvs/dirsec/adminserver/admserv/newinst/src In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv20336/admserv/newinst/src
Modified Files: AdminUtil.pm.in Log Message: resolves: #247215 Summary: Reimplement ds_remove (cgi) and ds_removal (command line wrapper) without setuputil code (comment #23)
Index: AdminUtil.pm.in =================================================================== RCS file: /cvs/dirsec/adminserver/admserv/newinst/src/AdminUtil.pm.in,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- AdminUtil.pm.in 24 Jul 2007 20:10:16 -0000 1.11 +++ AdminUtil.pm.in 27 Jul 2007 01:35:29 -0000 1.12 @@ -23,12 +23,12 @@ updateAdmConf updateAdmpw updateLocalConf importCACert getLocalConfigDS getPset registerDSWithConfigDS registerManyDSWithConfigDS createSubDSNoConn - unregisterDSWithConfigDS); + unregisterDSWithConfigDS isConfigDS); @EXPORT_OK = qw(getAdmConf getConfigDSConn createConfigDS createSubDS updateAdmConf updateAdmpw updateLocalConf importCACert getLocalConfigDS getPset registerDSWithConfigDS registerManyDSWithConfigDS createSubDSNoConn - unregisterDSWithConfigDS); + unregisterDSWithConfigDS isConfigDS);
# load perldap use Mozilla::LDAP::Conn; @@ -130,6 +130,19 @@ return "$configdir/admin-serv"; }
+sub isConfigDS { + my $inst = shift; + my $configdir = shift; + my $admConf = getAdmConf ($configdir); + my $ldapstart = $admConf->{ldapStart}; + my $expected = $inst . "/start-slapd"; + if ( "$ldapstart" eq "$expected" ) { + return 1; + } else { + return 0; + } +} + sub getConfigDSConn { my $url = shift; my $id = shift; @@ -229,6 +242,10 @@ $inf->{slapd}->{RootDN}, $inf->{slapd}->{RootDNPwd}, $inf->{General}->{certdir}); + if (!$conn) { + @{$errs} = ('error_connection_failed'); + return 0; + }
# add the NetscapeRoot suffix @{$errs} = addSuffix($conn, "o=NetscapeRoot", "NetscapeRoot"); @@ -597,6 +614,7 @@ unlink($instinf->{filename}); $instinf->{General}->{ConfigDirectoryLdapURL} = $inf->{General}->{ConfigDirectoryLdapURL}; + $instinf->{General}->{AdminDomain} = $inf->{General}->{AdminDomain}; if (!registerDSWithConfigDS($inst, $errs, $instinf, $conn, $admConf, $configdir)) { return 0;
389-commits@lists.fedoraproject.org