From 5b1c8e7a5fa24b8da554ea86d962af1b0f70d6b4 Mon Sep 17 00:00:00 2001 From: William Brown Date: Aug 23 2017 04:01:15 +0000 Subject: Ticket 49348 - support perlless and wrapperless install Bug Description: We have a number of shell wrappers that now server no purpose - they existed to support non-standard library paths, but this issue is not true of autotools in 2017. We also want to remove perl in favour of python. This adds a non-default option to produce a perl-less server install, which will force us to adapt our lib389 test suites to workout without the perl tools. Fix Description: Add support for a "--disable-perl" flag to configure. Remove the shell library wrappers, and rename the targets in makefile. Fix an issue in task.c and main.c with normdn and error message clarity. Finally, the major component was improvements and polish to the basic_test suite to fully support python 3 with a perl-less install. See also: https://pagure.io/lib389/issue/88 https://pagure.io/389-ds-base/issue/49348 Author: wibrown Review by: mreynolds (THanks!) --- diff --git a/Makefile.am b/Makefile.am index 26f1a27..89b16ea 100644 --- a/Makefile.am +++ b/Makefile.am @@ -60,7 +60,6 @@ else WITH_SYSTEMD = 0 endif - # these paths are dependent on the settings of prefix and exec_prefix which may be specified # at make time. So we cannot use AC_DEFINE in the configure.ac because that would set the # values prior to their being defined. Defining them here ensures that they are properly @@ -278,10 +277,17 @@ defaultgroup=@defaultgroup@ #------------------------ # Build Products #------------------------ -sbin_PROGRAMS = ns-slapd ldap-agent-bin +sbin_PROGRAMS = ns-slapd ldap-agent -bin_PROGRAMS = dbscan-bin dsktune-bin infadd-bin ldclt-bin \ - ldif-bin migratecred-bin mmldif-bin pwdhash-bin rsearch-bin +bin_PROGRAMS = dbscan \ + dsktune \ + infadd \ + ldclt \ + ldif \ + migratecred \ + mmldif \ + pwdhash \ + rsearch server_LTLIBRARIES = libsds.la libnunc-stans.la libldaputil.la libslapd.la libns-dshttpd.la @@ -331,10 +337,6 @@ serverplugin_LTLIBRARIES = libacl-plugin.la \ $(LIBPAM_PASSTHRU_PLUGIN) $(LIBDNA_PLUGIN) \ $(LIBBITWISE_PLUGIN) $(LIBPRESENCE_PLUGIN) $(LIBPOSIX_WINSYNC_PLUGIN) -nodist_property_DATA = ns-slapd.properties - -noinst_PROGRAMS = makstrdb - noinst_LIBRARIES = libavl.a dist_noinst_HEADERS = \ @@ -557,12 +559,9 @@ endif dist_noinst_DATA = \ $(srcdir)/buildnum.pl \ - $(srcdir)/ldap/admin/src/*.pl \ $(srcdir)/ldap/admin/src/*.in \ $(srcdir)/ldap/admin/src/scripts/*.in \ $(srcdir)/ldap/admin/src/scripts/*.ldif \ - $(srcdir)/ldap/admin/src/scripts/*.pl \ - $(srcdir)/ldap/admin/src/scripts/*.pm \ $(srcdir)/ldap/admin/src/scripts/*.py \ $(srcdir)/ldap/admin/src/scripts/*.sh \ $(srcdir)/ldap/admin/src/scripts/ds-replcheck \ @@ -571,8 +570,6 @@ dist_noinst_DATA = \ $(srcdir)/ldap/ldif/*.ldif \ $(srcdir)/ldap/schema/*.ldif \ $(srcdir)/ldap/schema/slapd-collations.conf \ - $(srcdir)/ldap/servers/slapd/mkDBErrStrs.pl \ - $(srcdir)/ldap/servers/slapd/tools/rsearch/scripts/dbgen* \ $(srcdir)/ldap/servers/snmp/ldap-agent.conf \ $(srcdir)/ldap/servers/snmp/redhat-directory.mib \ $(srcdir)/lib/ldaputil/certmap.conf \ @@ -587,8 +584,16 @@ dist_noinst_DATA = \ $(srcdir)/setup.py.in \ $(srcdir)/wrappers/*.in \ $(srcdir)/wrappers/systemd.template.sysconfig \ - $(srcdir)/dirsrvtests \ - $(NULL) + $(srcdir)/dirsrvtests + +if ENABLE_PERL +dist_noinst_DATA += \ + $(srcdir)/ldap/admin/src/*.pl \ + $(srcdir)/ldap/admin/src/scripts/*.pl \ + $(srcdir)/ldap/admin/src/scripts/*.pm \ + $(srcdir)/ldap/servers/slapd/mkDBErrStrs.pl \ + $(srcdir)/ldap/servers/slapd/tools/rsearch/scripts/dbgen* +endif #------------------------ # Installed Files @@ -683,7 +688,12 @@ systemschema_DATA = $(srcdir)/ldap/schema/00core.ldif \ schema_DATA = $(srcdir)/ldap/schema/99user.ldif -sbin_SCRIPTS = ldap/admin/src/scripts/setup-ds.pl \ +sbin_SCRIPTS = ldap/admin/src/scripts/ds_selinux_enabled \ + ldap/admin/src/scripts/ds_selinux_port_query \ + wrappers/ds_systemd_ask_password_acl + +if ENABLE_PERL +sbin_SCRIPTS += ldap/admin/src/scripts/setup-ds.pl \ ldap/admin/src/scripts/migrate-ds.pl \ ldap/admin/src/scripts/remove-ds.pl \ ldap/admin/src/scripts/start-dirsrv \ @@ -721,35 +731,29 @@ sbin_SCRIPTS = ldap/admin/src/scripts/setup-ds.pl \ ldap/admin/src/scripts/verify-db.pl \ ldap/admin/src/scripts/dbverify \ ldap/admin/src/scripts/upgradedb \ - ldap/admin/src/scripts/dbmon.sh \ - ldap/admin/src/scripts/ds_selinux_enabled \ - ldap/admin/src/scripts/ds_selinux_port_query \ - wrappers/ds_systemd_ask_password_acl \ - wrappers/ldap-agent - -bin_SCRIPTS = ldap/servers/slapd/tools/rsearch/scripts/dbgen.pl \ - wrappers/dbscan \ - wrappers/dsktune \ - wrappers/infadd \ - wrappers/ldclt \ - wrappers/ldif \ - wrappers/migratecred \ - wrappers/mmldif \ - wrappers/pwdhash \ - wrappers/rsearch \ - wrappers/cl-dump \ - ldap/admin/src/scripts/cl-dump.pl \ + ldap/admin/src/scripts/dbmon.sh +endif + +bin_SCRIPTS = \ wrappers/repl-monitor \ - ldap/admin/src/scripts/repl-monitor.pl \ ldap/admin/src/scripts/readnsstate +if ENABLE_PERL +bin_SCRIPTS += ldap/servers/slapd/tools/rsearch/scripts/dbgen.pl \ + wrappers/cl-dump \ + ldap/admin/src/scripts/cl-dump.pl \ + ldap/admin/src/scripts/repl-monitor.pl +endif + # For scripts that are "as is". dist_bin_SCRIPTS = ldap/admin/src/scripts/ds-replcheck \ - ldap/admin/src/scripts/ds-logpipe.py \ - ldap/admin/src/logconv.pl + ldap/admin/src/scripts/ds-logpipe.py + +dist_bin_SCRIPTS += ldap/admin/src/logconv.pl # SCRIPTS makes them executables - these are perl modules # and should not be marked as executable - so use DATA +if ENABLE_PERL perl_DATA = ldap/admin/src/scripts/SetupLog.pm \ ldap/admin/src/scripts/Resource.pm \ ldap/admin/src/scripts/DSUtil.pm \ @@ -765,6 +769,7 @@ perl_DATA = ldap/admin/src/scripts/SetupLog.pm \ ldap/admin/src/scripts/DSCreate.pm \ ldap/admin/src/scripts/DSUpdate.pm \ ldap/admin/src/scripts/DSUpdateDialogs.pm +endif python_DATA = ldap/admin/src/scripts/failedbinds.py \ ldap/admin/src/scripts/logregex.py @@ -773,6 +778,7 @@ gdbautoload_DATA = ldap/admin/src/scripts/ns-slapd-gdb.py dist_sysctl_DATA = ldap/admin/src/70-dirsrv.conf +if ENABLE_PERL property_DATA = ldap/admin/src/scripts/setup-ds.res \ ldap/admin/src/scripts/migrate-ds.res @@ -810,6 +816,7 @@ task_SCRIPTS = ldap/admin/src/scripts/template-bak2db \ ldap/admin/src/scripts/template-usn-tombstone-cleanup.pl \ ldap/admin/src/scripts/template-verify-db.pl \ ldap/admin/src/scripts/template-dbverify +endif if SYSTEMD # yes, that is an @ in the filename . . . @@ -909,6 +916,7 @@ dist_man_MANS = man/man1/dbscan.1 \ # processed by the update script # shell scripts and other files are SCRIPTS - executable #------------------------ +if ENABLE_PERL update_DATA = ldap/admin/src/scripts/exampleupdate.pl \ ldap/admin/src/scripts/exampleupdate.ldif \ ldap/admin/src/scripts/10cleanupldapi.pl \ @@ -965,6 +973,7 @@ update_DATA = ldap/admin/src/scripts/exampleupdate.pl \ ldap/admin/src/scripts/91reindex.pl update_SCRIPTS = ldap/admin/src/scripts/exampleupdate.sh +endif #//////////////////////////////////////////////////////////////// # @@ -974,6 +983,11 @@ update_SCRIPTS = ldap/admin/src/scripts/exampleupdate.sh #------------------------ # makstrdb #------------------------ +if ENABLE_PERL +noinst_PROGRAMS = makstrdb + +nodist_property_DATA = ns-slapd.properties + makstrdb_SOURCES = lib/libsi18n/makstrdb.c makstrdb_CPPFLAGS = $(AM_CPPFLAGS) $(DSPLUGIN_CPPFLAGS) @@ -984,6 +998,8 @@ makstrdb_CPPFLAGS = $(AM_CPPFLAGS) $(DSPLUGIN_CPPFLAGS) ns-slapd.properties: makstrdb ./makstrdb +endif + #//////////////////////////////////////////////////////////////// # @@ -1812,46 +1828,42 @@ libwhoami_plugin_la_LDFLAGS = -avoid-version #------------------------ # dbscan #------------------------ -dbscan_bin_SOURCES = ldap/servers/slapd/tools/dbscan.c +dbscan_SOURCES = ldap/servers/slapd/tools/dbscan.c -dbscan_bin_CPPFLAGS = @db_inc@ @nspr_inc@ $(AM_CPPFLAGS) -dbscan_bin_LDADD = $(NSPR_LINK) $(DB_LINK) +dbscan_CPPFLAGS = @db_inc@ @nspr_inc@ $(AM_CPPFLAGS) +dbscan_LDADD = $(NSPR_LINK) $(DB_LINK) #------------------------ # dsktune #------------------------ -dsktune_bin_SOURCES = ldap/systools/idsktune.c \ - ldap/systools/pio.c -dsktune_bin_CPPFLAGS = $(AM_CPPFLAGS) $(DSPLUGIN_CPPFLAGS) +dsktune_SOURCES = ldap/systools/idsktune.c ldap/systools/pio.c +dsktune_CPPFLAGS = $(AM_CPPFLAGS) $(DSPLUGIN_CPPFLAGS) #------------------------ # infadd #------------------------ -infadd_bin_SOURCES = ldap/servers/slapd/tools/rsearch/addthread.c \ +infadd_SOURCES = ldap/servers/slapd/tools/rsearch/addthread.c \ ldap/servers/slapd/tools/rsearch/infadd.c \ ldap/servers/slapd/tools/rsearch/nametable.c -infadd_bin_CPPFLAGS = $(AM_CPPFLAGS) $(DSPLUGIN_CPPFLAGS) -infadd_bin_LDADD = $(NSPR_LINK) $(NSS_LINK) $(LDAPSDK_LINK) $(SASL_LINK) $(LIBSOCKET) +infadd_CPPFLAGS = $(AM_CPPFLAGS) $(DSPLUGIN_CPPFLAGS) +infadd_LDADD = $(NSPR_LINK) $(NSS_LINK) $(LDAPSDK_LINK) $(SASL_LINK) $(LIBSOCKET) #------------------------ # ldap-agent #------------------------ -ldap_agent_bin_SOURCES = ldap/servers/snmp/main.c \ +ldap_agent_SOURCES = ldap/servers/snmp/main.c \ ldap/servers/snmp/ldap-agent.c \ ldap/servers/slapd/agtmmap.c -ldap_agent_bin_CPPFLAGS = $(AM_CPPFLAGS) $(DSPLUGIN_CPPFLAGS) @netsnmp_inc@ -ldap_agent_bin_LDADD = $(LDAPSDK_LINK_NOTHR) $(SASL_LINK) $(NSS_LINK) $(NSPR_LINK) $(NETSNMP_LINK) $(THREADLIB) -if SOLARIS -ldap_agent_bin_LDADD += -lrt -endif +ldap_agent_CPPFLAGS = $(AM_CPPFLAGS) $(DSPLUGIN_CPPFLAGS) @netsnmp_inc@ +ldap_agent_LDADD = $(LDAPSDK_LINK_NOTHR) $(SASL_LINK) $(NSS_LINK) $(NSPR_LINK) $(NETSNMP_LINK) $(THREADLIB) #------------------------ # ldclt #------------------------ -ldclt_bin_SOURCES = ldap/servers/slapd/tools/ldaptool-sasl.c \ +ldclt_SOURCES = ldap/servers/slapd/tools/ldaptool-sasl.c \ ldap/servers/slapd/tools/ldclt/data.c \ ldap/servers/slapd/tools/ldclt/ldapfct.c \ ldap/servers/slapd/tools/ldclt/ldclt.c \ @@ -1864,38 +1876,34 @@ ldclt_bin_SOURCES = ldap/servers/slapd/tools/ldaptool-sasl.c \ ldap/servers/slapd/tools/ldclt/version.c \ ldap/servers/slapd/tools/ldclt/workarounds.c -if SOLARIS -ldclt_bin_SOURCES += ldap/servers/slapd/tools/ldclt/opCheck.c -endif - -ldclt_bin_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/ldap/servers/slapd/tools $(DSPLUGIN_CPPFLAGS) $(SASL_INCLUDES) -ldclt_bin_LDADD = $(NSPR_LINK) $(NSS_LINK) $(LDAPSDK_LINK) $(SASL_LINK) $(LIBNSL) $(LIBSOCKET) $(LIBDL) $(THREADLIB) +ldclt_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/ldap/servers/slapd/tools $(DSPLUGIN_CPPFLAGS) $(SASL_INCLUDES) +ldclt_LDADD = $(NSPR_LINK) $(NSS_LINK) $(LDAPSDK_LINK) $(SASL_LINK) $(LIBNSL) $(LIBSOCKET) $(LIBDL) $(THREADLIB) #------------------------ # ldif #------------------------ -ldif_bin_SOURCES = ldap/servers/slapd/tools/ldif.c +ldif_SOURCES = ldap/servers/slapd/tools/ldif.c -ldif_bin_CPPFLAGS = $(AM_CPPFLAGS) $(DSPLUGIN_CPPFLAGS) -ldif_bin_LDADD = $(NSPR_LINK) $(NSS_LINK) $(LDAPSDK_LINK_NOTHR) $(SASL_LINK) +ldif_CPPFLAGS = $(AM_CPPFLAGS) $(DSPLUGIN_CPPFLAGS) +ldif_LDADD = $(NSPR_LINK) $(NSS_LINK) $(LDAPSDK_LINK_NOTHR) $(SASL_LINK) #------------------------ # migratecred #------------------------ -migratecred_bin_SOURCES = ldap/servers/slapd/tools/migratecred.c +migratecred_SOURCES = ldap/servers/slapd/tools/migratecred.c -migratecred_bin_CPPFLAGS = $(AM_CPPFLAGS) $(DSPLUGIN_CPPFLAGS) -migratecred_bin_LDADD = libslapd.la $(NSPR_LINK) $(NSS_LINK) $(SVRCORE_LINK) $(LDAPSDK_LINK) $(SASL_LINK) -migratecred_bin_DEPENDENCIES = libslapd.la +migratecred_CPPFLAGS = $(AM_CPPFLAGS) $(DSPLUGIN_CPPFLAGS) +migratecred_LDADD = libslapd.la $(NSPR_LINK) $(NSS_LINK) $(SVRCORE_LINK) $(LDAPSDK_LINK) $(SASL_LINK) +migratecred_DEPENDENCIES = libslapd.la #------------------------ # mmldif #------------------------ -mmldif_bin_SOURCES = ldap/servers/slapd/tools/mmldif.c +mmldif_SOURCES = ldap/servers/slapd/tools/mmldif.c -mmldif_bin_CPPFLAGS = $(AM_CPPFLAGS) $(DSPLUGIN_CPPFLAGS) -mmldif_bin_LDADD = libslapd.la $(NSPR_LINK) $(NSS_LINK) $(SVRCORE_LINK) $(LDAPSDK_LINK_NOTHR) $(SASL_LINK) -mmldif_bin_DEPENDENCIES = libslapd.la +mmldif_CPPFLAGS = $(AM_CPPFLAGS) $(DSPLUGIN_CPPFLAGS) +mmldif_LDADD = libslapd.la $(NSPR_LINK) $(NSS_LINK) $(SVRCORE_LINK) $(LDAPSDK_LINK_NOTHR) $(SASL_LINK) +mmldif_DEPENDENCIES = libslapd.la #------------------------ # ns-slapd @@ -1960,22 +1968,22 @@ endif #------------------------ # pwdhash #------------------------ -pwdhash_bin_SOURCES = ldap/servers/slapd/tools/pwenc.c +pwdhash_SOURCES = ldap/servers/slapd/tools/pwenc.c -pwdhash_bin_CPPFLAGS = $(AM_CPPFLAGS) $(DSPLUGIN_CPPFLAGS) -pwdhash_bin_LDADD = libslapd.la $(NSPR_LINK) $(NSS_LINK) $(SVRCORE_LINK) $(LDAPSDK_LINK) $(SASL_LINK) -pwdhash_bin_DEPENDENCIES = libslapd.la +pwdhash_CPPFLAGS = $(AM_CPPFLAGS) $(DSPLUGIN_CPPFLAGS) +pwdhash_LDADD = libslapd.la $(NSPR_LINK) $(NSS_LINK) $(SVRCORE_LINK) $(LDAPSDK_LINK) $(SASL_LINK) +pwdhash_DEPENDENCIES = libslapd.la #------------------------ # rsearch #------------------------ -rsearch_bin_SOURCES = ldap/servers/slapd/tools/rsearch/nametable.c \ +rsearch_SOURCES = ldap/servers/slapd/tools/rsearch/nametable.c \ ldap/servers/slapd/tools/rsearch/rsearch.c \ ldap/servers/slapd/tools/rsearch/sdattable.c \ ldap/servers/slapd/tools/rsearch/searchthread.c -rsearch_bin_CPPFLAGS = $(AM_CPPFLAGS) $(DSPLUGIN_CPPFLAGS) -rsearch_bin_LDADD = $(NSPR_LINK) $(NSS_LINK) $(LDAPSDK_LINK) $(SASL_LINK) $(LIBSOCKET) +rsearch_CPPFLAGS = $(AM_CPPFLAGS) $(DSPLUGIN_CPPFLAGS) +rsearch_LDADD = $(NSPR_LINK) $(NSS_LINK) $(LDAPSDK_LINK) $(SASL_LINK) $(LIBSOCKET) #------------------------- # CMOCKA TEST PROGRAMS @@ -2113,6 +2121,7 @@ fixupcmd = sed \ -e 's,@enable_auto_dn_suffix\@,$(enable_auto_dn_suffix),g' \ -e 's,@enable_presence\@,$(enable_presence),g' \ -e 's,@enable_asan\@,$(ASAN_ON),g' \ + -e 's,@enable_perl\@,@enable_perl@,g' \ -e 's,@ECHO_N\@,$(ECHO_N),g' \ -e 's,@ECHO_C\@,$(ECHO_C),g' \ -e 's,@brand\@,$(brand),g' \ diff --git a/configure.ac b/configure.ac index 19986c0..91d6d39 100644 --- a/configure.ac +++ b/configure.ac @@ -103,6 +103,21 @@ AC_ARG_ENABLE(asan, AS_HELP_STRING([--enable-asan], [Enable gcc address sanitize AC_SUBST([asan_defs]) AM_CONDITIONAL(enable_asan,test "$enable_asan" = "yes") +if test -z "$enable_perl" ; then + enable_perl=yes +fi +AC_MSG_CHECKING(for --enable-perl) +AC_ARG_ENABLE(perl, AS_HELP_STRING([--enable-perl], [Enable perl and shell script wrappers (default: yes)]) +[ + AC_MSG_RESULT(yes) +], +[ + AC_MSG_RESULT(no) +]) +AC_SUBST([enable_perl]) +AM_CONDITIONAL(ENABLE_PERL,test "$enable_perl" = "yes") + + AM_CONDITIONAL([RPM_HARDEND_CC], [test -f /usr/lib/rpm/redhat/redhat-hardened-cc1]) AC_MSG_CHECKING(for --enable-gcc-security) AC_ARG_ENABLE(gcc-security, AS_HELP_STRING([--enable-gcc-security], [Enable gcc secure compilation options (default: no)]), @@ -777,6 +792,8 @@ AC_DEFINE([LDAP_ERROR_LOGGING], [1], [LDAP error logging flag]) # Build our pkgconfig files # This currently conflicts with %.in: rule in Makefile.am, which should be removed eventually. +# AC_CONFIG_FILES([ldap/admin/src/defaults.inf]) + AC_CONFIG_FILES([src/pkgconfig/dirsrv.pc src/pkgconfig/nunc-stans.pc src/pkgconfig/libsds.pc]) AC_CONFIG_FILES([Makefile rpm/389-ds-base.spec ]) diff --git a/dirsrvtests/tests/suites/basic/basic_test.py b/dirsrvtests/tests/suites/basic/basic_test.py index 21f69ba..45988dc 100644 --- a/dirsrvtests/tests/suites/basic/basic_test.py +++ b/dirsrvtests/tests/suites/basic/basic_test.py @@ -11,11 +11,14 @@ :Requirement: Basic Directory Server Operations """ -from subprocess import check_output +from subprocess import check_output, Popen import pytest from lib389.tasks import * from lib389.utils import * +from lib389.topologies import topology_st +from lib389.dbgen import dbgen + from lib389._constants import DN_DM, PASSWORD, PW_DM from lib389.topologies import topology_st @@ -44,13 +47,9 @@ def import_example_ldif(topology_st): ldif = '%s/Example.ldif' % get_data_dir(topology_st.standalone.prefix) import_ldif = topology_st.standalone.get_ldif_dir() + "/Example.ldif" shutil.copyfile(ldif, import_ldif) - try: - topology_st.standalone.tasks.importLDIF(suffix=DEFAULT_SUFFIX, - input_file=import_ldif, - args={TASK_WAIT: True}) - except ValueError: - log.error('Online import failed') - assert False + topology_st.standalone.tasks.importLDIF(suffix=DEFAULT_SUFFIX, + input_file=import_ldif, + args={TASK_WAIT: True}) @pytest.fixture(params=ROOTDSE_DEF_ATTR_LIST) @@ -62,7 +61,7 @@ def rootdse_attr(topology_st, request): topology_st.standalone.start() RETURN_DEFAULT_OPATTR = "nsslapd-return-default-opattr" - rootdse_attr_name = request.param + rootdse_attr_name = ensure_bytes(request.param) log.info(" Add the %s: %s to rootdse" % (RETURN_DEFAULT_OPATTR, rootdse_attr_name)) @@ -156,14 +155,14 @@ def test_basic_ops(topology_st, import_example_ldif): # try: topology_st.standalone.modify_s(USER1_DN, [(ldap.MOD_ADD, 'description', - 'New description')]) + b'New description')]) except ldap.LDAPError as e: log.error('Failed to add description: error ' + e.message['desc']) assert False try: topology_st.standalone.modify_s(USER1_DN, [(ldap.MOD_REPLACE, 'description', - 'Modified description')]) + b'Modified description')]) except ldap.LDAPError as e: log.error('Failed to modify description: error ' + e.message['desc']) assert False @@ -250,16 +249,12 @@ def test_basic_import_export(topology_st, import_example_ldif): # # Test online/offline LDIF imports # + topology_st.standalone.start() # Generate a test ldif (50k entries) ldif_dir = topology_st.standalone.get_ldif_dir() import_ldif = ldif_dir + '/basic_import.ldif' - try: - topology_st.standalone.buildLDIF(50000, import_ldif) - except OSError as e: - log.fatal('test_basic_import_export: failed to create test ldif,\ - error: %s - %s' % (e.errno, e.strerror)) - assert False + dbgen(topology_st.standalone, 50000, import_ldif, DEFAULT_SUFFIX) # Online try: @@ -398,10 +393,10 @@ def test_basic_acl(topology_st, import_example_ldif): 7. Cleanup should PASS. """ + """Run some basic access control(ACL) tests""" log.info('Running test_basic_acl...') - DENY_ACI = ('(targetattr = "*") (version 3.0;acl "deny user";deny (all)' + - '(userdn = "ldap:///' + USER1_DN + '");)') + DENY_ACI = ensure_bytes('(targetattr = "*")(version 3.0;acl "deny user";deny (all)(userdn = "ldap:///%s");)' % USER1_DN) # # Add two users @@ -610,14 +605,14 @@ def test_basic_referrals(topology_st, import_example_ldif): topology_st.standalone.modify_s(SUFFIX_CONFIG, [(ldap.MOD_REPLACE, 'nsslapd-referral', - 'ldap://localhost.localdomain:389/o%3dnetscaperoot')]) + b'ldap://localhost.localdomain:389/o%3dnetscaperoot')]) except ldap.LDAPError as e: log.fatal('test_basic_referrals: Failed to set referral: error ' + e.message['desc']) assert False try: topology_st.standalone.modify_s(SUFFIX_CONFIG, [(ldap.MOD_REPLACE, - 'nsslapd-state', 'Referral')]) + 'nsslapd-state', b'Referral')]) except ldap.LDAPError as e: log.fatal('test_basic_referrals: Failed to set backend state: error ' + e.message['desc']) @@ -645,7 +640,7 @@ def test_basic_referrals(topology_st, import_example_ldif): # try: topology_st.standalone.modify_s(SUFFIX_CONFIG, [(ldap.MOD_REPLACE, - 'nsslapd-state', 'Backend')]) + 'nsslapd-state', b'Backend')]) except ldap.LDAPError as e: log.fatal('test_basic_referrals: Failed to set backend state: error ' + e.message['desc']) @@ -761,8 +756,8 @@ def test_basic_ldapagent(topology_st, import_example_ldif): log.info('Running test_basic_ldapagent...') var_dir = topology_st.standalone.get_local_state_dir() + config_file = os.path.join(topology_st.standalone.get_sysconf_dir(), 'dirsrv/config/agent.conf') - cmd = 'sudo %s %s' % (os.path.join(topology_st.standalone.get_sbin_dir(), 'ldap-agent'), config_file) agent_config_file = open(config_file, 'w') agent_config_file.write('agentx-master ' + var_dir + '/agentx/master\n') @@ -770,19 +765,16 @@ def test_basic_ldapagent(topology_st, import_example_ldif): agent_config_file.write('server slapd-' + topology_st.standalone.serverid + '\n') agent_config_file.close() - rc = os.system(cmd) - if rc != 0: - log.fatal('test_basic_ldapagent: Failed to start snmp ldap agent %s: error %d' % (cmd, rc)) - assert False - - log.info('snmp ldap agent started') - - # - # Cleanup - kill the agent - # - pid = check_output(['pidof', '-s', 'ldap-agent-bin']) - log.info('Cleanup - killing agent: ' + pid) - rc = os.system('sudo kill -9 ' + pid) + # Remember, this is *forking* + check_output([os.path.join(topology_st.standalone.get_sbin_dir(), 'ldap-agent'), config_file]) + # First kill any previous agents .... + pidpath = os.path.join(var_dir, 'run/ldap-agent.pid') + pid = None + with open(pidpath, 'r') as pf: + pid = pf.readlines()[0].strip() + if pid: + log.debug('test_basic_ldapagent: Terminating agent %s', pid) + check_output(['kill', pid]) log.info('test_basic_ldapagent: PASSED') @@ -807,8 +799,8 @@ def test_basic_dse(topology_st, import_example_ldif): log.info('Running test_basic_dse...') dse_file = topology_st.standalone.confdir + '/dse.ldif' - pid = check_output(['pidof', '-s', 'ns-slapd']) - os.system('sudo kill -9 ' + pid) + pid = check_output(['pidof', '-s', 'ns-slapd']).strip() + check_output(['sudo', 'kill', '-9', ensure_str(pid)]) if os.path.getsize(dse_file) == 0: log.fatal('test_basic_dse: dse.ldif\'s content was incorrectly removed!') assert False @@ -842,9 +834,8 @@ def test_def_rootdse_attr(topology_st, import_example_ldif, rootdse_attr_name): log.info(" Assert rootdse search hasn't %s attr" % rootdse_attr_name) try: - entries = topology_st.standalone.search_s("", ldap.SCOPE_BASE) - entry = str(entries[0]) - assert rootdse_attr_name not in entry + entry = topology_st.standalone.search_s("", ldap.SCOPE_BASE)[0] + assert not entry.hasAttr(rootdse_attr_name) except ldap.LDAPError as e: log.fatal('Search failed, error: ' + e.message['desc']) @@ -870,9 +861,8 @@ adds nsslapd-return-default-opattr attr with value of one operation attribute. log.info(" Assert rootdse search has %s attr" % rootdse_attr) try: - entries = topology_st.standalone.search_s("", ldap.SCOPE_BASE) - entry = str(entries[0]) - assert rootdse_attr in entry + entry = topology_st.standalone.search_s("", ldap.SCOPE_BASE)[0] + assert entry.hasAttr(rootdse_attr) except ldap.LDAPError as e: log.fatal('Search failed, error: ' + e.message['desc']) diff --git a/ldap/admin/src/defaults.inf.in b/ldap/admin/src/defaults.inf.in index 77d27b1..8565ff7 100644 --- a/ldap/admin/src/defaults.inf.in +++ b/ldap/admin/src/defaults.inf.in @@ -20,6 +20,7 @@ product = @capbrand@ Directory Server version = @PACKAGE_VERSION@ asan_enabled = @enable_asan@ +enable_perl = @enable_perl@ with_systemd = @with_systemd@ with_selinux = @with_selinux@ prefix = @prefixdir@ diff --git a/ldap/servers/slapd/task.c b/ldap/servers/slapd/task.c index 72c23ac..f3d02d9 100644 --- a/ldap/servers/slapd/task.c +++ b/ldap/servers/slapd/task.c @@ -892,7 +892,7 @@ task_import_add(Slapi_PBlock *pb __attribute__((unused)), rv = charray_normdn_add(&include, (char *)slapi_value_get_string(val), "nsIncludeSuffix"); - if (0 != rv) { + if (rv < 0) { *returncode = LDAP_PARAM_ERROR; return SLAPI_DSE_CALLBACK_ERROR; } @@ -904,7 +904,7 @@ task_import_add(Slapi_PBlock *pb __attribute__((unused)), rv = charray_normdn_add(&exclude, (char *)slapi_value_get_string(val), "nsExcludeSuffix"); - if (0 != rv) { + if (rv < 0) { *returncode = LDAP_PARAM_ERROR; return SLAPI_DSE_CALLBACK_ERROR; } @@ -1243,7 +1243,7 @@ task_export_add(Slapi_PBlock *pb __attribute__((unused)), rv = charray_normdn_add(&include, (char *)slapi_value_get_string(val), "nsIncludeSuffix"); - if (0 != rv) { + if (rv < 0) { *returncode = LDAP_PARAM_ERROR; goto out; } @@ -1255,7 +1255,7 @@ task_export_add(Slapi_PBlock *pb __attribute__((unused)), rv = charray_normdn_add(&exclude, (char *)slapi_value_get_string(val), "nsExcludeSuffix"); - if (0 != rv) { + if (rv < 0) { *returncode = LDAP_PARAM_ERROR; goto out; } diff --git a/ldap/servers/snmp/main.c b/ldap/servers/snmp/main.c index ccda2b2..8477831 100644 --- a/ldap/servers/snmp/main.c +++ b/ldap/servers/snmp/main.c @@ -95,7 +95,7 @@ main(int argc, char *argv[]) } fclose(pid_fp); if (kill(child_pid, SIGUSR1) == 0) { - printf("ldap-agent: Already running as pid %d!\n", child_pid); + printf("ldap-agent: Already running as pid %d %s!\n", child_pid, pidfile); exit(1); } else { /* old pidfile exists, but the process doesn't. Cleanup pidfile */ diff --git a/wrappers/dbscan.in b/wrappers/dbscan.in deleted file mode 100755 index 942ffc9..0000000 --- a/wrappers/dbscan.in +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/sh - -############################################################################### -## (1) Specify variables used by this script. ## -############################################################################### - -BIN_DIR=@bindir@ -COMMAND=dbscan-bin - - -############################################################################### -## (2) Set the LD_LIBRARY_PATH environment variable to determine the ## -## search order this command wrapper uses to find shared libraries. ## -############################################################################### - -libpath_add() { - [ -z "$1" ] && return - LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$1 -} - -libpath_add "@nspr_libdir@" -libpath_add "@db_libdir@" - -export LD_LIBRARY_PATH - - -############################################################################### -## (3) Set the PATH environment variable to determine the search ## -## order this command wrapper uses to find binary executables. ## -## ## -## NOTE: Since the wrappers themselves are ALWAYS located in ## -## "/usr/bin", this directory will always be excluded ## -## from the search path. Since "/bin" is nothing more ## -## than a symbolic link to "/usr/bin" on Solaris, this ## -## directory will also always be excluded from the search ## -## path on this platform. ## -############################################################################### - -PATH=${BIN_DIR} -export PATH - - -############################################################################### -## (4) Execute the binary executable specified by this command wrapper ## -## based upon the preset LD_LIBRARY_PATH and PATH environment variables.## -############################################################################### - -ORIGINAL_IFS=${IFS} -IFS=: - -for dir in ${PATH} -do - if [ -x ${dir}/${COMMAND} ] - then - IFS=${ORIGINAL_IFS} - ${dir}/${COMMAND} "$@" - exit $? - fi -done - -echo "Unable to find \"${COMMAND}\" in \"${PATH}\"!" - -exit 255 - diff --git a/wrappers/dsktune.in b/wrappers/dsktune.in deleted file mode 100755 index 7c4777c..0000000 --- a/wrappers/dsktune.in +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/sh - -############################################################################### -## (1) Specify variables used by this script. ## -############################################################################### - -LIB_DIR= -BIN_DIR=@bindir@ -COMMAND=dsktune-bin - - -############################################################################### -## (2) Set the LD_LIBRARY_PATH environment variable to determine the ## -## search order this command wrapper uses to find shared libraries. ## -############################################################################### - -LD_LIBRARY_PATH=${LIB_DIR} -export LD_LIBRARY_PATH - - -############################################################################### -## (3) Set the PATH environment variable to determine the search ## -## order this command wrapper uses to find binary executables. ## -## ## -## NOTE: Since the wrappers themselves are ALWAYS located in ## -## "/usr/bin", this directory will always be excluded ## -## from the search path. Since "/bin" is nothing more ## -## than a symbolic link to "/usr/bin" on Solaris, this ## -## directory will also always be excluded from the search ## -## path on this platform. ## -############################################################################### - -PATH=${BIN_DIR} -export PATH - - -############################################################################### -## (4) Execute the binary executable specified by this command wrapper ## -## based upon the preset LD_LIBRARY_PATH and PATH environment variables.## -############################################################################### - -ORIGINAL_IFS=${IFS} -IFS=: - -for dir in ${PATH} -do - if [ -x ${dir}/${COMMAND} ] - then - IFS=${ORIGINAL_IFS} - ${dir}/${COMMAND} "$@" - exit $? - fi -done - -echo "Unable to find \"${COMMAND}\" in \"${PATH}\"!" - -exit 255 - diff --git a/wrappers/infadd.in b/wrappers/infadd.in deleted file mode 100755 index 3ebc40b..0000000 --- a/wrappers/infadd.in +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -############################################################################### -## (1) Specify variables used by this script. ## -############################################################################### - -BIN_DIR=@bindir@ -COMMAND=infadd-bin - - -############################################################################### -## (2) Set the LD_LIBRARY_PATH environment variable to determine the ## -## search order this command wrapper uses to find shared libraries. ## -############################################################################### - -libpath_add() { - [ -z "$1" ] && return - LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$1 -} - -libpath_add "@nss_libdir@" -libpath_add "@nspr_libdir@" -libpath_add "@ldapsdk_libdir@" -libpath_add "@sasl_libdir@" - -export LD_LIBRARY_PATH - - -############################################################################### -## (3) Set the PATH environment variable to determine the search ## -## order this command wrapper uses to find binary executables. ## -## ## -## NOTE: Since the wrappers themselves are ALWAYS located in ## -## "/usr/bin", this directory will always be excluded ## -## from the search path. Since "/bin" is nothing more ## -## than a symbolic link to "/usr/bin" on Solaris, this ## -## directory will also always be excluded from the search ## -## path on this platform. ## -############################################################################### - -PATH=${BIN_DIR} -export PATH - - -############################################################################### -## (4) Execute the binary executable specified by this command wrapper ## -## based upon the preset LD_LIBRARY_PATH and PATH environment variables.## -############################################################################### - -ORIGINAL_IFS=${IFS} -IFS=: - -for dir in ${PATH} -do - if [ -x ${dir}/${COMMAND} ] - then - IFS=${ORIGINAL_IFS} - ${dir}/${COMMAND} "$@" - exit $? - fi -done - -echo "Unable to find \"${COMMAND}\" in \"${PATH}\"!" - -exit 255 - diff --git a/wrappers/ldap-agent-initscript.in b/wrappers/ldap-agent-initscript.in index b7aa4fe..4dc83fa 100644 --- a/wrappers/ldap-agent-initscript.in +++ b/wrappers/ldap-agent-initscript.in @@ -53,7 +53,7 @@ success() baseexec="ldap-agent" exec="@sbindir@/$baseexec" -processname="ldap-agent-bin" +processname="ldap-agent" prog="@package_name@-snmp" pidfile="@localstatedir@/run/ldap-agent.pid" configfile="@sysconfdir@/@package_name@/config/ldap-agent.conf" diff --git a/wrappers/ldap-agent.in b/wrappers/ldap-agent.in deleted file mode 100755 index 62c3d6e..0000000 --- a/wrappers/ldap-agent.in +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -############################################################################### -## (1) Specify variables used by this script. ## -############################################################################### - -BIN_DIR=@sbindir@ -COMMAND=ldap-agent-bin - -# We don't need to load any mibs, so set MIBS to nothing. -MIBS= -export MIBS - -############################################################################### -## (2) Set the LD_LIBRARY_PATH environment variable to determine the ## -## search order this command wrapper uses to find shared libraries. ## -############################################################################### - -libpath_add() { - [ -z "$1" ] && return - LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$1 -} - -libpath_add "@nss_libdir@" -libpath_add "@nspr_libdir@" -libpath_add "@ldapsdk_libdir@" -libpath_add "@netsnmp_libdir@" - -export LD_LIBRARY_PATH - - -############################################################################### -## (3) Set the PATH environment variable to determine the search ## -## order this command wrapper uses to find binary executables. ## -## ## -## NOTE: Since the wrappers themselves are ALWAYS located in ## -## "/usr/bin", this directory will always be excluded ## -## from the search path. Since "/bin" is nothing more ## -## than a symbolic link to "/usr/bin" on Solaris, this ## -## directory will also always be excluded from the search ## -## path on this platform. ## -############################################################################### - -PATH=${BIN_DIR} -export PATH - - -############################################################################### -## (4) Execute the binary executable specified by this command wrapper ## -## based upon the preset LD_LIBRARY_PATH and PATH environment variables.## -############################################################################### - -ORIGINAL_IFS=${IFS} -IFS=: - -for dir in ${PATH} -do - if [ -x ${dir}/${COMMAND} ] - then - IFS=${ORIGINAL_IFS} - ${dir}/${COMMAND} "$@" - exit $? - fi -done - -echo "Unable to find \"${COMMAND}\" in \"${PATH}\"!" - -exit 255 - diff --git a/wrappers/ldclt.in b/wrappers/ldclt.in deleted file mode 100755 index 7f0a3cc..0000000 --- a/wrappers/ldclt.in +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -############################################################################### -## (1) Specify variables used by this script. ## -############################################################################### - -BIN_DIR=@bindir@ -COMMAND=ldclt-bin - - -############################################################################### -## (2) Set the LD_LIBRARY_PATH environment variable to determine the ## -## search order this command wrapper uses to find shared libraries. ## -############################################################################### - -libpath_add() { - [ -z "$1" ] && return - LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$1 -} - -libpath_add "@nss_libdir@" -libpath_add "@nspr_libdir@" -libpath_add "@ldapsdk_libdir@" -libpath_add "@sasl_libdir@" - -export LD_LIBRARY_PATH -SASL_PATH=@sasl_path@ -export SASL_PATH - - -############################################################################### -## (3) Set the PATH environment variable to determine the search ## -## order this command wrapper uses to find binary executables. ## -## ## -## NOTE: Since the wrappers themselves are ALWAYS located in ## -## "/usr/bin", this directory will always be excluded ## -## from the search path. Since "/bin" is nothing more ## -## than a symbolic link to "/usr/bin" on Solaris, this ## -## directory will also always be excluded from the search ## -## path on this platform. ## -############################################################################### - -PATH=${BIN_DIR} -export PATH - - -############################################################################### -## (4) Execute the binary executable specified by this command wrapper ## -## based upon the preset LD_LIBRARY_PATH and PATH environment variables.## -############################################################################### - -ORIGINAL_IFS=${IFS} -IFS=: - -for dir in ${PATH} -do - if [ -x ${dir}/${COMMAND} ] - then - IFS=${ORIGINAL_IFS} - ${dir}/${COMMAND} "$@" - exit $? - fi -done - -echo "Unable to find \"${COMMAND}\" in \"${PATH}\"!" - -exit 255 - diff --git a/wrappers/ldif.in b/wrappers/ldif.in deleted file mode 100755 index 5407920..0000000 --- a/wrappers/ldif.in +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -############################################################################### -## (1) Specify variables used by this script. ## -############################################################################### - -BIN_DIR=@bindir@ -COMMAND=ldif-bin - - -############################################################################### -## (2) Set the LD_LIBRARY_PATH environment variable to determine the ## -## search order this command wrapper uses to find shared libraries. ## -############################################################################### - -libpath_add() { - [ -z "$1" ] && return - LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$1 -} - -libpath_add "@nss_libdir@" -libpath_add "@nspr_libdir@" -libpath_add "@ldapsdk_libdir@" -libpath_add "@sasl_libdir@" - -export LD_LIBRARY_PATH - - -############################################################################### -## (3) Set the PATH environment variable to determine the search ## -## order this command wrapper uses to find binary executables. ## -## ## -## NOTE: Since the wrappers themselves are ALWAYS located in ## -## "/usr/bin", this directory will always be excluded ## -## from the search path. Since "/bin" is nothing more ## -## than a symbolic link to "/usr/bin" on Solaris, this ## -## directory will also always be excluded from the search ## -## path on this platform. ## -############################################################################### - -PATH=${BIN_DIR} -export PATH - - -############################################################################### -## (4) Execute the binary executable specified by this command wrapper ## -## based upon the preset LD_LIBRARY_PATH and PATH environment variables.## -############################################################################### - -ORIGINAL_IFS=${IFS} -IFS=: - -for dir in ${PATH} -do - if [ -x ${dir}/${COMMAND} ] - then - IFS=${ORIGINAL_IFS} - ${dir}/${COMMAND} "$@" - exit $? - fi -done - -echo "Unable to find \"${COMMAND}\" in \"${PATH}\"!" - -exit 255 - diff --git a/wrappers/migratecred.in b/wrappers/migratecred.in deleted file mode 100755 index 49de8d7..0000000 --- a/wrappers/migratecred.in +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -############################################################################### -## (1) Specify variables used by this script. ## -############################################################################### - -BIN_DIR=@bindir@ -COMMAND=migratecred-bin - - -############################################################################### -## (2) Set the LD_LIBRARY_PATH environment variable to determine the ## -## search order this command wrapper uses to find shared libraries. ## -############################################################################### - -libpath_add() { - [ -z "$1" ] && return - LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$1 -} - -libpath_add "@serverdir@" -libpath_add "@nss_libdir@" -libpath_add "@nspr_libdir@" -libpath_add "@ldapsdk_libdir@" -libpath_add "@sasl_libdir@" -libpath_add "@pcre_libdir@" - -export LD_LIBRARY_PATH - - -############################################################################### -## (3) Set the PATH environment variable to determine the search ## -## order this command wrapper uses to find binary executables. ## -## ## -## NOTE: Since the wrappers themselves are ALWAYS located in ## -## "/usr/bin", this directory will always be excluded ## -## from the search path. Since "/bin" is nothing more ## -## than a symbolic link to "/usr/bin" on Solaris, this ## -## directory will also always be excluded from the search ## -## path on this platform. ## -############################################################################### - -PATH=${BIN_DIR} -export PATH - - -############################################################################### -## (4) Execute the binary executable specified by this command wrapper ## -## based upon the preset LD_LIBRARY_PATH and PATH environment variables.## -############################################################################### - -ORIGINAL_IFS=${IFS} -IFS=: - -for dir in ${PATH} -do - if [ -x ${dir}/${COMMAND} ] - then - IFS=${ORIGINAL_IFS} - ${dir}/${COMMAND} "$@" - exit $? - fi -done - -echo "Unable to find \"${COMMAND}\" in \"${PATH}\"!" - -exit 255 - diff --git a/wrappers/mmldif.in b/wrappers/mmldif.in deleted file mode 100755 index aa09bae..0000000 --- a/wrappers/mmldif.in +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -############################################################################### -## (1) Specify variables used by this script. ## -############################################################################### - -BIN_DIR=@bindir@ -COMMAND=mmldif-bin - - -############################################################################### -## (2) Set the LD_LIBRARY_PATH environment variable to determine the ## -## search order this command wrapper uses to find shared libraries. ## -############################################################################### - -libpath_add() { - [ -z "$1" ] && return - LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$1 -} - -libpath_add "@serverdir@" -libpath_add "@nss_libdir@" -libpath_add "@nspr_libdir@" -libpath_add "@ldapsdk_libdir@" -libpath_add "@sasl_libdir@" -libpath_add "@pcre_libdir@" - -export LD_LIBRARY_PATH - - -############################################################################### -## (3) Set the PATH environment variable to determine the search ## -## order this command wrapper uses to find binary executables. ## -## ## -## NOTE: Since the wrappers themselves are ALWAYS located in ## -## "/usr/bin", this directory will always be excluded ## -## from the search path. Since "/bin" is nothing more ## -## than a symbolic link to "/usr/bin" on Solaris, this ## -## directory will also always be excluded from the search ## -## path on this platform. ## -############################################################################### - -PATH=${BIN_DIR} -export PATH - - -############################################################################### -## (4) Execute the binary executable specified by this command wrapper ## -## based upon the preset LD_LIBRARY_PATH and PATH environment variables.## -############################################################################### - -ORIGINAL_IFS=${IFS} -IFS=: - -for dir in ${PATH} -do - if [ -x ${dir}/${COMMAND} ] - then - IFS=${ORIGINAL_IFS} - ${dir}/${COMMAND} "$@" - exit $? - fi -done - -echo "Unable to find \"${COMMAND}\" in \"${PATH}\"!" - -exit 255 - diff --git a/wrappers/pwdhash.in b/wrappers/pwdhash.in deleted file mode 100755 index 69618fa..0000000 --- a/wrappers/pwdhash.in +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -############################################################################### -## (1) Specify variables used by this script. ## -############################################################################### - -BIN_DIR=@bindir@ -COMMAND=pwdhash-bin - - -############################################################################### -## (2) Set the LD_LIBRARY_PATH environment variable to determine the ## -## search order this command wrapper uses to find shared libraries. ## -############################################################################### - -libpath_add() { - [ -z "$1" ] && return - LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$1 -} - -libpath_add "@serverdir@" -libpath_add "@nss_libdir@" -libpath_add "@nspr_libdir@" -libpath_add "@ldapsdk_libdir@" -libpath_add "@sasl_libdir@" -libpath_add "@pcre_libdir@" - -export LD_LIBRARY_PATH - - -############################################################################### -## (3) Set the PATH environment variable to determine the search ## -## order this command wrapper uses to find binary executables. ## -## ## -## NOTE: Since the wrappers themselves are ALWAYS located in ## -## "/usr/bin", this directory will always be excluded ## -## from the search path. Since "/bin" is nothing more ## -## than a symbolic link to "/usr/bin" on Solaris, this ## -## directory will also always be excluded from the search ## -## path on this platform. ## -############################################################################### - -PATH=${BIN_DIR} -export PATH - - -############################################################################### -## (4) Execute the binary executable specified by this command wrapper ## -## based upon the preset LD_LIBRARY_PATH and PATH environment variables.## -############################################################################### - -ORIGINAL_IFS=${IFS} -IFS=: - -for dir in ${PATH} -do - if [ -x ${dir}/${COMMAND} ] - then - IFS=${ORIGINAL_IFS} - ${dir}/${COMMAND} "$@" - exit $? - fi -done - -echo "Unable to find \"${COMMAND}\" in \"${PATH}\"!" - -exit 255 - diff --git a/wrappers/rsearch.in b/wrappers/rsearch.in deleted file mode 100755 index a78abd7..0000000 --- a/wrappers/rsearch.in +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -############################################################################### -## (1) Specify variables used by this script. ## -############################################################################### - -BIN_DIR=@bindir@ -COMMAND=rsearch-bin - - -############################################################################### -## (2) Set the LD_LIBRARY_PATH environment variable to determine the ## -## search order this command wrapper uses to find shared libraries. ## -############################################################################### - -libpath_add() { - [ -z "$1" ] && return - LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$1 -} - -libpath_add "@nss_libdir@" -libpath_add "@nspr_libdir@" -libpath_add "@ldapsdk_libdir@" -libpath_add "@sasl_libdir@" - -export LD_LIBRARY_PATH - - -############################################################################### -## (3) Set the PATH environment variable to determine the search ## -## order this command wrapper uses to find binary executables. ## -## ## -## NOTE: Since the wrappers themselves are ALWAYS located in ## -## "/usr/bin", this directory will always be excluded ## -## from the search path. Since "/bin" is nothing more ## -## than a symbolic link to "/usr/bin" on Solaris, this ## -## directory will also always be excluded from the search ## -## path on this platform. ## -############################################################################### - -PATH=${BIN_DIR} -export PATH - - -############################################################################### -## (4) Execute the binary executable specified by this command wrapper ## -## based upon the preset LD_LIBRARY_PATH and PATH environment variables.## -############################################################################### - -ORIGINAL_IFS=${IFS} -IFS=: - -for dir in ${PATH} -do - if [ -x ${dir}/${COMMAND} ] - then - IFS=${ORIGINAL_IFS} - ${dir}/${COMMAND} "$@" - exit $? - fi -done - -echo "Unable to find \"${COMMAND}\" in \"${PATH}\"!" - -exit 255 -