summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRich Megginson <rmeggins@redhat.com>2005-10-21 19:21:19 +0000
committerRich Megginson <rmeggins@redhat.com>2005-10-21 19:21:19 +0000
commit35f8ea348b5f4c08f8e09130db59abddd849d870 (patch)
tree4089978c5ec8c123e0c4c81bc8b7f06683bca8a7
parent8216af284bf01728074d474131ae781e6033055c (diff)
downloadds-35f8ea348b5f4c08f8e09130db59abddd849d870.tar.gz
ds-35f8ea348b5f4c08f8e09130db59abddd849d870.tar.xz
ds-35f8ea348b5f4c08f8e09130db59abddd849d870.zip
Bug(s) fixed: 171066
Bug Description: Get rid of nsperl; use perldap with system perl Reviewed by: Noriko, Rob, Nathan (Thanks!) Branch: HEAD Fix Description: All perl scripts are made executable by using the #!/usr/bin/env perl *nix trick. This means that the correct version of perl must be in the user's PATH e.g. 5.6.1 or later. This version is either shipped with the OS or available on all platforms. On HP/ux, it is available as a depot which is installed in /opt/perl. For CGI perl scripts, the PATH can be set in the admserv.conf, so we may have to do that for HP/ux. To make perldap work, some ugly hacks are involved. Each perl script that uses perldap has a BEGIN section that figures out where it is in the server root, sets a server root variable, and sets LD_LIBRARY_PATH and SHLIB_PATH to point to serverroot/shared/lib. Perldap will be installed under serverroot/lib/perl. This directory will have 3 subdirectories: arch - containing the binary files; auto - containing autoloaded perl modules; and Mozilla - containing the base perldap .pm files. The BEGIN section also sets the perl INC path to find those modules. The directory gets rid of nsperl plus a lot of old crufty perl building code that we do not use anymore. Those are the removed files. The admin server code also gets rid of the perl.c wrapper. Noriko pointed out that this does not take care of upgrade install, so I added several more files and diffs to take care of that case. Basically, go through the tasks in o=netscaperoot and replace perl?scriptname with just scriptname. Also, go through all of the template generated scripts and replace the shebang line with #!/usr/bin/env perl, and make sure they are chmod +x. I also found a few more places that referenced nsperl and removed them. Platforms tested: RHEL4 Flag Day: no Doc impact: no QA impact: should be covered by regular nightly and manual testing New Tests integrated into TET: none
-rw-r--r--buildpaths.mk2
-rw-r--r--components.mk12
-rw-r--r--httpd/src/Makefile4
-rw-r--r--ldap/admin/src/AddPerlHeader.pl92
-rw-r--r--ldap/admin/src/Base.def45
-rw-r--r--ldap/admin/src/Base.pm95
-rw-r--r--ldap/admin/src/CreateInstall.pl66
-rw-r--r--ldap/admin/src/DSAdmin.def43
-rw-r--r--ldap/admin/src/DSAdmin.mk163
-rw-r--r--ldap/admin/src/DSAdmin.pm262
-rw-r--r--ldap/admin/src/DSAdmin.xs108
-rw-r--r--ldap/admin/src/Inf.pm275
-rw-r--r--ldap/admin/src/Makefile3
-rw-r--r--ldap/admin/src/configure_instance.cpp55
-rw-r--r--ldap/admin/src/create_instance.c8
-rw-r--r--ldap/admin/src/ds_newinst.pl1
-rw-r--r--ldap/admin/src/ds_viewlog.pl2
-rw-r--r--ldap/admin/src/getConfigInfo2
-rwxr-xr-xldap/admin/src/import2info2
-rw-r--r--ldap/admin/src/makemccvlvindexes2
-rw-r--r--ldap/admin/src/makevlvindex2
-rw-r--r--ldap/admin/src/makevlvsearch2
-rw-r--r--ldap/admin/src/migrateInstance2
-rw-r--r--ldap/admin/src/migrateLocalDB2
-rw-r--r--ldap/admin/src/migratePwdFile2
-rw-r--r--ldap/admin/src/migrateTo42
-rwxr-xr-xldap/admin/src/migratedsgw2
-rw-r--r--ldap/admin/src/ns-newpwpolicy.pl24
-rwxr-xr-xldap/admin/src/scripts/template-cl-dump.pl17
-rw-r--r--ldap/admin/src/scripts/template-migrate50to5116
-rw-r--r--ldap/admin/src/scripts/template-migrate5to616
-rw-r--r--ldap/admin/src/scripts/template-migrate5to716
-rw-r--r--ldap/admin/src/scripts/template-migrate6to716
-rw-r--r--ldap/admin/src/scripts/template-migrateInstance510
-rw-r--r--ldap/admin/src/scripts/template-migrateInstance610
-rw-r--r--ldap/admin/src/scripts/template-migrateInstance710
-rwxr-xr-xldap/admin/src/scripts/template-migrateTo516
-rw-r--r--ldap/admin/src/scripts/template-migrateTo616
-rw-r--r--ldap/admin/src/scripts/template-migrateTo716
-rwxr-xr-xldap/admin/src/scripts/template-ns-newpwpolicy.pl16
-rwxr-xr-xldap/admin/src/scripts/template-repl-monitor-cgi.pl8
-rwxr-xr-xldap/admin/src/scripts/template-repl-monitor.pl32
-rw-r--r--ldap/admin/src/scripts/template-verify-db.pl13
-rwxr-xr-xldap/admin/src/updatedsgw2
-rwxr-xr-xldap/admin/src/upgradeServer92
-rwxr-xr-xldap/clients/orgchart/myorg.pl2
-rwxr-xr-xldap/clients/orgchart/org.pl25
-rw-r--r--ldap/cm/Makefile39
-rw-r--r--ldap/cm/fixSetupInf.pl9
-rwxr-xr-xldap/cm/newinst/ns-update18
-rwxr-xr-xldap/cm/newinst/setup.sh6
-rw-r--r--ldap/cm/newinst/slapd.inf3
-rw-r--r--ldap/cm/newinstnt/slapd.inf3
-rw-r--r--ldap/ldif/commonTasks.ldif6
-rw-r--r--ldap/ldif/tasks.ldif2
-rwxr-xr-xnsperl.mk65
56 files changed, 420 insertions, 1360 deletions
diff --git a/buildpaths.mk b/buildpaths.mk
index d512d355..83ee4069 100644
--- a/buildpaths.mk
+++ b/buildpaths.mk
@@ -135,3 +135,5 @@ LDAPCONSOLE_SOURCE_ROOT = $(BUILD_ROOT)/../directoryconsole
# JAF - activation.jar - http://java.sun.com/products/javabeans/glasgow/jaf.html
# JWSDP - jaxrpc-api.jar,jaxrpc.jar,saaj.jar - http://java.sun.com/webservices/downloads/webservicespack.html
# Crimson - crimson.jar - http://xml.apache.org/crimson/
+
+PERLDAP_SOURCE_ROOT = $(MOZILLA_SOURCE_ROOT)
diff --git a/components.mk b/components.mk
index 78d9985b..fb258f75 100644
--- a/components.mk
+++ b/components.mk
@@ -741,3 +741,15 @@ else
-@echo "MAVEN is not required except on Windows."
endif #WINNT
+########### PerLDAP #############
+ifdef PERLDAP_SOURCE_ROOT
+ PERLDAP_BUILT_DIR = $(PERLDAP_SOURCE_ROOT)/directory/perldap/blib
+ PERLDAP_ARCHLIB_DIR = $(PERLDAP_BUILT_DIR)/arch
+ PERLDAP_LIB_DIR = $(PERLDAP_BUILT_DIR)/lib/Mozilla
+ PERLDAP_AUTOLIB_DIR = $(PERLDAP_BUILT_DIR)/lib/auto
+# under the serverroot/lib directory, we should have a perl directory which contains arch/, auto/, and Mozilla/
+ PACKAGE_SRC_DEST += $(PERLDAP_ARCHLIB_DIR) lib/perl
+ PACKAGE_SRC_DEST += $(PERLDAP_LIB_DIR) lib/perl
+ PACKAGE_SRC_DEST += $(PERLDAP_AUTOLIB_DIR) lib/perl
+# else we're using the pre-built zip file - see ldap/cm/Makefile
+endif
diff --git a/httpd/src/Makefile b/httpd/src/Makefile
index 3064968d..fc18bf03 100644
--- a/httpd/src/Makefile
+++ b/httpd/src/Makefile
@@ -147,8 +147,6 @@ ifeq ($(ARCH), NCR)
#OBJS+=$(HTTPD_DIR)/httpd-lib/nspr20/uxwrap.o
endif
-DAEMONLIB=
-
ifeq ($(ARCH), WINNT)
# Don't define DEPLIBS for NT because standard macros like LINK_EXE
# and LINK_DLL automatically pick up DEPLIBS which we don't always wan't.
@@ -168,7 +166,6 @@ else
ifndef DEPLIBS
DEPLIBS = $(addsuffix .$(LIB_SUFFIX), \
$(addprefix $(OBJDIR)/lib/lib,$(HTTPD_LIBS)) \
- $(DAEMONLIB) \
$(OBJDIR)/lib/libaccess \
$(OBJDIR)/lib/libbase \
$(OBJDIR)/lib/libsi18n \
@@ -179,7 +176,6 @@ DEPLIBS += $(SECURITY_DEP) \
DEPLINK = $(addsuffix .$(LIB_SUFFIX), \
$(addprefix $(OBJDIR)/lib/lib,$(HTTPD_LIBS)) \
- $(DAEMONLIB) \
$(OBJDIR)/lib/libaccess \
$(OBJDIR)/lib/libbase \
$(OBJDIR)/lib/libsi18n \
diff --git a/ldap/admin/src/AddPerlHeader.pl b/ldap/admin/src/AddPerlHeader.pl
deleted file mode 100644
index 1e64c401..00000000
--- a/ldap/admin/src/AddPerlHeader.pl
+++ /dev/null
@@ -1,92 +0,0 @@
-#
-# 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) 2001 Sun Microsystems, Inc. Used by permission.
-# Copyright (C) 2005 Red Hat, Inc.
-# All rights reserved.
-# END COPYRIGHT BLOCK
-#
-# used to add the perl preamble to all perl scripts used by the directory
-# server run time; the problem is that the INC paths are compiled into
-# the executable and cannot be overridden at run time, so we have to make
-# sure we fix them
-
-# the first argument is the source path for the INC path
-# the second argument is the token to replace with the server root
-# at install time
-# the third argument is the source perl script
-# the fourth argument is the destination perl script
-#
-
-($sourceLibPath, $serverRootToken, $sourceScript, $destScript) = @ARGV;
-open SRC, $sourceScript or die "Error: could not open $sourceScript: $!";
-open DEST, ">$destScript" or die "Error: could not write $destScript: $!";
-
-$isNT = -d '\\';
-
-print DEST<<EOF1;
-#!perl
-# This preamble must be at the beginning of every perl script so that we can
-# find packages and dynamically load code at run time; SERVER_ROOT must
-# be replaced with the absolute path to the server root at installation
-# time; it is assumed that the perl library will be installed as
-# server root/install/perl
-BEGIN {
-EOF1
-
-# if on NT, just assume we are using activeState, which looks like this
-# server root/install/lib
-# /bin
-# /site/lib
-# there is no arch subdir on NT
-if ($isNT) {
- print DEST "\t\@INC = qw( $serverRootToken/install/lib $serverRootToken/install/site/lib . );\n";
- print DEST "}\n";
-} else {
- print DEST<<EOF2;
- \$BUILD_PERL_PATH = \"$sourceLibPath\";
- \$RUN_PERL_PATH = \"$serverRootToken/install\";
- # make sure we use the unix path conventions
- grep { s#\$BUILD_PERL_PATH#\$RUN_PERL_PATH#g } \@INC;
-}
-EOF2
-}
-
-# copy the rest of the file
-while (<SRC>) {
- print DEST;
-}
-
-close DEST;
-close SRC;
diff --git a/ldap/admin/src/Base.def b/ldap/admin/src/Base.def
deleted file mode 100644
index 0dd8f263..00000000
--- a/ldap/admin/src/Base.def
+++ /dev/null
@@ -1,45 +0,0 @@
-; 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) 2001 Sun Microsystems, Inc. Used by permission.
-; Copyright (C) 2005 Red Hat, Inc.
-; All rights reserved.
-; END COPYRIGHT BLOCK
-;
-DESCRIPTION 'Setup SDK Dynamic perl module'
-CODE SHARED READ EXECUTE
-DATA SHARED READ WRITE
-EXPORTS
- XS_NSSetupSDK__Base_toLocal @2
- XS_NSSetupSDK__Base_toUTF8 @3
- boot_NSSetupSDK__Base @4
diff --git a/ldap/admin/src/Base.pm b/ldap/admin/src/Base.pm
deleted file mode 100644
index 0edf682d..00000000
--- a/ldap/admin/src/Base.pm
+++ /dev/null
@@ -1,95 +0,0 @@
-#
-# 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) 2001 Sun Microsystems, Inc. Used by permission.
-# Copyright (C) 2005 Red Hat, Inc.
-# All rights reserved.
-# END COPYRIGHT BLOCK
-#
-
-package NSSetupSDK::Base;
-
-use POSIX;
-
-use strict;
-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $AUTOLOAD);
-
-require Exporter;
-require DynaLoader;
-require AutoLoader;
-
-@ISA = qw(Exporter DynaLoader);
-# Items to export into callers namespace by default. Note: do not export
-# names by default without a very good reason. Use EXPORT_OK instead.
-# Do not simply export all your public functions/methods/constants.
-
-# Items to export into callers namespace by default. Note: do not export
-# names by default without a very good reason. Use EXPORT_OK instead.
-# Do not simply export all your public functions/methods/constants.
-@EXPORT = qw(
- toLocal toUTF8
-);
-$VERSION = '1.00';
-
-bootstrap NSSetupSDK::Base $VERSION;
-
-# Autoload methods go after =cut, and are processed by the autosplit program.
-
-1;
-__END__
-# Below is the stub of documentation for your module. You better edit it!
-
-=head1 NAME
-
-NSSetupSDK::Base - Perl extension for directory server administrative utility functions
-
-=head1 SYNOPSIS
-
- use NSSetupSDK::Base;
-
-=head1 DESCRIPTION
-
-The NSSetupSDK::Base module is used by directory server administration scripts, such as
-those used for installation/uninstallation, instance creation/removal, CGIs,
-etc.
-
-=head1 AUTHOR
-
-Richard Megginson richm@netscape.com
-
-=head1 SEE ALSO
-
-perl(1).
-
-=cut
diff --git a/ldap/admin/src/CreateInstall.pl b/ldap/admin/src/CreateInstall.pl
deleted file mode 100644
index de15fdac..00000000
--- a/ldap/admin/src/CreateInstall.pl
+++ /dev/null
@@ -1,66 +0,0 @@
-#!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) 2001 Sun Microsystems, Inc. Used by permission.
-# Copyright (C) 2005 Red Hat, Inc.
-# All rights reserved.
-# END COPYRIGHT BLOCK
-#
-# figure out what the server root assuming the path to this script is
-# server root/bin/slapd/admin/bin
-
-($serverRoot = $0) =~ s@[\\/]?bin[\\/]slapd[\\/]admin[\\/]bin.*$@@g;
-
-# run the post install program
-$isNT = -d '\\';
-$quote = $isNT ? "\"" : "";
-# make sure the arguments are correctly quoted on NT
-@fixargs = map { /^[\"].*[\"]$/ ? $_ : $quote . $_ . $quote } @ARGV;
-if (! $serverRoot) {
- $serverRoot = ".";
-}
-chdir "$serverRoot/bin/slapd/admin/bin";
-
-# note: exec on NT doesn't work the same way as exec on Unix. On Unix, exec replaces the calling
-# process with the called process. The parent, if waiting for the calling process, will happily
-# wait for it's replacement. On NT however, the parent thinks the calling process has gone, and
-# it doesn't know about the called process, so it stops waiting. So, we have to do a system()
-# on NT to force the calling process to wait for the called process. On Unix, we can do the
-# faster and more memory efficient exec() call.
-if ($isNT) {
- system {'./ds_create'} './ds_create', @fixargs;
-} else {
- exec {'./ds_create'} './ds_create', @fixargs;
-}
diff --git a/ldap/admin/src/DSAdmin.def b/ldap/admin/src/DSAdmin.def
deleted file mode 100644
index 06b766b8..00000000
--- a/ldap/admin/src/DSAdmin.def
+++ /dev/null
@@ -1,43 +0,0 @@
-; 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) 2001 Sun Microsystems, Inc. Used by permission.
-; Copyright (C) 2005 Red Hat, Inc.
-; All rights reserved.
-; END COPYRIGHT BLOCK
-;
-LIBRARY "DSAdmin"
-EXPORTS
- boot_DSAdmin
- _boot_DSAdmin = boot_DSAdmin
-
diff --git a/ldap/admin/src/DSAdmin.mk b/ldap/admin/src/DSAdmin.mk
deleted file mode 100644
index 0a1db8f2..00000000
--- a/ldap/admin/src/DSAdmin.mk
+++ /dev/null
@@ -1,163 +0,0 @@
-#
-# 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) 2001 Sun Microsystems, Inc. Used by permission.
-# Copyright (C) 2005 Red Hat, Inc.
-# All rights reserved.
-# END COPYRIGHT BLOCK
-#
-# Makefile for the DSAdmin dynamic loaded perl module
-
-LDAP_SRC = ../..
-BUILD_ROOT = ../../..
-
-NOSTDCLEAN=true # don't let nsconfig.mk define target clean
-NOSTDSTRIP=true # don't let nsconfig.mk define target strip
-NSPR20=true # probably should be defined somewhere else (not sure where)
-
-include $(BUILD_ROOT)/nsconfig.mk
-include $(LDAP_SRC)/nsldap.mk
-
-BINDIR=$(LDAP_ADMIN_BIN_RELDIR)
-OBJDEST=$(LDAP_ADMOBJDIR)
-
-INCLUDES += -I$(LDAP_SRC)/admin/include
-
-DS_SERVER_DEFS = -DNS_DS
-
-INFO = $(OBJDIR)/$(DIR)
-
-ifneq ($(ARCH), WINNT)
-EXTRALDFLAGS += $(SSLLIBFLAG)
-endif
-
-EXTRA_LIBS += $(LIBPERL_A) $(SETUPUTIL_S_LINK) $(LDAP_ADMLIB) \
- $(LDAPLINK) $(DEPLINK) $(ADMINUTIL_LINK) \
- $(NSPRLINK) $(NLSLINK) \
- $(NLSLINK_CONV_STATIC)
-
-# the security libs are statically linked into libds_admin.so; osf doesn't like
-# to link against them again, it thinks they are multiply defined
-ifneq ($(ARCH), OSF1)
-EXTRA_LIBS += $(SECURITYLINK) $(DBMLINK)
-else
-#DLL_LDFLAGS=-shared -all -error_unresolved -taso
-#EXTRA_LIBS += -lcxx -lcxxstd -lcurses -lc
-endif
-
-ifeq ($(ARCH), WINNT)
-PLATFORM_INCLUDE = -I$(BUILD_ROOT)/include/nt
-SUBSYSTEM=console
-EXTRA_LIBS+=comctl32.lib $(LDAP_SDK_LIBLDAP_DLL) $(LDAP_LIBUTIL)
-EXTRA_LIBS_DEP+=$(LDAP_LIBUTIL_DEP)
-DEF_FILE:=DSAdmin.def
-LINK_DLL += /NODEFAULTLIB:msvcrtd.lib
-endif
-
-ifeq ($(ARCH), AIX)
-EXTRA_LIBS += $(DLL_EXTRA_LIBS) -lbsd
-LD=ld
-endif
-
-# absolutely do not try to build perl-stuff with warnings-as-errors.
-# (duh.)
-ifeq ($(ARCH), Linux)
-CFLAGS := $(subst -Werror,,$(CFLAGS))
-endif
-
-DSADMIN_OBJS = DSAdmin.o
-DSADMIN_BASENAME = DSAdmin$(DLL_PRESUFFIX).$(DLL_SUFFIX)
-
-OBJS= $(addprefix $(OBJDEST)/, $(DSADMIN_OBJS))
-DSADMIN_SO = $(addprefix $(BINDIR)/, $(DSADMIN_BASENAME))
-
-EXTRA_LIBS_DEP = $(SETUPUTIL_DEP)
-
-# for Solaris, our most common unix build platform, we check for undefined
-# symbols at link time so we don't catch them at run time. To do this, we
-# set the -z defs flag. We also have to add explicitly link with the C and
-# C++ runtime libraries (e.g., -lc) because, even though ld and CC link
-# with them implicitly, -z defs will throw errors if we do not link with
-# them explicitly.
-ifeq ($(ARCH), SOLARIS)
-LINK_DLL += -z defs
-# removed -lcx from the following line
-EXTRA_LIBS += -lCstd -lCrun -lm -lw -lc
-# with the Forte 6 and later compilers, we must use CC to link
-LD=CC
-endif
-
-all: $(OBJDEST) $(BINDIR) $(DSADMIN_SO)
-
-dummy:
- -@echo PERL_EXE = $(PERL_EXE)
- -@echo PERL_EXENT = $(PERL_EXENT)
- -@echo PERL_BASEDIR = $(PERL_BASEDIR)
- -@echo PERL_ROOT = $(PERL_ROOT)
- -@echo IS_ACTIVESTATE = $(IS_ACTIVESTATE)
- -@echo PERL_CONFIG = $(PERL_CONFIG)
- -@echo PERL_ROOT = $(PERL_ROOT)
- -@echo PERL = $(PERL)
- -@echo PERL_LIB = $(PERL_LIB)
- -@echo PERL_ARCHLIB = $(PERL_ARCHLIB)
- -@echo EXTRA_LIBS_DEP = $(EXTRA_LIBS_DEP)
- abort
-
-ifeq ($(ARCH), WINNT)
-$(DSADMIN_SO): $(OBJS) $(EXTRA_LIBS_DEP) $(DEF_FILE)
- $(LINK_DLL) /DEF:$(DEF_FILE)
-# linking this file causes a .exp and a .lib file to be generated which don't seem
-# to be required while running, so I get rid of them
- $(RM) $(subst .dll,.exp,$@) $(subst .dll,.lib,$@)
-else
-$(DSADMIN_SO): $(OBJS)
- $(LINK_DLL) $(EXTRA_LIBS)
-endif
-
-$(OBJDEST)/DSAdmin.o: $(OBJDEST)/DSAdmin.c
-ifeq ($(ARCH), WINNT)
- $(CC) -c $(CFLAGS) $(PERL_CFLAGS) $(MCC_INCLUDE) $(SETUPSDK_INCLUDE) $(PERL_INC) $< $(OFFLAG)$@
-else
- $(CXX) $(EXCEPTIONS) -c $(CFLAGS) $(PERL_CFLAGS) $(MCC_INCLUDE) $(SETUPSDK_INCLUDE) $(PERL_INC) $< $(OFFLAG)$@
-endif
-
-$(OBJDEST)/DSAdmin.c: DSAdmin.xs
- $(PERL) -w -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) $(XSPROTOARG) $(XSUBPPARGS) $< > $@
-
-#MYCMD := "Mksymlists('NAME' => 'DSAdmin', 'DLBASE' => 'DSAdmin');"
-#$(DEF_FILE): DSAdmin.xs
-# $(PERL) -w "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -MExtUtils::Mksymlists -e "$(MYCMD)"
-
-clean:
- -$(RM) $(OBJDEST)/DSAdmin.c $(OBJS) $(DSADMIN_SO)
diff --git a/ldap/admin/src/DSAdmin.pm b/ldap/admin/src/DSAdmin.pm
deleted file mode 100644
index a2c40d6a..00000000
--- a/ldap/admin/src/DSAdmin.pm
+++ /dev/null
@@ -1,262 +0,0 @@
-#
-# 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) 2001 Sun Microsystems, Inc. Used by permission.
-# Copyright (C) 2005 Red Hat, Inc.
-# All rights reserved.
-# END COPYRIGHT BLOCK
-#
-
-package DSAdmin;
-
-use POSIX;
-
-use strict;
-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $AUTOLOAD
-$isNT $PATHSEP $quote $script_suffix $exe_suffix $os
-$dll_suffix $argumentative @args $first $rest $errs $pos
-);
-
-require Exporter;
-require DynaLoader;
-require AutoLoader;
-
-@ISA = qw(Exporter DynaLoader);
-# Items to export into callers namespace by default. Note: do not export
-# names by default without a very good reason. Use EXPORT_OK instead.
-# Do not simply export all your public functions/methods/constants.
-
-# Items to export into callers namespace by default. Note: do not export
-# names by default without a very good reason. Use EXPORT_OK instead.
-# Do not simply export all your public functions/methods/constants.
-@EXPORT = qw(
- normalizeDN toLocal toUTF8
-);
-$VERSION = '1.00';
-
-bootstrap DSAdmin $VERSION;
-
-BEGIN {
- require 'uname.lib';
- $isNT = -d '\\';
-# @INC = ( '.', '../../../admin/admin/bin' );
-# grep { s@/@\\@g } @INC if $isNT;
- $PATHSEP = $isNT ? '\\' : '/';
- # NT needs quotes around some things unix doesn't
- $quote = $isNT ? "\"" : "";
-
- $script_suffix = $isNT ? ".bat" : "";
- $exe_suffix = $isNT ? ".exe" : "";
- if ($isNT) {
- $os = "WINNT";
- } else {
- $os = &uname("-s");
- }
-
- # dll suffix for shared libraries in old instance; note that the dll suffix
- # may have changed for the new instance e.g. AIX now uses .so
- if ( $os eq "AIX" ) {
- $dll_suffix = "_shr.a";
- }
- elsif ( $os eq "HP-UX" ) {
- $arch = &uname("-p");
- if ( $arch eq "ia64" ) {
- $dll_suffix = ".so";
- } else {
- $dll_suffix = ".sl";
- }
- }
- elsif ( $os eq "WINNT" ) {
- $dll_suffix = ".dll";
- }
- else {
- $dll_suffix = ".so";
- }
-}
-
-sub getCwd {
- my $command = $isNT ? "cd" : "/bin/pwd";
- open(PWDCMD, "$command 2>&1 |") or
- die "Error: could not execute $command: $!";
- # without the following sleep, reading from the pipe will
- # return nothing; I guess it gives the pwd command time
- # to get some data to read . . .
- sleep(1);
- my $curdir;
- while (<PWDCMD>) {
- if (!$curdir) {
- chomp($curdir = $_);
- }
- }
- my $code = close(PWDCMD);
-# if ($code || $?) {
-# print "$command returned code=$code status=$? dir=$curdir\n";
-# }
-# print "getCwd curdir=\[$curdir\]\n";
- return $curdir;
-}
-
-# this is used to run the system() call, capture exit and signal codes,
-# and die() upon badness; the first argument is a directory to change
-# dir to, if any, and the rest are passed to system()
-sub mySystem {
- my $rc = &mySystemNoDie(@_);
- my ($dir, @args) = @_;
- if ($rc == 0) {
-# success
- } elsif ($rc == 0xff00) {
- die "Error executing @args: error code $rc: $!";
- } elsif ($rc > 0x80) {
- $rc >>= 8;
- die "Error executing @args: error code $rc: $!";
- } else {
- if ($rc & 0x80) {
- $rc &= ~0x80;
- }
- die "Error executing @args: received signal $rc: $!";
- }
-
- # usually won't get return value
- return $rc;
-}
-
-# This version does not die but just returns the error code
-sub mySystemNoDie {
- my ($dir, @args) = @_;
- if ($dir && ($dir ne "")) {
- chdir($dir) or die "Could not change directory to $dir: $!";
- }
- my $cmd = $args[0];
- # the system {$cmd} avoids some NT shell quoting problems if the $cmd
- # needs to be quoted e.g. contains spaces; the map puts double quotes
- # around the arguments on NT which are stripped by the command
- # interpreter cmd.exe; but don't quote things which are already quoted
- my @fixargs = map { /^[\"].*[\"]$/ ? $_ : $quote . $_ . $quote } @args;
- my $rc = 0;
- if ($cmd =~ /[.](bat|cmd)$/) {
- # we have to pass batch files directly to the NT command interpreter
- $cmd = $ENV{COMSPEC};
- if (!$cmd) {
- $cmd = 'c:\winnt\system32\cmd.exe';
- }
-# print "system $cmd /c \"@fixargs\"\n";
- $rc = 0xffff & system {$cmd} '/c', "\"@fixargs\"";
- } else {
- print "system $cmd @fixargs\n";
- $rc = 0xffff & system {$cmd} @fixargs;
- }
- return $rc;
-}
-
-sub getTempFileName {
- my $tmp = tmpnam();
- while (-f $tmp) {
- $tmp = tmpnam();
- }
-
- return $tmp;
-}
-
-sub getopts {
- local($argumentative) = @_;
- local(@args,$_,$first,$rest);
- local($errs) = 0;
- local($[) = 0;
-
- @args = split( / */, $argumentative );
- while(@ARGV && ($_ = $ARGV[0]) =~ /^-(.)(.*)/) {
- ($first,$rest) = ($1,$2);
- $pos = index($argumentative,$first);
- if($pos >= $[) {
- if($args[$pos+1] eq ':') {
- shift(@ARGV);
- if($rest eq '') {
- ++$errs unless @ARGV;
- $rest = shift(@ARGV);
- }
- eval "\$main::opt_$first = \$rest;";
- }
- else {
- eval "\$main::opt_$first = 1";
- if($rest eq '') {
- shift(@ARGV);
- }
- else {
- $ARGV[0] = "-$rest";
- }
- }
- }
- else {
- print STDERR "Unknown option: $first\n";
- ++$errs;
- if($rest ne '') {
- $ARGV[0] = "-$rest";
- }
- else {
- shift(@ARGV);
- }
- }
- }
- $errs == 0;
-}
-
-# Autoload methods go after =cut, and are processed by the autosplit program.
-
-1;
-__END__
-# Below is the stub of documentation for your module. You better edit it!
-
-=head1 NAME
-
-DSAdmin - Perl extension for directory server administrative utility functions
-
-=head1 SYNOPSIS
-
- use DSAdmin;
-
-=head1 DESCRIPTION
-
-The DSAdmin module is used by directory server administration scripts, such as
-those used for installation/uninstallation, instance creation/removal, CGIs,
-etc.
-
-=head1 AUTHOR
-
-Richard Megginson richm@netscape.com
-
-=head1 SEE ALSO
-
-perl(1).
-
-=cut
diff --git a/ldap/admin/src/DSAdmin.xs b/ldap/admin/src/DSAdmin.xs
deleted file mode 100644
index f25909a6..00000000
--- a/ldap/admin/src/DSAdmin.xs
+++ /dev/null
@@ -1,108 +0,0 @@
-/** 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) 2001 Sun Microsystems, Inc. Used by permission.
- * Copyright (C) 2005 Red Hat, Inc.
- * All rights reserved.
- * END COPYRIGHT BLOCK **/
-/*
- This file contains the definitions of C functions callable from perl.
- The perl interface for these functions is found in DSAdmin.pm.
-*/
-
-#include "dsalib.h"
-
-#include "nsutils.h"
-#include "utf8.h"
-
-/* these are the perl include files needed */
-#ifdef __cplusplus
-extern "C" {
-#endif
-#include "EXTERN.h"
-/* The next two lines are hacks because someone build perl with gcc which
-has this feature call __attribute__ which is not present with sun cc */
-#define HASATTRIBUTE
-#define __attribute__(_attr_)
-
-#ifdef HPUX11 /* conflict with perl 'struct magic' and hpux 'struct magic' */
-#define magic p_magic
-#define MAGIC p_MAGIC
-#endif /* HPUX */
-
-#include "perl.h"
-#include "XSUB.h"
-#ifdef __cplusplus
-}
-#endif
-
-
-MODULE = DSAdmin PACKAGE = DSAdmin
-
-PROTOTYPES: DISABLE
-
-SV *
-normalizeDN(dn)
- char* dn
- PREINIT:
- char* temp_dn;
- CODE:
- /* duplicate the DN since dn_normalize_convert modifies the argument */
- temp_dn = (char *)malloc(strlen(dn) + 1);
- strcpy(temp_dn, dn);
- ST(0) = sv_newmortal();
- /* dn_normalize_convert returns its argument */
- sv_setpv( ST(0), dn_normalize_convert(temp_dn) );
- free(temp_dn);
-
-SV *
-toLocal(s)
- char* s
- PREINIT:
- char* temp_s;
- CODE:
- temp_s = UTF8ToLocal(s);
- ST(0) = sv_newmortal();
- sv_setpv( ST(0), temp_s );
- nsSetupFree(temp_s);
-
-SV *
-toUTF8(s)
- char* s
- PREINIT:
- char* temp_s;
- CODE:
- temp_s = localToUTF8(s);
- ST(0) = sv_newmortal();
- sv_setpv( ST(0), temp_s );
- nsSetupFree(temp_s);
diff --git a/ldap/admin/src/Inf.pm b/ldap/admin/src/Inf.pm
deleted file mode 100644
index 4eee2ade..00000000
--- a/ldap/admin/src/Inf.pm
+++ /dev/null
@@ -1,275 +0,0 @@
-#!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) 2001 Sun Microsystems, Inc. Used by permission.
-# Copyright (C) 2005 Red Hat, Inc.
-# All rights reserved.
-# END COPYRIGHT BLOCK
-#
-
-package NSSetupSDK::Inf;
-
-use NSSetupSDK::Base;
-
-%otherEnc = ('local' => "utf8", utf8 => "local");
-# mapping of encoding to the subroutine which converts from that encoding
-%convertEnc = ('local' => \&toUTF8, utf8 => \&toLocal);
-
-#############################################################################
-# Creator, the argument (optional) is the INF file to read
-#
-sub new {
- my ($class, $filename) = @_;
- my $self = {};
-
- bless $self, $class;
-
- if ($filename) {
- $self->read($filename);
- }
-
- return $self;
-}
-
-#############################################################################
-# Read in and initialize ourself with the given INF file. The file will be
-# encoded in either local or utf8 encoding. The type of encoding is given
-# in the $enc argument. We first read in the values in the given encoding,
-# then convert the file to the other encoding, then read in and initialize
-# the values for the other encoding
-#
-sub read {
- my ($self, $filename, $enc) = @_;
- my $inf = {}; # the contents of the inf file
- my @sectionList = (); # a list of section names, in order
- my $sectionName = "General"; # default section name
-
- open INF, $filename or return undef;
-
- push @sectionList, $sectionName;
- while (<INF>) {
- next if /^\s*#/; # skip comments
- next if /^\s*$/; # skip blank lines
- if (/^\s*\[([^\]]+)\]/) {
- $sectionName = $1; # new section
- if ($sectionName cmp "General") {
- # General is already in the list
- push @sectionList, $sectionName;
- }
- } else {
- chop;
- ($name, $value) = split(/\s*=\s*/, $_, 2);
-# print "name=$name value=$value\n";
- $inf->{$sectionName}{$enc}{$name} = $value;
- $inf->{$sectionName}{$otherEnc{$enc}}{$name} =
- &{$convertEnc{$enc}}($value);
- }
- }
- close INF;
-
- $self->{inf} = $inf;
- $self->{sections} = [ @sectionList ];
-
-# foreach $section (keys %inf) {
-# print '[', $section, ']', "\n";
-# foreach $name (keys %{ $inf{$section} }) {
-# print "local $name=$inf{$section}{local}{$name}\n";
-# print "UTF8 $name=$inf{$section}{utf8}{$name}\n";
-# }
-# }
-
- return 1;
-}
-
-sub readLocal {
- my $self = shift;
- return $self->read(@_, 'local');
-}
-
-sub readUTF8 {
- my $self = shift;
- return $self->read(@_, 'utf8');
-}
-
-#############################################################################
-# Init from a hash; used to create a subsection as another inf
-#
-sub init {
- my ($self, $hashRef) = @_;
- my $inf = {};
- $inf->{General} = $hashRef;
- $self->{inf} = $inf;
- $self->{sections} = [ "General" ];
-
- return 1;
-}
-
-#############################################################################
-# return the number of sections
-#
-sub numSections {
- my $self = shift;
- return scalar(@{$self->{sections}});
-}
-
-#############################################################################
-# return the section corresponding to the given name or number
-#
-sub getSection {
- my ($self, $section) = @_;
- if ($section =~ /\d+/) { # section is a number
- $section = $self->{sections}->[$section];
- }
-
- my $newSec = new Inf;
- $newSec->init($self->{inf}->{$section});
- return $newSec;
-}
-
-#############################################################################
-# return the value of the given name in local encoding
-#
-sub getLocal {
- my ($self, $name) = @_;
- return getFromSection($self, "General", $name, "local");
-}
-
-#############################################################################
-# return the value of the given name in UTF8 encoding
-#
-sub getUTF8 {
- my ($self, $name) = @_;
- return getFromSection($self, "General", $name, "utf8");
-}
-
-#############################################################################
-# return the value of the given name in UTF8 encoding
-#
-sub get {
- my ($self, $name) = @_;
- return getFromSection($self, "General", $name, "utf8");
-}
-
-#############################################################################
-# return the value of the given name in the given section
-#
-sub getFromSection {
- my ($self, $section, $name, $enc) = @_;
-# print "self inf = ", %{ $self->{inf} }, "\n";
-# print "self inf section = ", %{ $self->{inf}->{$section} }, "\n";
- return $self->{inf}->{$section}{$enc}{$name};
-}
-
-#############################################################################
-# set the value
-#
-sub setInSection {
- my ($self, $section, $name, $value, $enc) = @_;
- if (!$enc) {
- $enc = 'utf8';
- }
- $self->{inf}->{$section}{$enc}{$name} = $value;
- $self->{inf}->{$section}{$otherEnc{$enc}}{$name} =
- &{$convertEnc{$enc}}($value);
-}
-
-#############################################################################
-# set the value; value is locally encoded
-#
-sub setLocal {
- my ($self, $name, $value) = @_;
- setInSection($self, "General", $name, $value, "local");
-}
-
-#############################################################################
-# set the value; value is UTF-8 encoded
-#
-sub setUTF8 {
- my ($self, $name, $value) = @_;
- setInSection($self, "General", $name, $value, "utf8");
-}
-
-#############################################################################
-# set the value, assume UTF-8 encoding
-#
-sub set {
- my ($self, $name, $value) = @_;
- setInSection($self, "General", $name, $value, "utf8");
-}
-
-sub write {
- my ($self, $ref, $enc) = @_;
- my $needClose = undef;
- if (!$enc) {
- $enc = "local"; # write file in local encoding by default
- }
- if (!$ref) {
- # no filehandle given
- $ref = \*STDOUT;
- } elsif (!ref($ref)) { # not a ref, assume scalar filename
- # filename
- open(OUTPUT, ">$ref") or die "Error: could not write file $ref: $!";
- $ref = \*OUTPUT;
- $needClose = 1; # be sure to close
- } elsif (ref($ref) eq 'SCALAR') {
- # filename
- open(OUTPUT, ">$$ref") or die "Error: could not write file $$ref: $!";
- $ref = \*OUTPUT;
- $needClose = 1; # be sure to close
- } # else already a file handle ref
- foreach $secName (@{ $self->{sections} }) {
- print $ref "[", $secName, "]\n";
- foreach $name (keys %{ $self->{inf}->{$secName}{$enc} }) {
- $value = $self->{inf}->{$secName}{$enc}{$name};
- print $ref $name, "=", $value, "\n";
- }
- print $ref "\n";
- }
- if ($needClose) {
- close $ref;
- }
-}
-
-sub writeLocal {
- my ($self, $ref) = @_;
- $self->write($ref, 'local');
-}
-
-sub writeUTF8 {
- my ($self, $ref) = @_;
- $self->write($ref, 'utf8');
-}
-
-1; # the mandatory TRUE return from the package
diff --git a/ldap/admin/src/Makefile b/ldap/admin/src/Makefile
index 5210982c..e5e72793 100644
--- a/ldap/admin/src/Makefile
+++ b/ldap/admin/src/Makefile
@@ -348,10 +348,12 @@ installPerlFiles: $(BINDIR) $(PERL_SCRIPTS_DEST)
$(BINDIR)/%: %
-@$(RM) $@
$(CP) $< $@
+ chmod +x $@
$(LDAP_SERVER_RELDIR)/%: % $(LDAP_SERVER_RELDIR)
-@$(RM) $@
$(CP) $< $@
+ chmod +x $@
$(INST_INCLUDES): install_keywords.h
-@$(RM) $@
@@ -360,3 +362,4 @@ $(INST_INCLUDES): install_keywords.h
$(SCRIPTSDIR)/template-%: scripts/template-% $(SCRIPTSDIR)
-@$(RM) $@
$(CP) $< $@
+ chmod +x $@
diff --git a/ldap/admin/src/configure_instance.cpp b/ldap/admin/src/configure_instance.cpp
index 50cced26..5beb9ff2 100644
--- a/ldap/admin/src/configure_instance.cpp
+++ b/ldap/admin/src/configure_instance.cpp
@@ -1964,5 +1964,60 @@ reconfigure_instance(int argc, char *argv[])
}
while (ldapent.next() == OKAY);
+ // we no longer use nsperl - any CGIs which we used to invoke via perl?perlscript
+ // are now invoked directly by making the perl script executable - we need to
+ // search for all nsexecref: perl?perlscript and replace them with
+ // nsexecref: perlscript
+ filter = NSString("(nsexecref=perl*)");
+ scope = LDAP_SCOPE_SUBTREE;
+ baseDN = name_netscaperootDN;
+
+ ldapent.clear();
+ le = ldapent.retrieve(filter, scope, baseDN);
+ if (le != OKAY)
+ {
+ if (le == NOT_FOUND) {
+ dsLogMessage(SETUP_LOG_INFO, "Slapd",
+ "No old nsperl references found");
+ } else {
+ dsLogMessage(SETUP_LOG_FATAL, "Slapd",
+ "ERROR: Could not find old nsperl references\n"
+ "URL %s user id %s DN %s (%d:%s)",
+ installInfo->get(SLAPD_KEY_K_LDAP_URL),
+ installInfo->get(SLAPD_KEY_SERVER_ADMIN_ID),
+ (const char *)baseDN,
+ le.errorCode(), le.msg());
+ return le.errorCode();
+ }
+ } else {
+ do
+ {
+ LdapEntry repEntry(ldapent.ldap());
+ repEntry.retrieve(ldapent.entryDN());
+ char *val = repEntry.getAttribute("nsexecref");
+ const char *ptr = 0;
+ if (val && *val && (ptr = strstr(val, "perl?"))) {
+ ptr = strchr(ptr, '?');
+ ptr++;
+ NSString newscript = NSString(ptr);
+ repEntry.setAttribute("nsexecref", newscript);
+ }
+
+ le = repEntry.replace(repEntry.entryDN());
+ if (le != OKAY)
+ {
+ dsLogMessage(SETUP_LOG_FATAL, "Slapd",
+ "ERROR: Could not fix old nsperl reference\n"
+ "URL %s user id %s DN %s (%d:%s)" ,
+ installInfo->get(SLAPD_KEY_K_LDAP_URL),
+ installInfo->get(SLAPD_KEY_SERVER_ADMIN_ID),
+ (const char *)repEntry.entryDN(),
+ le.errorCode(), le.msg());
+ return le.errorCode();
+ }
+ }
+ while (ldapent.next() == OKAY);
+ }
+
return 0;
}
diff --git a/ldap/admin/src/create_instance.c b/ldap/admin/src/create_instance.c
index 11ff03e8..08136ccf 100644
--- a/ldap/admin/src/create_instance.c
+++ b/ldap/admin/src/create_instance.c
@@ -765,9 +765,13 @@ char *gen_perl_script_auto(char *s_root, char *cs_path, char *name,
FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP,
FILE_PATHSEP, name);
PR_snprintf(fn, sizeof(fn), "%s%c%s", cs_path, FILE_PATHSEP, name);
+#ifdef USE_NSPERL
PR_snprintf(myperl, sizeof(myperl), "!%s%cbin%cslapd%cadmin%cbin%cperl",
s_root, FILE_PATHSEP, FILE_PATHSEP,
FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP);
+#else
+ strcpy(myperl, "!/usr/bin/env perl");
+#endif
table[0][0] = "DS-ROOT";
table[0][1] = s_root;
@@ -812,9 +816,13 @@ char *gen_perl_script_auto_for_migration(char *s_root, char *cs_path, char *name
FILE_PATHSEP, name);
PR_snprintf(fn, sizeof(fn), "%s%cbin%cslapd%cadmin%cbin%c%s", s_root, FILE_PATHSEP,
FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP, name);
+#ifdef USE_NSPERL
PR_snprintf(myperl, sizeof(myperl), "!%s%cbin%cslapd%cadmin%cbin%cperl",
s_root, FILE_PATHSEP, FILE_PATHSEP,
FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP);
+#else
+ strcpy(myperl, "!/usr/bin/env perl");
+#endif
table[0][0] = "DS-ROOT";
table[0][1] = s_root;
diff --git a/ldap/admin/src/ds_newinst.pl b/ldap/admin/src/ds_newinst.pl
index 401d4db0..81dde5dd 100644
--- a/ldap/admin/src/ds_newinst.pl
+++ b/ldap/admin/src/ds_newinst.pl
@@ -1,3 +1,4 @@
+#!/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
diff --git a/ldap/admin/src/ds_viewlog.pl b/ldap/admin/src/ds_viewlog.pl
index 358d7d7b..2581cdde 100644
--- a/ldap/admin/src/ds_viewlog.pl
+++ b/ldap/admin/src/ds_viewlog.pl
@@ -1,4 +1,4 @@
-#!perl
+#!/usr/bin/env perl
#
# BEGIN COPYRIGHT BLOCK
# This Program is free software; you can redistribute it and/or modify it under
diff --git a/ldap/admin/src/getConfigInfo b/ldap/admin/src/getConfigInfo
index f3e4b356..981bcec9 100644
--- a/ldap/admin/src/getConfigInfo
+++ b/ldap/admin/src/getConfigInfo
@@ -1,4 +1,4 @@
-#!perl
+#!/usr/bin/env perl
#
# BEGIN COPYRIGHT BLOCK
# This Program is free software; you can redistribute it and/or modify it under
diff --git a/ldap/admin/src/import2info b/ldap/admin/src/import2info
index 9c65d914..ad225e68 100755
--- a/ldap/admin/src/import2info
+++ b/ldap/admin/src/import2info
@@ -1,4 +1,4 @@
-#!perl
+#!/usr/bin/env perl
#
# BEGIN COPYRIGHT BLOCK
# This Program is free software; you can redistribute it and/or modify it under
diff --git a/ldap/admin/src/makemccvlvindexes b/ldap/admin/src/makemccvlvindexes
index fb63e47d..03717b00 100644
--- a/ldap/admin/src/makemccvlvindexes
+++ b/ldap/admin/src/makemccvlvindexes
@@ -1,4 +1,4 @@
-#!perl
+#!/usr/bin/env perl
#
# BEGIN COPYRIGHT BLOCK
# This Program is free software; you can redistribute it and/or modify it under
diff --git a/ldap/admin/src/makevlvindex b/ldap/admin/src/makevlvindex
index 322ecc24..592bd2dc 100644
--- a/ldap/admin/src/makevlvindex
+++ b/ldap/admin/src/makevlvindex
@@ -1,4 +1,4 @@
-#!perl
+#!/usr/bin/env perl
#
# BEGIN COPYRIGHT BLOCK
# This Program is free software; you can redistribute it and/or modify it under
diff --git a/ldap/admin/src/makevlvsearch b/ldap/admin/src/makevlvsearch
index 0423767d..45ee5a1f 100644
--- a/ldap/admin/src/makevlvsearch
+++ b/ldap/admin/src/makevlvsearch
@@ -1,4 +1,4 @@
-#!perl
+#!/usr/bin/env perl
#
# BEGIN COPYRIGHT BLOCK
# This Program is free software; you can redistribute it and/or modify it under
diff --git a/ldap/admin/src/migrateInstance b/ldap/admin/src/migrateInstance
index 14cd5a54..95cab4b1 100644
--- a/ldap/admin/src/migrateInstance
+++ b/ldap/admin/src/migrateInstance
@@ -1,4 +1,4 @@
-#!perl
+#!/usr/bin/env perl
#
# BEGIN COPYRIGHT BLOCK
# This Program is free software; you can redistribute it and/or modify it under
diff --git a/ldap/admin/src/migrateLocalDB b/ldap/admin/src/migrateLocalDB
index 522532ad..90e9a97f 100644
--- a/ldap/admin/src/migrateLocalDB
+++ b/ldap/admin/src/migrateLocalDB
@@ -1,4 +1,4 @@
-#!perl
+#!/usr/bin/env perl
#
# BEGIN COPYRIGHT BLOCK
# This Program is free software; you can redistribute it and/or modify it under
diff --git a/ldap/admin/src/migratePwdFile b/ldap/admin/src/migratePwdFile
index 7677012e..5b76381a 100644
--- a/ldap/admin/src/migratePwdFile
+++ b/ldap/admin/src/migratePwdFile
@@ -1,4 +1,4 @@
-#!perl
+#!/usr/bin/env perl
#
# BEGIN COPYRIGHT BLOCK
# This Program is free software; you can redistribute it and/or modify it under
diff --git a/ldap/admin/src/migrateTo4 b/ldap/admin/src/migrateTo4
index 22c17c52..ca8e3d14 100644
--- a/ldap/admin/src/migrateTo4
+++ b/ldap/admin/src/migrateTo4
@@ -1,4 +1,4 @@
-#!perl
+#!/usr/bin/env perl
#
# BEGIN COPYRIGHT BLOCK
# This Program is free software; you can redistribute it and/or modify it under
diff --git a/ldap/admin/src/migratedsgw b/ldap/admin/src/migratedsgw
index a15c580d..9801788c 100755
--- a/ldap/admin/src/migratedsgw
+++ b/ldap/admin/src/migratedsgw
@@ -1,4 +1,4 @@
-#!perl
+#!/usr/bin/env perl
#
# BEGIN COPYRIGHT BLOCK
# This Program is free software; you can redistribute it and/or modify it under
diff --git a/ldap/admin/src/ns-newpwpolicy.pl b/ldap/admin/src/ns-newpwpolicy.pl
index c91aa822..7a1a3c5d 100644
--- a/ldap/admin/src/ns-newpwpolicy.pl
+++ b/ldap/admin/src/ns-newpwpolicy.pl
@@ -1,4 +1,4 @@
-# perl script
+#!/usr/bin/env perl
#
# BEGIN COPYRIGHT BLOCK
# This Program is free software; you can redistribute it and/or modify it under
@@ -39,6 +39,28 @@
# END COPYRIGHT BLOCK
#
+# enable the use of our bundled perldap with our bundled ldapsdk libraries
+# all of this nonsense can be omitted if the mozldapsdk and perldap are
+# installed in the operating system locations (e.g. /usr/lib /usr/lib/perl5)
+BEGIN {
+ my $savedir = `pwd`;
+ my $dirname = `dirname $0`;
+ chdir $dirname;
+ my $sroot = `pwd`;
+ $sroot =~ s@/slapd-.*@@;
+ chomp($sroot);
+ chdir $savedir;
+ push @INC, "$sroot/lib/perl/arch", "$sroot/lib/perl";
+ if ($ENV{LD_LIBRARY_PATH}) {
+ $ENV{LD_LIBRARY_PATH} .= ":";
+ }
+ $ENV{LD_LIBRARY_PATH} .= "$sroot/shared/lib";
+ # this is only needed for HP/ux PA-RISC, but it doesn't hurt other platforms
+ if ($ENV{SHLIB_PATH}) {
+ $ENV{SHLIB_PATH} .= ":";
+ }
+ $ENV{SHLIB_PATH} .= "$sroot/shared/lib";
+}
# Add new password policy specific entries
#############################################################################
diff --git a/ldap/admin/src/scripts/template-cl-dump.pl b/ldap/admin/src/scripts/template-cl-dump.pl
index 009e6416..747a306a 100755
--- a/ldap/admin/src/scripts/template-cl-dump.pl
+++ b/ldap/admin/src/scripts/template-cl-dump.pl
@@ -96,6 +96,23 @@
# DSHOME/bin/slapd/admin/scripts
#
################################################################################
+# enable the use of our bundled perldap with our bundled ldapsdk libraries
+# all of this nonsense can be omitted if the mozldapsdk and perldap are
+# installed in the operating system locations (e.g. /usr/lib /usr/lib/perl5)
+BEGIN {
+ my $sroot = "{{DS-ROOT}}";
+ push @INC, "$sroot/lib/perl/arch", "$sroot/lib/perl";
+ if ($ENV{LD_LIBRARY_PATH}) {
+ $ENV{LD_LIBRARY_PATH} .= ":";
+ }
+ $ENV{LD_LIBRARY_PATH} .= "$sroot/shared/lib";
+ # this is only needed for HP/ux PA-RISC, but it doesn't hurt other platforms
+ if ($ENV{SHLIB_PATH}) {
+ $ENV{SHLIB_PATH} .= ":";
+ }
+ $ENV{SHLIB_PATH} .= "$sroot/shared/lib";
+}
+
$usage="Usage: $0 [-h host] [-p port] [-D bind-dn] [-w bind-password | -P bind-cert] [-r replica-roots] [-o output-file] [-c] [-v]\n\n $0 -i changelog-ldif-file-with-base64encoding [-o output-file] [-c]";
use Getopt::Std; # Parse command line arguments
diff --git a/ldap/admin/src/scripts/template-migrate50to51 b/ldap/admin/src/scripts/template-migrate50to51
index 518a978b..768860e8 100644
--- a/ldap/admin/src/scripts/template-migrate50to51
+++ b/ldap/admin/src/scripts/template-migrate50to51
@@ -39,6 +39,22 @@
# END COPYRIGHT BLOCK
#
+# enable the use of our bundled perldap with our bundled ldapsdk libraries
+# all of this nonsense can be omitted if the mozldapsdk and perldap are
+# installed in the operating system locations (e.g. /usr/lib /usr/lib/perl5)
+BEGIN {
+ my $sroot = "{{DS-ROOT}}";
+ push @INC, "$sroot/lib/perl/arch", "$sroot/lib/perl";
+ if ($ENV{LD_LIBRARY_PATH}) {
+ $ENV{LD_LIBRARY_PATH} .= ":";
+ }
+ $ENV{LD_LIBRARY_PATH} .= "$sroot/shared/lib";
+ # this is only needed for HP/ux PA-RISC, but it doesn't hurt other platforms
+ if ($ENV{SHLIB_PATH}) {
+ $ENV{SHLIB_PATH} .= ":";
+ }
+ $ENV{SHLIB_PATH} .= "$sroot/shared/lib";
+}
# Migrate a 5.0 directory server to a 5.1 directory server
#######################################################################################################
diff --git a/ldap/admin/src/scripts/template-migrate5to6 b/ldap/admin/src/scripts/template-migrate5to6
index 63c5774d..9a8b2577 100644
--- a/ldap/admin/src/scripts/template-migrate5to6
+++ b/ldap/admin/src/scripts/template-migrate5to6
@@ -39,6 +39,22 @@
# END COPYRIGHT BLOCK
#
+# enable the use of our bundled perldap with our bundled ldapsdk libraries
+# all of this nonsense can be omitted if the mozldapsdk and perldap are
+# installed in the operating system locations (e.g. /usr/lib /usr/lib/perl5)
+BEGIN {
+ my $sroot = "{{DS-ROOT}}";
+ push @INC, "$sroot/lib/perl/arch", "$sroot/lib/perl";
+ if ($ENV{LD_LIBRARY_PATH}) {
+ $ENV{LD_LIBRARY_PATH} .= ":";
+ }
+ $ENV{LD_LIBRARY_PATH} .= "$sroot/shared/lib";
+ # this is only needed for HP/ux PA-RISC, but it doesn't hurt other platforms
+ if ($ENV{SHLIB_PATH}) {
+ $ENV{SHLIB_PATH} .= ":";
+ }
+ $ENV{SHLIB_PATH} .= "$sroot/shared/lib";
+}
# Migrate a 5.x directory server to a 6.2 directory server
#######################################################################################################
diff --git a/ldap/admin/src/scripts/template-migrate5to7 b/ldap/admin/src/scripts/template-migrate5to7
index 622b2216..f2e10e2a 100644
--- a/ldap/admin/src/scripts/template-migrate5to7
+++ b/ldap/admin/src/scripts/template-migrate5to7
@@ -39,6 +39,22 @@
# END COPYRIGHT BLOCK
#
+# enable the use of our bundled perldap with our bundled ldapsdk libraries
+# all of this nonsense can be omitted if the mozldapsdk and perldap are
+# installed in the operating system locations (e.g. /usr/lib /usr/lib/perl5)
+BEGIN {
+ my $sroot = "{{DS-ROOT}}";
+ push @INC, "$sroot/lib/perl/arch", "$sroot/lib/perl";
+ if ($ENV{LD_LIBRARY_PATH}) {
+ $ENV{LD_LIBRARY_PATH} .= ":";
+ }
+ $ENV{LD_LIBRARY_PATH} .= "$sroot/shared/lib";
+ # this is only needed for HP/ux PA-RISC, but it doesn't hurt other platforms
+ if ($ENV{SHLIB_PATH}) {
+ $ENV{SHLIB_PATH} .= ":";
+ }
+ $ENV{SHLIB_PATH} .= "$sroot/shared/lib";
+}
# Migrate a 5.x directory server to a 7.0 directory server
#######################################################################################################
diff --git a/ldap/admin/src/scripts/template-migrate6to7 b/ldap/admin/src/scripts/template-migrate6to7
index da799610..284fac9e 100644
--- a/ldap/admin/src/scripts/template-migrate6to7
+++ b/ldap/admin/src/scripts/template-migrate6to7
@@ -39,6 +39,22 @@
# END COPYRIGHT BLOCK
#
+# enable the use of our bundled perldap with our bundled ldapsdk libraries
+# all of this nonsense can be omitted if the mozldapsdk and perldap are
+# installed in the operating system locations (e.g. /usr/lib /usr/lib/perl5)
+BEGIN {
+ my $sroot = "{{DS-ROOT}}";
+ push @INC, "$sroot/lib/perl/arch", "$sroot/lib/perl";
+ if ($ENV{LD_LIBRARY_PATH}) {
+ $ENV{LD_LIBRARY_PATH} .= ":";
+ }
+ $ENV{LD_LIBRARY_PATH} .= "$sroot/shared/lib";
+ # this is only needed for HP/ux PA-RISC, but it doesn't hurt other platforms
+ if ($ENV{SHLIB_PATH}) {
+ $ENV{SHLIB_PATH} .= ":";
+ }
+ $ENV{SHLIB_PATH} .= "$sroot/shared/lib";
+}
# Migrate a 6.x directory server to a 7.0 directory server
#######################################################################################################
diff --git a/ldap/admin/src/scripts/template-migrateInstance5 b/ldap/admin/src/scripts/template-migrateInstance5
index f7224e8a..7c3a7004 100644
--- a/ldap/admin/src/scripts/template-migrateInstance5
+++ b/ldap/admin/src/scripts/template-migrateInstance5
@@ -140,16 +140,6 @@ if (!(-d $serverHome)) {
exit(1);
}
$ENV{"$LIB_PATH"} = "$root${PATHSEP}lib${SEP}".$ENV{"$LIB_PATH"} ;
-if ($isSolaris9) {
- $ENV{"$LIB_PATH"} = "$root${PATHSEP}lib${PATHSEP}nsPerl5.005_03${PATHSEP}lib${PATHSEP}sun4-solaris${PATHSEP}CORE${SEP}".$ENV{"$LIB_PATH"} ;
-}
-
-if ($isNT) {
- $ENV{"PERL5LIB"} = "$root${PATHSEP}lib${PATHSEP}nsPerl5.005_03${PATHSEP}site${PATHSEP}lib${SEP}".$ENV{"PERL5LIB"} ;
-}
-else {
- $ENV{"PERL5LIB"} = "$root${PATHSEP}lib${PATHSEP}nsPerl5.005_03${PATHSEP}lib${PATHSEP}site${SEP}".$ENV{"PERL5LIB"} ;
-}
# get the version of the DS to migrate
($oldVersion, $oldMinor) = &getVersion($oldDir);
diff --git a/ldap/admin/src/scripts/template-migrateInstance6 b/ldap/admin/src/scripts/template-migrateInstance6
index 422e9450..fcca538e 100644
--- a/ldap/admin/src/scripts/template-migrateInstance6
+++ b/ldap/admin/src/scripts/template-migrateInstance6
@@ -144,16 +144,6 @@ if ($olddatadir && !(-d $olddatadir)) {
exit(1);
}
$ENV{"$LIB_PATH"} = "$root${PATHSEP}lib${SEP}".$ENV{"$LIB_PATH"} ;
-if ($isSolaris9) {
- $ENV{"$LIB_PATH"} = "$root${PATHSEP}lib${PATHSEP}nsPerl5.6.1${PATHSEP}lib${PATHSEP}sun4-solaris${PATHSEP}CORE${SEP}".$ENV{"$LIB_PATH"} ;
-}
-
-if ($isNT) {
- $ENV{"PERL5LIB"} = "$root${PATHSEP}lib${PATHSEP}nsPerl5.6.1${PATHSEP}site${PATHSEP}lib${SEP}".$ENV{"PERL5LIB"} ;
-}
-else {
- $ENV{"PERL5LIB"} = "$root${PATHSEP}lib${PATHSEP}nsPerl5.6.1${PATHSEP}lib${PATHSEP}site${SEP}".$ENV{"PERL5LIB"} ;
-}
# get the version of the DS to migrate
($oldVersion, $oldMinor) = &getVersion($oldDir, $oldversionstr);
diff --git a/ldap/admin/src/scripts/template-migrateInstance7 b/ldap/admin/src/scripts/template-migrateInstance7
index 2493a82e..acc0e987 100644
--- a/ldap/admin/src/scripts/template-migrateInstance7
+++ b/ldap/admin/src/scripts/template-migrateInstance7
@@ -144,16 +144,6 @@ if ($olddatadir && !(-d $olddatadir)) {
exit(1);
}
$ENV{"$LIB_PATH"} = "$root${PATHSEP}lib${SEP}".$ENV{"$LIB_PATH"} ;
-if ($isSolaris9) {
- $ENV{"$LIB_PATH"} = "$root${PATHSEP}lib${PATHSEP}nsPerl5.6.1${PATHSEP}lib${PATHSEP}sun4-solaris${PATHSEP}CORE${SEP}".$ENV{"$LIB_PATH"} ;
-}
-
-if ($isNT) {
- $ENV{"PERL5LIB"} = "$root${PATHSEP}lib${PATHSEP}nsPerl5.6.1${PATHSEP}site${PATHSEP}lib${SEP}".$ENV{"PERL5LIB"} ;
-}
-else {
- $ENV{"PERL5LIB"} = "$root${PATHSEP}lib${PATHSEP}nsPerl5.6.1${PATHSEP}lib${PATHSEP}site${SEP}".$ENV{"PERL5LIB"} ;
-}
# get the version of the DS to migrate
($oldVersion, $oldMinor) = &getVersion($oldDir, $oldversionstr);
diff --git a/ldap/admin/src/scripts/template-migrateTo5 b/ldap/admin/src/scripts/template-migrateTo5
index d9849525..320236ad 100755
--- a/ldap/admin/src/scripts/template-migrateTo5
+++ b/ldap/admin/src/scripts/template-migrateTo5
@@ -39,6 +39,22 @@
# END COPYRIGHT BLOCK
#
+# enable the use of our bundled perldap with our bundled ldapsdk libraries
+# all of this nonsense can be omitted if the mozldapsdk and perldap are
+# installed in the operating system locations (e.g. /usr/lib /usr/lib/perl5)
+BEGIN {
+ my $sroot = "{{DS-ROOT}}";
+ push @INC, "$sroot/lib/perl/arch", "$sroot/lib/perl";
+ if ($ENV{LD_LIBRARY_PATH}) {
+ $ENV{LD_LIBRARY_PATH} .= ":";
+ }
+ $ENV{LD_LIBRARY_PATH} .= "$sroot/shared/lib";
+ # this is only needed for HP/ux PA-RISC, but it doesn't hurt other platforms
+ if ($ENV{SHLIB_PATH}) {
+ $ENV{SHLIB_PATH} .= ":";
+ }
+ $ENV{SHLIB_PATH} .= "$sroot/shared/lib";
+}
# Migrate a 4.0 directory server to a 5.x directory server
########################################################################################################
diff --git a/ldap/admin/src/scripts/template-migrateTo6 b/ldap/admin/src/scripts/template-migrateTo6
index 2f1c8c95..eeeb9e69 100644
--- a/ldap/admin/src/scripts/template-migrateTo6
+++ b/ldap/admin/src/scripts/template-migrateTo6
@@ -39,6 +39,22 @@
# END COPYRIGHT BLOCK
#
+# enable the use of our bundled perldap with our bundled ldapsdk libraries
+# all of this nonsense can be omitted if the mozldapsdk and perldap are
+# installed in the operating system locations (e.g. /usr/lib /usr/lib/perl5)
+BEGIN {
+ my $sroot = "{{DS-ROOT}}";
+ push @INC, "$sroot/lib/perl/arch", "$sroot/lib/perl";
+ if ($ENV{LD_LIBRARY_PATH}) {
+ $ENV{LD_LIBRARY_PATH} .= ":";
+ }
+ $ENV{LD_LIBRARY_PATH} .= "$sroot/shared/lib";
+ # this is only needed for HP/ux PA-RISC, but it doesn't hurt other platforms
+ if ($ENV{SHLIB_PATH}) {
+ $ENV{SHLIB_PATH} .= ":";
+ }
+ $ENV{SHLIB_PATH} .= "$sroot/shared/lib";
+}
# Migrate a old directory server to a 6.2 directory server
########################################################################################################
diff --git a/ldap/admin/src/scripts/template-migrateTo7 b/ldap/admin/src/scripts/template-migrateTo7
index 4ee514e8..4a7b2c37 100644
--- a/ldap/admin/src/scripts/template-migrateTo7
+++ b/ldap/admin/src/scripts/template-migrateTo7
@@ -39,6 +39,22 @@
# END COPYRIGHT BLOCK
#
+# enable the use of our bundled perldap with our bundled ldapsdk libraries
+# all of this nonsense can be omitted if the mozldapsdk and perldap are
+# installed in the operating system locations (e.g. /usr/lib /usr/lib/perl5)
+BEGIN {
+ my $sroot = "{{DS-ROOT}}";
+ push @INC, "$sroot/lib/perl/arch", "$sroot/lib/perl";
+ if ($ENV{LD_LIBRARY_PATH}) {
+ $ENV{LD_LIBRARY_PATH} .= ":";
+ }
+ $ENV{LD_LIBRARY_PATH} .= "$sroot/shared/lib";
+ # this is only needed for HP/ux PA-RISC, but it doesn't hurt other platforms
+ if ($ENV{SHLIB_PATH}) {
+ $ENV{SHLIB_PATH} .= ":";
+ }
+ $ENV{SHLIB_PATH} .= "$sroot/shared/lib";
+}
# Migrate a old directory server to a 7.0 directory server
########################################################################################################
diff --git a/ldap/admin/src/scripts/template-ns-newpwpolicy.pl b/ldap/admin/src/scripts/template-ns-newpwpolicy.pl
index 55388f33..a15e595d 100755
--- a/ldap/admin/src/scripts/template-ns-newpwpolicy.pl
+++ b/ldap/admin/src/scripts/template-ns-newpwpolicy.pl
@@ -39,6 +39,22 @@
# END COPYRIGHT BLOCK
#
+# enable the use of our bundled perldap with our bundled ldapsdk libraries
+# all of this nonsense can be omitted if the mozldapsdk and perldap are
+# installed in the operating system locations (e.g. /usr/lib /usr/lib/perl5)
+BEGIN {
+ my $sroot = "{{DS-ROOT}}";
+ push @INC, "$sroot/lib/perl/arch", "$sroot/lib/perl";
+ if ($ENV{LD_LIBRARY_PATH}) {
+ $ENV{LD_LIBRARY_PATH} .= ":";
+ }
+ $ENV{LD_LIBRARY_PATH} .= "$sroot/shared/lib";
+ # this is only needed for HP/ux PA-RISC, but it doesn't hurt other platforms
+ if ($ENV{SHLIB_PATH}) {
+ $ENV{SHLIB_PATH} .= ":";
+ }
+ $ENV{SHLIB_PATH} .= "$sroot/shared/lib";
+}
# Add new password policy specific entries
#############################################################################
diff --git a/ldap/admin/src/scripts/template-repl-monitor-cgi.pl b/ldap/admin/src/scripts/template-repl-monitor-cgi.pl
index ad88c1e6..c9cbd92f 100755
--- a/ldap/admin/src/scripts/template-repl-monitor-cgi.pl
+++ b/ldap/admin/src/scripts/template-repl-monitor-cgi.pl
@@ -56,8 +56,8 @@ if ($cgiVars{'admurl'}) {
$params .= " -u \"$admurl\"";
}
$siteroot = $cgiVars{'siteroot'};
-$perl = "$siteroot/bin/slapd/admin/bin/perl";
-$ENV{'LD_LIBRARY_PATH'} = "$siteroot/lib:$siteroot/lib/nsPerl5.005_03/lib";
+$ENV{'LD_LIBRARY_PATH'} = "$siteroot/shared/lib";
+$ENV{'SHLIB_PATH'} = "$siteroot/shared/lib";
# Save user-specified parameters as cookies in monreplication.properties.
# Sync up with the property file so that monreplication2 is interval, and
@@ -65,8 +65,8 @@ $ENV{'LD_LIBRARY_PATH'} = "$siteroot/lib:$siteroot/lib/nsPerl5.005_03/lib";
$propertyfile = "$siteroot/bin/admin/admin/bin/property/monreplication.properties";
$edit1 = "s#monreplication2=.*#monreplication2=$cgiVars{'refreshinterval'}#;";
$edit2 = "s#^monreplication3=.*#monreplication3=$cgiVars{'configfile'}#;";
-system("$perl -p -i.bak -e \"$edit1\" -e \"$edit2\" $propertyfile");
+system("perl -p -i.bak -e \"$edit1\" -e \"$edit2\" $propertyfile");
# Now the real work
$replmon = "$siteroot/bin/slapd/admin/scripts/template-repl-monitor.pl";
-system("$perl $replmon $params");
+system("perl -I$siteroot/lib/perl/arch -I$siteroot/lib/perl $replmon $params");
diff --git a/ldap/admin/src/scripts/template-repl-monitor.pl b/ldap/admin/src/scripts/template-repl-monitor.pl
index 918c9271..60a7b7bd 100755
--- a/ldap/admin/src/scripts/template-repl-monitor.pl
+++ b/ldap/admin/src/scripts/template-repl-monitor.pl
@@ -146,16 +146,36 @@
# <DSHOME>/bin/slapd/admin/bin/perl repl-monitor.pl
#
# 3. Set environment variable PERL5LIB to your Perl lib dirs where
-# Mozilla::LDAP module can be located.
+# Mozilla::LDAP module can be located. This should be under serverroot/lib/perl
+# e.g. PERL5LIB="serverroot/lib/perl/arch:serverroot/lib/perl"
#
-# 4. Invoke the script as follows if <MYPERLDIR>/lib/site contains
-# Mozilla/LDAP:
-# <MYPERLDIR>/bin/perl -I <MYPERLDIR>/lib/site repl-monitor.pl
+# 4. Set LD_LIBRARY_PATH (or SHLIB_PATH) to point to the location of our
+# bundled shared libraries e.g. LD_LIBRARY_PATH="serverroot/shared/lib"
#
-# If you get error "Can't load ...", try to set environment variable
-# for library path to <DSHOME>/lib:<DSHOME>/lib/nsPerl5.005_03/lib
+# 5. Invoke the script as follows if <MYPERLDIR> (serverroot/lib/perl) contains
+# Mozilla/LDAP:
+# <MYPERLDIR>/bin/perl -I <MYPERLDIR>/arch -I <MYPERLDIR> repl-monitor.pl
#
#############################################################################
+# enable the use of our bundled perldap with our bundled ldapsdk libraries
+# all of this nonsense can be omitted if the mozldapsdk and perldap are
+# installed in the operating system locations (e.g. /usr/lib /usr/lib/perl5)
+# this script is always invoked by repl-monitor-cgi.pl, which sets all of these
+# If using this script standalone, be sure to set the shared lib path and
+# the path to the perldap modules.
+# BEGIN {
+# my $sroot = "{{DS-ROOT}}";
+# push @INC, "$sroot/lib/perl/arch", "$sroot/lib/perl";
+# if ($ENV{LD_LIBRARY_PATH}) {
+# $ENV{LD_LIBRARY_PATH} .= ":";
+# }
+# $ENV{LD_LIBRARY_PATH} .= "$sroot/shared/lib";
+# # this is only needed for HP/ux PA-RISC, but it doesn't hurt other platforms
+# if ($ENV{SHLIB_PATH}) {
+# $ENV{SHLIB_PATH} .= ":";
+# }
+# $ENV{SHLIB_PATH} .= "$sroot/shared/lib";
+# }
$usage = "\nusage: $0 -f configuration-file [-h host] [-p port] [-r] [-u refresh-url] [-t refresh-interval]\n\nor : $0 -v\n";
use Getopt::Std; # parse command line arguments
diff --git a/ldap/admin/src/scripts/template-verify-db.pl b/ldap/admin/src/scripts/template-verify-db.pl
index 4004f5ae..a95ff21e 100644
--- a/ldap/admin/src/scripts/template-verify-db.pl
+++ b/ldap/admin/src/scripts/template-verify-db.pl
@@ -95,6 +95,13 @@ sub getLastLogfile
return \$logfile;
}
+$isWin = -d '\\';
+if ($isWin) {
+ $NULL = "nul";
+} else {
+ $NULL = "/dev/null";
+}
+
print("*****************************************************************\n");
print("verify-db: This tool should only be run if recovery start fails\n" .
"and the server is down. If you run this tool while the server is\n" .
@@ -109,7 +116,7 @@ for (my $i = 0; $i < @$dbdirs; $i++)
{
# run ../bin/slapd/server/db_printlog -h <dbdir> for each <dbdir>
print "Verify log files in $$dbdirs[$i] ... ";
- open(PRINTLOG, "..{{SEP}}bin{{SEP}}slapd{{SEP}}server{{SEP}}db_printlog -h $$dbdirs[$i] 2>&1 1> nul |");
+ open(PRINTLOG, "..{{SEP}}bin{{SEP}}slapd{{SEP}}server{{SEP}}db_printlog -h $$dbdirs[$i] 2>&1 1> $NULL |");
sleep 1;
my $haserr = 0;
while ($l = <PRINTLOG>)
@@ -147,7 +154,7 @@ for (my $i = 0; $i < @$dbdirs; $i++)
{
my $thisdb = $$dbdirs[$i] . "{{SEP}}" . $db;
print "Verify $thisdb ... ";
- open(DBVERIFY, "..{{SEP}}bin{{SEP}}slapd{{SEP}}server{{SEP}}db_verify $thisdb 2>&1 1> nul |");
+ open(DBVERIFY, "..{{SEP}}bin{{SEP}}slapd{{SEP}}server{{SEP}}db_verify $thisdb 2>&1 1> $NULL |");
sleep 1;
my $haserr = 0;
while ($l = <DBVERIFY>)
@@ -188,7 +195,7 @@ for (my $i = 0; $i < @$dbdirs; $i++)
{
my $thisdb = $$instdirs[$j] . "{{SEP}}" . $db;
print "Verify $thisdb ... ";
- open(DBVERIFY, "..{{SEP}}bin{{SEP}}slapd{{SEP}}server{{SEP}}db_verify $thisdb 2>&1 1> null |");
+ open(DBVERIFY, "..{{SEP}}bin{{SEP}}slapd{{SEP}}server{{SEP}}db_verify $thisdb 2>&1 1> $NULL |");
sleep 1;
my $haserr = 0;
while ($l = <DBVERIFY>)
diff --git a/ldap/admin/src/updatedsgw b/ldap/admin/src/updatedsgw
index a0318d32..e7b055ba 100755
--- a/ldap/admin/src/updatedsgw
+++ b/ldap/admin/src/updatedsgw
@@ -1,4 +1,4 @@
-#!perl
+#!/usr/bin/env perl
#
# BEGIN COPYRIGHT BLOCK
# This Program is free software; you can redistribute it and/or modify it under
diff --git a/ldap/admin/src/upgradeServer b/ldap/admin/src/upgradeServer
index 7a462189..afc26606 100755
--- a/ldap/admin/src/upgradeServer
+++ b/ldap/admin/src/upgradeServer
@@ -1,4 +1,4 @@
-#!perl
+#!/usr/bin/env perl
#
# BEGIN COPYRIGHT BLOCK
# This Program is free software; you can redistribute it and/or modify it under
@@ -266,7 +266,7 @@ sub get_changelog_dir {
last; # not found, just abort
}
if ($inClEntry && /^nsslapd-changelogdir:\s*/i) {
- $clDir = $';
+ $clDir = $'; #'
chomp($clDir);
last;
}
@@ -407,6 +407,48 @@ sub getChangelogVersion {
return $version;
}
+sub instantiate_new_package_scripts {
+
+ my @newtemplates = (
+ "$sroot/bin/slapd/admin/scripts/template-cl-dump.pl",
+ "$sroot/bin/slapd/admin/scripts/template-migrate5to7",
+ "$sroot/bin/slapd/admin/scripts/template-migrate6to7",
+ "$sroot/bin/slapd/admin/scripts/template-migrateInstance7",
+ "$sroot/bin/slapd/admin/scripts/template-migrateTo4",
+ "$sroot/bin/slapd/admin/scripts/template-migrateTo7",
+ "$sroot/bin/slapd/admin/scripts/template-repl-monitor-cgi.pl",
+ );
+
+ foreach $src ( @newtemplates ) {
+ $dest = "$sroot/bin/slapd/admin/bin/$1" if $src =~ /.*template-(.*)$/;
+ # repl mon cgi script goes in bin/admin/admin/bin
+ if ($src =~ /repl-monitor-cgi.pl/) {
+ $dest =~ s@/bin/slapd/admin/bin/@/bin/admin/admin/bin/@;
+ }
+ unless ( open ( template, $src )) {
+ print "Can't open $src: $!\n";
+ next;
+ }
+ unless ( open ( target, ">$dest" )) {
+ print "Can't open $dest: $!\n";
+ close template;
+ next;
+ }
+ while ( <template> ) {
+ s#{{PERL-EXEC}}#!/usr/bin/env perl#g;
+ s#{{DS-ROOT}}#$sroot#g;
+ s#{{SEP}}#${PS}#g;
+ print target;
+ }
+ close template;
+ close target;
+
+ chmod 0755, $dest;
+ }
+
+ return 0;
+}
+
#
# Some scripts generated by create_instance may not
# get generated during in-place upgrade. This function
@@ -418,8 +460,18 @@ sub getChangelogVersion {
#
sub instantiate_new_scripts {
- @newtemplates = (
- "$sroot/bin/slapd/admin/scripts/template-db2index.pl"
+ my @newtemplates = (
+ "$sroot/bin/slapd/admin/scripts/template-verify-db.pl",
+ "$sroot/bin/slapd/admin/scripts/template-db2index.pl",
+ "$sroot/bin/slapd/admin/scripts/template-bak2db.pl",
+ "$sroot/bin/slapd/admin/scripts/template-db2bak.pl",
+ "$sroot/bin/slapd/admin/scripts/template-db2ldif.pl",
+ "$sroot/bin/slapd/admin/scripts/template-dsml-activate.pl",
+ "$sroot/bin/slapd/admin/scripts/template-ldif2db.pl",
+ "$sroot/bin/slapd/admin/scripts/template-ns-accountstatus.pl",
+ "$sroot/bin/slapd/admin/scripts/template-ns-activate.pl",
+ "$sroot/bin/slapd/admin/scripts/template-ns-inactivate.pl",
+ "$sroot/bin/slapd/admin/scripts/template-ns-newpwpolicy.pl"
);
$host = localhost;
@@ -444,7 +496,7 @@ sub instantiate_new_scripts {
next;
}
while ( <template> ) {
- s#{{PERL-EXEC}}#!$sroot/bin/slapd/admin/bin/perl#g;
+ s#{{PERL-EXEC}}#!/usr/bin/env perl#g;
s#{{DS-ROOT}}#$sroot#g;
s#{{SEP}}#${PS}#g;
s#{{ROOT-DN}}#$rootdn#g;
@@ -460,20 +512,28 @@ sub instantiate_new_scripts {
}
# copy schema is safe even if same version
-copy_schema_files;
+copy_schema_files if ($prefix);
# modify only if necessary
-modify_dse_ldif;
+modify_dse_ldif if ($prefix);
# fix changelog is safe even if same version - no op
-my $clDir = get_changelog_dir;
-if ($clDir && -d $clDir) {
- my $oldclversion = getChangelogVersion($clDir);
- my $clversion = "2.0"; # with DS 6.1
-
- if ($oldclversion < $clversion) {
- fix_changelog($clDir, $clversion);
- }
+if ($prefix) {
+ my $clDir = get_changelog_dir;
+ if ($clDir && -d $clDir) {
+ my $oldclversion = getChangelogVersion($clDir);
+ my $clversion = "2.0"; # with DS 6.1
+
+ if ($oldclversion < $clversion) {
+ fix_changelog($clDir, $clversion);
+ }
+ }
}
-instantiate_new_scripts ();
+# fix instance specific scripts
+if ($prefix) {
+ instantiate_new_scripts ();
+} else {
+# fix non instance specific (package) scripts
+ instantiate_new_package_scripts ();
+}
diff --git a/ldap/clients/orgchart/myorg.pl b/ldap/clients/orgchart/myorg.pl
index 6a0561f2..e00fd5ba 100755
--- a/ldap/clients/orgchart/myorg.pl
+++ b/ldap/clients/orgchart/myorg.pl
@@ -1,4 +1,4 @@
-#!../../../bin/slapd/admin/bin/perl
+#!/usr/bin/env perl
#
# BEGIN COPYRIGHT BLOCK
# This Program is free software; you can redistribute it and/or modify it under
diff --git a/ldap/clients/orgchart/org.pl b/ldap/clients/orgchart/org.pl
index 44e649bd..af1928e1 100755
--- a/ldap/clients/orgchart/org.pl
+++ b/ldap/clients/orgchart/org.pl
@@ -1,4 +1,4 @@
-#!../../../bin/slapd/admin/bin/perl
+#!/usr/bin/env perl
#
# BEGIN COPYRIGHT BLOCK
# This Program is free software; you can redistribute it and/or modify it under
@@ -41,6 +41,29 @@
#
#set ts=4
+# enable the use of our bundled perldap with our bundled ldapsdk libraries
+# all of this nonsense can be omitted if the mozldapsdk and perldap are
+# installed in the operating system locations (e.g. /usr/lib /usr/lib/perl5)
+BEGIN {
+ my $savedir = `pwd`;
+ my $dirname = `dirname $0`;
+ chdir $dirname;
+ my $sroot = `pwd`;
+ $sroot =~ s@/clients/orgchart/bin*@@;
+ chomp($sroot);
+ chdir $savedir;
+ push @INC, "$sroot/lib/perl/arch", "$sroot/lib/perl";
+ if ($ENV{LD_LIBRARY_PATH}) {
+ $ENV{LD_LIBRARY_PATH} .= ":";
+ }
+ $ENV{LD_LIBRARY_PATH} .= "$sroot/shared/lib";
+ # this is only needed for HP/ux PA-RISC, but it doesn't hurt other platforms
+ if ($ENV{SHLIB_PATH}) {
+ $ENV{SHLIB_PATH} .= ":";
+ }
+ $ENV{SHLIB_PATH} .= "$sroot/shared/lib";
+}
+
# ------------
#
# Notes for anybody reading the code below:
diff --git a/ldap/cm/Makefile b/ldap/cm/Makefile
index 70bb9f55..6764e876 100644
--- a/ldap/cm/Makefile
+++ b/ldap/cm/Makefile
@@ -185,6 +185,10 @@ DOTEXE = .exe
PACKAGE_STAGE_DIR=$(OBJDIR)/package
endif
+ifdef INTERNAL_BUILD
+ PERLDAP := perldap
+endif
+
# these are files and directories in the import adminsrv directory which we don't
# make a local copy of, we just import directly into the tar file or create a
# symlink to
@@ -565,29 +569,6 @@ ifdef INTERNAL_BUILD
$(PERL) -w fixPerlDAPInf.pl $(dir $@)/perldap.inf
endif
-# this is the rule to pull nsPerl
-ifndef NSPERL_PULL_METHOD
-NSPERL_PULL_METHOD = FTP
-endif
-
-$(INSTDIR)/nsperl/$(NSPERL_ZIP_FILE):
-ifdef INTERNAL_BUILD
- $(RM) $@
- $(FTP_PULL) -method $(NSPERL_PULL_METHOD) \
- -objdir $(dir $@) \
- -componentdir $(NSPERL_COMPONENT_DIR) \
- -files $(notdir $@),nsperl.inf
- @if [ ! -f $@ ] ; \
- then echo "Error: could not get component NSPERL file $@" ; \
- exit 1 ; \
- fi
- $(PERL) -w fixNSPerlInf.pl $(dir $@)/nsperl.inf nsperl561
-# one more hack to nsperl - we must remove LDIF.pm because it
-# conflicts with the one in perldap - bug 600138
-# SITEHACK is defined in nsperl.mk
-# $(ZIP) -d $(dir $@)/$(NSPERL_ZIP_FILE) lib/nsPerl5.6.1/$(SITEHACK)/Mozilla/LDAP/LDIF.pm
-endif
-
$(INSTDIR)/slapd:
$(MKDIR) -p $@
@@ -597,7 +578,6 @@ ifneq ($(ARCH), WINNT)
# ---THE UNIX PACKAGE---
packageDirectory: $(INSTDIR)/slapd \
- $(INSTDIR)/nsperl/$(NSPERL_ZIP_FILE) \
$(INSTDIR)/perldap/$(PERLDAP_ZIP_FILE) \
$(ADMSERV_DEP)
@@ -712,15 +692,15 @@ ifndef NO_INSTALLER_TAR_FILES
# build the combined packages tar file; use h flag to follow symlinks
ifdef BUILD_SHIP
ifndef BUILD_PATCH
- cd $(INSTDIR); $(TAR) cvfh - setup.inf setup slapd nsperl \
- perldap dsktune $(ADMIN_IMPORTS) | gzip -f > $(BUILD_SHIP)/$(FTPNAMEGZ)
+ cd $(INSTDIR); $(TAR) cvfh - setup.inf setup slapd \
+ $(PERLDAP) dsktune $(ADMIN_IMPORTS) | gzip -f > $(BUILD_SHIP)/$(FTPNAMEGZ)
endif
ifeq ($(DEBUG), optimize)
# $(REMSH) "/u/svbld/bin/preRtm $(BUILD_SHIP) $(FTPNAMEGZ) svbld"
endif
else
- cd $(INSTDIR); $(TAR) cvfh - setup.inf setup slapd nsperl \
- perldap dsktune $(ADMIN_IMPORTS) | gzip -f > ../all$(NS_BUILD_FLAVOR).tar.gz
+ cd $(INSTDIR); $(TAR) cvfh - setup.inf setup slapd \
+ $(PERLDAP) dsktune $(ADMIN_IMPORTS) | gzip -f > ../all$(NS_BUILD_FLAVOR).tar.gz
endif # BUILD_SHIP
#cp $(INSTDIR).tar.gz $(BUILD_SHIP)
#cp $(INSTDIR)/all$(NS_BUILD_FLAVOR).tar.gz $(BUILD_SHIP)
@@ -891,8 +871,7 @@ ifeq ($(ARCH), WINNT)
SLAPD_DIR=slapd
-_perl: $(INSTDIR)/nsperl/$(NSPERL_ZIP_FILE) \
- $(INSTDIR)/perldap/$(PERLDAP_ZIP_FILE)
+_perl: $(INSTDIR)/perldap/$(PERLDAP_ZIP_FILE)
# ------------------------- all below this line is packageDirectory --------------------------
diff --git a/ldap/cm/fixSetupInf.pl b/ldap/cm/fixSetupInf.pl
index 50ee87f8..ca9b990b 100644
--- a/ldap/cm/fixSetupInf.pl
+++ b/ldap/cm/fixSetupInf.pl
@@ -65,10 +65,6 @@ while ( <FILE> ) {
$_ .= ", slapd";
$addedSlapd = 1;
}
- if (! /nsperl/) {
- $_ .= ", nsperl";
- $addedNSperl = 1;
- }
if (! /perldap/) {
$_ .= ", perldap";
$addedPerLDAP = 1;
@@ -99,11 +95,6 @@ if ($addedSlapd) {
print OUT "ComponentInfoFile = slapd/slapd.inf\n";
}
-if ($addedNSperl) {
- print OUT "\n[nsperl]\n";
- print OUT "ComponentInfoFile = nsperl/nsperl.inf\n";
-}
-
if ($addedPerLDAP) {
print OUT "\n[perldap]\n";
print OUT "ComponentInfoFile = perldap/perldap.inf\n";
diff --git a/ldap/cm/newinst/ns-update b/ldap/cm/newinst/ns-update
index 24676d6a..ba283995 100755
--- a/ldap/cm/newinst/ns-update
+++ b/ldap/cm/newinst/ns-update
@@ -44,7 +44,7 @@
# dependencies
sroot=`echo $0 | sed s#/bin/slapd/admin/bin/.\*##g`
-PERL=$sroot/bin/slapd/admin/bin/perl
+PERL=perl # just use perl from PATH
start_server()
{
@@ -60,18 +60,6 @@ start_server()
cd $cwd
}
-install_nsperl()
-{
- # the current version of nsPerl to use is defined in the slapd.inf
- nsperlinst=`grep '^NSPerlPostInstall' setup/slapd/slapd.inf | cut -f2 -d= 2> /dev/null`
- if [ "$nsperlinst" ]; then
- # run the nsperl installer
- $nsperlinst > setup/nsperl/install.log
- # use nsperl as our local copy of perl
- cp `dirname $nsperlinst`/nsperl $PERL
- fi
-}
-
wrap_security_tools()
{
cwd=`pwd`
@@ -148,8 +136,6 @@ if [ "$iDSISolaris" = "" ]; then
fi
done
fi
-
- install_nsperl
fi
if [ $reconfig ] ; then
@@ -171,6 +157,8 @@ if [ $reconfig ] ; then
start_server $sroot $dir
echo ""
done
+ # fix any non-instance specific files - omit server instance argument
+ $PERL $sroot/bin/slapd/admin/bin/upgradeServer $sroot
fi
wrap_security_tools $sroot
diff --git a/ldap/cm/newinst/setup.sh b/ldap/cm/newinst/setup.sh
index b5c9b6a3..640d416b 100755
--- a/ldap/cm/newinst/setup.sh
+++ b/ldap/cm/newinst/setup.sh
@@ -39,11 +39,5 @@
setupdir=`dirname $0`
cd ${setupdir}
-# Configure nsPerl
-if [ ! -f "./tools/perl" ]; then
- ./tools/nsPerl5.6.1/install > /dev/null
- ln -s ./nsPerl5.6.1/nsperl ./tools/perl
-fi
-
# Kick off setup script
./setup.pl $*
diff --git a/ldap/cm/newinst/slapd.inf b/ldap/cm/newinst/slapd.inf
index c3c826e3..863c8ab7 100644
--- a/ldap/cm/newinst/slapd.inf
+++ b/ldap/cm/newinst/slapd.inf
@@ -52,7 +52,7 @@ Expires= %%%PUMPKIN_HOUR%%%
Security= %%%SECURITY%%%
Vendor= Fedora Project
Description= %%%SERVER_NAME%%%
-Dependencies= base/4.5, svrcore/4.5, nsperl561/1.13, perldap14/1.01
+Dependencies= base/4.5, svrcore/4.5
ProductName=Directory Server
IsDirLite=%%%IS_DIR_LITE%%%
SourcePath=slapd
@@ -65,7 +65,6 @@ PostUninstall=
Checked=True
Mandatory=False
IsLdap=True
-NSPerlPostInstall=lib/nsPerl5.6.1/install
[slapd-client]
Name= Fedora Directory Server Console
diff --git a/ldap/cm/newinstnt/slapd.inf b/ldap/cm/newinstnt/slapd.inf
index b3df80ae..fc2917a3 100644
--- a/ldap/cm/newinstnt/slapd.inf
+++ b/ldap/cm/newinstnt/slapd.inf
@@ -55,7 +55,7 @@ Security= %%%SECURITY%%%
Vendor=Fedora Project
Description=Fedora Directory Server
DefaultAcceptLanguage=en
-Dependencies=admin/4.5,nsperl561/1.10,perldap14/1.01
+Dependencies=admin/4.5
Revision=
Checked=TRUE
IsLdap=TRUE
@@ -75,7 +75,6 @@ ReadGlobalCache=DSINST_ReadGlobalCache
PostInstall=DSINST_PostInstall
PreUninstall=DSINST_PreUnInstall
PostUninstall=DSINST_PostUnInstall
-NSPerlPostInstall=lib\nsPerl5.6.1\install.bat
[slapd-client]
NickName=slapd-client
diff --git a/ldap/ldif/commonTasks.ldif b/ldap/ldif/commonTasks.ldif
index 94ef71d7..d0027e1a 100644
--- a/ldap/ldif/commonTasks.ldif
+++ b/ldap/ldif/commonTasks.ldif
@@ -56,7 +56,7 @@ dn: cn=Migrate, cn=Operation, cn=Tasks
objectclass: top
objectclass: nstask
objectclass: nsAdminObject
-nsexecref: perl?migrateInstance
+nsexecref: migrateInstance
dn: cn=Create, cn=Operation, cn=Tasks
objectclass: top
@@ -68,10 +68,10 @@ dn: cn=GetConfigInfo, cn=Operation, cn=Tasks
objectclass: top
objectclass: nstask
objectclass: nsAdminObject
-nsexecref: perl?getConfigInfo
+nsexecref: getConfigInfo
dn: cn=MigrateLocalDB, cn=Operation, cn=Tasks
objectclass: top
objectclass: nstask
objectclass: nsAdminObject
-nsexecref: perl?migrateLocalDB
+nsexecref: migrateLocalDB
diff --git a/ldap/ldif/tasks.ldif b/ldap/ldif/tasks.ldif
index 7bd01791..5c3d8740 100644
--- a/ldap/ldif/tasks.ldif
+++ b/ldap/ldif/tasks.ldif
@@ -133,7 +133,7 @@ dn: cn=ViewLog, cn=operation, cn=Tasks
objectclass: top
objectclass: nstask
objectclass: nsAdminObject
-nsexecref: perl?ds_viewlog.pl
+nsexecref: ds_viewlog.pl
dn: cn=ListBackups, cn=operation, cn=Tasks
objectclass: top
diff --git a/nsperl.mk b/nsperl.mk
index adbbf3e8..b7b06001 100755
--- a/nsperl.mk
+++ b/nsperl.mk
@@ -39,8 +39,6 @@
#
NSPERL_RELDATE := 20020626
-NSPERL_VERSION := nsPerl5.6.1
-NSPERL_COMPONENT_DIR = $(COMPONENTS_DIR)/nsPerl/$(NSPERL_RELDATE)/$(NSOBJDIR_NAME_32)
# default; will be redefined below for specific platform
#PERL=$(NSPERL_COMPONENT_DIR)/lib/$(NSPERL_VERSION)/nsperl
PERL=/share/builds/sbstools/nsPerl/$(NSPERL_RELDATE)/$(NSOBJDIR_NAME_32)/nsperl
@@ -55,66 +53,3 @@ endif
ifdef USE_PERL_FROM_PATH
PERL = $(shell perl -e 'print "$$\n"')
endif
-
-NSPERL_ZIP_FILE = nsperl561.zip
-
-# This makefile sets up the environment so that we can build and link
-# perl xsubs. It assumes that you have a perl base directory that has
-# a bin and lib subdir and that which perl yields base dir/bin/perl[.exe]
-# also, this is only really necessary for NT, since this usually just
-# works in the NFS world of unix
-# for unix, we derive the paths from the Config information
-ifdef USE_OLD_NTPERL
-PERL_EXE = $(shell $(PERL) -e '($$foo = $$) =~ s@\\@/@g ; print "$$foo\n"')
-PERL_EXENT = $(subst \,/,$(PERL_EXE))
-PERL_BASEDIR = $(dir $(PERL_EXENT))
-PERL_ROOT = $(subst /bin/,,$(PERL_BASEDIR))
-IS_ACTIVESTATE = $(shell $(PERL) -v | grep -i activestate)
-else
-PERL_CONFIG = $(shell $(PERL) -e 'use Config; foreach $$item (qw(installprivlib installarchlib installsitelib installsitearch prefixexp)) { ($$foo = $$Config{$$item}) =~ s@\\@/@g ; print "$$foo "; } print "\\\n"')
-PERL_LIB = $(word 1, $(PERL_CONFIG))
-PERL_ARCHLIB = $(word 2, $(PERL_CONFIG))
-SITELIB = $(word 3, $(PERL_CONFIG))
-SITEARCH = $(word 4, $(PERL_CONFIG))
-PERL_ROOT = $(word 5, $(PERL_CONFIG))
-endif
-
-ifdef USE_OLD_NTPERL
-PERL_LIB = $(PERL_ROOT)/lib
-PERL_ARCHLIB = $(PERL_LIB)
-PERL_SITE = site
-SITELIB = $(PERL_ROOT)/$(PERL_SITE)/lib
-SITEARCH = $(SITELIB)
-endif
-
-INSTALLSITEARCH = $(SITEARCH)
-INSTALLSITELIB = $(SITELIB)
-SITEARCHEXP = $(SITEARCH)
-SITELIBEXP = $(SITELIB)
-XSUBPPDIR = $(PERL_LIB)/ExtUtils
-XSUBPP = $(XSUBPPDIR)/xsubpp
-XSPROTOARG =
-XSUBPPDEPS = $(XSUBPPDIR)/typemap
-XSUBPPARGS = -typemap $(XSUBPPDIR)/typemap
-PERL_INC = -I$(PERL_ARCHLIB)/CORE
-
-SITEHACK = $(subst $(PERL_ROOT)/,,$(SITELIB))
-ARCHHACK = $(subst $(PERL_ROOT)/,,$(PERL_ARCHLIB))
-
-ifeq ($(ARCH), WINNT)
-ifdef IS_ACTIVESTATE
-# C compilation/linking does not work for activestate; force C++
-PERL_CFLAGS = -TP -D_CONSOLE -DNO_STRICT -DPERL_OBJECT
-ifeq ($(DEBUG), full)
-PERL_CFLAGS += -DNDEBUG
-endif
-LIBPERL_A = /LIBPATH:$(PERL_ARCHLIB)/CORE perlCAPI.lib perlcore.lib PerlCRT.lib
-else
-LIBPERL_A = /LIBPATH:$(PERL_ARCHLIB)/CORE perl56.lib
-endif
-else
-ifeq ($(DEBUG), full)
-PERL_CFLAGS = -UDEBUG
-endif
-LIBPERL_A = -L$(PERL_ARCHLIB)/CORE -lperl
-endif