[Fedora-directory-commits] directoryconsole/src/com/netscape/admin/dirserv/panel MappingUtils.java, 1.1.1.1, 1.2
by Doctor Conrad
Author: nkinder
Update of /cvs/dirsec/directoryconsole/src/com/netscape/admin/dirserv/panel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv2901/src/com/netscape/admin/dirserv/panel
Modified Files:
MappingUtils.java
Log Message:
Resolves: 250137
Summary: Updated verison number to 1.1.0
Index: MappingUtils.java
===================================================================
RCS file: /cvs/dirsec/directoryconsole/src/com/netscape/admin/dirserv/panel/MappingUtils.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- MappingUtils.java 18 Jul 2005 00:56:00 -0000 1.1.1.1
+++ MappingUtils.java 30 Jul 2007 17:16:41 -0000 1.2
@@ -493,9 +493,9 @@
/**
* Returns the suffix of the backend that is naming context and parent of the entry.
- * For example if we have 2 backends with suffixes 'o=fedora.com' and 'ou=people, o=fedora.com'
- * For 'cn=Michael, o=fedora.com' it will return 'o=fedora.com'
- * For 'cn=Michael, ou=people, o=fedora.com' it will return 'o=fedora.com' ('ou=people, o=fedora.com' is not a naming context)
+ * For example if we have 2 backends with suffixes 'o=example.com' and 'ou=people, o=example.com'
+ * For 'cn=Michael, o=example.com' it will return 'o=example.com'
+ * For 'cn=Michael, ou=people, o=example.com' it will return 'o=example.com' ('ou=people, o=example.com' is not a naming context)
* For 'cn=plugins, cn=config' (not in a regular backend) it will return null
*/
public static String getTopSuffixForEntry(LDAPConnection ldc, String dn) {
@@ -522,9 +522,9 @@
/**
* This method gets the shortest suffix which is superior of the given dn from the given suffix list .
- * For example if we have a list with 2 suffixes 'o=fedora.com' and 'ou=people, o=fedora.com'
- * For 'cn=Michael, o=fedora.com' it will return 'o=fedora.com'
- * For 'cn=Michael, ou=people, o=fedora.com' it will return 'o=fedora.com'
+ * For example if we have a list with 2 suffixes 'o=example.com' and 'ou=people, o=example.com'
+ * For 'cn=Michael, o=example.com' it will return 'o=example.com'
+ * For 'cn=Michael, ou=people, o=example.com' it will return 'o=example.com'
* For 'cn=plugins, cn=config' (not in the list of suffixes) it will return null
*
* @param dn of the entry we want to handle
@@ -555,9 +555,9 @@
/**
* Returns the suffix of the backend to which this entry belongs.
- * For example if we have 2 backends with suffixes 'o=fedora.com' and 'ou=people, o=fedora.com'
- * For 'cn=Michael, o=fedora.com' it will return 'o=fedora.com'
- * For 'cn=Michael, ou=people, o=fedora.com' it will return 'ou=people, o=fedora.com'
+ * For example if we have 2 backends with suffixes 'o=example.com' and 'ou=people, o=example.com'
+ * For 'cn=Michael, o=example.com' it will return 'o=example.com'
+ * For 'cn=Michael, ou=people, o=example.com' it will return 'ou=people, o=example.com'
* For 'cn=plugins, cn=config' (not in a regular backend) it will return null
*/
16 years, 8 months
[Fedora-directory-commits] directoryconsole/src/com/netscape/admin/dirserv DSAdmin.java, 1.5, 1.6 about.properties, 1.4, 1.5 dirserv.properties, 1.6, 1.7
by Doctor Conrad
Author: nkinder
Update of /cvs/dirsec/directoryconsole/src/com/netscape/admin/dirserv
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv2901/src/com/netscape/admin/dirserv
Modified Files:
DSAdmin.java about.properties dirserv.properties
Log Message:
Resolves: 250137
Summary: Updated verison number to 1.1.0
Index: DSAdmin.java
===================================================================
RCS file: /cvs/dirsec/directoryconsole/src/com/netscape/admin/dirserv/DSAdmin.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- DSAdmin.java 11 Jul 2007 01:26:23 -0000 1.5
+++ DSAdmin.java 30 Jul 2007 17:16:40 -0000 1.6
@@ -1267,7 +1267,7 @@
static public int SECURITY_ENABLE = 2;
// Minimum required console version
- private static final float MINIMUM_VERSION = 1.0f;
+ private static final float MINIMUM_VERSION = 1.1f;
// Icon for the console
private static final String _imageName = "directory.gif";
Index: about.properties
===================================================================
RCS file: /cvs/dirsec/directoryconsole/src/com/netscape/admin/dirserv/about.properties,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- about.properties 29 Sep 2006 17:17:26 -0000 1.4
+++ about.properties 30 Jul 2007 17:16:40 -0000 1.5
@@ -19,7 +19,7 @@
#
# Strings and logos used by the DSAboutDialog
-aboutDialog-dialogTitle=Fedora Directory Server 1.0.3
+aboutDialog-dialogTitle=Fedora Directory Server 1.1.0
aboutDialog-productLogo=com/netscape/management/client/images/logo32.gif
aboutDialog-productCopyright=Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.\nCopyright (C) 2005 Red Hat, Inc.\nAll rights reserved.
aboutDialog-productLicense=Fedora is a trademark of Red Hat, Inc. in the United States and other countries and is used by permission.
Index: dirserv.properties
===================================================================
RCS file: /cvs/dirsec/directoryconsole/src/com/netscape/admin/dirserv/dirserv.properties,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- dirserv.properties 2 Jul 2007 19:44:08 -0000 1.6
+++ dirserv.properties 30 Jul 2007 17:16:40 -0000 1.7
@@ -164,9 +164,9 @@
#
dialog-configtitle=Fedora Directory Server
dsAdmin-title=Fedora Directory Server
-dsAdmin-version=Version 1.0.3
+dsAdmin-version=Version 1.1.0
dsAdmin-nsServerPort=Port
-dsAdmin-framework-description=Fedora Directory Server Console 1.0.3
+dsAdmin-framework-description=Fedora Directory Server Console 1.1.0
dsAdmin-remove-server-cgi-failed=ds_remove failure
#
@@ -1736,12 +1736,12 @@
encryption-nosslfamily-msg=At least one cipher family must be selected to enable SSL
encryption-nosslfamily-title=Invalid SSL settings
encryption-preferences-title=Encryption Preferences
-encryption-consoleSSL-label=Use SSL in Fedora Console
-encryption-consoleSSL-ttip=Use SSL for connections from Fedora Console to this server
+encryption-consoleSSL-label=Use SSL in Console
+encryption-consoleSSL-ttip=Use SSL for connections from Console to this server
encryption-SSLCheckHostName-label=Check hostname against name in certificate for outbound SSL connections
encryption-SSLCheckHostName-ttip=Check the hostname used for outbound SSL connections against the name in the destination server's certificate
encryption-confirm-clientauth-title=Require Client Authentication
-encryption-confirm-clientauth-msg=When the server is configured to require SSL client authentication,\nFedora Console cannot use SSL to manage the server.\nIt will use a regular LDAP connection.
+encryption-confirm-clientauth-msg=When the server is configured to require SSL client authentication,\nConsole cannot use SSL to manage the server.\nIt will use a regular LDAP connection.
encryption-confirm-sslport-title=Encrypted Port Checking
encryption-confirm-sslport-msg=The encrypted port is %0. On Unix, using a port\nbelow 1024 requires the server to be installed as root.\n\nBefore restarting the server, make sure it was installed\nas root or set a port above 1024 using the Settings tab.
@@ -2390,7 +2390,7 @@
general-ldapv2quoting-title=Using Deprecated LDAPv2 Style Quoting
general-ldapv2quoting-msg=The field %0 has the value %1 which uses the deprecated\nLDAPv2 style quoting. It will be converted to use LDAPv3 escapes.
general-neednewconsole-title=Console Version Mismatch
-general-neednewconsole-msg=This Directory Server Console is not compatible with Admin Console version %0.\nPlease install the latest Admin Console or download the components from the Fedora web server.
+general-neednewconsole-msg=This Directory Server is not compatible with the Console version you are running (%0).\nPlease install the latest Console.
general-notyetimplemented=Not Yet Implemented!
general-backendname-exist-msg=Database named %0 already exists
general-backendname-exist-title=Error on creation
@@ -2686,7 +2686,7 @@
mappingtree-referral-LDAPUrl-no-good-title=Confirmation Needed
mappingtree-referral-LDAPUrl-no-good-msg=This URL is not compliant with the Standard LDAP URL format.\nIf your LDAP client understands a non standard format,\nclick YES to add it to the list.
mappingtree-multiple-db-title=Warning
-mappingtree-multiple-db-msg= You have chosen to distribute a single suffix across multiple databases.\n This requires configuring distribution logic with Fedora Professional Services.\n In addition, you cannot replicate a suffix distributed across multiple databases.\n Do you want to continue?
+mappingtree-multiple-db-msg= You have chosen to distribute a single suffix across multiple databases.\n This requires a custom distribution logic plugin.\n In addition, you cannot replicate a suffix distributed across multiple databases.\n Do you want to continue?
mappingtree-reload-suffix-title=Error Reading Suffix
mappingtree-reload-suffix-msg=Failed to read %0\n Error: %1
mappingtree-del-warning-title=Database Successfully Deleted
16 years, 8 months
[Fedora-directory-commits] console/src/com/netscape/management/client/theme theme.properties, 1.4, 1.5
by Doctor Conrad
Author: nkinder
Update of /cvs/dirsec/console/src/com/netscape/management/client/theme
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv5556/src/com/netscape/management/client/theme
Modified Files:
theme.properties
Log Message:
Resolves: 249897
Summary: Changed package name to fedora-idm-console.
Index: theme.properties
===================================================================
RCS file: /cvs/dirsec/console/src/com/netscape/management/client/theme/theme.properties,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- theme.properties 26 Jul 2007 23:08:49 -0000 1.4
+++ theme.properties 27 Jul 2007 20:29:59 -0000 1.5
@@ -20,7 +20,7 @@
console-title=Fedora Management Console
console-useragent=Fedora-Management-Console
-console-prefsdir=.fedora-console
+console-prefsdir=.fedora-idm-console
login-title=Fedora Management Console Login
banner-console=Fedora Management Console
16 years, 8 months
[Fedora-directory-commits] console fedora-idm-console, NONE, 1.1 fedora-idm-console.spec, NONE, 1.1 build.properties, 1.12, 1.13 build.xml, 1.15, 1.16 fedora-console, 1.1, NONE fedora-console.spec, 1.3, NONE
by Doctor Conrad
Author: nkinder
Update of /cvs/dirsec/console
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv5556
Modified Files:
build.properties build.xml
Added Files:
fedora-idm-console fedora-idm-console.spec
Removed Files:
fedora-console fedora-console.spec
Log Message:
Resolves: 249897
Summary: Changed package name to fedora-idm-console.
--- NEW FILE fedora-idm-console ---
#!/bin/sh
#
# BEGIN COPYRIGHT BLOCK
# Copyright (C) 2005 Red Hat, Inc.
# All rights reserved.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation version
# 2.1 of the License.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# END COPYRIGHT BLOCK
JAVA=`which java`
if [ -z "$JAVA" -o ! -x "$JAVA" ]
then
echo "$0: The java program is not in your path, or is not executable.";
exit 1
fi
CLASSDEST=@classdest@
#
# Launch the Console
#
java -ms8m -mx64m -cp @jssjar@:@ldapjdkjar@:$CLASSDEST/@basejar@:$CLASSDEST/@mccjar@:$CLASSDEST/@mcclangjar@:$CLASSDEST/@nmclfjar@:$CLASSDEST/@nmclflangjar@:$CLASSDEST/@themejar@ -Djava.library.path=@libdir@ -Djava.util.prefs.systemRoot="$HOME/.@prefsdir@" -Djava.util.prefs.userRoot="$HOME/.@prefsdir@" com.netscape.management.client.console.Console $*
--- NEW FILE fedora-idm-console.spec ---
%define major_version 1.1
%define minor_version 0
Name: fedora-idm-console
Version: %{major_version}.%{minor_version}
Release: 3
Group: Applications
Vendor: Fedora Project
URL: http://directory.fedora.redhat.com
License: LGPL
Packager: Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
Summary: Fedora Management Console
BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildArch: noarch
Source: %{name}-%{version}.tar.gz
Autoreq: 0
AutoReqProv: no
Requires: %{name}-framework >= %{version}
BuildPreReq: ant >= 1.6.2, ldapjdk >= 4.18, jss >= 4.2
%description
A Java based remote management console used for Managing Fedora
Administration Server and Fedora Directory Server.
# prep and setup expect there to be a Source file
# in the /usr/src/redhat/SOURCES directory - it will be unpacked
# in the _builddir (not BuildRoot)
%package framework
Summary: Fedora Management Console Framework
Requires: ldapjdk >= 4.18, jss >= 4.2
Group: System Environment/Libraries
%description framework
A Java Management Console framework used for remote server management.
%prep
%setup -q
%build
cd console
ant -Dlib.dir=%{_libdir}
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT/usr/share/java
install -m777 built/release/jars/fedora-* $RPM_BUILD_ROOT/usr/share/java
install -d $RPM_BUILD_ROOT/usr/bin
install -m777 built/release/%{name} $RPM_BUILD_ROOT/usr/bin
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
/usr/share/java/%{name}-%{version}_en.jar
/usr/bin/%{name}
%files framework
%defattr(-,root,root)
/usr/share/java/%{name}-base-%{version}.jar
/usr/share/java/fedora-mcc-%{version}.jar
/usr/share/java/fedora-mcc-%{version}_en.jar
/usr/share/java/fedora-nmclf-%{version}.jar
/usr/share/java/fedora-nmclf-%{version}_en.jar
%post
cd /usr/share/java
ln -s %{name}-%{version}_en.jar %{name}-%{major_version}_en.jar
ln -s %{name}-%{version}_en.jar %{name}_en.jar
%post framework
cd /usr/share/java
ln -s %{name}-base-%{version}.jar %{name}-base-%{major_version}.jar
ln -s %{name}-base-%{version}.jar %{name}-base.jar
ln -s fedora-mcc-%{version}.jar fedora-mcc-%{major_version}.jar
ln -s fedora-mcc-%{version}.jar fedora-mcc.jar
ln -s fedora-mcc-%{version}_en.jar fedora-mcc-%{major_version}_en.jar
ln -s fedora-mcc-%{version}_en.jar fedora-mcc_en.jar
ln -s fedora-nmclf-%{version}.jar fedora-nmclf-%{major_version}.jar
ln -s fedora-nmclf-%{version}.jar fedora-nmclf.jar
ln -s fedora-nmclf-%{version}_en.jar fedora-nmclf-%{major_version}_en.jar
ln -s fedora-nmclf-%{version}_en.jar fedora-nmclf_en.jar
%preun
rm -rf /usr/share/java/%{name}-%{major_version}_en.jar
rm -rf /usr/share/java/%{name}_en.jar
%preun framework
rm -rf /usr/share/java/%{name}-base-%{major_version}.jar
rm -rf /usr/share/java/%{name}-base.jar
rm -rf /usr/share/java/fedora-mcc-%{major_version}.jar
rm -rf /usr/share/java/fedora-mcc.jar
rm -rf /usr/share/java/fedora-mcc-%{major_version}_en.jar
rm -rf /usr/share/java/fedora-mcc_en.jar
rm -rf /usr/share/java/fedora-nmclf-%{major_version}.jar
rm -rf /usr/share/java/fedora-nmclf.jar
rm -rf /usr/share/java/fedora-nmclf-%{major_version}_en.jar
rm -rf /usr/share/java/fedora-nmclf_en.jar
%changelog
* Fri Jul 27 2007 Nathan Kinder <nkinder(a)redhat.com> 1.1.0-3
- Changed package name to be less generic.
* Thu Jul 26 2007 Nathan Kinder <nkinder(a)redhat.com> 1.1.0-2
- Updated start script and theme jar names. Fixed post and
preun steps for framework subpackage.
* Fri Jun 29 2007 Nathan Kinder <nkinder(a)redhat.com> 1.1.0-1
- Updated for 1.1.0 release
* Mon Nov 14 2005 Nathan Kinder <nkinder(a)redhat.com> 1.0-1
- Initial creation
Index: build.properties
===================================================================
RCS file: /cvs/dirsec/console/build.properties,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- build.properties 26 Jul 2007 23:08:46 -0000 1.12
+++ build.properties 27 Jul 2007 20:29:59 -0000 1.13
@@ -36,11 +36,11 @@
nmclf.name=${nmclf.core}-${console.dotversion}
nmclf.gen.name=${nmclf.core}-${console.dotgenversion}
-base.core=${console.brand}-base
+base.core=${console.brand}-idm-console-base
base.name=${base.core}-${console.dotversion}
base.gen.name=${base.core}-${console.dotgenversion}
-theme.core=${console.brand}-console
+theme.core=${console.brand}-idm-console
theme.name=${theme.core}-${console.dotversion}
theme.gen.name=${theme.core}-${console.dotgenversion}
Index: build.xml
===================================================================
RCS file: /cvs/dirsec/console/build.xml,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- build.xml 26 Jul 2007 23:08:46 -0000 1.15
+++ build.xml 27 Jul 2007 20:29:59 -0000 1.16
@@ -184,9 +184,9 @@
<classpath refid="console.classpath" />
</javac>
- <!-- create fedora-console script -->
- <copy file="fedora-console" todir="${release.dir}"/>
- <replace file="${release.dir}/fedora-console">
+ <!-- create fedora-idm-console script -->
+ <copy file="fedora-idm-console" todir="${release.dir}"/>
+ <replace file="${release.dir}/fedora-idm-console">
<replacefilter token="@classdest@" value="${classdest}"/>
<replacefilter token="@jssjar@" value="${jss.local.location}/${jss.jar.name}"/>
<replacefilter token="@ldapjdkjar@" value="${ldapjdk.local.location}/${ldapjdk.jar.name}"/>
--- fedora-console DELETED ---
--- fedora-console.spec DELETED ---
16 years, 8 months
[Fedora-directory-commits] ldapserver/ldap/admin/src/scripts DialogManager.pm, 1.4, 1.5 SetupDialogs.pm.in, 1.2, 1.3 setup-ds.res.in, 1.8, 1.9
by Doctor Conrad
Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/admin/src/scripts
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv21095
Modified Files:
DialogManager.pm SetupDialogs.pm.in setup-ds.res.in
Log Message:
Resolves: #249739
Summary: Implement a script registering DS to the Configuration DS (comment#5)
Index: DialogManager.pm
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/scripts/DialogManager.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- DialogManager.pm 20 Jun 2007 16:27:50 -0000 1.4
+++ DialogManager.pm 27 Jul 2007 01:46:10 -0000 1.5
@@ -89,6 +89,11 @@
}
}
+sub resetDialog {
+ my $self = shift;
+ @{$self->{dialogs}} = ();
+}
+
# see if the user answered with the special BACK answer
sub isBack {
my $self = shift;
Index: SetupDialogs.pm.in
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/scripts/SetupDialogs.pm.in,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SetupDialogs.pm.in 13 Jul 2007 19:51:48 -0000 1.2
+++ SetupDialogs.pm.in 27 Jul 2007 01:46:10 -0000 1.3
@@ -253,4 +253,8 @@
return ($welcome, $license, $setuptype, $hostdlg, $usergroup);
}
+sub getRegDialogs {
+ return ($usergroup);
+}
+
1;
Index: setup-ds.res.in
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/scripts/setup-ds.res.in,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- setup-ds.res.in 13 Jul 2007 18:35:32 -0000 1.8
+++ setup-ds.res.in 27 Jul 2007 01:46:10 -0000 1.9
@@ -66,7 +66,7 @@
dialog_dsrootdn_prompt = Directory Manager DN
dialog_dsrootdn_error = The input '%s' is not a valid DN. Please choose another one.\n\n
dialog_dsrootpw_prompt1 = Password
-dialog_dsrootpw_prompt2 = Password (again)
+dialog_dsrootpw_prompt2 = Password (confirm)
dialog_dsrootpw_invalid = The password contains invalid characters. Please choose another one.\n\n
dialog_dsrootpw_tooshort = The password must be at least %s characters long. Please choose another one.\n\n
dialog_dsrootpw_nomatch = The passwords do not match. Please try again.\n\n
16 years, 8 months
[Fedora-directory-commits] adminserver/admserv/newinst/src RegDSDialogs.pm, NONE, 1.1 register-ds-admin.pl.in, NONE, 1.1 register-ds-admin.res.in, NONE, 1.1 AdminServer.pm.in, 1.7, 1.8 ConfigDSDialogs.pm, 1.5, 1.6 setup-ds-admin.res.in, 1.5, 1.6
by Doctor Conrad
Author: nhosoi
Update of /cvs/dirsec/adminserver/admserv/newinst/src
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv20804/admserv/newinst/src
Modified Files:
AdminServer.pm.in ConfigDSDialogs.pm setup-ds-admin.res.in
Added Files:
RegDSDialogs.pm register-ds-admin.pl.in
register-ds-admin.res.in
Log Message:
resolves: #249739
Summary: Implement a script registering DS to the Configuration DS (comment #1-4)
--- NEW FILE RegDSDialogs.pm ---
# BEGIN COPYRIGHT BLOCK
# This Program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; version 2 of the License.
#
# This Program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
# Place, Suite 330, Boston, MA 02111-1307 USA.
#
# In addition, as a special exception, Red Hat, Inc. gives You the additional
# right to link the code of this Program with code not covered under the GNU
# General Public License ("Non-GPL Code") and to distribute linked combinations
# including the two, subject to the limitations in this paragraph. Non-GPL Code
# permitted under this exception must only link to the code of this Program
# through those well defined interfaces identified in the file named EXCEPTION
# found in the source code files (the "Approved Interfaces"). The files of
# Non-GPL Code may instantiate templates or use macros or inline functions from
# the Approved Interfaces without causing the resulting work to be covered by
# the GNU General Public License. Only Red Hat, Inc. may make changes or
# additions to the list of Approved Interfaces. You must obey the GNU General
# Public License in all respects for all of the Program code and other code used
# in conjunction with the Program except the Non-GPL Code covered by this
# exception. If you modify this file, you may extend this exception to your
# version of the file, but you are not obligated to do so. If you do not wish to
# provide this exception without modification, you must delete this exception
# statement from your version and license this file solely under the GPL without
# exception.
#
#
# Copyright (C) 2007 Red Hat, Inc.
# All rights reserved.
# END COPYRIGHT BLOCK
#
package RegDSDialogs;
use strict;
use DialogManager;
use Setup;
use Dialog;
use Util;
my $configdsinfo = new Dialog (
$TYPICAL,
'use_existing_configds_txt',
sub {
my $self = shift;
my $servid = $self->{manager}->{inf}->{slapd}->{ServerIdentifier};
return $servid;
},
sub {
my $self = shift;
my $ans = shift;
my $index = shift;
my $res = $DialogManager::SAME;
$self->{manager}->setType($TYPICAL);
if ($index == 0) {
# validate serverIdentifier?
foreach my $inst (@{$self->{manager}->{inf}->{slapd}->{Instances}})
{
if ( "$inst" eq "slapd-" . $ans )
{
$self->{manager}->{inf}->{slapd}->{ServerIdentifier} = $ans;
$res = $DialogManager::NEXT;
goto out;
}
}
out:
if ( $DialogManager::SAME == $res )
{
$self->{manager}->alert("error_configds_txt", $ans);
}
return $res;
}
return $res;
},
['dialog_dsserverid_prompt']
);
sub getDialogs {
return ($configdsinfo);
}
1;
--- NEW FILE register-ds-admin.pl.in ---
#!/usr/bin/env perl
# BEGIN COPYRIGHT BLOCK
# This Program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; version 2 of the License.
#
# This Program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
# Place, Suite 330, Boston, MA 02111-1307 USA.
#
# In addition, as a special exception, Red Hat, Inc. gives You the additional
# right to link the code of this Program with code not covered under the GNU
# General Public License ("Non-GPL Code") and to distribute linked combinations
# including the two, subject to the limitations in this paragraph. Non-GPL Code
# permitted under this exception must only link to the code of this Program
# through those well defined interfaces identified in the file named EXCEPTION
# found in the source code files (the "Approved Interfaces"). The files of
# Non-GPL Code may instantiate templates or use macros or inline functions from
# the Approved Interfaces without causing the resulting work to be covered by
# the GNU General Public License. Only Red Hat, Inc. may make changes or
# additions to the list of Approved Interfaces. You must obey the GNU General
# Public License in all respects for all of the Program code and other code used
# in conjunction with the Program except the Non-GPL Code covered by this
# exception. If you modify this file, you may extend this exception to your
# version of the file, but you are not obligated to do so. If you do not wish to
# provide this exception without modification, you must delete this exception
# statement from your version and license this file solely under the GPL without
# exception.
#
#
# Copyright (C) 2007 Red Hat, Inc.
# All rights reserved.
# END COPYRIGHT BLOCK
#
use lib "@perldir@";
use File::Basename;
use Net::Domain qw(hostfqdn);
# Admin Setup modules
use AdminUtil;
use AdminServer;
# Directory Setup modules
use Resource;
use Setup;
use SetupLog;
use DialogManager;
use Inf;
use Util;
sub reg_get_passwd
{
my $setup = shift;
my $key = shift;
my $value = shift;
print("\n==============================================================================\n");
$setup->msg(0, $key, $value);
system("stty -echo");
my $ans = <STDIN>;
system("stty echo");
print "\n";
chop($ans);
return $ans;
}
my $res = new Resource("@propertydir(a)/register-ds-admin.res",
"@propertydir(a)/setup-ds-admin.res",
"@propertydir(a)/setup-ds.res");
my $setup = new Setup($res);
$setup->msg('begin_ds_registration');
# get existing instances
my $instconfigdir = $setup->{configdir};
my @instances = ();
for my $dir (glob("$setup->{configdir}/slapd-*")) {
if (-d $dir) {
push @instances, basename($dir);
}
}
if ( $#instances < 0 )
{
$setup->msg($FATAL, 'error_no_ds');
$setup->doExit(1);
}
# see if there is already a configds
my $admConf = AdminUtil::getAdmConf("$instconfigdir/admin-serv");
my @admConfKeys = keys %$admConf;
my $orig_confdsid = "";
my $new_confdsid = "";
my $adminuid = "";
my @errs = ();
my $fqdn = hostfqdn();
# set defaults
if ( $#admConfKeys >= 0 )
{
# Admin Server is installed; that is Config DS exists, which may be
# replaced with a new one in the RegDSDialogs
$orig_confdsid = getLocalConfigDS("$instconfigdir/admin-serv");
$setup->{inf}->{slapd}->{ServerIdentifier} = $orig_confdsid;
$setup->{inf}->{slapd}->{Instances} = \@instances;
$setup->{inf}->{General}->{ConfigDirectoryLdapURL} = $admConf->{ldapurl};
$setup->{inf}->{General}->{ConfigDirectoryAdminID} = $admConf->{userdn};
$setup->{inf}->{General}->{AdminDomain} = $admConf->{AdminDomain};
$setup->{inf}->{General}->{SuiteSpotUserID} = $admConf->{SuiteSpotUserID};
$setup->{inf}->{General}->{SuiteSpotGroup} = $admConf->{SuiteSpotGroup};
($setup->{inf}->{General}->{FullMachineName} = $admConf->{ldapurl}) =~
s/.*:\/\/(.*):[0-9]*\/.*/\1/;
$setup->{inf}->{admin}->{SysUser} = $admConf->{sysuser};
$adminuid = $admConf->{userdn};
# read additional config from config DS
my $pset = AdminUtil::getPset($admConf);
if ($pset && %{$pset}) {
$setup->{inf}->{admin}->{Port} = $pset->{"configuration.nsserverport"};
$setup->{asorigport} = $pset->{"configuration.nsserverport"}; # save orig. port
$setup->{inf}->{admin}->{ServerIpAddress} = $pset->{"configuration.nsserveraddress"};
}
my $admpw = AdminUtil::getAdmpw($admConf);
if ($admpw && %{$admpw}) {
$setup->{inf}->{admin}->{ServerAdminID} = $admpw->{ServerAdminID};
$setup->{inf}->{admin}->{ServerAdminPwd} = $admpw->{ServerAdminPwd};
}
$setup->{reconfigas} = 1; # allow AS reconfig
my $dialogmgr = new DialogManager($setup, $res, $TYPICAL);
require RegDSDialogs;
my @dialogs = RegDSDialogs->getDialogs();
$dialogmgr->addDialog(@dialogs);
my $rc = $dialogmgr->run();
if ($rc)
{
$setup->doExit(1);
}
$new_confdsid = $setup->{inf}->{slapd}->{ServerIdentifier};
my $newinst = "slapd-$new_confdsid";
my $inf = createInfFromConfig("$instconfigdir/$newinst", $newinst);
if ( NULL == $inf )
{
$setup->msg($FATAL, 'error_create_inf_from_config',
"$instconfigdir/$newinst");
$setup->doExit(1);
}
if ( $orig_confdsid ne $new_confdsid )
{
# To switch to the new Config DS, unregister the old one
print("\n==============================================================================\n");
$setup->msg('unregister_old_confds', $orig_confdsid);
# If we don't have it, prompt for the Admin password
if (!$setup->{inf}->{General}->{ConfigDirectoryAdminPwd} ||
"" eq $setup->{inf}->{General}->{ConfigDirectoryAdminPwd})
{
$ans = reg_get_passwd($setup, 'input_admin_passwd', $adminuid);
$setup->{inf}->{General}->{ConfigDirectoryAdminPwd} = $ans;
}
while (!unregisterDSWithConfigDS($orig_confdsid, \@errs, $setup->{inf}))
{
$setup->msg($FATAL, 'error_unregister_ds', $orig_confdsid);
$ans = reg_get_passwd($setup, 'input_admin_passwd', $adminuid);
$setup->{inf}->{General}->{ConfigDirectoryAdminPwd} = $ans;
@errs = ();
}
# updating the port number
my $oldport = 0;
my $newport = $inf->{slapd}->{ServerPort};
($oldport = $setup->{inf}->{General}->{ldapurl}) =~ s/.*:([0-9]*)\/.*/\1/;
$setup->{inf}->{General}->{ldapurl} =~ s/$oldport/$newport/;
$setup->{inf}->{General}->{ConfigDirectoryLdapURL} = "ldap://" . $fqdn . ":". $newport . "/o=NetscapeRoot";
}
# Set the new inf to $setup->{inf}
$setup->{inf}->{slapd} = $inf->{slapd};
}
else
{
# Admin Server is not set up.
# @instances has more than one instance
# note: this is orig_confdsid is just a candidate...
($orig_confdsid = $instances[0]) =~ s/slapd-(.*)/\1/;
my $originst = "slapd-$orig_confdsid";
my $inf = createInfFromConfig("$instconfigdir/$originst", $originst);
if ( NULL == $inf )
{
$setup->msg($FATAL, 'error_create_inf_from_config',
"$instconfigdir/$originst");
$setup->doExit(1);
}
$setup->{inf} = $inf;
$setup->{inf}->{slapd}->{ServerIdentifier} = $orig_confdsid;
$setup->{inf}->{slapd}->{Instances} = \@instances;
my $dialogmgr = new DialogManager($setup, $res, $TYPICAL);
require RegDSDialogs;
require SetupDialogs;
require ConfigDSDialogs;
require ASDialogs;
my @dialogs = RegDSDialogs->getDialogs();
$dialogmgr->addDialog(@dialogs);
my $rc = $dialogmgr->run();
if ( $rc )
{
$setup->doExit(1);
}
$new_confdsid = $setup->{inf}->{slapd}->{ServerIdentifier};
if ( $orig_confdsid ne $new_confdsid )
{
my $newinst = "slapd-$new_confdsid";
$inf = createInfFromConfig("$instconfigdir/$newinst", $newinst);
if ( NULL == $inf )
{
$setup->msg($FATAL, 'error_create_inf_from_config',
"$instconfigdir/$newinst");
$setup->doExit(1);
}
$setup->{inf}->{slapd} = $inf->{slapd};
$setup->{inf}->{slapd}->{Instances} = \@instances;
}
$setup->{inf}->{General}->{ConfigDirectoryLdapURL} = "ldap://" . $fqdn . ":". $setup->{inf}->{slapd}->{ServerPort} . "/o=NetscapeRoot";
$dialogmgr->resetDialog();
@dialogs = SetupDialogs->getRegDialogs();
push @dialogs, ConfigDSDialogs->getRegDialogs();
push @dialogs, ASDialogs->getDialogs();
$dialogmgr->addDialog(@dialogs);
$rc = $dialogmgr->run();
if ( $rc )
{
$setup->doExit(1);
}
$adminuid = $setup->{inf}->{General}->{ConfigDirectoryAdminID};
}
# Get the ConfigDS's rootDN password
print("\n==============================================================================\n");
$setup->msg('register_new_confds', $new_confdsid);
$setup->{inf}->{slapd}->{RootDNPwd} = reg_get_passwd($setup,
'input_rootdn_passwd', $new_confdsid);
if ( ($#admConfKeys >= 0 && ($orig_confdsid ne $new_confdsid)) ||
$#admConfKeys < 0 )
{
@errs = ();
# First, let's register the Configuration Directory itself
while (!createConfigDS($setup->{inf}, \@errs))
{
foreach my $err (@errs)
{
if ( $err eq "suffix_already_exists" )
{
goto out;
}
}
$setup->{inf}->{slapd}->{RootDNPwd} = reg_get_passwd($setup,
'input_rootdn_passwd', $new_confdsid);
@errs = ();
}
out:
}
# If we don't have it, prompt for the Admin password
if (!$setup->{inf}->{General}->{ConfigDirectoryAdminPwd} ||
"" eq $setup->{inf}->{General}->{ConfigDirectoryAdminPwd})
{
$ans = reg_get_passwd($setup, 'input_admin_passwd', $adminuid);
$setup->{inf}->{General}->{ConfigDirectoryAdminPwd} = $ans;
}
@errs = ();
while (!registerDSWithConfigDS($new_confdsid, \@errs, $setup->{inf}))
{
$setup->msg($WARN, 'error_register_configds', $new_confdsid);
$ans = reg_get_passwd($setup, 'input_admin_passwd', $adminuid);
$setup->{inf}->{General}->{ConfigDirectoryAdminPwd} = $ans;
@errs = ();
}
my $hassubinst = 0;
# Then, register the rest of the Directory Servers, if any
my @subinstances = (); # array without the Config DS
foreach my $subinst (@instances)
{
if ( "$subinst" ne "slapd-" . $new_confdsid )
{
if ( 0 == $hassubinst )
{
$hassubinst = 1;
print("\n==============================================================================\n");
$setup->msg('register_subds');
}
my $subid = $subinst;
$subid =~ s/slapd-//;
push(@subinstances, ($subinst));
my $subinf = createInfFromConfig("$instconfigdir/$subinst", $subinst);
if ( NULL == $subinf )
{
$setup->msg($FATAL, 'error_create_inf_from_config',
"$subinstconfigdir/$subinst");
$setup->doExit(1);
}
$setup->{inf}->{slapd} = $subinf->{slapd};
$setup->{inf}->{slapd}->{RootDNPwd} = reg_get_passwd($setup,
'input_rootdn_passwd', $subid);
while (!createSubDS($setup->{inf}, \@errs))
{
$setup->msg($FATAL, @errs);
$setup->msg($FATAL, 'error_create_configds');
$setup->{inf}->{slapd}->{RootDNPwd} = reg_get_passwd($setup,
'input_rootdn_passwd', $subid);
}
}
}
if ( $#subinstances >= 0 )
{
@errs = ();
if ( !registerManyDSWithConfigDS($setup->{inf}, \@errs, $instconfigdir, @subinstances) )
{
$setup->msg($FATAL, @errs);
$setup->doExit(1);
}
}
# configure and register the admin server instance
# need these 3 values for ldapStart
$setup->{inf}->{slapd}->{ServerIdentifier} = $new_confdsid;
$setup->{inf}->{slapd}->{UseExistingMC} = "yes";
$setup->{inf}->{slapd}->{SlapdConfigForMC} = "yes";
if ( !$setup->{reconfigas} )
{
if ( !createAdminServer($setup) )
{
$setup->msg($FATAL, 'error_create_adminserver');
$setup->doExit(1);
}
}
else
{
if ( !reconfigAdminServer($setup) )
{
$setup->msg($FATAL, 'error_reconfig_adminserver');
$setup->doExit(1);
}
}
$setup->msg('end_ds_registration');
$setup->doExit(0);
--- NEW FILE register-ds-admin.res.in ---
begin_ds_registration = Beginning registration of the Directory Server
use_existing_configds_txt = Do you want to use this server as Configuration Directory Server?\n\n
unregister_old_confds = Cleaning up old Config DS: %s\n
register_new_confds = Registering new Config DS: %s\n
register_subds = Registering Sub DSes:
end_ds_registration = Finished registration of the Directory Server
input_rootdn_passwd = Please input the Directory Manager password on the server %s:
input_admin_uid = Please input the password for the Administrator User ID: [%s]
input_admin_passwd = Please input the password for the Administrator User %s:
input_userid = Please input the UNIX user id to run the server: [%s]
input_groupid = Please input the UNIX group id to run the server: [%s]
error_configds_txt = Error: the server ID %s does not exist. Choose server ID existing on the host.\n
error_opening_instconfdir = Error: could not open config dir %s: %s\n\nDirectory Servers may not be set up yet.\nPlease run setup-ds-admin.pl.\nNote: once you run setup-ds-admin.pl, the server is automatically registered.\n
error_no_ds = Error: could not find a Directory Server instance.\n\nDirectory Server may not be set up yet.\nPlease run setup-ds-admin.pl.\nNote: once you run setup-ds-admin.pl, the server is automatically registered.\n
error_create_inf_from_config = Error: could not retrieve necessary info from %s. Please check the file.\n
error_register_configds = Error: failed to register the configuration server info to the Configuration Directory Server %s.\n
error_register_subds = Error: failed to register the additional server info to the Configuration Directory Server %s.\n
error_unregister_ds = Error: failed to clean up the configuration info from the old Configuration\nDirectory Server %s.\n
error_connection_failed = Error: failed to open an LDAP connection.\n
Index: AdminServer.pm.in
===================================================================
RCS file: /cvs/dirsec/adminserver/admserv/newinst/src/AdminServer.pm.in,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- AdminServer.pm.in 24 Jul 2007 20:10:16 -0000 1.7
+++ AdminServer.pm.in 27 Jul 2007 01:42:46 -0000 1.8
@@ -189,9 +189,9 @@
# This is how we extract the sie and isie as the as entries are
# being added
sub registercb {
- my ($context, $entry, $errs) = @_;
+ my ($context, $entry, $errs) = @_;
- my $rc = check_and_add_entry([$context->{conn}], $entry, $errs);
+ my $rc = check_and_add_entry([$context->{conn}, $context->{reconfig}], $entry, $errs);
my $setup = $context->{setup};
if ($rc) {
if ($entry->hasValue('objectclass', 'nsApplication', 1)) {
@@ -218,6 +218,7 @@
my $setup = shift;
my $inf = $setup->{inf};
my $configdir = shift;
+ my $reconfig = shift;
my @errs;
$setup->msg('registering_adminserver');
@@ -260,7 +261,7 @@
$setup->msg($FATAL, 'error_updating_localconf', $localconf, $!);
return 0;
}
- my $context = {conn => $conn, localfh => \*LOCALCONF, setup => $setup};
+ my $context = {conn => $conn, localfh => \*LOCALCONF, setup => $setup, reconfig => $reconfig};
getMappedEntries($mapper, \@ldiffiles, \@errs, \®istercb, $context);
close(LOCALCONF);
@@ -408,7 +409,7 @@
return 0;
}
- if (!registerASWithConfigDS($setup, $configdir)) {
+ if (!registerASWithConfigDS($setup, $configdir, $reconfig)) {
return 0;
}
Index: ConfigDSDialogs.pm
===================================================================
RCS file: /cvs/dirsec/adminserver/admserv/newinst/src/ConfigDSDialogs.pm,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ConfigDSDialogs.pm 24 Jul 2007 20:10:16 -0000 1.5
+++ ConfigDSDialogs.pm 27 Jul 2007 01:42:46 -0000 1.6
@@ -167,6 +167,108 @@
['dialog_configdsinfo_ca_prompt']
);
+my $regconfigdsinfo = new Dialog (
+ $EXPRESS,
+ 'dialog_configdsinfo_text',
+ sub {
+ my $self = shift;
+ my $index = shift;
+ if ($index == 0) { # the url
+ my $url = $self->{manager}->{inf}->{General}->{ConfigDirectoryLdapURL};
+ if (!defined($url)) {
+ my $host = $self->{manager}->{inf}->{General}->{FullMachineName} ||
+ hostfqdn;
+ my $port = $self->{manager}->{inf}->{slapd}->{ServerPort} || 389;
+ if (!portAvailable($port)) {
+ $port = getAvailablePort();
+ }
+ my $suffix = "o=NetscapeRoot";
+ $url = "ldap://$host:$port/$suffix";
+ }
+ return $url;
+ } elsif ($index == 1) { # the id
+ return $self->{manager}->{inf}->{General}->{ConfigDirectoryAdminID} ||
+ "admin";
+ } elsif ($index == 2 || $index == 3) { # the password
+ return undef;
+ } elsif ($index == 4) { # admin domain
+ my $admindomain = $self->{manager}->{inf}->{General}->{AdminDomain};
+ if (!defined($admindomain)) {
+ $admindomain = $self->{manager}->{inf}->{General}->{FullMachineName} ||
+ hostfqdn;
+ $admindomain =~ s/^[^\.]*\.//; # just the domain part
+ }
+ return $admindomain;
+ } else { # the CA cert
+ my $url = $self->{manager}->{inf}->{General}->{ConfigDirectoryLdapURL};
+ my $cert = $self->{manager}->{inf}->{General}->{CACertificate};
+ if (($url !~ /^ldaps/) or $self->{manager}->{inf}->{General}->{certdb} or
+ ($cert =~ /^-----BEGIN CERTIFICATE-----/)) {
+ # not using LDAPS, or already have a certdb - hide CA prompt
+ $self->{prompts}->[5]->[2] = 1;
+ } else {
+ $self->{prompts}->[5]->[2] = 0; # unhide CA prompt
+ }
+ return $self->{manager}->{inf}->{General}->{CACertificate};
+ }
+ },
+ sub {
+ my $self = shift;
+ my $ans = shift;
+ my $index = shift;
+
+ my $res = $DialogManager::SAME;
+ if ($index == 0) {
+ # validate URL?
+ $self->{manager}->{inf}->{General}->{ConfigDirectoryLdapURL} = $ans;
+ my $url = $self->{manager}->{inf}->{General}->{ConfigDirectoryLdapURL};
+ if (($url !~ /^ldaps/) or $self->{manager}->{inf}->{General}->{certdb}) {
+ # not using LDAPS, or already have a certdb - hide CA prompt
+ $self->{prompts}->[5]->[2] = 1;
+ } else {
+ $self->{prompts}->[5]->[2] = 0; # unhide CA prompt
+ }
+ $res = $DialogManager::NEXT;
+ } elsif ($index == 1) { # id
+ $self->{manager}->{inf}->{General}->{ConfigDirectoryAdminID} = $ans;
+ $res = $DialogManager::NEXT;
+ } elsif ($index == 2) { # pwd
+ my $test = $ans;
+ if ($test) {
+ $test =~ s/\s//g;
+ }
+ if (!$ans or (length($test) != length($ans))) {
+ $self->{manager}->alert("dialog_configdsadmin_invalid");
+ } else {
+ $self->{firstpassword} = $ans; # save for next index
+ $res = $DialogManager::NEXT;
+ }
+ } elsif ($index == 3) { # verify second password
+ if ($ans ne $self->{firstpassword}) {
+ $self->{manager}->alert("dialog_configdsadmin_nomatch");
+ } else {
+ $self->{manager}->{inf}->{General}->{ConfigDirectoryAdminPwd} = $ans;
+ $res = $DialogManager::NEXT;
+ }
+ } elsif ($index == 4) { # admin domain
+ $self->{manager}->{inf}->{General}->{AdminDomain} = $ans;
+ $res = $DialogManager::NEXT;
+ } else { # CA cert filename
+ if ($ans && length($ans) &&
+ ($ans !~ /^-----BEGIN CERTIFICATE-----/) && ! -f $ans) {
+ $self->{manager}->alert("dialog_configdsinfo_ca_error", $ans);
+ } else {
+ $self->{manager}->{inf}->{General}->{CACertificate} = $ans;
+ $res = $DialogManager::NEXT;
+ }
+ }
+ return $res;
+ },
+ ['dialog_configdsinfo_url_prompt'], ['dialog_configdsinfo_id_prompt'],
+ ['dialog_configdsinfo_pwd_prompt', 1], ['dialog_configdsinfo_pwd2_prompt', 1],
+ ['dialog_configdsinfo_domain_prompt', 0, 0], ['dialog_configdsinfo_ca_prompt']
+);
+
my $configdsadmin = new Dialog (
$EXPRESS,
'dialog_configdsadmin_text',
@@ -311,4 +413,8 @@
return ($useconfigds, $configdsinfo, $configdsadmin, $configdsadmindomain);
}
+sub getRegDialogs {
+ return ($regconfigdsinfo, $configdsadmindomain);
+}
+
1;
Index: setup-ds-admin.res.in
===================================================================
RCS file: /cvs/dirsec/adminserver/admserv/newinst/src/setup-ds-admin.res.in,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- setup-ds-admin.res.in 13 Jul 2007 18:39:15 -0000 1.5
+++ setup-ds-admin.res.in 27 Jul 2007 01:42:46 -0000 1.6
@@ -46,6 +46,7 @@
dialog_configdsinfo_url_prompt = Configuration directory server URL
dialog_configdsinfo_id_prompt = Configuration directory server admin ID
dialog_configdsinfo_pwd_prompt = Configuration directory server admin password
+dialog_configdsinfo_pwd2_prompt = Configuration directory server admin password (confirm)
dialog_configdsinfo_domain_prompt = Configuration directory server admin domain
dialog_configdsinfo_ca_prompt = CA certificate filename
dialog_configdsinfo_ca_error = '%s' is not a valid CA certificate file. Please choose another one.\n\n
@@ -57,7 +58,7 @@
dialog_configdsadmin_text = Please enter the administrator ID for the configuration directory\nserver. This is the ID typically used to log in to the console. You\nwill also be prompted for the password.\n\n
dialog_configdsadmin_prompt = Configuration directory server\nadministrator ID
dialog_configdsadmin_pw1_prompt = Password
-dialog_configdsadmin_pw2_prompt = Password (again)
+dialog_configdsadmin_pw2_prompt = Password (confirm)
dialog_configdsadmin_error = The input '%s' is not a valid ID. Please choose another one.\n\n
dialog_configdsadmin_invalid = The password contains invalid characters. Please choose another one.\n\n
dialog_configdsadmin_nomatch = The passwords do not match. Please try again.\n\n
16 years, 8 months
[Fedora-directory-commits] adminserver Makefile.am, 1.23, 1.24 Makefile.in, 1.23, 1.24
by Doctor Conrad
Author: nhosoi
Update of /cvs/dirsec/adminserver
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv20804
Modified Files:
Makefile.am Makefile.in
Log Message:
resolves: #249739
Summary: Implement a script registering DS to the Configuration DS (comment #1-4)
Index: Makefile.am
===================================================================
RCS file: /cvs/dirsec/adminserver/Makefile.am,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- Makefile.am 11 Jul 2007 01:20:21 -0000 1.23
+++ Makefile.am 27 Jul 2007 01:42:46 -0000 1.24
@@ -161,18 +161,22 @@
ds_start ds_restart ds_shutdown ds_ldif2db ds_db2ldif ds_bak2db \
ds_db2bak ds_listdb ds_rmdb ds_snmpctrl ds_vlvindex ds_addindex
-bin_SCRIPTS = admserv/newinst/src/register_server.pl
cgibin_SCRIPTS = admserv/cgi-src40/ds_create admserv/cgi-src40/ds_remove
-nodist_cmdbin_SCRIPTS = admserv/cfgstuff/start-ds-admin admserv/cfgstuff/stop-ds-admin admserv/cfgstuff/restart-ds-admin
+nodist_cmdbin_SCRIPTS = admserv/cfgstuff/start-ds-admin \
+ admserv/cfgstuff/stop-ds-admin \
+ admserv/cfgstuff/restart-ds-admin \
+ admserv/cfgstuff/ds_removal
cmdbin_SCRIPTS = admserv/newinst/src/setup-ds-admin.pl \
- admserv/newinst/src/migrate-ds-admin.pl
+ admserv/newinst/src/migrate-ds-admin.pl \
+ admserv/newinst/src/register-ds-admin.pl
perl_SCRIPTS = admserv/newinst/src/ASDialogs.pm \
admserv/newinst/src/AdminUtil.pm \
admserv/newinst/src/AdminServer.pm \
admserv/newinst/src/ConfigDSDialogs.pm \
- admserv/newinst/src/AdminMigration.pm
+ admserv/newinst/src/AdminMigration.pm \
+ admserv/newinst/src/RegDSDialogs.pm
libds_admin_serv_la_SOURCES = $(libbase_a_SOURCES) $(libsi18n_a_SOURCES) $(libadmin_a_SOURCES)
libds_admin_serv_la_LINK = $(MYLINK)
@@ -370,6 +374,7 @@
# regular property files go here
property_DATA = admserv/newinst/src/setup-ds-admin.res \
admserv/newinst/src/migrate-ds-admin.res \
+ admserv/newinst/src/register-ds-admin.res \
admserv/cgi-src40/ds_create.res \
admserv/cgi-src40/ds_remove.res
Index: Makefile.in
===================================================================
RCS file: /cvs/dirsec/adminserver/Makefile.in,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- Makefile.in 11 Jul 2007 01:20:21 -0000 1.23
+++ Makefile.in 27 Jul 2007 01:42:46 -0000 1.24
@@ -99,13 +99,13 @@
esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(cgibindir)" \
- "$(DESTDIR)$(bindir)" "$(DESTDIR)$(cgibindir)" \
- "$(DESTDIR)$(cmdbindir)" "$(DESTDIR)$(initdir)" \
- "$(DESTDIR)$(cmdbindir)" "$(DESTDIR)$(perldir)" \
- "$(DESTDIR)$(helpdir)" "$(DESTDIR)$(htmldir)" \
- "$(DESTDIR)$(icondir)" "$(DESTDIR)$(infdir)" \
- "$(DESTDIR)$(ldifdir)" "$(DESTDIR)$(configdir)" \
- "$(DESTDIR)$(propertydir)" "$(DESTDIR)$(propertydir)"
+ "$(DESTDIR)$(cgibindir)" "$(DESTDIR)$(cmdbindir)" \
+ "$(DESTDIR)$(initdir)" "$(DESTDIR)$(cmdbindir)" \
+ "$(DESTDIR)$(perldir)" "$(DESTDIR)$(helpdir)" \
+ "$(DESTDIR)$(htmldir)" "$(DESTDIR)$(icondir)" \
+ "$(DESTDIR)$(infdir)" "$(DESTDIR)$(ldifdir)" \
+ "$(DESTDIR)$(configdir)" "$(DESTDIR)$(propertydir)" \
+ "$(DESTDIR)$(propertydir)"
libLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(lib_LTLIBRARIES)
libds_admin_serv_la_LIBADD =
@@ -238,14 +238,13 @@
am_viewlog_OBJECTS = admserv/cgi-src40/viewlog.$(OBJEXT)
viewlog_OBJECTS = $(am_viewlog_OBJECTS)
viewlog_DEPENDENCIES = $(am__DEPENDENCIES_2)
-binSCRIPT_INSTALL = $(INSTALL_SCRIPT)
cgibinSCRIPT_INSTALL = $(INSTALL_SCRIPT)
cmdbinSCRIPT_INSTALL = $(INSTALL_SCRIPT)
initSCRIPT_INSTALL = $(INSTALL_SCRIPT)
nodist_cmdbinSCRIPT_INSTALL = $(INSTALL_SCRIPT)
perlSCRIPT_INSTALL = $(INSTALL_SCRIPT)
-SCRIPTS = $(bin_SCRIPTS) $(cgibin_SCRIPTS) $(cmdbin_SCRIPTS) \
- $(init_SCRIPTS) $(nodist_cmdbin_SCRIPTS) $(perl_SCRIPTS)
+SCRIPTS = $(cgibin_SCRIPTS) $(cmdbin_SCRIPTS) $(init_SCRIPTS) \
+ $(nodist_cmdbin_SCRIPTS) $(perl_SCRIPTS)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I.
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
@@ -588,17 +587,22 @@
admserv/newinst/src/dirserver.map \
admserv/newinst/src/asmigrate.map
-bin_SCRIPTS = admserv/newinst/src/register_server.pl
cgibin_SCRIPTS = admserv/cgi-src40/ds_create admserv/cgi-src40/ds_remove
-nodist_cmdbin_SCRIPTS = admserv/cfgstuff/start-ds-admin admserv/cfgstuff/stop-ds-admin admserv/cfgstuff/restart-ds-admin
+nodist_cmdbin_SCRIPTS = admserv/cfgstuff/start-ds-admin \
+ admserv/cfgstuff/stop-ds-admin \
+ admserv/cfgstuff/restart-ds-admin \
+ admserv/cfgstuff/ds_removal
+
cmdbin_SCRIPTS = admserv/newinst/src/setup-ds-admin.pl \
- admserv/newinst/src/migrate-ds-admin.pl
+ admserv/newinst/src/migrate-ds-admin.pl \
+ admserv/newinst/src/register-ds-admin.pl
perl_SCRIPTS = admserv/newinst/src/ASDialogs.pm \
admserv/newinst/src/AdminUtil.pm \
admserv/newinst/src/AdminServer.pm \
admserv/newinst/src/ConfigDSDialogs.pm \
- admserv/newinst/src/AdminMigration.pm
+ admserv/newinst/src/AdminMigration.pm \
+ admserv/newinst/src/RegDSDialogs.pm
libds_admin_serv_la_SOURCES = $(libbase_a_SOURCES) $(libsi18n_a_SOURCES) $(libadmin_a_SOURCES)
libds_admin_serv_la_LINK = $(MYLINK)
@@ -775,6 +779,7 @@
# regular property files go here
property_DATA = admserv/newinst/src/setup-ds-admin.res \
admserv/newinst/src/migrate-ds-admin.res \
+ admserv/newinst/src/register-ds-admin.res \
admserv/cgi-src40/ds_create.res \
admserv/cgi-src40/ds_remove.res
@@ -1272,25 +1277,6 @@
viewlog$(EXEEXT): $(viewlog_OBJECTS) $(viewlog_DEPENDENCIES)
@rm -f viewlog$(EXEEXT)
$(viewlog_LINK) $(viewlog_LDFLAGS) $(viewlog_OBJECTS) $(viewlog_LDADD) $(LIBS)
-install-binSCRIPTS: $(bin_SCRIPTS)
- @$(NORMAL_INSTALL)
- test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
- @list='$(bin_SCRIPTS)'; for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- if test -f $$d$$p; then \
- f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
- echo " $(binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \
- $(binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \
- else :; fi; \
- done
-
-uninstall-binSCRIPTS:
- @$(NORMAL_UNINSTALL)
- @list='$(bin_SCRIPTS)'; for p in $$list; do \
- f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
- echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
- rm -f "$(DESTDIR)$(bindir)/$$f"; \
- done
install-cgibinSCRIPTS: $(cgibin_SCRIPTS)
@$(NORMAL_INSTALL)
test -z "$(cgibindir)" || $(mkdir_p) "$(DESTDIR)$(cgibindir)"
@@ -2540,7 +2526,7 @@
$(DATA) config.h
installdirs: installdirs-recursive
installdirs-am:
- for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(cgibindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(cgibindir)" "$(DESTDIR)$(cmdbindir)" "$(DESTDIR)$(initdir)" "$(DESTDIR)$(cmdbindir)" "$(DESTDIR)$(perldir)" "$(DESTDIR)$(helpdir)" "$(DESTDIR)$(htmldir)" "$(DESTDIR)$(icondir)" "$(DESTDIR)$(infdir)" "$(DESTDIR)$(ldifdir)" "$(DESTDIR)$(configdir)" "$(DESTDIR)$(propertydir)" "$(DESTDIR)$(propertydir)"; do \
+ for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(cgibindir)" "$(DESTDIR)$(cgibindir)" "$(DESTDIR)$(cmdbindir)" "$(DESTDIR)$(initdir)" "$(DESTDIR)$(cmdbindir)" "$(DESTDIR)$(perldir)" "$(DESTDIR)$(helpdir)" "$(DESTDIR)$(htmldir)" "$(DESTDIR)$(icondir)" "$(DESTDIR)$(infdir)" "$(DESTDIR)$(ldifdir)" "$(DESTDIR)$(configdir)" "$(DESTDIR)$(propertydir)" "$(DESTDIR)$(propertydir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
install: install-recursive
@@ -2612,7 +2598,7 @@
@$(NORMAL_INSTALL)
$(MAKE) $(AM_MAKEFLAGS) install-data-hook
-install-exec-am: install-binSCRIPTS install-libLTLIBRARIES
+install-exec-am: install-libLTLIBRARIES
install-info: install-info-recursive
@@ -2640,14 +2626,14 @@
ps-am:
-uninstall-am: uninstall-binSCRIPTS uninstall-cgibinPROGRAMS \
- uninstall-cgibinSCRIPTS uninstall-cmdbinSCRIPTS \
- uninstall-dist_helpDATA uninstall-dist_htmlDATA \
- uninstall-dist_iconDATA uninstall-infDATA uninstall-info-am \
- uninstall-initSCRIPTS uninstall-ldifDATA \
- uninstall-libLTLIBRARIES uninstall-nodist_cmdbinSCRIPTS \
- uninstall-nodist_configDATA uninstall-nodist_propertyDATA \
- uninstall-perlSCRIPTS uninstall-propertyDATA
+uninstall-am: uninstall-cgibinPROGRAMS uninstall-cgibinSCRIPTS \
+ uninstall-cmdbinSCRIPTS uninstall-dist_helpDATA \
+ uninstall-dist_htmlDATA uninstall-dist_iconDATA \
+ uninstall-infDATA uninstall-info-am uninstall-initSCRIPTS \
+ uninstall-ldifDATA uninstall-libLTLIBRARIES \
+ uninstall-nodist_cmdbinSCRIPTS uninstall-nodist_configDATA \
+ uninstall-nodist_propertyDATA uninstall-perlSCRIPTS \
+ uninstall-propertyDATA
uninstall-info: uninstall-info-recursive
@@ -2659,12 +2645,11 @@
distclean-compile distclean-generic distclean-hdr \
distclean-libtool distclean-recursive distclean-tags \
distcleancheck distdir distuninstallcheck dvi dvi-am html \
- html-am info info-am install install-am install-binSCRIPTS \
- install-cgibinPROGRAMS install-cgibinSCRIPTS \
- install-cmdbinSCRIPTS install-data install-data-am \
- install-data-hook install-dist_helpDATA install-dist_htmlDATA \
- install-dist_iconDATA install-exec install-exec-am \
- install-infDATA install-info install-info-am \
+ html-am info info-am install install-am install-cgibinPROGRAMS \
+ install-cgibinSCRIPTS install-cmdbinSCRIPTS install-data \
+ install-data-am install-data-hook install-dist_helpDATA \
+ install-dist_htmlDATA install-dist_iconDATA install-exec \
+ install-exec-am install-infDATA install-info install-info-am \
install-initSCRIPTS install-ldifDATA install-libLTLIBRARIES \
install-man install-nodist_cmdbinSCRIPTS \
install-nodist_configDATA install-nodist_propertyDATA \
@@ -2674,14 +2659,14 @@
maintainer-clean-recursive mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \
pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
- uninstall-binSCRIPTS uninstall-cgibinPROGRAMS \
- uninstall-cgibinSCRIPTS uninstall-cmdbinSCRIPTS \
- uninstall-dist_helpDATA uninstall-dist_htmlDATA \
- uninstall-dist_iconDATA uninstall-infDATA uninstall-info-am \
- uninstall-initSCRIPTS uninstall-ldifDATA \
- uninstall-libLTLIBRARIES uninstall-nodist_cmdbinSCRIPTS \
- uninstall-nodist_configDATA uninstall-nodist_propertyDATA \
- uninstall-perlSCRIPTS uninstall-propertyDATA
+ uninstall-cgibinPROGRAMS uninstall-cgibinSCRIPTS \
+ uninstall-cmdbinSCRIPTS uninstall-dist_helpDATA \
+ uninstall-dist_htmlDATA uninstall-dist_iconDATA \
+ uninstall-infDATA uninstall-info-am uninstall-initSCRIPTS \
+ uninstall-ldifDATA uninstall-libLTLIBRARIES \
+ uninstall-nodist_cmdbinSCRIPTS uninstall-nodist_configDATA \
+ uninstall-nodist_propertyDATA uninstall-perlSCRIPTS \
+ uninstall-propertyDATA
define NL
\\n
16 years, 8 months
[Fedora-directory-commits] adminserver/admserv/newinst/src AdminUtil.pm.in, 1.11, 1.12
by Doctor Conrad
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;
16 years, 8 months
[Fedora-directory-commits] adminserver/admserv/cgi-src40 ds_remove.in, 1.3, 1.4
by Doctor Conrad
Author: nhosoi
Update of /cvs/dirsec/adminserver/admserv/cgi-src40
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv20336/admserv/cgi-src40
Modified Files:
ds_remove.in
Log Message:
resolves: #247215
Summary: Reimplement ds_remove (cgi) and ds_removal (command line wrapper) without setuputil code (comment #23)
Index: ds_remove.in
===================================================================
RCS file: /cvs/dirsec/adminserver/admserv/cgi-src40/ds_remove.in,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ds_remove.in 24 Jul 2007 20:10:15 -0000 1.3
+++ ds_remove.in 27 Jul 2007 01:35:29 -0000 1.4
@@ -30,16 +30,24 @@
use FileConn;
use Resource;
+# remove_tree($centry, $key, $instname, [$isparent, [$dontremove]])
+# $centry: entry to look for the path to be removed
+# $key: key to look for the path in the entry
+# $instname: instance name "slapd-<ID>" to check the path
+# $isparent: specify 1 to remove from the parent dir
+# $dontremove: pattern not to be removed (e.g., ".db$")
sub remove_tree
{
my $centry = shift;
my $key = shift;
my $instname = shift;
my $isparent = shift;
+ my $dontremove = shift;
foreach my $path ( @{$centry->{$key}} )
{
my $rmdir = "";
+ my $rc = 0;
if ( 1 == $isparent )
{
$rmdir = dirname($path);
@@ -50,8 +58,55 @@
}
if ( -d $rmdir && $rmdir =~ /$instname/ )
{
- my $rc = rmtree($rmdir);
- print STDERR "rmtree: $rmdir => RC: $rc\n";
+ if ( "" eq "$dontremove" )
+ {
+ $rc = rmtree($rmdir);
+ if ( 0 == $rc )
+ {
+ print "Content-type: text/plain\n\n";
+ print "NMC_ErrInfo: $rmdir was not removed.\n";
+ print STDERR "Warning: $rmdir was not removed.\n";
+ }
+ }
+ else
+ {
+ # Skip the dontremove files
+ $rc = opendir(DIR, $rmdir);
+ if ($rc)
+ {
+ while (defined(my $file = readdir(DIR)))
+ {
+ next if ( "$file" =~ /$dontremove/ );
+ next if ( "$file" eq "." );
+ next if ( "$file" eq ".." );
+ my $rmfile = $rmdir . "/" . $file;
+ my $rc0 = rmtree($rmfile);
+ if ( 0 == $rc0 )
+ {
+ print "Content-type: text/plain\n\n";
+ print "NMC_ErrInfo: $rmfile was not removed.\n";
+ print STDERR "Warning: $rmfile was not removed.\n";
+ }
+ }
+ closedir(DIR);
+ }
+ my $newrmdir = $rmdir . ".removed";
+ my $rc1 = 1;
+ if ( -d $newrmdir )
+ {
+ $rc1 = rmtree($newrmdir);
+ if ( 0 == $rc1 )
+ {
+ print "Content-type: text/plain\n\n";
+ print "NMC_ErrInfo: $newrmdir was not removed.\n";
+ print STDERR "Warning: $newrmdir was not removed.\n";
+ }
+ }
+ if ( 0 < $rc1 )
+ {
+ rename($rmdir, $newrmdir);
+ }
+ }
}
}
}
@@ -83,12 +138,23 @@
my $instname = $query->param('InstanceName');
my ($slapd, $inst) = split(/-/, $instname, 2);
+my $configdir = "@instconfigdir@/slapd-$inst";
+if ( ! -d $configdir )
+{
+ print "Content-type: text/plain\n\n";
+ print "NMC_ErrInfo: $configdir does not exist\n";
+ print "NMC_Status: 1\n";
+ print STDERR "Error: $configdir does not exist\n";
+ exit 1;
+}
my @errs;
-my $inf = createInfFromConfig("@instconfigdir@/slapd-$inst", $inst, \@errs);
-if (@errs) {
+my $inf = createInfFromConfig($configdir, $inst, \@errs);
+if (@errs)
+{
print "Content-type: text/plain\n\n";
print "NMC_ErrInfo: ", $res->getText(@errs), "\n";
print "NMC_Status: 1\n";
+ print STDERR "Error: ", $res->getText(@errs), "\n";
exit 1;
}
@@ -108,14 +174,43 @@
my $dn = "cn=config";
my $entry = $conn->search($dn, "base", "(cn=*)", 0);
-if (!$entry) {
+if (!$entry)
+{
print "Content-type: text/plain\n\n";
print "NMC_ErrInfo: Search $dn in $dseldif failed: $entry\n";
print "NMC_Status: 1\n";
+ print STDERR "Error: Search $dn in $dseldif failed: $entry\n";
+ exit 1;
+}
+
+# Unregister the server from the configuration ds
+# get config ds url from input or admconf
+# get admin id from input or admconf
+# must get admin password from input (PASSWORD_PIPE?)
+# get admin domain
+# config ds info
+if (!unregisterDSWithConfigDS($inst, \@errs, $inf))
+{
+ print "Content-type: text/plain\n\n";
+ print "NMC_ErrInfo: ", $res->getText(@errs), "\n";
+ print "NMC_Status: 1\n";
+ print STDERR "Error:", $res->getText(@errs), "\n";
+ exit 1;
+}
+
+$dn = "cn=config,cn=ldbm database,cn=plugins,cn=config";
+my $dbentry = $conn->search($dn, "base", "(cn=*)", 0);
+if (!$dbentry)
+{
+ print "Content-type: text/plain\n\n";
+ print "NMC_ErrInfo: Search $dn in $dseldif failed: $dbentry\n";
+ print "NMC_Status: 1\n";
+ print "Error: Search $dn in $dseldif failed: $dbentry\n";
exit 1;
}
+$conn->close();
-# stop the server first
+# stop the server
my $instdir = "";
foreach my $path ( @{$entry->{"nsslapd-instancedir"}} )
{
@@ -131,56 +226,51 @@
# Ignore the stop failure
print "Content-type: text/plain\n\n";
print "NMC_ErrInfo: Could not stop directory server: $output\n";
+ print STDERR "Warning: Could not stop directory server: $output\n";
}
$instdir = $path; # need to use it later...
} else {
print "Content-type: text/plain\n\n";
print "NMC_ErrInfo: The program $prog does not exist\n";
print "NMC_Status: 1\n";
+ print STDERR "Error: The program $prog does not exist\n";
exit 1;
}
}
}
-
-# Unregister the server from the configuration ds
-# get config ds url from input or admconf
-# get admin id from input or admconf
-# must get admin password from input (PASSWORD_PIPE?)
-# get admin domain
-# config ds info
-if (!unregisterDSWithConfigDS($inst, \@errs, $inf)) {
- print "Content-type: text/plain\n\n";
- print "NMC_ErrInfo: ", $res->getText(@errs), "\n";
- print "NMC_Status: 1\n";
- exit 1;
-}
-
+
# remove physical dirs/files
-$dn = "cn=config,cn=ldbm database,cn=plugins,cn=config";
-my $dbentry = $conn->search($dn, "base", "(cn=*)", 0);
-if (!$dbentry) {
- print "Content-type: text/plain\n\n";
- print "NMC_ErrInfo: Search $dn in $dseldif failed: $dbentry\n";
- print "NMC_Status: 1\n";
- exit 1;
-}
remove_tree($dbentry, "nsslapd-directory", $instname, 1);
remove_tree($dbentry, "nsslapd-db-logdirectory", $instname, 1);
remove_tree($entry, "nsslapd-lockdir", $instname);
remove_tree($entry, "nsslapd-tmpdir", $instname);
remove_tree($entry, "nsslapd-bakdir", $instname, 1);
remove_tree($entry, "nsslapd-errorlog", $instname, 1);
-remove_tree($entry, "nsslapd-schemadir", $instname, 1);
# instance dir
-if ( -d $instdir )
+if ( -d $instdir && $instdir =~ /$instname/ )
{
# clean up pid files (if any)
remove_pidfile("STARTPIDFILE", $instdir, $instname);
remove_pidfile("PIDFILE", $instdir, $instname);
+ if ( 1 == isConfigDS($instname, "@instconfigdir@/admin-serv") )
+ {
+ # if it is the Config DS, adm.conf and local.conf needs to be removed.
+ unlink("@instconfigdir(a)/admin-serv/adm.conf");
+ unlink("@instconfigdir(a)/admin-serv/local.conf");
+ }
+
my $rc = rmtree($instdir);
+ if ( 0 == $rc )
+ {
+ print "Content-type: text/plain\n\n";
+ print "NMC_ErrInfo: $instdir was not removed.\n";
+ print STDERR "Warning: $instdir was not removed.\n";
+ }
}
+# Finally, config dir
+remove_tree($entry, "nsslapd-schemadir", $instname, 1, "\.db\$");
# if we got here, report success
print "Content-type: text/plain\n\n";
16 years, 8 months
[Fedora-directory-commits] adminserver/admserv/cfgstuff ds_removal.in, NONE, 1.1
by Doctor Conrad
Author: nhosoi
Update of /cvs/dirsec/adminserver/admserv/cfgstuff
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv20336/admserv/cfgstuff
Added Files:
ds_removal.in
Log Message:
resolves: #247215
Summary: Reimplement ds_remove (cgi) and ds_removal (command line wrapper) without setuputil code (comment #23)
--- NEW FILE ds_removal.in ---
#!/bin/sh
# BEGIN COPYRIGHT BLOCK
# This Program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; version 2 of the License.
#
# This Program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
# Place, Suite 330, Boston, MA 02111-1307 USA.
#
# In addition, as a special exception, Red Hat, Inc. gives You the additional
# right to link the code of this Program with code not covered under the GNU
# General Public License ("Non-GPL Code") and to distribute linked combinations
# including the two, subject to the limitations in this paragraph. Non-GPL Code
# permitted under this exception must only link to the code of this Program
# through those well defined interfaces identified in the file named EXCEPTION
# found in the source code files (the "Approved Interfaces"). The files of
# Non-GPL Code may instantiate templates or use macros or inline functions from
# the Approved Interfaces without causing the resulting work to be covered by
# the GNU General Public License. Only Red Hat, Inc. may make changes or
# additions to the list of Approved Interfaces. You must obey the GNU General
# Public License in all respects for all of the Program code and other code used
# in conjunction with the Program except the Non-GPL Code covered by this
# exception. If you modify this file, you may extend this exception to your
# version of the file, but you are not obligated to do so. If you do not wish to
# provide this exception without modification, you must delete this exception
# statement from your version and license this file solely under the GPL without
# exception.
#
#
# Copyright (C) 2007 Red Hat, Inc.
# All rights reserved.
# END COPYRIGHT BLOCK
#
Usage()
{
echo "Usage: $0 -s server_id -w admin_password"
echo " server_id: Directory server identifier; slapd-<server_id>"
echo " admin_password: Administration user password"
}
err0=""
err1=""
err2=""
server_id=""
admin_pw=""
while [ "$1" != "" ]
do
if [ "$1" = "-s" ]; then
shift
server_id=$1
elif [ "$1" = "-w" ]; then
shift
admin_pw=$1
elif [ "$1" = "-h" -o "$1" = "-H" -o "$1" = "--help" ]; then
Usage
exit 0
else
err0="Option $1 is not supported. "
fi
if [ "$1" != "" ]; then
shift
fi
done
if [ "$server_id" = "" ]; then
err1="Directory Server identifier is missing. "
fi
if [ "$admin_pw" = "" ]; then
err2="Administration user password is missing. "
fi
if [ "$err0" != "" -o "$err1" != "" -o "$err2" != "" ];then
echo Error: ${err0}${err1}${err2}
Usage
exit 1
fi
PASSWORD_PIPE=STDIN; export PASSWORD_PIPE
QUERY_STRING="InstanceName=slapd-${server_id}"; export QUERY_STRING
SERVER_NAMES=slapd-${server_id}; export SERVER_NAMES
REQUEST_METHOD=GET; export REQUEST_METHOD
if [ -c /dev/null ]; then
NULL=/dev/null
else
NULL=/tmp/ds_remove.out
fi
@cgibindir@/ds_remove > $NULL << EOF
Password: ${admin_pw}
EOF
exit $?
16 years, 8 months