include/base include/libaccess include/netsite.h include/public ldap/include ldap/servers ldap/systools lib/base lib/ldaputil lib/libaccess Makefile.am Makefile.in
by Mark Reynolds
Makefile.am | 1
Makefile.in | 22
include/base/systems.h | 312 --------
include/base/systhr.h | 7
include/libaccess/symbols.h | 8
include/netsite.h | 2
include/public/base/systems.h | 122 ---
include/public/nsapi.h | 2
ldap/include/lthread.h | 402 -----------
ldap/include/proto-ntutil.h | 111 ---
ldap/servers/plugins/distrib/Makefile.AIX | 76 --
ldap/servers/plugins/distrib/Makefile.BSDI | 62 -
ldap/servers/plugins/distrib/Makefile.IRIX | 62 -
ldap/servers/plugins/distrib/Makefile.OSF1 | 61 -
ldap/servers/plugins/distrib/Makefile.ReliantUNIX | 62 -
ldap/servers/plugins/distrib/Makefile.UnixWare | 62 -
ldap/servers/plugins/distrib/Makefile.UnixWareUDK | 62 -
ldap/servers/plugins/http/http_impl.c | 25
ldap/servers/plugins/pwdstorage/crypt_pwd.c | 2
ldap/servers/plugins/pwdstorage/pwd_init.c | 2
ldap/servers/plugins/replication/cl5_api.c | 2
ldap/servers/plugins/replication/repl5_init.c | 10
ldap/servers/plugins/replication/repl_shared.h | 4
ldap/servers/plugins/replication/replutil.c | 2
ldap/servers/plugins/replication/tests/makesim | 8
ldap/servers/plugins/uiduniq/plugin-utils.h | 4
ldap/servers/plugins/vattrsp_template/vattrsp.c | 14
ldap/servers/slapd/back-ldbm/back-ldbm.h | 10
ldap/servers/slapd/back-ldbm/index.c | 4
ldap/servers/slapd/back-ldbm/ldbm_attr.c | 5
ldap/servers/slapd/config.c | 13
ldap/servers/slapd/configdse.c | 2
ldap/servers/slapd/connection.c | 4
ldap/servers/slapd/csngen.c | 11
ldap/servers/slapd/daemon.c | 27
ldap/servers/slapd/detach.c | 17
ldap/servers/slapd/fe.h | 26
ldap/servers/slapd/globals.c | 58 -
ldap/servers/slapd/libglobs.c | 30
ldap/servers/slapd/libmakefile | 60 -
ldap/servers/slapd/localhost.c | 4
ldap/servers/slapd/main.c | 25
ldap/servers/slapd/ntuserpin.c | 214 -----
ldap/servers/slapd/passwd_extop.c | 4
ldap/servers/slapd/proto-slap.h | 14
ldap/servers/slapd/slap.h | 26
ldap/servers/slapd/slapi-plugin.h | 13
ldap/servers/slapd/snmp_collator.c | 9
ldap/servers/slapd/ssl.c | 54 -
ldap/servers/slapd/time.c | 4
ldap/servers/slapd/tools/ldaptool.h | 24
ldap/servers/slapd/tools/ldclt/data.c | 21
ldap/servers/slapd/tools/ldclt/ldapfct.c | 183 -----
ldap/servers/slapd/tools/ldclt/ldclt.c | 217 -----
ldap/servers/slapd/tools/ldclt/opCheck.c | 121 ---
ldap/servers/slapd/tools/ldclt/port.h | 16
ldap/servers/slapd/tools/ldclt/remote.h | 18
ldap/servers/slapd/tools/ldclt/utils.c | 95 --
ldap/servers/slapd/tools/migratecred.c | 8
ldap/servers/slapd/tools/mkdep.c | 74 --
ldap/servers/slapd/util.c | 3
ldap/systools/idsktune.c | 798 ----------------------
ldap/systools/viewcore.c | 8
lib/base/dnsdmain.cpp | 4
lib/base/file.cpp | 17
lib/base/systhr.cpp | 6
lib/ldaputil/examples/Certmap.mak | 286 -------
lib/ldaputil/examples/Makefile | 5
lib/ldaputil/examples/init.c | 7
lib/ldaputil/examples/plugin.c | 4
lib/libaccess/symbols.cpp | 4
71 files changed, 71 insertions(+), 3991 deletions(-)
New commits:
commit d42a531c6d0457766638bd941f7e8c85f6dcb30a
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Tue Jun 16 09:34:25 2015 -0400
Ticket 47998 - remove remaining obsolete OS code/files
Description: Removed remaining OS code (Tru64, SNI, SCO, UNIXware, etc)
https://fedorahosted.org/389/ticket/47998
Reviewed by: nhosoi(Thanks!)
diff --git a/Makefile.am b/Makefile.am
index 39fc2ee..8dcdb36 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -746,7 +746,6 @@ libslapd_la_SOURCES = ldap/servers/slapd/add.c \
ldap/servers/slapd/modify.c \
ldap/servers/slapd/modrdn.c \
ldap/servers/slapd/modutil.c \
- ldap/servers/slapd/ntuserpin.c \
ldap/servers/slapd/object.c \
ldap/servers/slapd/objset.c \
ldap/servers/slapd/operation.c \
diff --git a/Makefile.in b/Makefile.in
index 218bc8d..a29509d 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -740,9 +740,8 @@ am__libslapd_la_SOURCES_DIST = ldap/servers/slapd/add.c \
ldap/servers/slapd/log.c ldap/servers/slapd/mapping_tree.c \
ldap/servers/slapd/match.c ldap/servers/slapd/modify.c \
ldap/servers/slapd/modrdn.c ldap/servers/slapd/modutil.c \
- ldap/servers/slapd/ntuserpin.c ldap/servers/slapd/object.c \
- ldap/servers/slapd/objset.c ldap/servers/slapd/operation.c \
- ldap/servers/slapd/opshared.c \
+ ldap/servers/slapd/object.c ldap/servers/slapd/objset.c \
+ ldap/servers/slapd/operation.c ldap/servers/slapd/opshared.c \
ldap/servers/slapd/pagedresults.c ldap/servers/slapd/pblock.c \
ldap/servers/slapd/plugin.c ldap/servers/slapd/plugin_acl.c \
ldap/servers/slapd/plugin_internal_op.c \
@@ -819,7 +818,6 @@ am_libslapd_la_OBJECTS = ldap/servers/slapd/libslapd_la-add.lo \
ldap/servers/slapd/libslapd_la-modify.lo \
ldap/servers/slapd/libslapd_la-modrdn.lo \
ldap/servers/slapd/libslapd_la-modutil.lo \
- ldap/servers/slapd/libslapd_la-ntuserpin.lo \
ldap/servers/slapd/libslapd_la-object.lo \
ldap/servers/slapd/libslapd_la-objset.lo \
ldap/servers/slapd/libslapd_la-operation.lo \
@@ -2126,9 +2124,8 @@ libslapd_la_SOURCES = ldap/servers/slapd/add.c \
ldap/servers/slapd/log.c ldap/servers/slapd/mapping_tree.c \
ldap/servers/slapd/match.c ldap/servers/slapd/modify.c \
ldap/servers/slapd/modrdn.c ldap/servers/slapd/modutil.c \
- ldap/servers/slapd/ntuserpin.c ldap/servers/slapd/object.c \
- ldap/servers/slapd/objset.c ldap/servers/slapd/operation.c \
- ldap/servers/slapd/opshared.c \
+ ldap/servers/slapd/object.c ldap/servers/slapd/objset.c \
+ ldap/servers/slapd/operation.c ldap/servers/slapd/opshared.c \
ldap/servers/slapd/pagedresults.c ldap/servers/slapd/pblock.c \
ldap/servers/slapd/plugin.c ldap/servers/slapd/plugin_acl.c \
ldap/servers/slapd/plugin_internal_op.c \
@@ -4384,9 +4381,6 @@ ldap/servers/slapd/libslapd_la-modrdn.lo: \
ldap/servers/slapd/libslapd_la-modutil.lo: \
ldap/servers/slapd/$(am__dirstamp) \
ldap/servers/slapd/$(DEPDIR)/$(am__dirstamp)
-ldap/servers/slapd/libslapd_la-ntuserpin.lo: \
- ldap/servers/slapd/$(am__dirstamp) \
- ldap/servers/slapd/$(DEPDIR)/$(am__dirstamp)
ldap/servers/slapd/libslapd_la-object.lo: \
ldap/servers/slapd/$(am__dirstamp) \
ldap/servers/slapd/$(DEPDIR)/$(am__dirstamp)
@@ -5537,7 +5531,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/slapd/$(DEPDIR)/libslapd_la-modify.Plo(a)am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/slapd/$(DEPDIR)/libslapd_la-modrdn.Plo(a)am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/slapd/$(DEPDIR)/libslapd_la-modutil.Plo(a)am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/slapd/$(DEPDIR)/libslapd_la-ntuserpin.Plo(a)am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/slapd/$(DEPDIR)/libslapd_la-object.Plo(a)am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/slapd/$(DEPDIR)/libslapd_la-objset.Plo(a)am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/slapd/$(DEPDIR)/libslapd_la-operation.Plo(a)am__quote@
@@ -7908,13 +7901,6 @@ ldap/servers/slapd/libslapd_la-modutil.lo: ldap/servers/slapd/modutil.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libslapd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ldap/servers/slapd/libslapd_la-modutil.lo `test -f 'ldap/servers/slapd/modutil.c' || echo '$(srcdir)/'`ldap/servers/slapd/modutil.c
-ldap/servers/slapd/libslapd_la-ntuserpin.lo: ldap/servers/slapd/ntuserpin.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libslapd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ldap/servers/slapd/libslapd_la-ntuserpin.lo -MD -MP -MF ldap/servers/slapd/$(DEPDIR)/libslapd_la-ntuserpin.Tpo -c -o ldap/servers/slapd/libslapd_la-ntuserpin.lo `test -f 'ldap/servers/slapd/ntuserpin.c' || echo '$(srcdir)/'`ldap/servers/slapd/ntuserpin.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ldap/servers/slapd/$(DEPDIR)/libslapd_la-ntuserpin.Tpo ldap/servers/slapd/$(DEPDIR)/libslapd_la-ntuserpin.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ldap/servers/slapd/ntuserpin.c' object='ldap/servers/slapd/libslapd_la-ntuserpin.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libslapd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ldap/servers/slapd/libslapd_la-ntuserpin.lo `test -f 'ldap/servers/slapd/ntuserpin.c' || echo '$(srcdir)/'`ldap/servers/slapd/ntuserpin.c
-
ldap/servers/slapd/libslapd_la-object.lo: ldap/servers/slapd/object.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libslapd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ldap/servers/slapd/libslapd_la-object.lo -MD -MP -MF ldap/servers/slapd/$(DEPDIR)/libslapd_la-object.Tpo -c -o ldap/servers/slapd/libslapd_la-object.lo `test -f 'ldap/servers/slapd/object.c' || echo '$(srcdir)/'`ldap/servers/slapd/object.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ldap/servers/slapd/$(DEPDIR)/libslapd_la-object.Tpo ldap/servers/slapd/$(DEPDIR)/libslapd_la-object.Plo
diff --git a/include/base/systems.h b/include/base/systems.h
index 044cb83..3ba039f 100644
--- a/include/base/systems.h
+++ b/include/base/systems.h
@@ -64,66 +64,8 @@
/* --- Begin platform-specific definitions --- */
-#if defined(AIX)
-#define ACCELERATOR_CACHE
-#define AUTH_DBM
-#define BSD_RLIMIT
-#undef BSD_SIGNALS
-/* AIX can handle really big shoes */
-#define DAEMON_LISTEN_SIZE 4096
-#define DAEMON_NEEDS_SEMAPHORE
-#define DAEMON_UNIX_MOBRULE
-#define DLL_CAPABLE
-#define DLL_DLOPEN
-#define DLL_DLOPEN_FLAGS RTLD_NOW|RTLD_GLOBAL
-#define DNS_CACHE
-#define FILE_INHERIT_FCNTL
-#define FILE_MMAP_FLAGS MAP_SHARED
-#define HAS_STATFS
-#define HAVE_ATEXIT
-#define HAVE_PW_R /* reent passwd routines */
-#define HAVE_STRERROR_R
-#define HAVE_STRTOK_R
-#define HAVE_TIME_R 2 /* arg count */
-#define HAVE_STRFTIME /* no cftime */
-#define JAVA_STATIC_LINK
-#undef NEED_CRYPT_H
-#define NEED_SETEID_PROTO /* setegid, seteuid */
-#define NEED_STRINGS_H /* for strcasecmp */
-#define NET_SOCKETS
-#define SA_HANDLER_T(x) (void (*)(int))x
-#if OSVERSION < 4210
-#define SA_NOCLDWAIT 0 /* AIX < 4.2 don't got this */
-#endif /* OSVERSION < 4210 */
-#define SHMEM_MMAP_FLAGS MAP_SHARED
-#ifdef HW_THREADS
-#define THREAD_ANY
-#endif
-
-#elif defined(BSDI)
-
-#define ACCELERATOR_CACHE
-#define AUTH_DBM
-#define BSD_MAIL
-#define BSD_RLIMIT
-#define BSD_SIGNALS
-#define BSD_TIME
-#define DAEMON_UNIX_MOBRULE
-#define DNS_CACHE
-#define FILE_INHERIT_FCNTL
-#define FILE_MMAP_FLAGS (MAP_FILE | MAP_SHARED)
-#define HAS_STATFS
-#define HAVE_ATEXIT
-#undef NEED_CRYPT_PROTO
-#define NET_SOCKETS
-#ifndef NO_DOMAINNAME
-#define NO_DOMAINNAME
-#endif
-#define SHMEM_MMAP_FLAGS MAP_SHARED
-#define JAVA_STATIC_LINK
-
-#elif defined(HPUX)
+#if defined(HPUX)
#define ACCELERATOR_CACHE
#define AUTH_DBM
@@ -149,169 +91,6 @@
/* warning: mmap doesn't work under 9.04 */
#define SHMEM_MMAP_FLAGS MAP_FILE | MAP_VARIABLE | MAP_SHARED
-#elif defined (IRIX)
-
-#define ACCELERATOR_CACHE
-#define AUTH_DBM
-#define BSD_RLIMIT
-#undef BSD_SIGNALS
-#define DAEMON_UNIX_MOBRULE
-#define DLL_CAPABLE
-#define DLL_DLOPEN
-#define DLL_DLOPEN_FLAGS RTLD_NOW
-#define DNS_CACHE
-#define FILE_INHERIT_FCNTL
-#define FILE_MMAP_FLAGS MAP_SHARED
-#define HAS_STATVFS
-#define HAVE_ATEXIT
-#define HAVE_STRTOK_R
-#ifdef IRIX
-#define HAVE_TIME_R 2 /* arg count */
-#else
-#define HAVE_TIME_R 3 /* arg count */
-#define NEED_SETEID_PROTO /* setegid, seteuid */
-#endif
-#define JAVA_STATIC_LINK
-#define NEED_CRYPT_H
-#define NET_SOCKETS
-#define SA_HANDLER_T(x) (void (*)(int))x
-#define SHMEM_MMAP_FLAGS MAP_SHARED
-#define THROW_HACK throw()
-
-#elif defined(NCR)
-
-#define ACCELERATOR_CACHE
-#define AUTH_DBM
-#undef BSD_RLIMIT
-/* #define DAEMON_NEEDS_SEMAPHORE */
-#define DAEMON_UNIX_MOBRULE
-#define DLL_CAPABLE
-#define DLL_DLOPEN
-#define DLL_DLOPEN_FLAGS RTLD_NOW
-#define DNS_CACHE
-#define FILE_INHERIT_FCNTL
-#define FILE_MMAP_FLAGS MAP_SHARED
-#define HAS_STATVFS
-#define HAVE_ATEXIT
-#define HAVE_STRTOK_R
-#define JAVA_STATIC_LINK
-#define NEED_CRYPT_H
-#define NEED_FILIO
-#define NEED_GHN_PROTO
-#define NET_SOCKETS
-#define SHMEM_MMAP_FLAGS MAP_SHARED
-
-#elif defined(NEC)
-
-#define ACCELERATOR_CACHE
-#define DNS_CACHE
-#define AUTH_DBM
-#undef BSD_RLIMIT
-#define DAEMON_NEEDS_SEMAPHORE
-#define DAEMON_UNIX_MOBRULE
-#define DLL_DLOPEN
-#define DLL_DLOPEN_FLAGS RTLD_NOW
-#define DLL_CAPABLE
-#define FILE_INHERIT_FCNTL
-#define FILE_MMAP_FLAGS MAP_SHARED
-#define HAS_STATVFS
-#define HAVE_ATEXIT
-#define HAVE_STRTOK_R
-#define HAVE_TIME_R 2 /* arg count */
-#define JAVA_STATIC_LINK
-#define NEED_CRYPT_H
-#define NEED_FILIO
-#define NET_SOCKETS
-#define SHMEM_MMAP_FLAGS MAP_SHARED
-
-#elif defined(OSF1)
-
-#define ACCELERATOR_CACHE
-#define AUTH_DBM
-#define BSD_RLIMIT
-#undef BSD_SIGNALS
-#define BSD_TIME
-#define DAEMON_NEEDS_SEMAPHORE
-#define DAEMON_UNIX_MOBRULE
-#define DLL_CAPABLE
-#define DLL_DLOPEN
-#define DLL_DLOPEN_FLAGS RTLD_NOW
-#define DNS_CACHE
-#define FILE_INHERIT_FCNTL
-#define FILE_MMAP_FLAGS MAP_SHARED
-#define HAVE_ATEXIT
-#define HAVE_STRFTIME /* no cftime */
-#define HAVE_TIME_R 2 /* ctime_r arg count */
-#define NET_SOCKETS
-#define SA_HANDLER_T(x) (void (*)(int))x
-#define SHMEM_MMAP_FLAGS MAP_SHARED
-
-#elif defined(SCO)
-
-#define ACCELERATOR_CACHE
-#define AUTH_DBM
-#undef BSD_RLIMIT
-#undef BSD_SIGNALS
-#define DAEMON_NEEDS_SEMAPHORE
-#define DAEMON_UNIX_MOBRULE
-#define DLL_CAPABLE
-#define DLL_DLOPEN
-#define DLL_DLOPEN_FLAGS RTLD_NOW
-#define DNS_CACHE
-#define FILE_INHERIT_FCNTL
-#define FILE_MMAP_FLAGS MAP_SHARED
-#define HAS_STATVFS
-#define HAVE_ATEXIT
-#undef NEED_CRYPT_H
-#undef NEED_FILIO
-#undef NEED_GHN_PROTO
-#undef NEED_SETEID_PROTO /* setegid, seteuid */
-#define NET_SOCKETS
-#define SHMEM_MMAP_FLAGS MAP_SHARED
-#define SA_HANDLER_T(x) (void (*)(int))x
-
-
-#elif defined(SNI)
-
-#define ACCELERATOR_CACHE
-#define AUTH_DBM
-#undef BSD_RLIMIT
-#define DAEMON_NEEDS_SEMAPHORE
-#define DAEMON_UNIX_MOBRULE
-#define DLL_CAPABLE
-#define DLL_DLOPEN
-#define DLL_DLOPEN_FLAGS RTLD_NOW
-#define DNS_CACHE
-#define FILE_INHERIT_FCNTL
-#define FILE_MMAP_FLAGS MAP_SHARED
-#define HAS_STATVFS
-#define HAVE_ATEXIT
-#define JAVA_STATIC_LINK
-#define NEED_CRYPT_H
-#define NEED_FILIO
-#define NEED_SETEID_PROTO /* setegid, seteuid */
-#define NET_SOCKETS
-#define SHMEM_MMAP_FLAGS MAP_SHARED
-#define USE_PIPE
-/*
- * define this if your C++ platform has separate inline functions for
- * e.g. const char *strchr(const char *, char)
- * and
- * char *strchr(char *, char)
- * and your compiler complains about this:
- * func(const char *bla)
- * {
- * char *fasel = strchr(bla, '.');
- * ....
- * because it says that you cannot initialize a char * with a const char *
- */
-#define HAS_CONSTVALUED_STRFUNCS
-
-/* hack for C++ platforms where bool is a keyword */
-#ifndef boolean
-#define boolean boolean
-#endif
-
#elif defined(Linux)
#define ACCELERATOR_CACHE
@@ -333,12 +112,12 @@
#define HAS_STATFS
#define JAVA_STATIC_LINK
#define SA_HANDLER_T(x) (void (*)(int))(x)
-
#undef NEED_CRYPT_PROTO
#define NET_SOCKETS
#ifndef NO_DOMAINNAME
#define NO_DOMAINNAME
#endif
+
#elif defined(SOLARIS) || defined(SOLARISx86)
#define ACCELERATOR_CACHE
@@ -369,21 +148,6 @@
#endif
#define SHMEM_MMAP_FLAGS MAP_SHARED
-#elif defined (SONY)
-
-#define AUTH_DBM
-#undef BSD_RLIMIT
-#define DAEMON_NEEDS_SEMAPHORE
-#define DAEMON_UNIX_MOBRULE
-#define DLL_CAPABLE
-#define FILE_INHERIT_FCNTL
-#define FILE_MMAP_FLAGS MAP_SHARED
-#define HAVE_ATEXIT
-#define NEED_CRYPT_H
-#define NEED_FILIO
-#define NET_SOCKETS
-#define SHMEM_MMAP_FLAGS MAP_SHARED
-
#elif defined(SUNOS4)
#define ACCELERATOR_CACHE
@@ -407,37 +171,6 @@
#define NET_SOCKETS
#define SHMEM_MMAP_FLAGS MAP_SHARED
-#elif defined(UNIXWARE) || defined(UnixWare)
-
-#define ACCELERATOR_CACHE
-#define AUTH_DBM
-#undef BSD_RLIMIT
-#define DAEMON_UNIX_MOBRULE
-#define DLL_CAPABLE
-#define DLL_DLOPEN
-#define DLL_DLOPEN_FLAGS RTLD_NOW
-#define DNS_CACHE
-#define FILE_INHERIT_FCNTL
-#define FILE_MMAP_FLAGS MAP_SHARED
-#define HAS_STATVFS
-#define HAVE_ATEXIT
-#define NEED_CRYPT_H
-#define NEED_FILIO
-#define NEED_GHN_PROTO
-#define NEED_SETEID_PROTO /* setegid, seteuid */
-#define NET_SOCKETS
-#define SHMEM_MMAP_FLAGS MAP_SHARED
-
-#ifndef boolean
-#define boolean boolean
-#endif
-
-#if defined (UnixWare)
-/* UnixWare but not UNIXWARE... */
-#define NEED_STRINGS_H /* for strcasecmp */
-#define SA_HANDLER_T(x) (void (*)(int))x
-#endif
-
#else
#error "Missing defines in ns/netsite/include/base/systems.h"
#endif
@@ -483,10 +216,6 @@
#define THREAD_NSPR_USER
#else
#define THREAD_NSPR_KERNEL
-#ifdef IRIX
-#undef SEM_FLOCK
-#define SEM_IRIX
-#endif /* IRIX */
#endif /* SW_THREADS */
#define THREAD_ANY
@@ -514,43 +243,6 @@ typedef PRFileDesc *SYS_NETFD;
#define SYS_NETFD_T PRFileDesc *
#endif /* !SYS_NETFD_T */
-#ifdef SEM_WIN32
-
-typedef HANDLE SEMAPHORE;
-#define SEMAPHORE_T HANDLE
-#define SEM_ERROR NULL
-/* That oughta hold them (I hope) */
-#define SEM_MAXVALUE 32767
-
-#elif defined(SEM_IRIX)
-
-#ifndef OS_ULOCKS_H
-#include <ulocks.h>
-#define OS_ULOCKS_H
-#endif /* !OS_ULOCKS_H */
-
-typedef struct {
- usptr_t *arena;
- usema_t *sem;
-} semirix_s;
-typedef semirix_s* SEMAPHORE;
-#define SEMAPHORE_T semirix_s *
-#define SEM_ERROR NULL
-
-#elif defined(SEM_FLOCK)
-
-#define SEMAPHORE_T SYS_FILE
-typedef SYS_FILE SEMAPHORE;
-#define SEM_ERROR NULL
-
-#else /* ! SEM_WIN32, !SEM_IRIX */
-
-typedef int SEMAPHORE;
-#define SEMAPHORE_T int
-#define SEM_ERROR -1
-
-#endif /* SEM_WIN32 */
-
#endif /* !APSTUDIO_READONLY_SYMBOLS */
#endif /* BASE_SYSTEMS_H */
diff --git a/include/base/systhr.h b/include/base/systhr.h
index 20cc4ad..30b5bab 100644
--- a/include/base/systhr.h
+++ b/include/base/systhr.h
@@ -65,15 +65,8 @@
NSPR_BEGIN_EXTERN_C
-#ifdef UnixWare
-typedef void(*ArgFn_systhread_start)(void *);
-NSAPI_PUBLIC
-SYS_THREAD INTsysthread_start( int prio, int stksz, \
- ArgFn_systhread_start, void *arg);
-#else
NSAPI_PUBLIC
SYS_THREAD INTsysthread_start(int prio, int stksz, void (*fn)(void *), void *arg);
-#endif
NSAPI_PUBLIC SYS_THREAD INTsysthread_current(void);
diff --git a/include/libaccess/symbols.h b/include/libaccess/symbols.h
index f56b934..e6ff343 100644
--- a/include/libaccess/symbols.h
+++ b/include/libaccess/symbols.h
@@ -117,16 +117,8 @@ NSPR_BEGIN_EXTERN_C
extern int symTableAddSym(void * table, Symbol_t * newsym, void * symref);
extern void symTableRemoveSym(void * table, Symbol_t * sym);
extern void symTableDestroy(void * table, int flags);
-
-/* for ANSI C++ on SCO UDK, otherwise fn name is managled */
-#ifdef UnixWare
-typedef int (*ArgFn_symTableEnum)(Symbol_t * sym, void * parg);
-extern void symTableEnumerate(void * table, void * argp, ArgFn_symTableEnum);
-#else /* UnixWare */
extern void symTableEnumerate(void * table, void * argp,
int (*func)(Symbol_t * sym, void * parg));
-#endif /* UnixWare */
-
extern int symTableFindSym(void * table, const char * symname,
int symtype, void **psymref);
extern int symTableNew(void **ptable);
diff --git a/include/netsite.h b/include/netsite.h
index 9147430..295e539 100644
--- a/include/netsite.h
+++ b/include/netsite.h
@@ -78,12 +78,10 @@
#define VOID void
#endif
-#ifndef SNI
#if !defined (boolean) && !defined (__GNUC__)
typedef int boolean;
#endif
-#endif
#define NS_TRUE 1
#define NS_FALSE 0
diff --git a/include/public/base/systems.h b/include/public/base/systems.h
index cfd1388..049eb48 100644
--- a/include/public/base/systems.h
+++ b/include/public/base/systems.h
@@ -54,28 +54,7 @@
/* --- Begin native platform configuration definitions --- */
-#if defined(AIX)
-
-#define FILE_UNIX
-#define FILE_UNIX_MMAP
-#define MALLOC_POOLS
-#define SEM_FLOCK
-#define SHMEM_UNIX_MMAP
-#define ZERO(ptr,len) memset(ptr,0,len)
-#define NEED_STRCASECMP
-#define NEED_STRNCASECMP
-
-#elif defined(BSDI)
-
-#define BSD_FLOCK
-#define FILE_UNIX
-#define FILE_UNIX_MMAP
-#define MALLOC_POOLS
-#define SEM_FLOCK
-#define SHMEM_UNIX_MMAP
-#define ZERO(ptr,len) memset(ptr,0,len)
-
-#elif defined(HPUX)
+#if defined(HPUX)
#define FILE_UNIX
#define FILE_UNIX_MMAP
@@ -85,78 +64,6 @@
#define SHMEM_UNIX_MMAP
#define ZERO(ptr,len) memset(ptr,0,len)
-#elif defined (IRIX)
-
-#define FILE_UNIX
-#define FILE_UNIX_MMAP
-#define MALLOC_POOLS
-#define SEM_FLOCK
-#define SHMEM_UNIX_MMAP
-#define ZERO(ptr,len) memset(ptr,0,len)
-
-#elif defined(NCR)
-
-#define CASECMPARG_T unsigned
-#define FILE_UNIX
-#define FILE_UNIX_MMAP
-#define MALLOC_POOLS
-#define NEED_STRCASECMP
-#define NEED_STRNCASECMP
-#ifndef S_ISLNK
-#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
-#endif
-#define SEM_FLOCK
-#define SHMEM_UNIX_MMAP
-#define ZERO(ptr,len) memset(ptr,0,len)
-
-#elif defined(NEC)
-
-#define FILE_UNIX
-#define FILE_UNIX_MMAP
-#define MALLOC_POOLS
-#define NEED_STRCASECMP
-#define NEED_STRNCASECMP
-#ifndef S_ISLNK
-#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
-#endif
-#define SEM_FLOCK
-#define SHMEM_UNIX_MMAP
-#define ZERO(ptr,len) memset(ptr,0,len)
-
-#elif defined(OSF1)
-
-#undef BSD_FLOCK
-#define FILE_UNIX
-#define FILE_UNIX_MMAP
-#define MALLOC_POOLS
-#define SEM_FLOCK
-#define SHMEM_UNIX_MMAP
-#define ZERO(ptr,len) memset(ptr,0,len)
-
-#elif defined(SCO)
-
-#define FILE_UNIX
-#define FILE_UNIX_MMAP
-#define MALLOC_POOLS
-#define SEM_FLOCK
-#define SHMEM_UNIX_MMAP
-#define ZERO(ptr,len) memset(ptr,0,len)
-
-#elif defined(SNI)
-
-#define CASECMPARG_T const
-#define FILE_UNIX
-#define FILE_UNIX_MMAP
-#define MALLOC_POOLS
-#define NEED_STRCASECMP
-#define NEED_STRNCASECMP
-#define SEM_FLOCK
-#define SHMEM_UNIX_MMAP
-#if 0
-#define socketpair(a,b,c,d) pipe(d)
-#endif
-#define ZERO(ptr,len) memset(ptr,0,len)
-
#elif defined(SOLARIS) || defined (SOLARISx86)
#undef FILE_UNIX /* avoid redefinition message */
@@ -168,16 +75,6 @@
#define SHMEM_UNIX_MMAP
#define ZERO(ptr,len) memset(ptr,0,len)
-#elif defined (SONY)
-
-#define FILE_UNIX
-#define FILE_UNIX_MMAP
-#define NEED_STRCASECMP
-#define NEED_STRNCASECMP
-#define SEM_FLOCK
-#define SHMEM_UNIX_MMAP
-#define ZERO(ptr,len) memset(ptr,0,len)
-
#elif defined(SUNOS4)
#define BSD_FLOCK
@@ -188,21 +85,6 @@
#define SHMEM_UNIX_MMAP
#define ZERO(ptr,len) memset(ptr,0,len)
-#elif defined(UNIXWARE) || defined(UnixWare)
-
-#define CASECMPARG_T const
-#define FILE_UNIX
-#define FILE_UNIX_MMAP
-#define MALLOC_POOLS
-#define NEED_STRCASECMP
-#define NEED_STRNCASECMP
-#ifndef S_ISLNK
-#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
-#endif
-#define SEM_FLOCK
-#define SHMEM_UNIX_MMAP
-#define ZERO(ptr,len) memset(ptr,0,len)
-
#elif defined(Linux)
#define FILE_UNIX
@@ -213,9 +95,7 @@
#define ZERO(ptr,len) memset(ptr,0,len)
#else
-
#error "Missing defines in ns/netsite/include/public/base/systems.h"
-
#endif
#ifndef NSPR_BEGIN_EXTERN_C
diff --git a/include/public/nsapi.h b/include/public/nsapi.h
index 5dde361..b85a81c 100644
--- a/include/public/nsapi.h
+++ b/include/public/nsapi.h
@@ -54,7 +54,7 @@
#include "base/systems.h"
-#if defined(FILE_UNIX_MMAP) || defined(FILE_WIN32_MMAP)
+#if defined(FILE_UNIX_MMAP)
#define FILE_MMAP
#endif
diff --git a/ldap/include/lthread.h b/ldap/include/lthread.h
deleted file mode 100644
index 910adb3..0000000
--- a/ldap/include/lthread.h
+++ /dev/null
@@ -1,402 +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 **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/* lthread.h - ldap threads header file */
-
-#ifndef _LTHREAD_H
-#define _LTHREAD_H
-
-#if defined( THREAD_SUNOS4_LWP )
-/***********************************
- * *
- * thread definitions for sunos4 *
- * *
- ***********************************/
-
-#define _THREAD
-
-#include <lwp/lwp.h>
-#include <lwp/stackdep.h>
-
-typedef void *(*VFP)();
-
-/* thread attributes and thread type */
-typedef int pthread_attr_t;
-typedef thread_t pthread_t;
-
-/* default attr states */
-#define pthread_mutexattr_default NULL
-#define pthread_condattr_default NULL
-
-/* thread state - joinable or not */
-#define PTHREAD_CREATE_JOINABLE 0
-#define PTHREAD_CREATE_DETACHED 1
-/* thread scope - who is in scheduling pool */
-#define PTHREAD_SCOPE_PROCESS 0
-#define PTHREAD_SCOPE_SYSTEM 1
-
-/* mutex attributes and mutex type */
-typedef int pthread_mutexattr_t;
-typedef mon_t pthread_mutex_t;
-
-/* mutex and condition variable scope - process or system */
-#define PTHREAD_SHARE_PRIVATE 0
-#define PTHREAD_SHARE_PROCESS 1
-
-/* condition variable attributes and condition variable type */
-typedef int pthread_condattr_t;
-typedef struct lwpcv {
- int lcv_created;
- cv_t lcv_cv;
-} pthread_cond_t;
-
-#else /* end sunos4 */
-
-#if defined( THREAD_SUNOS5_LWP )
-/***********************************
- * *
- * thread definitions for sunos5 *
- * *
- ***********************************/
-
-#define _THREAD
-
-#include <thread.h>
-#include <synch.h>
-
-typedef void *(*VFP)();
-
-/* sunos5 threads are preemptive */
-#define PTHREAD_PREEMPTIVE 1
-
-/* thread attributes and thread type */
-typedef int pthread_attr_t;
-typedef thread_t pthread_t;
-
-/* default attr states */
-#define pthread_mutexattr_default NULL
-#define pthread_condattr_default NULL
-
-/* thread state - joinable or not */
-#define PTHREAD_CREATE_JOINABLE 0
-#define PTHREAD_CREATE_DETACHED THR_DETACHED
-/* thread scope - who is in scheduling pool */
-#define PTHREAD_SCOPE_PROCESS 0
-#define PTHREAD_SCOPE_SYSTEM THR_BOUND
-
-/* mutex attributes and mutex type */
-typedef int pthread_mutexattr_t;
-typedef mutex_t pthread_mutex_t;
-
-/* mutex and condition variable scope - process or system */
-#define PTHREAD_SHARE_PRIVATE USYNC_THREAD
-#define PTHREAD_SHARE_PROCESS USYNC_PROCESS
-
-/* condition variable attributes and condition variable type */
-typedef int pthread_condattr_t;
-typedef cond_t pthread_cond_t;
-
-#else /* end sunos5 */
-
-#if defined( THREAD_MIT_PTHREADS )
-/***********************************
- * *
- * definitions for mit pthreads *
- * *
- ***********************************/
-
-#define _THREAD
-
-#include <pthread.h>
-
-#else /* end mit pthreads */
-
-#if defined( THREAD_AIX_PTHREADS )
-/***********************************
- * *
- * definitions for aix pthreads *
- * *
- ***********************************/
-
-#define _THREAD
-
-#include <pthread.h>
-
-typedef void *(*VFP)(void *);
-
-/* thread state - joinable or not */
-#define PTHREAD_CREATE_JOINABLE 0
-
-/* default attr states */
-#define pthread_mutexattr_default NULL
-#define pthread_condattr_default NULL
-
-#else /* aix pthreads */
-
-#if defined( THREAD_HP_DCE_PTHREADS )
-/**************************************
- * *
- * definitions for HP dce pthreads *
- * *
- **************************************/
-
-#define _THREAD
-typedef void *(*VFP)();
-
-#include <pthread.h>
-
-/* dce threads are preemptive */
-#define PTHREAD_PREEMPTIVE 1
-
-/* pthread_kill() is a noop on HP */
-#define PTHREAD_KILL_IS_NOOP 1
-
-/* thread state - joinable or not */
-#define PTHREAD_CREATE_JOINABLE 0
-#define PTHREAD_CREATE_DETACHED 1
-
-#define pthread_attr_init( a ) pthread_attr_create( a )
-#define pthread_attr_destroy( a ) pthread_attr_delete( a )
-#define pthread_attr_setdetachstate( a, b ) \
- pthread_attr_setdetach_np( a, b )
-/*
- * HP's DCE threads implementation passes a (pthread_attr_t *)
- * for the second argument. So, we need to fake things a bit.
- * hpdce_pthread_create_detached() is in thread.c. Note that we
- * create threads and detach them. If you need to create a joinable
- * thread, you need to call hpdce_pthread_create_joinable() directly.
- */
-#define pthread_create( a, b, c, d ) \
- hpdce_pthread_create_detached( a, b, c, d )
-
-int
-hpdce_pthread_create_joinable( pthread_t *tid, pthread_attr_t *attr,
- VFP func, void *arg );
-int hpdce_pthread_create_detached( pthread_t *tid, pthread_attr_t *attr,
- VFP func, void *arg );
-#else /* HP dce pthreads */
-
-#if defined( THREAD_DCE_PTHREADS )
-/***********************************
- * *
- * definitions for dce pthreads *
- * *
- ***********************************/
-
-#define _THREAD
-typedef void *(*VFP)();
-
-#include <pthread.h>
-
-/* dce threads are preemptive */
-#define PTHREAD_PREEMPTIVE 1
-
-/* thread state - joinable or not */
-#ifndef PTHREAD_CREATE_JOINABLE
-#define PTHREAD_CREATE_JOINABLE 0
-#endif
-#ifndef PTHREAD_CREATE_DETACHED
-#define PTHREAD_CREATE_DETACHED 1
-#endif
-
-#define pthread_attr_init( a ) pthread_attr_create( a )
-#define pthread_attr_destroy( a ) pthread_attr_delete( a )
-#define pthread_attr_setdetachstate( a, b ) \
- pthread_attr_setdetach_np( a, b )
-#if defined( OSF1 )
-/* pthread_create's second parameter is passed by value, not by reference.
- * To work around this, call another function instead:
- */
-#define pthread_create( a, b, c, d ) std_pthread_create( a, b, c, d )
-extern int
-std_pthread_create (pthread_t *tid,
- pthread_attr_t *attr,
- pthread_startroutine_t func,
- pthread_addr_t arg); /* defined in thread.c */
-
-/* OSF1 doesn't support pthread_kill() */
-#define PTHREAD_KILL_IS_NOOP 1
-
-#endif /* OSF1 */
-
-#else /* dce pthreads */
-
-#if defined( THREAD_SGI_SPROC )
-/***********************************
- * *
- * thread definitions for sgi irix *
- * *
- ***********************************/
-
-#define _THREAD
-
-#include <sys/types.h>
-#include <sys/signal.h>
-#include <sys/procset.h>
-#include <sys/prctl.h>
-#include <ulocks.h>
-
-typedef void *(*VFP)(void *);
-
-/* sgi threads are preemptive */
-#define PTHREAD_PREEMPTIVE 1
-
-/* thread attributes and thread type */
-typedef int pthread_attr_t;
-typedef pid_t pthread_t;
-
-/* default attr states */
-#define pthread_mutexattr_default 0
-#define pthread_condattr_default 0
-
-/* thread state - joinable or not */
-#define PTHREAD_CREATE_JOINABLE 0
-#define PTHREAD_CREATE_DETACHED 1
-/* thread scope - who is in scheduling pool */
-#define PTHREAD_SCOPE_PROCESS 0
-#define PTHREAD_SCOPE_SYSTEM 1
-
-/* mutex attributes and mutex type */
-typedef int pthread_mutexattr_t;
-typedef int pthread_mutex_t;
-
-/* mutex and condition variable scope - process or system */
-#define PTHREAD_SHARE_PRIVATE 0
-#define PTHREAD_SHARE_PROCESS 1
-
-/* condition variable attributes and condition variable type */
-typedef int pthread_condattr_t;
-struct irix_cv_waiter {
- pid_t icvw_pid;
- struct irix_cv_waiter *icvw_next;
-};
-typedef struct irix_cv {
- pthread_mutex_t icv_mutex;
- pthread_mutex_t *icv_waitermutex;
- struct irix_cv_waiter *icv_waiterq;
-} pthread_cond_t;
-
-#else
-
-#endif /* sgi sproc */
-#endif /* dce pthreads */
-#endif /* hp dce pthreads */
-#endif /* aix pthreads */
-#endif /* mit pthreads */
-#endif /* sunos5 */
-#endif /* sunos4 */
-
-#ifndef _THREAD
-
-/***********************************
- * *
- * thread definitions for no *
- * underlying library support *
- * *
- ***********************************/
-
-typedef void *(*VFP)();
-
-/* thread attributes and thread type */
-typedef int pthread_attr_t;
-typedef int pthread_t;
-
-/* default attr states */
-#define pthread_mutexattr_default NULL
-#define pthread_condattr_default NULL
-
-/* thread state - joinable or not */
-#define PTHREAD_CREATE_JOINABLE 0
-#define PTHREAD_CREATE_DETACHED 0
-/* thread scope - who is in scheduling pool */
-#define PTHREAD_SCOPE_PROCESS 0
-#define PTHREAD_SCOPE_SYSTEM 0
-
-/* mutex attributes and mutex type */
-typedef int pthread_mutexattr_t;
-typedef int pthread_mutex_t;
-
-/* mutex and condition variable scope - process or system */
-#define PTHREAD_SHARE_PRIVATE 0
-#define PTHREAD_SHARE_PROCESS 0
-
-/* condition variable attributes and condition variable type */
-typedef int pthread_condattr_t;
-typedef int pthread_cond_t;
-
-#endif /* no threads support */
-
-/* POSIX standard pthread function declarations: */
-
-int pthread_attr_init( pthread_attr_t *attr );
-int pthread_attr_destroy( pthread_attr_t *attr );
-int pthread_attr_getdetachstate( pthread_attr_t *attr, int *detachstate );
-int pthread_attr_setdetachstate( pthread_attr_t *attr, int detachstate );
-
-int pthread_create( pthread_t *tid, pthread_attr_t *attr, VFP func, void *arg );
-void pthread_yield();
-void pthread_exit();
-int pthread_kill( pthread_t tid, int sig );
-#if defined( hpux ) || defined( OSF1 ) || defined( AIXV4 ) /* <thread.h> declares pthread_join */
-#else
-int pthread_join( pthread_t tid, int *status );
-#endif
-
-#if defined( hpux ) || defined( OSF1 ) /* <thread.h> declares pthread_mutex_init */
-#else
-int pthread_mutex_init( pthread_mutex_t *mp, pthread_mutexattr_t *attr );
-#endif
-int pthread_mutex_destroy( pthread_mutex_t *mp );
-int pthread_mutex_lock( pthread_mutex_t *mp );
-int pthread_mutex_unlock( pthread_mutex_t *mp );
-int pthread_mutex_trylock( pthread_mutex_t *mp );
-
-#if defined( hpux ) || defined( OSF1 ) /* <thread.h> declares pthread_cond_init */
-#else
-int pthread_cond_init( pthread_cond_t *cv, pthread_condattr_t *attr );
-#endif
-int pthread_cond_destroy( pthread_cond_t *cv );
-int pthread_cond_wait( pthread_cond_t *cv, pthread_mutex_t *mp );
-int pthread_cond_signal( pthread_cond_t *cv );
-int pthread_cond_broadcast( pthread_cond_t *cv );
-
-#endif /* _LTHREAD_H */
diff --git a/ldap/include/proto-ntutil.h b/ldap/include/proto-ntutil.h
deleted file mode 100644
index 2629577..0000000
--- a/ldap/include/proto-ntutil.h
+++ /dev/null
@@ -1,111 +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 **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/******************************************************
- *
- *
- * proto-ntutil.h - Prototypes for utility functions used
- * throughout slapd on NT.
- *
- ******************************************************/
-#if defined( _WINDOWS )
-
-#ifndef _PROTO_NTUTIL
-#define _PROTO_NTUTIL
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- *
- * ntreg.c
- *
- */
-extern int SlapdGetRegSZ( LPTSTR lpszRegKey, LPSTR lpszValueName, LPTSTR lpszValue );
-extern void unixtodospath(char *szText);
-extern void dostounixpath(char *szText);
-
-
-/*
- *
- * getopt.c
- *
- */
-extern int getopt (int argc, char *const *argv, const char *optstring);
-extern char *optarg;
-/*
- *
- * ntevent.c
- *
- */
-extern BOOL MultipleInstances();
-extern BOOL SlapdIsAService();
-extern void InitializeSlapdLogging( LPTSTR lpszRegLocation, LPTSTR lpszEventLogName, LPTSTR lpszMessageFile );
-extern void ReportSlapdEvent(WORD wEventType, DWORD dwIdEvent, WORD wNumInsertStrings,
- char *pszStrings);
-extern BOOL ReportSlapdStatusToSCMgr(
- SERVICE_STATUS *serviceStatus,
- SERVICE_STATUS_HANDLE serviceStatusHandle,
- HANDLE Event,
- DWORD dwCurrentState,
- DWORD dwWin32ExitCode,
- DWORD dwCheckPoint,
- DWORD dwWaitHint);
-extern void WINAPI SlapdServiceCtrlHandler(DWORD dwOpcode);
-extern BOOL SlapdGetServerNameFromCmdline(char *szServerName, char *szCmdLine, int dirname);
-
-/*
- *
- * ntgetpassword.c
- *
- */
-extern char *Slapd_GetPassword();
-extern void CenterDialog(HWND hwndParent, HWND hwndDialog);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _PROTO_NTUTIL */
-
-#endif /* _WINDOWS */
diff --git a/ldap/servers/plugins/distrib/Makefile.AIX b/ldap/servers/plugins/distrib/Makefile.AIX
deleted file mode 100644
index 4803d06..0000000
--- a/ldap/servers/plugins/distrib/Makefile.AIX
+++ /dev/null
@@ -1,76 +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 ---
-#
-# AIX Makefile for Directory Server plug-in examples
-# NOTE: Make sure to set the DSLIB variable to the path
-# to the libslapd_shr.a file (for example,
-# DSLIB = /usr/netscape/suitespot/lib/libslapd_shr.a
-
-CC = xlC_r
-LD = ld
-
-# Set this to the path to the libslapd_shr.a file
-DSLIB =
-
-INCLUDE_FLAGS= -I../../include
-CFLAGS= $(INCLUDE_FLAGS) -qarch=com
-LIBPATH=/usr/lib/threads:/usr/lpp/xlC/lib:/usr/lib:/lib:..:../../../../lib
-EXTRA_LIBS= -bI:/usr/lib/lowsys.exp -lC_r -lC -lpthreads -lc_r -lm \
- /usr/lib/libc.a $(DSLIB)
-LDFLAGS= -bE:libtest-plugin_shr.exp -bM:SRE -bnoentry -blibpath:$(LIBPATH) \
- $(EXTRA_LIBS)
-
-OBJS = distrib
-
-all: libtest-plugin_shr.a
-
-
-libtest-plugin_shr.a: $(OBJS)
- rm -f libtest-plugin_shr.exp
- echo "#!" > libtest-plugin_shr.exp
- nm -B -C -g $(OBJS) | \
- awk '/ [B,T,D] / {print $$3}' | \
- sed -e 's/^\.//' | sort -u >> libtest-plugin_shr.exp
- $(LD) $(LDFLAGS) -o $@ $(OBJS)
-
-.c.o:
- $(CC) $(CFLAGS) -c $<
-
-clean:
- -rm -f $(OBJS) libtest-plugin_shr.a
-
diff --git a/ldap/servers/plugins/distrib/Makefile.BSDI b/ldap/servers/plugins/distrib/Makefile.BSDI
deleted file mode 100644
index 50ffa8c..0000000
--- a/ldap/servers/plugins/distrib/Makefile.BSDI
+++ /dev/null
@@ -1,62 +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 ---
-#
-# SOLARIS Makefile for Directory Server plug-in examples
-#
-
-CC = cc
-LD = ld
-
-INCLUDE_FLAGS = -I../../include
-CFLAGS = $(INCLUDE_FLAGS) -D_REENTRANT -KPIC
-LDFLAGS = -G
-
-OBJS = distrib.o
-
-all: libtest-plugin.so
-
-
-libtest-plugin.so: $(OBJS)
- $(LD) $(LDFLAGS) -o $@ $(OBJS)
-
-.c.o:
- $(CC) $(CFLAGS) -c $<
-
-clean:
- -rm -f $(OBJS) libtest-plugin.so
-
diff --git a/ldap/servers/plugins/distrib/Makefile.IRIX b/ldap/servers/plugins/distrib/Makefile.IRIX
deleted file mode 100644
index 55cd3ce..0000000
--- a/ldap/servers/plugins/distrib/Makefile.IRIX
+++ /dev/null
@@ -1,62 +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 ---
-#
-# IRIX Makefile for Directory Server plug-in examples
-#
-
-CC = cc
-LD = ld
-
-INCLUDE_FLAGS = -I../../include
-CFLAGS = $(INCLUDE_FLAGS) -D_SGI_MP_SOURCE -fullwarn
-LDFLAGS = -32 -shared
-
-OBJS = distrib.o
-
-all: libtest-plugin.so
-
-
-libtest-plugin.so: $(OBJS)
- $(LD) $(LDFLAGS) -o $@ $(OBJS)
-
-.c.o:
- $(CC) $(CFLAGS) -c $<
-
-clean:
- -rm -f $(OBJS) libtest-plugin.so
-
diff --git a/ldap/servers/plugins/distrib/Makefile.OSF1 b/ldap/servers/plugins/distrib/Makefile.OSF1
deleted file mode 100644
index 3f61b6b..0000000
--- a/ldap/servers/plugins/distrib/Makefile.OSF1
+++ /dev/null
@@ -1,61 +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 ---
-#
-# OSF1 Makefile for Directory Server plug-in examples
-
-CC = cc
-LD = ld
-
-INCLUDE = -I../../include
-CFLAGS = $(INCLUDE) -DIS_64 -ieee_with_inexact -pthread -DOSF1
-LDFLAGS = -shared -all -expect_unresolved "*" -taso
-
-
-OBJS = distrib.o
-
-all: libtest-plugin.so
-
-libtest-plugin.so: $(OBJS)
- $(LD) $(LDFLAGS) -o $@ $(OBJS)
-
-.c.o:
- $(CC) $(CFLAGS) -c $<
-
-clean:
- -rm -f $(OBJS) libtest-plugin.so
-
diff --git a/ldap/servers/plugins/distrib/Makefile.ReliantUNIX b/ldap/servers/plugins/distrib/Makefile.ReliantUNIX
deleted file mode 100644
index 50ffa8c..0000000
--- a/ldap/servers/plugins/distrib/Makefile.ReliantUNIX
+++ /dev/null
@@ -1,62 +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 ---
-#
-# SOLARIS Makefile for Directory Server plug-in examples
-#
-
-CC = cc
-LD = ld
-
-INCLUDE_FLAGS = -I../../include
-CFLAGS = $(INCLUDE_FLAGS) -D_REENTRANT -KPIC
-LDFLAGS = -G
-
-OBJS = distrib.o
-
-all: libtest-plugin.so
-
-
-libtest-plugin.so: $(OBJS)
- $(LD) $(LDFLAGS) -o $@ $(OBJS)
-
-.c.o:
- $(CC) $(CFLAGS) -c $<
-
-clean:
- -rm -f $(OBJS) libtest-plugin.so
-
diff --git a/ldap/servers/plugins/distrib/Makefile.UnixWare b/ldap/servers/plugins/distrib/Makefile.UnixWare
deleted file mode 100644
index 50ffa8c..0000000
--- a/ldap/servers/plugins/distrib/Makefile.UnixWare
+++ /dev/null
@@ -1,62 +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 ---
-#
-# SOLARIS Makefile for Directory Server plug-in examples
-#
-
-CC = cc
-LD = ld
-
-INCLUDE_FLAGS = -I../../include
-CFLAGS = $(INCLUDE_FLAGS) -D_REENTRANT -KPIC
-LDFLAGS = -G
-
-OBJS = distrib.o
-
-all: libtest-plugin.so
-
-
-libtest-plugin.so: $(OBJS)
- $(LD) $(LDFLAGS) -o $@ $(OBJS)
-
-.c.o:
- $(CC) $(CFLAGS) -c $<
-
-clean:
- -rm -f $(OBJS) libtest-plugin.so
-
diff --git a/ldap/servers/plugins/distrib/Makefile.UnixWareUDK b/ldap/servers/plugins/distrib/Makefile.UnixWareUDK
deleted file mode 100644
index 50ffa8c..0000000
--- a/ldap/servers/plugins/distrib/Makefile.UnixWareUDK
+++ /dev/null
@@ -1,62 +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 ---
-#
-# SOLARIS Makefile for Directory Server plug-in examples
-#
-
-CC = cc
-LD = ld
-
-INCLUDE_FLAGS = -I../../include
-CFLAGS = $(INCLUDE_FLAGS) -D_REENTRANT -KPIC
-LDFLAGS = -G
-
-OBJS = distrib.o
-
-all: libtest-plugin.so
-
-
-libtest-plugin.so: $(OBJS)
- $(LD) $(LDFLAGS) -o $@ $(OBJS)
-
-.c.o:
- $(CC) $(CFLAGS) -c $<
-
-clean:
- -rm -f $(OBJS) libtest-plugin.so
-
diff --git a/ldap/servers/plugins/http/http_impl.c b/ldap/servers/plugins/http/http_impl.c
index 98d0506..4da46cc 100644
--- a/ldap/servers/plugins/http/http_impl.c
+++ b/ldap/servers/plugins/http/http_impl.c
@@ -88,23 +88,14 @@ extern "C" {
#define LDAP_DEBUG_PLUGIN 0x10000 /* 65536 */
/* debugging stuff */
-# ifdef _WIN32
- extern int *module_ldap_debug;
-# define LDAPDebug( level, fmt, arg1, arg2, arg3 ) \
- { \
- if ( *module_ldap_debug & level ) { \
- slapd_log_error_proc( NULL, fmt, arg1, arg2, arg3 ); \
- } \
- }
-# else /* _WIN32 */
- extern int slapd_ldap_debug;
-# define LDAPDebug( level, fmt, arg1, arg2, arg3 ) \
- { \
- if ( slapd_ldap_debug & level ) { \
- slapd_log_error_proc( NULL, fmt, arg1, arg2, arg3 ); \
- } \
- }
-# endif /* Win32 */
+
+extern int slapd_ldap_debug;
+#define LDAPDebug( level, fmt, arg1, arg2, arg3 ) \
+{ \
+ if ( slapd_ldap_debug & level ) { \
+ slapd_log_error_proc( NULL, fmt, arg1, arg2, arg3 ); \
+ } \
+}
#ifdef __cplusplus
}
diff --git a/ldap/servers/plugins/pwdstorage/crypt_pwd.c b/ldap/servers/plugins/pwdstorage/crypt_pwd.c
index cdf3831..0656fd7 100644
--- a/ldap/servers/plugins/pwdstorage/crypt_pwd.c
+++ b/ldap/servers/plugins/pwdstorage/crypt_pwd.c
@@ -49,7 +49,7 @@
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
-#if defined( hpux ) || defined ( AIX ) || defined (LINUX) || defined (OSF1)
+#if defined( hpux ) || defined (LINUX)
#ifndef __USE_XOPEN
#define __USE_XOPEN /* linux */
#endif /* __USE_XOPEN */
diff --git a/ldap/servers/plugins/pwdstorage/pwd_init.c b/ldap/servers/plugins/pwdstorage/pwd_init.c
index 4678f31..964986c 100644
--- a/ldap/servers/plugins/pwdstorage/pwd_init.c
+++ b/ldap/servers/plugins/pwdstorage/pwd_init.c
@@ -271,7 +271,6 @@ ssha512_pwd_storage_scheme_init( Slapi_PBlock *pb )
return( rc );
}
-#ifndef _WIN32
int
crypt_pwd_storage_scheme_init( Slapi_PBlock *pb )
{
@@ -296,7 +295,6 @@ crypt_pwd_storage_scheme_init( Slapi_PBlock *pb )
slapi_log_error( SLAPI_LOG_PLUGIN, plugin_name, "<= crypt_pwd_storage_scheme_init %d\n\n", rc );
return( rc );
}
-#endif
int
clear_pwd_storage_scheme_init( Slapi_PBlock *pb )
diff --git a/ldap/servers/plugins/replication/cl5_api.c b/ldap/servers/plugins/replication/cl5_api.c
index 81c0408..0d9b8d9 100644
--- a/ldap/servers/plugins/replication/cl5_api.c
+++ b/ldap/servers/plugins/replication/cl5_api.c
@@ -164,7 +164,7 @@
* pointers are allocated 8 bytes but lower 4 bytes are used.
* The value 0 means use the default stacksize.
*/
-#if defined (OSF1) || defined (__LP64__) || defined (_LP64) /* 64-bit architectures need bigger stacks */
+#if defined (__LP64__) || defined (_LP64) /* 64-bit architectures need bigger stacks */
#if defined(__hpux) && defined(__ia64)
#define DEFAULT_THREAD_STACKSIZE 524288L
#else
diff --git a/ldap/servers/plugins/replication/repl5_init.c b/ldap/servers/plugins/replication/repl5_init.c
index 8e2f114..5800d50 100644
--- a/ldap/servers/plugins/replication/repl5_init.c
+++ b/ldap/servers/plugins/replication/repl5_init.c
@@ -70,18 +70,8 @@ nsslapd-plugindescription: Multi-Master Replication Plugin
#include "repl.h"
#include "repl5.h"
#include "cl5.h" /* changelog interface */
-
#include "plstr.h"
-/* #ifdef _WIN32
-int *module_ldap_debug = 0;
-
-void plugin_init_debug_level(int *level_ptr)
-{
- module_ldap_debug = level_ptr;
-}
-#endif*/
-
#define NSDS_REPL_NAME_PREFIX "Netscape Replication"
static char *start_oid_list[] = {
diff --git a/ldap/servers/plugins/replication/repl_shared.h b/ldap/servers/plugins/replication/repl_shared.h
index 9a0d014..62d1f4e 100644
--- a/ldap/servers/plugins/replication/repl_shared.h
+++ b/ldap/servers/plugins/replication/repl_shared.h
@@ -51,11 +51,7 @@
#include "slapi-plugin.h"
#include "ldif.h" /* GGOODREPL - is this cheating? */
-#ifdef _WIN32
-#define FILE_PATHSEP '\\'
-#else
#define FILE_PATHSEP '/'
-#endif
#define CHANGELOGDB_TRIM_INTERVAL 300 /* 5 minutes */
#define CHANGELOGDB_COMPACT_INTERVAL 2592000 /* 30 days */
diff --git a/ldap/servers/plugins/replication/replutil.c b/ldap/servers/plugins/replication/replutil.c
index e861f33..47c08aa 100644
--- a/ldap/servers/plugins/replication/replutil.c
+++ b/ldap/servers/plugins/replication/replutil.c
@@ -50,12 +50,10 @@
#include <string.h>
#include <sys/types.h>
#include <errno.h>
-#ifndef _WIN32
#include <sys/file.h>
#include <sys/socket.h>
#include <unistd.h>
#include <fcntl.h>
-#endif
#ifdef OS_solaris
#include <dlfcn.h> /* needed for dlopen and dlsym */
#endif /* solaris: dlopen */
diff --git a/ldap/servers/plugins/replication/tests/makesim b/ldap/servers/plugins/replication/tests/makesim
index 235a350..b9e17fc 100755
--- a/ldap/servers/plugins/replication/tests/makesim
+++ b/ldap/servers/plugins/replication/tests/makesim
@@ -54,20 +54,12 @@ include $(LDAP_SRC)/nsldap.mk
LDFLAGS += $(EXLDFLAGS)
-ifeq ($(ARCH), WINNT)
-SUBSYSTEM=console
-endif
-
DEPLIBS=
EXTRA_LIBS_DEP =
EXTRA_LIBS =
-ifeq ($(ARCH), WINNT)
-EXTRA_LIBS += user32.lib
-endif
-
DNP_SIM = $(addsuffix $(EXE_SUFFIX), \
$(addprefix $(BINDIR)/, dnp_sim))
diff --git a/ldap/servers/plugins/uiduniq/plugin-utils.h b/ldap/servers/plugins/uiduniq/plugin-utils.h
index 0fe65b3..ddd125c 100644
--- a/ldap/servers/plugins/uiduniq/plugin-utils.h
+++ b/ldap/servers/plugins/uiduniq/plugin-utils.h
@@ -71,10 +71,6 @@
#include "slapi-plugin-compat4.h"
#include <stdio.h>
#include <string.h>
-#ifdef _WINDOWS
-#undef strcasecmp
-#define strcasecmp strcmpi
-#endif
#ifdef LDAP_DEBUG
#ifndef DEBUG
diff --git a/ldap/servers/plugins/vattrsp_template/vattrsp.c b/ldap/servers/plugins/vattrsp_template/vattrsp.c
index 6e14269..22714fa 100644
--- a/ldap/servers/plugins/vattrsp_template/vattrsp.c
+++ b/ldap/servers/plugins/vattrsp_template/vattrsp.c
@@ -47,13 +47,11 @@
#include "slapi-plugin.h"
#include "slapi-private.h"
#include "vattr_spi.h"
+#include <sys/stat.h>
/* the global plugin handle */
static volatile vattr_sp_handle *vattr_handle = NULL;
-#include <sys/stat.h>
-
-
#define VATTRSP_PLUGIN_SUBSYSTEM "vattrsp-template-plugin" /* used for logging */
/* function prototypes */
@@ -89,22 +87,12 @@ static int vattrsp_vattr_types(
int flags
);
-
static Slapi_PluginDesc pdesc = { "vattrexamplesp", VENDOR, DS_PACKAGE_VERSION,
"vattr service provider example plugin" };
static void * vattrsp_plugin_identity = NULL;
-#ifdef _WIN32
-int *module_ldap_debug = 0;
-
-void plugin_init_debug_level(int *level_ptr)
-{
- module_ldap_debug = level_ptr;
-}
-#endif
-
/*
* Plugin identity mgmt
* --------------------
diff --git a/ldap/servers/slapd/back-ldbm/back-ldbm.h b/ldap/servers/slapd/back-ldbm/back-ldbm.h
index 074aa4c..c7bfd68 100644
--- a/ldap/servers/slapd/back-ldbm/back-ldbm.h
+++ b/ldap/servers/slapd/back-ldbm/back-ldbm.h
@@ -45,7 +45,7 @@
#ifndef _BACK_LDBM_H_
#define _BACK_LDBM_H_
-#if defined(irix) || defined(AIX) || defined(HPUX11) || defined(OS_solaris) || defined(linux)
+#if defined(HPUX11) || defined(OS_solaris) || defined(linux)
/* built-in 64-bit file I/O support */
#define DB_USE_64LFS
#endif
@@ -717,14 +717,6 @@ typedef struct tag_dblayer_handle dblayer_handle;
/* This structure was moved here from perfctrs.c so the ldbm_instance structure
* could use it. */
struct _perfctrs_private {
-#if defined(_WIN32)
- /* Handle to the shared memory object */
- HANDLE hMemory;
- /* Handle to the update event */
- HANDLE hEvent;
-#else
- /* Nothing yet */
-#endif
/* Pointer to the shared memory */
void *memory;
};
diff --git a/ldap/servers/slapd/back-ldbm/index.c b/ldap/servers/slapd/back-ldbm/index.c
index 0d9ac33..22e264e 100644
--- a/ldap/servers/slapd/back-ldbm/index.c
+++ b/ldap/servers/slapd/back-ldbm/index.c
@@ -44,10 +44,6 @@
/* index.c - routines for dealing with attribute indexes */
#include "back-ldbm.h"
-#if ( defined ( OSF1 ))
-#undef BUFSIZ
-#define BUFSIZ 1024
-#endif
static const char *errmsg = "database index operation failed";
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_attr.c b/ldap/servers/slapd/back-ldbm/ldbm_attr.c
index 81481cf..ac5c653 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_attr.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_attr.c
@@ -1033,11 +1033,6 @@ static int replace_filter(Slapi_Filter *f, char *s)
{
Slapi_Filter *newf = NULL;
Slapi_Filter *temp = NULL;
-/* LP: Fix for defect 515161. Crash on AIX
- * slapi_str2filter is a nasty function that mangle whatever gets passed in.
- * AIX crashes on altering the literal string.
- * So we need to allocate the string and then free it.
- */
char *buf = slapi_ch_strdup(s);
newf = slapi_str2filter(buf);
diff --git a/ldap/servers/slapd/config.c b/ldap/servers/slapd/config.c
index d003f70..0e63258 100644
--- a/ldap/servers/slapd/config.c
+++ b/ldap/servers/slapd/config.c
@@ -58,18 +58,11 @@
#define MAXARGS 1000
-
-extern int should_detach;
+extern int should_detach;
extern Slapi_PBlock *repl_pb;
-
-
extern char* slapd_SSL3ciphers;
-
-#ifndef _WIN32
extern char *localuser;
-#endif
-
-char* rel2abspath( char * );
+char* rel2abspath( char * );
/*
See if the given entry has an attribute with the given name and the
@@ -251,7 +244,6 @@ slapd_bootstrap_config(const char *configdir)
continue;
}
/* increase file descriptors */
-#if !defined(AIX)
if (!maxdescriptors[0] &&
entry_has_attr_and_value(e, CONFIG_MAXDESCRIPTORS_ATTRIBUTE,
maxdescriptors, sizeof(maxdescriptors)))
@@ -265,7 +257,6 @@ slapd_bootstrap_config(const char *configdir)
CONFIG_MAXDESCRIPTORS_ATTRIBUTE, errorbuf);
}
}
-#endif /* !defined(AIX) */
/* see if we need to enable error logging */
if (!logenabled[0] &&
diff --git a/ldap/servers/slapd/configdse.c b/ldap/servers/slapd/configdse.c
index 954d446..6ab3dfd 100644
--- a/ldap/servers/slapd/configdse.c
+++ b/ldap/servers/slapd/configdse.c
@@ -74,9 +74,7 @@ static const char *requires_restart[] = {
"cn=config:nsslapd-changelogmaxentries",
"cn=config:nsslapd-changelogmaxage",
"cn=config:nsslapd-db-locks",
-#if !defined(_WIN32) && !defined(AIX)
"cn=config:nsslapd-maxdescriptors",
-#endif
"cn=config:" CONFIG_RETURN_EXACT_CASE_ATTRIBUTE,
"cn=config:" CONFIG_SCHEMA_IGNORE_TRAILING_SPACES,
"cn=config,cn=ldbm:nsslapd-idlistscanlimit",
diff --git a/ldap/servers/slapd/connection.c b/ldap/servers/slapd/connection.c
index 3ea0576..899d99a 100644
--- a/ldap/servers/slapd/connection.c
+++ b/ldap/servers/slapd/connection.c
@@ -43,11 +43,9 @@
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
-#ifndef _WIN32
#include <sys/time.h>
#include <sys/socket.h>
#include <stdlib.h>
-#endif
#include <signal.h>
#include "slap.h"
#include "prcvar.h"
@@ -1523,7 +1521,7 @@ connection_threadmain()
#ifdef ENABLE_NUNC_STANS
enable_nunc_stans = config_get_enable_nunc_stans();
#endif
-#if defined( OSF1 ) || defined( hpux )
+#if defined( hpux )
/* Arrange to ignore SIGPIPE signals. */
SIGNAL( SIGPIPE, SIG_IGN );
#endif
diff --git a/ldap/servers/slapd/csngen.c b/ldap/servers/slapd/csngen.c
index 5214c45..192d982 100644
--- a/ldap/servers/slapd/csngen.c
+++ b/ldap/servers/slapd/csngen.c
@@ -742,18 +742,7 @@ _csngen_adjust_local_time (CSNGen *gen, time_t cur_time)
* test code
* **************************************************************************
*/
-
-/*
- * The defult thread stacksize for nspr21 is 64k. For OSF, we require
- * a larger stacksize as actual storage allocation is higher i.e
- * pointers are allocated 8 bytes but lower 4 bytes are used.
- * The value 0 means use the default stacksize.
- */
-#if defined (OSF1) || defined(__LP64__) || defined (_LP64) /* 64-bit architectures need large stacks */
-#define DEFAULT_THREAD_STACKSIZE 131072L
-#else
#define DEFAULT_THREAD_STACKSIZE 0
-#endif
#define GEN_TREAD_COUNT 20
int s_thread_count;
diff --git a/ldap/servers/slapd/daemon.c b/ldap/servers/slapd/daemon.c
index 820921c..5fa6893 100644
--- a/ldap/servers/slapd/daemon.c
+++ b/ldap/servers/slapd/daemon.c
@@ -58,13 +58,6 @@
#endif
#include <time.h>
#include <signal.h>
-#if defined(IRIX6_2) || defined(IRIX6_3)
-#include <sys/param.h>
-#endif
-#if defined(_AIX)
-#include <sys/select.h>
-#include <sys/param.h>
-#endif
#include <fcntl.h>
#define TCPLEN_T int
#ifdef NEED_FILIO
@@ -3245,21 +3238,15 @@ catch_signals()
static int
get_configured_connection_table_size()
{
- int size;
- size = config_get_conntablesize();
-
-/*
- * Cap the table size at nsslapd-maxdescriptors.
- */
-#if !defined(_WIN32) && !defined(AIX)
- {
- int maxdesc = config_get_maxdescriptors();
+ int size = config_get_conntablesize();
+ int maxdesc = config_get_maxdescriptors();
- if ( maxdesc >= 0 && size > maxdesc ) {
- size = maxdesc;
- }
+ /*
+ * Cap the table size at nsslapd-maxdescriptors.
+ */
+ if ( maxdesc >= 0 && size > maxdesc ) {
+ size = maxdesc;
}
-#endif
return size;
}
diff --git a/ldap/servers/slapd/detach.c b/ldap/servers/slapd/detach.c
index 3516c65..87b7e78 100644
--- a/ldap/servers/slapd/detach.c
+++ b/ldap/servers/slapd/detach.c
@@ -77,16 +77,13 @@ int
detach( int slapd_exemode, int importexport_encrypt,
int s_port, daemon_ports_t *ports_info )
{
-#ifndef _WIN32
int i, sd;
char *workingdir = 0;
char *errorlog = 0;
char *ptr = 0;
char errorbuf[BUFSIZ];
extern char *config_get_errorlog(void);
-#endif
-#ifndef _WIN32
if ( should_detach ) {
for ( i = 0; i < 5; i++ ) {
#if defined( sunos5 )
@@ -163,12 +160,9 @@ detach( int slapd_exemode, int importexport_encrypt,
}
(void) SIGNAL( SIGPIPE, SIG_IGN );
-#endif /* _WIN32 */
return 0;
}
-
-#ifndef _WIN32
/*
* close all open files except stdin/out/err
*/
@@ -187,16 +181,9 @@ close_all_files()
close( i );
}
}
-#endif /* !_WIN32 */
-
-/*
- * There is no need to do anything on some platforms (NT) and not try to
- * raise fds on AIX.
- */
static void raise_process_fd_limits(void)
{
-#if !defined(_WIN32) && !defined(AIX)
struct rlimit rl, setrl;
RLIM_TYPE curlim;
slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig();
@@ -247,7 +234,6 @@ static void raise_process_fd_limits(void)
(void)getrlimit( RLIMIT_NOFILE, &rl );
LDAPDebug( LDAP_DEBUG_TRACE, "descriptor limit changed from %d to %d\n",
curlim, rl.rlim_cur, 0 );
-#endif /* !_WIN32 && !AIX */
}
/*
@@ -256,7 +242,6 @@ static void raise_process_fd_limits(void)
void
raise_process_limits()
{
-#if !defined(_WIN32)
struct rlimit rl;
raise_process_fd_limits();
@@ -286,7 +271,5 @@ raise_process_limits()
errno,0,0);
}
#endif /* RLIMIT_VMEM */
-
-#endif /* !_WIN32 */
}
diff --git a/ldap/servers/slapd/fe.h b/ldap/servers/slapd/fe.h
index ae67491..0595a2a 100644
--- a/ldap/servers/slapd/fe.h
+++ b/ldap/servers/slapd/fe.h
@@ -66,15 +66,6 @@ extern PRLock *time_func_mutex;
extern PRLock *currenttime_mutex;
extern time_t starttime;
extern char *configfile;
-#if defined( _WIN32 )
-extern LPTSTR pszServerName;
-#endif
-#if defined( _WIN32 )
-/* String constants (no change for international) */
-extern HANDLE hSlapdEventSource;
-extern SERVICE_STATUS LDAPServerStatus;
-extern SERVICE_STATUS_HANDLE hLDAPServerServiceStatus;
-#endif
/*
* auth.c
@@ -92,15 +83,6 @@ void op_thread_cleanup();
void connection_post_shutdown_cleanup();
/*
- * ntuserpin.c - Prompts for the key database passphrase.
- */
-#include "svrcore.h"
-typedef struct SVRCORENTUserPinObj SVRCORENTUserPinObj;
-SVRCOREError SVRCORE_CreateNTUserPinObj(SVRCORENTUserPinObj **out);
-void SVRCORE_SetNTUserPinInteractive(SVRCORENTUserPinObj *obj, PRBool interactive);
-void SVRCORE_DestroyNTUserPinObj(SVRCORENTUserPinObj *obj);
-
-/*
* connection.c
*/
void connection_abandon_operations( Connection *conn );
@@ -135,12 +117,10 @@ struct connection_table
int n_tcpe; /* standard socket last ( +1 ) index in fd */
int s_tcps; /* ssl socket start index in fd */
int s_tcpe; /* ssl socket last ( +1 ) in fd */
-#ifndef XP_WIN32
#if defined(ENABLE_LDAPI)
int i_unixs; /* unix socket start index in fd */
int i_unixe; /* unix socket last ( +1 ) in fd */
#endif /* ENABLE_LDAPI */
-#endif
PRLock *table_mutex;
};
typedef struct connection_table Connection_Table;
@@ -159,12 +139,6 @@ Connection* connection_table_get_first_active_connection (Connection_Table *ct);
Connection* connection_table_get_next_active_connection (Connection_Table *ct, Connection *c);
typedef int (*Connection_Table_Iterate_Function)(Connection *c, void *arg);
int connection_table_iterate_active_connections(Connection_Table *ct, void* arg, Connection_Table_Iterate_Function f);
-#if defined( _WIN32 )
-Connection* connection_table_get_connection_from_fd(Connection_Table *ct,PRFileDesc *prfd);
-#endif
-#if 0
-void connection_table_dump(Connection_Table *ct);
-#endif
/*
* daemon.c
diff --git a/ldap/servers/slapd/globals.c b/ldap/servers/slapd/globals.c
index e28362f..02ca373 100644
--- a/ldap/servers/slapd/globals.c
+++ b/ldap/servers/slapd/globals.c
@@ -67,13 +67,6 @@
#include "slap.h"
#include "fe.h"
-/* On UNIX, there's only one copy of slapd_ldap_debug */
-/* On NT, each module keeps its own module_ldap_debug, which */
-/* points to the process' slapd_ldap_debug */
-#ifdef _WIN32
-int *module_ldap_debug;
-#endif
-
int should_detach = 1;
time_t starttime;
PRThread *listener_tid;
@@ -87,61 +80,12 @@ Slapi_Counter *ops_completed;
Slapi_Counter *num_conns;
Slapi_Counter *max_threads_count;
Slapi_Counter *conns_in_maxthreads;
-
-/*
- DEC/COMPAQ has released a patch for 4.0d (e?) which will speed up
- malloc/free considerably in multithreaded multiprocessor
- applications (like directory server!), sort of like SmartHeap but
- not as snazzy. The last three parameters only take effect if the
- patch is installed, otherwise they are ignored. The rest of the
- parameters are included along with their default values, but they
- are commented out except:
- unsigned long __noshrink = 1; old - default is 0; apparently this is ignored for now
- int __fast_free_max = INT_MAX; old - default is 13; may cause excessive memory consumption
-*/
-#if defined(OSF1) && defined(LDAP_DONT_USE_SMARTHEAP)
-/* From an email from Dave Long at DEC/Compaq:
-
- The following is an example of how to tune for maximum speed on a
- system with three or more CPUs and with no concern for memory used:
-
- #include <limits.h>
- #include <sys/types.h>
-*/
-unsigned long __noshrink = 1; /* old - default is 0; apparently this is ignored for now */
-/*
- size_t __minshrink = 65536;
- double __minshrinkfactor = 0.001;
- size_t __mingrow = 65536;
- double __mingrowfactor = 0.1;
- unsigned long __madvisor = 0;
- unsigned long __small_buff = 0;
-*/
-int __fast_free_max = INT_MAX; /* old - default is 13; may cause excessive memory consumption */
-/*
- unsigned long __sbrk_override = 0;
- unsigned long __taso_mode = 0;
-*/
-
-/*
- These are the new parameters
-*/
-int __max_cache = 27;
-int __first_fit = 2;
-int __delayed_free = 1;
-/*
- Note that the allowed values for the new __max_cache tuning variable
- are: 15, 18, 21, 24, 27. Any other value is likely to actually harm
- performance or even cause a core dump.
-*/
-#endif
-
Connection_Table *the_connection_table = NULL;
char *pid_file = "/dev/null";
char *start_pid_file = "/dev/null";
-char *attr_dataversion = ATTR_DATAVERSION;
+char *attr_dataversion = ATTR_DATAVERSION;
extern void set_dll_entry_points( slapdEntryPoints *sep );
void
diff --git a/ldap/servers/slapd/libglobs.c b/ldap/servers/slapd/libglobs.c
index 2499c57..e65d343 100644
--- a/ldap/servers/slapd/libglobs.c
+++ b/ldap/servers/slapd/libglobs.c
@@ -364,12 +364,10 @@ static struct config_get_and_set {
log_set_expirationtime, SLAPD_ACCESS_LOG,
(void**)&global_slapdFrontendConfig.accesslog_exptime,
CONFIG_INT, NULL, DEFAULT_LOG_EXPTIME},
-#ifndef _WIN32
{CONFIG_LOCALUSER_ATTRIBUTE, config_set_localuser,
NULL, 0,
(void**)&global_slapdFrontendConfig.localuser,
CONFIG_STRING, NULL, NULL/* deletion is not allowed */},
-#endif
{CONFIG_ERRORLOG_LOGROTATIONSYNCENABLED_ATTRIBUTE, NULL,
log_set_rotationsync_enabled, SLAPD_ERROR_LOG,
(void**)&global_slapdFrontendConfig.errorlog_rotationsync_enabled,
@@ -865,12 +863,10 @@ static struct config_get_and_set {
NULL, 0,
(void**)&global_slapdFrontendConfig.refer_url,
CONFIG_STRING, NULL, NULL/* deletion is not allowed */},
-#if !defined(AIX)
{CONFIG_MAXDESCRIPTORS_ATTRIBUTE, config_set_maxdescriptors,
NULL, 0,
(void**)&global_slapdFrontendConfig.maxdescriptors,
CONFIG_INT, NULL, DEFAULT_MAXDESCRIPTORS},
-#endif
{CONFIG_CONNTABLESIZE_ATTRIBUTE, config_set_conntablesize,
NULL, 0,
(void**)&global_slapdFrontendConfig.conntablesize,
@@ -3667,7 +3663,6 @@ int config_set_storagescheme() {
}
-#ifndef _WIN32
int
config_set_localuser( const char *attrname, char *value, char *errorbuf, int apply ) {
int retVal = LDAP_SUCCESS;
@@ -3697,7 +3692,6 @@ config_set_localuser( const char *attrname, char *value, char *errorbuf, int app
return retVal;
}
-#endif /* _WIN32 */
int
config_set_workingdir( const char *attrname, char *value, char *errorbuf, int apply ) {
@@ -3809,7 +3803,6 @@ config_set_maxthreadsperconn( const char *attrname, char *value, char *errorbuf,
return retVal;
}
-#if !defined(_WIN32) && !defined(AIX)
#include <sys/resource.h>
int
config_set_maxdescriptors( const char *attrname, char *value, char *errorbuf, int apply ) {
@@ -3852,7 +3845,6 @@ config_set_maxdescriptors( const char *attrname, char *value, char *errorbuf, in
return retVal;
}
-#endif /* !_WIN32 && !AIX */
int
config_set_conntablesize( const char *attrname, char *value, char *errorbuf, int apply ) {
@@ -3860,25 +3852,19 @@ config_set_conntablesize( const char *attrname, char *value, char *errorbuf, int
long nValue = 0;
int maxVal = 65535;
char *endp = NULL;
-#ifndef _WIN32
struct rlimit rlp;
-#endif
slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig();
if ( config_value_is_null( attrname, value, errorbuf, 0 )) {
return LDAP_OPERATIONS_ERROR;
}
-#ifndef _WIN32
if ( 0 == getrlimit( RLIMIT_NOFILE, &rlp ) ) {
maxVal = (int)rlp.rlim_max;
}
-#endif
errno = 0;
nValue = strtol(value, &endp, 0);
-
-#if !defined(AIX)
if ( *endp != '\0' || errno == ERANGE || nValue < 1 || nValue > maxVal ) {
PR_snprintf ( errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, "%s: invalid value \"%s\", connection table "
@@ -3891,7 +3877,6 @@ config_set_conntablesize( const char *attrname, char *value, char *errorbuf, int
retVal = LDAP_OPERATIONS_ERROR;
}
}
-#endif
if (apply) {
CFG_LOCK_WRITE(slapdFrontendConfig);
@@ -3968,15 +3953,6 @@ config_set_ioblocktimeout( const char *attrname, char *value, char *errorbuf, in
return retVal;
}
-#if defined(IRIX)
- /* on IRIX poll can only handle timeouts up to
- 2147483 without failing, cap it at 30 minutes */
-
- if ( nValue > SLAPD_DEFAULT_IOBLOCK_TIMEOUT ) {
- nValue = SLAPD_DEFAULT_IOBLOCK_TIMEOUT;
- }
-#endif /* IRIX */
-
if ( apply ) {
#ifdef ATOMIC_GETSET_IOBLOCKTIMEOUT
PR_AtomicSet(&slapdFrontendConfig->ioblocktimeout, (PRInt32)nValue);
@@ -5345,8 +5321,6 @@ config_get_rootpwstoragescheme() {
return retVal;
}
-#ifndef _WIN32
-
char *
config_get_localuser() {
slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig();
@@ -5359,7 +5333,6 @@ config_get_localuser() {
return retVal;
}
-#endif /* _WIN32 */
/* alias of encryption key and certificate files is now retrieved through */
/* calls to psetFullCreate() and psetGetAttrSingleValue(). See ssl.c, */
/* where this function is still used to set the global variable */
@@ -5401,7 +5374,6 @@ config_get_maxthreadsperconn(){
return retVal;
}
-#if !defined(_WIN32) && !defined(AIX)
int
config_get_maxdescriptors() {
slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig();
@@ -5413,8 +5385,6 @@ config_get_maxdescriptors() {
return retVal;
}
-#endif /* !_WIN32 && !AIX */
-
int
config_get_reservedescriptors(){
slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig();
diff --git a/ldap/servers/slapd/libmakefile b/ldap/servers/slapd/libmakefile
index 659165e..7e7e04f 100644
--- a/ldap/servers/slapd/libmakefile
+++ b/ldap/servers/slapd/libmakefile
@@ -80,46 +80,13 @@ LIBSLAPD_OBJS=plugin_role.o getfilelist.o libglobs.o log.o ch_malloc.o entry.o p
dse.o errormap.o computed.o match.o fileio.o \
generation.o localhost.o ssl.o factory.o auditlog.o \
lenstr.o eventq.o uuid.o uniqueid.o uniqueidgen.o \
- csngen.o utf8compare.o ntuserpin.o entrywsi.o valueset.o \
+ csngen.o utf8compare.o entrywsi.o valueset.o \
attrsyntax.o opshared.o add.o modify.o modrdn.o delete.o dl.o\
plugin_acl.o counters.o subentry.o object.o objset.o apibroker.o \
csn.o csnset.o slapd_plhash.o attrlist.o vattr.o bitset.o rdn.o \
mapping_tree.o backend_manager.o task.o resourcelimit.o \
bulk_import.o security_wrappers.o index_subsystem.o sasl_map.o
-ifeq ($(ARCH), AIX)
-ifeq ($(DEBUG), optimize)
-TEMP_CFLAGS = $(subst -O,,$(CFLAGS))
-$(OBJDEST)/vattr.o: vattr.c
- $(CC) -o $(OBJDEST)/vattr.o -c $(TEMP_CFLAGS) $(MCC_INCLUDE) vattr.c
-endif
-endif
-ifeq ($(ARCH), WINNT)
-#find out why this isn't needed on UNIX
-DLL_LDFLAGS += $(NSPRLINK) /IMPLIB:$(LIBSLAPD)
-DLL_LDFLAGS += -def:"libslapd.def"
-LIBSLAPD_DEF = $(LDAP_SRC)/servers/slapd/libslapd.def
-SUBSYSTEM=windows
-
-LDAP_COMMON_EXTRALIBSLIST = libsi18n
-LDAP_COMMON_EXTRALIBS = $(addsuffix .$(LIB_SUFFIX), \
- $(addprefix $(LDAP_LIBDIR)/, $(LDAP_COMMON_EXTRALIBSLIST)))
-LDAP_COMMON_LINK += libbase.$(LIB_SUFFIX)
-
-EXTRA_LIBS_DEP = $(SECURITY_DEP) $(NSPR_DEP) \
- $(LDAP_COMMON_LIBS_DEP) $(LDAPSDK_DEP) \
- $(LDAP_SDK_LIBSSLDAP_LIB_DEP) $(LIBLDAPU_DEP) $(_ldap_db_depend) \
- $(SVRCORE_DEP) \
- $(LDAP_COMMON_EXTRALIBS)
-
-EXTRA_LIBS += $(LDAPLINK) $(LIBSVRCORE) $(LIBSECURITY) $(LIBNSPR) \
- $(LDAP_COMMON_LINK) \
- $(LIBLDAPU) \
- $(LDAP_COMMON_EXTRALIBS)
-
-# JCM - Warnings as Errors!
-CFLAGS += /WX
-else
LDFLAGS = $(SSLLIBFLAG)
EXTRA_LIBS_DEP = $(SECURITY_DEP) \
$(NSPR_DEP) $(LDAPSDK_DEP) $(SVRCORE_DEP) \
@@ -129,16 +96,6 @@ EXTRA_LIBS = $(LDAP_LIBLITEKEY) -lavl -lldif \
$(SVRCORELINK) $(LDAPLINK) \
$(SECURITYLINK) $(NSPRLINK) \
$(ALIBS) $(DYNALIBS) $(THREADSLIB)
-endif
-ifeq ($(ARCH), AIX)
-LD=ld
-EXTRA_LIBS = $(LDAPLINK) $(SVRCORELINK) $(SECURITYLINK) $(NSPRLINK) \
- $(LDAP_COMMON_LINK) \
- $(LIBLDAPU) \
- $(DYNALIBS) $(THREADSLIB) \
- $(DLL_EXTRA_LIBS) \
- $(LDAP_LIBLITEKEY)
-endif
# Comment for the following comment:
# Updating LDAP C SDK to V6.0 has introduced a new dependent library
@@ -164,11 +121,6 @@ LD=CC
endif
endif
-#ifeq ($(ARCH), OSF1)
-#DLL_LDFLAGS=-shared -all -error_unresolved -taso -ySVRCORE_RegisterPinObj
-#EXTRA_LIBS += -lc
-#endif
-
OBJS = $(addprefix $(OBJDEST)/, $(LIBSLAPD_OBJS))
ERRORMAP.O = $(addprefix $(OBJDEST)/, errormap.o)
@@ -196,15 +148,7 @@ clean:
$(ERRORMAP.O): $(DIRVERDIR)/dberrstrs.h
$(DIRVERDIR)/dberrstrs.h: $(DB_INCLUDE)/db.h
-ifeq ($(ARCH), WINNT)
- $(PERL) mkDBErrStrs.pl -nt -i $(DB_INCLUDE) -o $(DIRVERDIR)
-else
- $(PERL) mkDBErrStrs.pl -i $(DB_INCLUDE) -o $(DIRVERDIR)
-endif
-
-ifeq ($(ARCH), WINNT)
-$(OBJS): $(OBJDEST)/%.o : %.c
-endif
+$(PERL) mkDBErrStrs.pl -i $(DB_INCLUDE) -o $(DIRVERDIR)
# Target to push the built binary to an installed server
LIBSLAPD_PUSH = $(addprefix $(INSTDIR)/, bin/slapd/server/libslapd.dll)
diff --git a/ldap/servers/slapd/localhost.c b/ldap/servers/slapd/localhost.c
index 38edb2f..e5bb64b 100644
--- a/ldap/servers/slapd/localhost.c
+++ b/ldap/servers/slapd/localhost.c
@@ -64,10 +64,6 @@
#define _PATH_RESCONF "/etc/resolv.conf"
#endif
-#if !defined(NO_DOMAINNAME) && defined(_WINDOWS)
-#define NO_DOMAINNAME 1
-#endif
-
#if defined (__hpux)
#if (MAXHOSTNAMELEN < 256)
# undef MAXHOSTNAMELEN
diff --git a/ldap/servers/slapd/main.c b/ldap/servers/slapd/main.c
index 28f6908..16de252 100644
--- a/ldap/servers/slapd/main.c
+++ b/ldap/servers/slapd/main.c
@@ -49,11 +49,7 @@
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
-#if !defined(aix)
#include <sys/fcntl.h>
-#else
-#include <fcntl.h>
-#endif
#include <time.h>
#include <stdarg.h>
#include <signal.h>
@@ -64,7 +60,7 @@
#include <arpa/inet.h>
#include <netdb.h>
#include <pwd.h> /* getpwnam */
-#if !defined(IRIX) && !defined(LINUX)
+#if !defined(LINUX)
union semun {
int val;
struct semid_ds *buf;
@@ -335,10 +331,8 @@ static int main_setuid(char *username)
/* set good defaults for front-end config in referral mode */
static void referral_set_defaults(void)
{
-#if !defined(AIX)
char errorbuf[SLAPI_DSE_RETURNTEXT_SIZE];
config_set_maxdescriptors( CONFIG_MAXDESCRIPTORS_ATTRIBUTE, "1024", errorbuf, 1);
-#endif
}
static int
@@ -996,7 +990,6 @@ main( int argc, char **argv)
goto cleanup;
}
-
/*
* Now it is safe to log our first startup message. If we were to
* log anything earlier than now it would appear on the admin startup
@@ -1161,7 +1154,7 @@ cleanup:
ndn_cache_destroy();
NSS_Shutdown();
PR_Cleanup();
-#if ( defined( hpux ) || defined( irix ) || defined( aix ) || defined( OSF1 ))
+#if defined( hpux )
exit( return_value );
#else
return return_value;
@@ -1169,7 +1162,7 @@ cleanup:
}
-#if ( defined( hpux ) || defined( irix ))
+#if defined( hpux )
void
signal2sigaction( int s, void *a )
{
@@ -1182,7 +1175,7 @@ signal2sigaction( int s, void *a )
(void)sigaddset( &act.sa_mask, s );
(void)sigaction( s, &act, NULL );
}
-#endif /* hpux || irix */
+#endif /* hpux */
static void
register_objects()
@@ -1481,16 +1474,6 @@ process_command_line(int argc, char **argv, char *myname,
case 'D': /* config dir */
configdir = rel2abspath( optarg_ext );
-#if defined( XP_WIN32 )
- pszServerName = slapi_ch_malloc( MAX_SERVICE_NAME );
- if( !SlapdGetServerNameFromCmdline(pszServerName, configdir, 1) )
- {
- MessageBox(GetDesktopWindow(), "Failed to get the Directory"
- " Server name from the command-line argument.",
- " ", MB_ICONEXCLAMATION | MB_OK);
- exit( 1 );
- }
-#endif
if ( config_set_configdir( "configdir (-D)",
configdir, errorbuf, 1) != LDAP_SUCCESS ) {
fprintf( stderr, "%s: aborting now\n", errorbuf );
diff --git a/ldap/servers/slapd/ntuserpin.c b/ldap/servers/slapd/ntuserpin.c
deleted file mode 100644
index fa9320d..0000000
--- a/ldap/servers/slapd/ntuserpin.c
+++ /dev/null
@@ -1,214 +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 **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/******************************************************
- *
- * ntuserpin.c - Prompts for the key
- * database passphrase.
- *
- ******************************************************/
-
-#if defined( _WIN32 )
-
-#include <windows.h>
-#include "ntwatchdog.h"
-#include "slapi-plugin.h"
-#include "fe.h"
-
-#undef Debug
-#undef OFF
-#undef LITTLE_ENDIAN
-
-#include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-#include "slap.h"
-#include "fe.h"
-
-static int i=0;
-static int cbRemotePassword = 0;
-
-extern char* NT_PromptForPin(const char *tokenName);
-
-static const char nt_retryWarning[] =
-"Warning: You entered an incorrect PIN. Incorrect PIN may result in disabling the token";
-
-struct SVRCORENTUserPinObj
-{
- SVRCOREPinObj base;
-};
-static const struct SVRCOREPinMethods vtable;
-
-/* ------------------------------------------------------------ */
-SVRCOREError
-SVRCORE_CreateNTUserPinObj(SVRCORENTUserPinObj **out)
-{
- SVRCOREError err = 0;
- SVRCORENTUserPinObj *obj = 0;
-
- do {
- obj = (SVRCORENTUserPinObj*)malloc(sizeof (SVRCORENTUserPinObj));
- if (!obj) { err = 1; break; }
-
- obj->base.methods = &vtable;
-
- } while(0);
-
- if (err)
- {
- SVRCORE_DestroyNTUserPinObj(obj);
- obj = 0;
- }
-
- *out = obj;
- return err;
-}
-
-void
-SVRCORE_DestroyNTUserPinObj(SVRCORENTUserPinObj *obj)
-{
- if (obj) free(obj);
-}
-
-static void destroyObject(SVRCOREPinObj *obj)
-{
- SVRCORE_DestroyNTUserPinObj((SVRCORENTUserPinObj*)obj);
-}
-
-/* First try to retrieve the password from the watchdog,
- if this is not available, prompt for the passphrase. */
-
-static char *getPin(SVRCOREPinObj *obj, const char *tokenName, PRBool retry)
-{
- HWND hwndRemote;
- char *szRemotePassword = NULL;
- HANDLE hRemoteProcess;
- DWORD dwNumberOfBytesRead=0;
- DWORD dwNumberOfBytesWritten=0;
- PK11_PIN *buf= NULL;
- char *password = NULL;
- char pin[MAX_PASSWORD];
- BOOL ret;
- DWORD err = 0;
-
- // Find Watchdog application window
- if( pszServerName && (hwndRemote = FindWindow("slapd", pszServerName)) &&
- (hRemoteProcess = (HANDLE)GetWindowLong( hwndRemote,
- GWL_PROCESS_HANDLE)))
- {
- cbRemotePassword = GetWindowLong(hwndRemote, GWL_PASSWORD_LENGTH);
- szRemotePassword = (HANDLE)GetWindowLong(hwndRemote, GWL_PASSWORD_ADDR);
-
- // if retry, don't get the pin from watchdog
- if (retry)
- {
- MessageBox(GetDesktopWindow(), nt_retryWarning,
- CAPBRAND " Server", MB_ICONEXCLAMATION | MB_OK);
- } else {
- if((cbRemotePassword != 0) && (szRemotePassword != 0))
- {
- buf = (PK11_PIN *)slapi_ch_malloc(sizeof
- (PK11_PIN)*cbRemotePassword);
- if(ReadProcessMemory(hRemoteProcess, szRemotePassword,
- (LPVOID)buf,sizeof(PK11_PIN)*cbRemotePassword ,
- &dwNumberOfBytesRead))
- {
-
- for (i=0; i < cbRemotePassword; i++) {
- if (strncmp (tokenName, buf[i].TokenName,
- buf[i].TokenLength)==0)
- {
- memset(pin, '\0', MAX_PASSWORD);
- PL_strncpyz (pin, buf[i].Password, sizeof(pin));
- slapi_ch_free ((void **) &buf);
- return slapi_ch_strdup(pin);
- }
- }
- }
- }
- }
- }
-
- /* Didn't get the password from Watchdog, or this is a retry,
- prompt the user. */
-
- password = NT_PromptForPin(tokenName);
-
- /* Store the password back to nt watchdog */
- if (password != NULL && hwndRemote && hRemoteProcess)
- {
- slapi_ch_free ((void **) &buf);
- buf = (PK11_PIN *)slapi_ch_malloc(sizeof(PK11_PIN));
- PL_strncpyz (buf[0].TokenName, tokenName, sizeof(buf[0].TokenName));
- buf[0].TokenLength=strlen(buf[0].TokenName);
- PL_strncpyz (buf[0].Password, password, sizeof(buf[0].Password));
- buf[0].PasswordLength=strlen(buf[0].Password);
- if (i== cbRemotePassword)
- {
- /* Add a new token and password to the end of the table.*/
-
- SetWindowLong(hwndRemote, GWL_PASSWORD_LENGTH,
- (LONG)cbRemotePassword+1);
- ret = WriteProcessMemory(hRemoteProcess,
- szRemotePassword+cbRemotePassword*sizeof(PK11_PIN),
- (LPVOID)buf, sizeof(PK11_PIN), &dwNumberOfBytesWritten);
- if( !ret )
- err = GetLastError();
- } else {
- /* This is a retry due to a wrong password stored in watchdog. */
- ret = WriteProcessMemory(hRemoteProcess,
- szRemotePassword+i*sizeof(PK11_PIN),(LPVOID)buf,
- sizeof(PK11_PIN), &dwNumberOfBytesWritten);
- if( !ret )
- err = GetLastError();
- }
- }
- slapi_ch_free ((void **) &buf);
- return (password);
-}
-
-/*
- * VTable
- */
-static const SVRCOREPinMethods vtable =
-{ 0, 0, destroyObject, getPin };
-#endif /* defined( _WIN32 ) */
diff --git a/ldap/servers/slapd/passwd_extop.c b/ldap/servers/slapd/passwd_extop.c
index 9b76e6d..3c8852e 100644
--- a/ldap/servers/slapd/passwd_extop.c
+++ b/ldap/servers/slapd/passwd_extop.c
@@ -54,12 +54,10 @@
#include <stdio.h>
#include <string.h>
#include <private/pprio.h>
-
-
#include <prio.h>
#include <plbase64.h>
-
#include <ssl.h>
+#include <pk11pub.h>
#include "slap.h"
#include "slapi-plugin.h"
#include "fe.h"
diff --git a/ldap/servers/slapd/proto-slap.h b/ldap/servers/slapd/proto-slap.h
index dd01999..486f589 100644
--- a/ldap/servers/slapd/proto-slap.h
+++ b/ldap/servers/slapd/proto-slap.h
@@ -414,11 +414,7 @@ int config_set_malloc_mxfast(const char *attrname, char *value, char *errorbuf,
int config_set_malloc_trim_threshold(const char *attrname, char *value, char *errorbuf, int apply);
int config_set_malloc_mmap_threshold(const char *attrname, char *value, char *errorbuf, int apply);
#endif
-
-#if !defined(AIX)
int config_set_maxdescriptors( const char *attrname, char *value, char *errorbuf, int apply );
-#endif /* !AIX */
-
int config_set_localuser( const char *attrname, char *value, char *errorbuf, int apply );
#ifdef MEMPOOL_EXPERIMENTAL
@@ -490,16 +486,12 @@ int config_get_schema_ignore_trailing_spaces();
char *config_get_rootdn();
char *config_get_rootpw();
char *config_get_rootpwstoragescheme();
-#ifndef _WIN32
char *config_get_localuser();
-#endif /* _WIN32 */
char *config_get_workingdir();
char *config_get_encryptionalias();
int config_get_threadnumber();
int config_get_maxthreadsperconn();
-#if !defined(_WIN32) && !defined(AIX)
int config_get_maxdescriptors();
-#endif /* !_WIN32 && !AIX */
int config_get_reservedescriptors();
int config_get_ioblocktimeout();
int config_get_idletimeout();
@@ -653,9 +645,7 @@ void do_delete( Slapi_PBlock *pb );
*/
int detach( int slapd_exemode, int importexport_encrypt,
int s_port, daemon_ports_t *ports_info );
-#ifndef _WIN32
void close_all_files( void );
-#endif
void raise_process_limits( void );
@@ -830,9 +820,7 @@ void log__delete_rotated_logs();
*/
void slapd_nasty(char* str, int c, int err);
int strarray2str( char **a, char *buf, size_t buflen, int include_quotes );
-#ifndef _WIN32
int slapd_chown_if_not_owner(const char *filename, uid_t uid, gid_t gid);
-#endif
int slapd_comp_path(char *p0, char *p1);
@@ -1470,7 +1458,7 @@ void ns_connection_post_io_or_closing(Connection *conn);
/*
* main.c
*/
-#if ( defined( hpux ) || defined( irix ))
+#if defined( hpux )
void signal2sigaction( int s, void *a );
#endif
int slapd_do_all_nss_ssl_init(int slapd_exemode, int importexport_encrypt,
diff --git a/ldap/servers/slapd/slap.h b/ldap/servers/slapd/slap.h
index 1ab8122..88b0082 100644
--- a/ldap/servers/slapd/slap.h
+++ b/ldap/servers/slapd/slap.h
@@ -200,7 +200,7 @@ typedef void (*VFPV)(); /* takes undefined arguments */
/*
* call the appropriate signal() function.
*/
-#if ( defined( hpux ) || defined ( irix ))
+#if defined( hpux )
/*
* we should not mix POSIX signal library function (sigaction)
* with SYSV's (sigset) on IRIX. nspr uses POSIX internally.
@@ -234,23 +234,13 @@ typedef void (*VFPV)(); /* takes undefined arguments */
#define LDAP_UNDEFINED (-1)
#ifndef SLAPD_INVALID_SOCKET
-#ifdef _WIN32
#define SLAPD_INVALID_SOCKET 0
-#else
-#define SLAPD_INVALID_SOCKET 0
-#endif
#endif
#define SLAPD_INVALID_SOCKET_INDEX (-1)
-#ifdef _WIN32
-#define SLAPD_DEFAULT_FILE_MODE S_IREAD | S_IWRITE
-#define SLAPD_DEFAULT_DIR_MODE 0
-#else /* _WIN32 */
#define SLAPD_DEFAULT_FILE_MODE S_IRUSR | S_IWUSR
#define SLAPD_DEFAULT_DIR_MODE S_IRWXU
-#endif
-
#define SLAPD_DEFAULT_ERRORLOG_LEVEL 16384
#define SLAPD_DEFAULT_IDLE_TIMEOUT 0 /* seconds - 0 == never */
#define SLAPD_DEFAULT_SIZELIMIT 2000 /* use -1 for no limit */
@@ -2000,9 +1990,7 @@ typedef struct _slapdEntryPoints {
#define CONFIG_MINSSF_ATTRIBUTE "nsslapd-minssf"
#define CONFIG_MINSSF_EXCLUDE_ROOTDSE "nsslapd-minssf-exclude-rootdse"
#define CONFIG_VALIDATE_CERT_ATTRIBUTE "nsslapd-validate-cert"
-#ifndef _WIN32
#define CONFIG_LOCALUSER_ATTRIBUTE "nsslapd-localuser"
-#endif /* !_WIN32 */
#define CONFIG_LOCALHOST_ATTRIBUTE "nsslapd-localhost"
#define CONFIG_PORT_ATTRIBUTE "nsslapd-port"
#define CONFIG_WORKINGDIR_ATTRIBUTE "nsslapd-workingdir"
@@ -2027,9 +2015,7 @@ typedef struct _slapdEntryPoints {
#define CONFIG_SECURELISTENHOST_ATTRIBUTE "nsslapd-securelistenhost"
#define CONFIG_THREADNUMBER_ATTRIBUTE "nsslapd-threadnumber"
#define CONFIG_MAXTHREADSPERCONN_ATTRIBUTE "nsslapd-maxthreadsperconn"
-#if !defined(_WIN32) && !defined(AIX)
#define CONFIG_MAXDESCRIPTORS_ATTRIBUTE "nsslapd-maxdescriptors"
-#endif /* !_WIN32 && ! AIX */
#define CONFIG_CONNTABLESIZE_ATTRIBUTE "nsslapd-conntablesize"
#define CONFIG_RESERVEDESCRIPTORS_ATTRIBUTE "nsslapd-reservedescriptors"
#define CONFIG_IDLETIMEOUT_ATTRIBUTE "nsslapd-idletimeout"
@@ -2199,9 +2185,7 @@ typedef struct _slapdFrontendConfig {
int idletimeout;
slapi_int_t ioblocktimeout;
slapi_onoff_t lastmod;
-#if !defined(_WIN32) && !defined(AIX)
int maxdescriptors;
-#endif /* !_WIN32 && !AIX */
int conntablesize;
slapi_int_t maxthreadsperconn;
int outbound_ldap_io_timeout;
@@ -2235,9 +2219,7 @@ typedef struct _slapdFrontendConfig {
char *errorlog;
char *listenhost;
int snmp_index;
-#ifndef _WIN32
char *localuser;
-#endif /* _WIN32 */
char *localhost;
char *rootdn;
char *rootpw;
@@ -2459,13 +2441,9 @@ slapdFrontendConfig_t *getFrontendConfig();
int slapd_bind_local_user(Connection *conn);
/* LP: NO_TIME cannot be -1, it generates wrong GeneralizedTime
- * And causes some errors on AIX also
+ * And causes some errors on AIX also
*/
-/* #if defined( XP_WIN32 ) */
#define NO_TIME (time_t)0 /* cannot be -1, NT's localtime( -1 ) returns NULL */
-/* #else */
-/* #define NO_TIME (time_t)-1 / * a value that time() does not return */
-/* #endif */
#define NOT_FIRST_TIME (time_t)1 /* not the first logon */
#define SLAPD_END_TIME (time_t)2147483647 /* (2^31)-1, in 2038 */
diff --git a/ldap/servers/slapd/slapi-plugin.h b/ldap/servers/slapd/slapi-plugin.h
index f003af3..3149cf3 100644
--- a/ldap/servers/slapd/slapi-plugin.h
+++ b/ldap/servers/slapd/slapi-plugin.h
@@ -718,24 +718,15 @@ typedef struct passwordpolicyarray Slapi_PWPolicy;
typedef void (*TaskCallbackFn)(Slapi_Task *task);
/*
- * The default thread stacksize for nspr21 is 64k (except on IRIX! It's 32k!).
+ * The default thread stacksize for nspr21 is 64k).
* For OSF, we require a larger stacksize as actual storage allocation is
* higher i.e pointers are allocated 8 bytes but lower 4 bytes are used.
* The value 0 means use the default stacksize.
*
- * larger stacksize (256KB) is needed on IRIX due to its 4KB BUFSIZ.
- * (@ pthread IRIX porting -- 01/11/99)
- *
* HP-UX on PA-RISC uses 64KB default stack size. Just set to 256K for all
* HP-UX.
*/
-#if ( defined( irix ))
-#define SLAPD_DEFAULT_THREAD_STACKSIZE 262144L
-#elif ( defined ( OSF1 ))
-#define SLAPD_DEFAULT_THREAD_STACKSIZE 262144L
-#elif ( defined ( AIX ))
-#define SLAPD_DEFAULT_THREAD_STACKSIZE 262144L
-#elif ( defined ( hpux ))
+#if ( defined ( hpux ))
#define SLAPD_DEFAULT_THREAD_STACKSIZE 262144L
#else
/* All other platforms use the default stack size */
diff --git a/ldap/servers/slapd/snmp_collator.c b/ldap/servers/slapd/snmp_collator.c
index 05a3afc..9bebfdd 100644
--- a/ldap/servers/slapd/snmp_collator.c
+++ b/ldap/servers/slapd/snmp_collator.c
@@ -98,17 +98,8 @@ static int hdl;
/* collator stuff */
static char *tmpstatsfile = AGT_STATS_FILE;
-#ifdef _WIN32
-static TCHAR szStatsFile[_MAX_PATH];
-static TCHAR szTempDir[_MAX_PATH];
-static HANDLE hParentProcess = NULL;
-static HANDLE hStatSlot = NULL;
-static HANDLE hLogFile = INVALID_HANDLE_VALUE;
-static TCHAR szSpoolRootDir[_MAX_PATH];
-#else
static char szStatsFile[_MAX_PATH];
static char stats_sem_name[_MAX_PATH];
-#endif /* _WIN32*/
static Slapi_Eq_Context snmp_eq_ctx;
static int snmp_collator_stopped = 0;
diff --git a/ldap/servers/slapd/ssl.c b/ldap/servers/slapd/ssl.c
index 233622a..b8fd084 100644
--- a/ldap/servers/slapd/ssl.c
+++ b/ldap/servers/slapd/ssl.c
@@ -1074,16 +1074,13 @@ slapd_nss_init(int init_ssl, int config_available)
is writable */
if (PR_SUCCESS != PR_Access(certdir, PR_ACCESS_WRITE_OK)) {
char *serveruser = "unknown";
-#ifndef _WIN32
+
serveruser = config_get_localuser();
-#endif
slapi_log_error(SLAPI_LOG_FATAL, "SSL Initialization",
"Warning: The key/cert database directory [%s] is not writable by "
"the server uid [%s]: initialization likely to fail.\n",
certdir, serveruser);
-#ifndef _WIN32
slapi_ch_free_string(&serveruser);
-#endif
}
}
@@ -1155,58 +1152,20 @@ svrcore_setup()
{
PRErrorCode errorCode;
int rv = 0;
-#ifndef _WIN32
SVRCOREStdPinObj *StdPinObj;
-#else
- SVRCOREFilePinObj *FilePinObj;
- SVRCOREAltPinObj *AltPinObj;
- SVRCORENTUserPinObj *NTUserPinObj;
-#endif
-#ifndef _WIN32
+
StdPinObj = (SVRCOREStdPinObj *)SVRCORE_GetRegisteredPinObj();
if (StdPinObj) {
- return 0; /* already registered */
+ return 0; /* already registered */
}
- if ( SVRCORE_CreateStdPinObj(&StdPinObj, dongle_file_name, PR_TRUE) !=
- SVRCORE_Success) {
+ if ( SVRCORE_CreateStdPinObj(&StdPinObj, dongle_file_name, PR_TRUE) != SVRCORE_Success) {
errorCode = PR_GetError();
slapd_SSL_warn("Security Initialization: Unable to create PinObj ("
SLAPI_COMPONENT_NAME_NSPR " error %d - %s)",
errorCode, slapd_pr_strerror(errorCode));
- return -1;
- }
- SVRCORE_RegisterPinObj((SVRCOREPinObj *)StdPinObj);
-#else
- AltPinObj = (SVRCOREAltPinObj *)SVRCORE_GetRegisteredPinObj();
- if (AltPinObj) {
- return 0; /* already registered */
- }
- if (SVRCORE_CreateFilePinObj(&FilePinObj, dongle_file_name) !=
- SVRCORE_Success) {
- errorCode = PR_GetError();
- slapd_SSL_warn("Security Initialization: Unable to create FilePinObj ("
- SLAPI_COMPONENT_NAME_NSPR " error %d - %s)",
- errorCode, slapd_pr_strerror(errorCode));
- return -1;
- }
- if (SVRCORE_CreateNTUserPinObj(&NTUserPinObj) != SVRCORE_Success){
- errorCode = PR_GetError();
- slapd_SSL_warn("Security Initialization: Unable to create NTUserPinObj ("
- SLAPI_COMPONENT_NAME_NSPR " error %d - %s)",
- errorCode, slapd_pr_strerror(errorCode));
return -1;
}
- if (SVRCORE_CreateAltPinObj(&AltPinObj, (SVRCOREPinObj *)FilePinObj,
- (SVRCOREPinObj *)NTUserPinObj) != SVRCORE_Success) {
- errorCode = PR_GetError();
- slapd_SSL_warn("Security Initialization: Unable to create AltPinObj ("
- SLAPI_COMPONENT_NAME_NSPR " error %d - %s)",
- errorCode, slapd_pr_strerror(errorCode));
- return -1;
- }
- SVRCORE_RegisterPinObj((SVRCOREPinObj *)AltPinObj);
-
-#endif /* _WIN32 */
+ SVRCORE_RegisterPinObj((SVRCOREPinObj *)StdPinObj);
return rv;
}
@@ -1562,7 +1521,6 @@ slapd_ssl_init2(PRFileDesc **fd, int startTLS)
int allowweakcipher = CIPHER_SET_DEFAULTWEAKCIPHER;
/* turn off the PKCS11 pin interactive mode */
-#ifndef _WIN32
SVRCOREStdPinObj *StdPinObj;
if (svrcore_setup()) {
@@ -1571,8 +1529,6 @@ slapd_ssl_init2(PRFileDesc **fd, int startTLS)
StdPinObj = (SVRCOREStdPinObj *)SVRCORE_GetRegisteredPinObj();
SVRCORE_SetStdPinInteractive(StdPinObj, PR_FALSE);
-#endif
-
errorbuf[0] = '\0';
/*
diff --git a/ldap/servers/slapd/time.c b/ldap/servers/slapd/time.c
index 33a9e32..621847c 100644
--- a/ldap/servers/slapd/time.c
+++ b/ldap/servers/slapd/time.c
@@ -44,11 +44,7 @@
#include <stdio.h>
#include <sys/types.h>
-#ifdef AIX
-#include <time.h>
-#else
#include <sys/time.h>
-#endif
#include "slap.h"
#include "fe.h"
diff --git a/ldap/servers/slapd/tools/ldaptool.h b/ldap/servers/slapd/tools/ldaptool.h
index 1aaf0ed..40d1975 100644
--- a/ldap/servers/slapd/tools/ldaptool.h
+++ b/ldap/servers/slapd/tools/ldaptool.h
@@ -44,39 +44,17 @@
/* should not cause problems in the future even if */
/* we forget to take it out :-) */
-#ifdef OSF1V4D
-#ifndef __STDC__
-# define __STDC__
-#endif /* __STDC__ */
-#endif /* OSF1V4D */
-
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
-#ifdef AIX
-#include <strings.h>
-#endif
-
-#ifdef SCOOS
-#include <sys/types.h>
-#endif
-
-#ifdef _WINDOWS
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-extern int getopt (int argc, char *const *argv, const char *optstring);
-#include <io.h> /* for _mktemp() */
-#define LDAPTOOL_MKTEMP( p ) _mktemp( p )
-#else
#include <sys/file.h>
#include <sys/stat.h>
#include <unistd.h>
#define LDAPTOOL_MKTEMP( p ) mktemp( p )
-#endif
#ifdef LINUX
#include <getopt.h> /* not always included from unistd.h */
@@ -84,9 +62,7 @@ extern int getopt (int argc, char *const *argv, const char *optstring);
#include <ctype.h>
-#ifndef SCOOS
#include <sys/types.h>
-#endif
#include <sys/stat.h>
#include <fcntl.h>
diff --git a/ldap/servers/slapd/tools/ldclt/data.c b/ldap/servers/slapd/tools/ldclt/data.c
index 2a7a651..e672a93 100644
--- a/ldap/servers/slapd/tools/ldclt/data.c
+++ b/ldap/servers/slapd/tools/ldclt/data.c
@@ -53,27 +53,6 @@
are manipulated by ldclt.
It is targeted to contain all the functions needed for
the images, etc...
- LOCAL : None.
- HISTORY :
----------+--------------+------------------------------------------------------
-dd/mm/yy | Author | Comments
----------+--------------+------------------------------------------------------
-11/01/99 | JL Schwing | Creation
----------+--------------+------------------------------------------------------
-06/03/00 | JL Schwing | 1.2 : Test malloc() return value.
----------+--------------+------------------------------------------------------
-28/11/00 | JL Schwing | 1.3 : Port on NT 4.
----------+--------------+------------------------------------------------------
-30/11/00 | JL Schwing | 1.4 : Implement loadImages for NT.
----------+--------------+------------------------------------------------------
-30/11/00 | JL Schwing | 1.5 : Port on OSF1.
----------+--------------+------------------------------------------------------
-01/12/00 | JL Schwing | 1.6 : Port on Linux.
----------+--------------+------------------------------------------------------
-06/03/01 | JL Schwing | 1.7 : Better error messages if images not found.
----------+--------------+------------------------------------------------------
-23/03/01 | JL Schwing | 1.8 : Implements data file list support in variants.
----------+--------------+------------------------------------------------------
*/
#include <stdio.h> /* printf(), etc... */
diff --git a/ldap/servers/slapd/tools/ldclt/ldapfct.c b/ldap/servers/slapd/tools/ldclt/ldapfct.c
index 69a8d62..18e0df1 100644
--- a/ldap/servers/slapd/tools/ldclt/ldapfct.c
+++ b/ldap/servers/slapd/tools/ldclt/ldapfct.c
@@ -50,189 +50,6 @@
DATE : 04 December 1998
DESCRIPTION :
This file contains the ldap part of this tool.
- LOCAL : None.
- HISTORY :
----------+--------------+------------------------------------------------------
-dd/mm/yy | Author | Comments
----------+--------------+------------------------------------------------------
-04/12/98 | JL Schwing | Creation
----------+--------------+------------------------------------------------------
-09/12/98 | JL Schwing | 1.2 : Forget to free ldap returned data.
----------+--------------+------------------------------------------------------
-10/12/98 | JL Schwing | 1.3 : Add nb of errors statistics.
----------+--------------+------------------------------------------------------
-10/12/98 | JL Schwing | 1.4 : Implement asynchronous mode.
----------+--------------+------------------------------------------------------
-11/12/98 | JL Schwing | 1.5 : fflush(stdout) after each printf.
----------+--------------+------------------------------------------------------
-14/12/98 | JL Schwing | 1.6 : Implement "-e close".
- | New function my_ldap_err2string() to prevent crashes.
----------+--------------+------------------------------------------------------
-16/12/98 | JL Schwing | 1.7 : Implement "-e add" and "-e delete".
- | Create separate functions for connection operations.
----------+--------------+------------------------------------------------------
-23/12/98 | JL Schwing | 1.8 : Factorise the doXxxx() functions.
- | Fix SIGSEGV in ldap_parse_result().
- | Implement result decoding in doAddEntry().
----------+--------------+------------------------------------------------------
-24/12/98 | JL Schwing | 1.9 : Bug fix - should support no message in async.
- | Bug fix - forget to check mctx.asyncMax !!!
- | Modify the getPending() algorythm to empty the queue
- | (if possible).
----------+--------------+------------------------------------------------------
-29/12/98 | JL Schwing | 1.10: Implement -Q.
- | Bug fix mode -q when asynchronous.
----------+--------------+------------------------------------------------------
-11/01/99 | JL Schwing | 1.11: Implement "-e emailPerson".
- | Bug fix - bad building of rdn in buildNewEntry().
----------+--------------+------------------------------------------------------
-13/01/99 | JL Schwing | 1.12: Implement "-e string".
----------+--------------+------------------------------------------------------
-14/01/99 | JL Schwing | 1.13: Implement "-s <scope>".
----------+--------------+------------------------------------------------------
-15/01/99 | JL Schwing | 1.14: Create automatically the missing nodes.
----------+--------------+------------------------------------------------------
-18/01/99 | JL Schwing | 1.15: Implements "-e randombase".
----------+--------------+------------------------------------------------------
-18/01/99 | JL Schwing | 1.16: Implements "-e v2".
----------+--------------+------------------------------------------------------
-20/01/99 | JL Schwing | 1.17: Bug fix - should'nt fail in createMissingNodes()
- | if error 68 (Already exists).
- | Increment counter for intermediate node(s) too.
----------+--------------+------------------------------------------------------
-23/01/99 | JL Schwing | 1.18: Improve traces.
- | Bug fix - remove leading spaces from rdn.
----------+--------------+------------------------------------------------------
-26/01/99 | JL Schwing | 1.19: Implement "-e noloop".
----------+--------------+------------------------------------------------------
-01/02/99 | JL Schwing | 1.20: Create *all* the nodes in createMissingNodes()
----------+--------------+------------------------------------------------------
-03/02/99 | JL Schwing | 1.21: Create the leaf entry after createMissingNodes()
----------+--------------+------------------------------------------------------
-26/02/99 | JL Schwing | 1.22: Detect "\," in createMissingNodes().
----------+--------------+------------------------------------------------------
-04/05/99 | JL Schwing | 1.23: Add call to opAdd().
----------+--------------+------------------------------------------------------
-04/05/99 | JL Schwing | 1.24: Forget some calls to opAdd().
----------+--------------+------------------------------------------------------
-04/05/99 | JL Schwing | 1.25: Too many calls to opAdd() !!!
----------+--------------+------------------------------------------------------
-19/05/99 | JL Schwing | 1.27: Implements doRename().
- | Do not print messages about intermediate nodes created
- | in quiet mode.
- | MOdify getPending()to support rename operations.
----------+--------------+------------------------------------------------------
-06/03/00 | JL Schwing | 1.28: Test malloc() return value.
----------+--------------+------------------------------------------------------
-06/03/00 | A. Hornik | 1.29: Bug fix - SEGV if no passwd provided.
----------+--------------+------------------------------------------------------
-03/08/00 | JL Schwing | 1.30: Improve errors decoding. This improvement
- | is to retrieve the additional error string that
- | is returned by the server. This is implemented for
- | the asynchronous operations and for the synchronous
- | search only, because for the other synchronous ops
- | we should use ldap_get_lderrno() that is not
- | implement in Solaris's libldap.
- | Add new function printErrorFromLdap().
----------+--------------+------------------------------------------------------
-03/08/00 | JL Schwing | 1.31: Fix SIGSEGV in printErrorFromLdap().
----------+--------------+------------------------------------------------------
-11/08/00 | JL Schwing | 1.32: Improve error decoding.
----------+--------------+------------------------------------------------------
-18/08/00 | JL Schwing | 1.33: Print begin and end dates.
----------+--------------+------------------------------------------------------
-25/08/00 | JL Schwing | 1.34: Implement consistent exit status...
----------+--------------+------------------------------------------------------
-11/10/00 | B Kolics | 1.35: Added SSL connection initialization to
- | | connectToServer, createMissingNodes
----------+--------------+------------------------------------------------------
-26/10/00 | B Kolics | 1.36: Moved SSL client initialization to basicInit
--------------------------------------------------------------------------------
-07/11/00 | JL Schwing | 1.37: Implements dynamic load of ssl-related
- | functions.
----------+--------------+------------------------------------------------------
-07/11/00 | JL Schwing | 1.38: Implement "-e inetOrgPerson".
- | Add new error message in createMissingNodes().
----------+--------------+------------------------------------------------------
-13/11/00 | JL Schwing | 1.39: Add new options "-e randombaselow and ...high"
----------+--------------+------------------------------------------------------
-14/11/00 | JL Schwing | 1.40: Will now use utils.c functions.
----------+--------------+------------------------------------------------------
-14/11/00 | JL Schwing | 1.41 : Port on AIX.
----------+--------------+------------------------------------------------------
-21/11/00 | JL Schwing | 1.42: Implement "-e attreplace=name:mask"
- | Add new function buildNewModAttrib().
----------+--------------+------------------------------------------------------
-24/11/00 | B Kolics | 1.43: Added SSL client authentication
----------+--------------+------------------------------------------------------
-29/11/00 | JL Schwing | 1.44: Port on NT 4.
----------+--------------+------------------------------------------------------
-01/12/00 | JL Schwing | 1.45: Port on Linux.
----------+--------------+------------------------------------------------------
-14/12/00 | JL Schwing | 1.46: Add more trace in VERY_VERBOSE mode.
- | Fix some trace messages.
- | Add new function dnFromMessage().
----------+--------------+------------------------------------------------------
-15/12/00 | JL Schwing | 1.47: Implement "-e counteach".
- | Implement "-e withnewparent" - cf bug Scopus 526148
----------+--------------+------------------------------------------------------
-18/12/00 | JL Schwing | 1.48: Add new exit status EXIT_RESSOURCE.
----------+--------------+------------------------------------------------------
-18/12/00 | JL Schwing | 1.49: Bug fix when -e rename,counteach
----------+--------------+------------------------------------------------------
-18/12/00 | JL Schwing | 1.50: Bug fix - support errors the user wants to
- | ignore in connectToServer().
- | Also a bug fix in tttctx->exitStatus management.
----------+--------------+------------------------------------------------------
-03/01/01 | JL Schwing | 1.51: Implement "-e attrsonly=value".
----------+--------------+------------------------------------------------------
-05/01/01 | JL Schwing | 1.52: Implement "-e randombinddn" and associated
- | "-e randombinddnlow/high"
- | Add new function buildNewBindDN().
----------+--------------+------------------------------------------------------
-05/03/01 | JL Schwing | 1.53: Fix the "anonymous" mode.
----------+--------------+------------------------------------------------------
-08/03/01 | JL Schwing | 1.54: Change referrals handling.
- | Add new functions refRebindProc() and referralSetup().
----------+--------------+------------------------------------------------------
-14/03/01 | JL Schwing | 1.55: Implement "-e commoncounter"
----------+--------------+------------------------------------------------------
-14/03/01 | JL Schwing | 1.56: Lint cleanup.
- | Port on _WIN32.
----------+--------------+------------------------------------------------------
-15/03/01 | JL Schwing | 1.57: Implement "-e attrlist=name:name:name"
- | Implement "-e randomattrlist=name:name:name"
----------+--------------+------------------------------------------------------
-19/03/01 | JL Schwing | 1.58: Implement "-e object=filename".
- | Implement "-e genldif=filename".
- | Add new functions buildVersatileObject() doGenldif()
----------+--------------+------------------------------------------------------
-21/03/01 | JL Schwing | 1.59: Implements variables in "-e object=filename"
----------+--------------+------------------------------------------------------
-23/03/01 | JL Schwing | 1.60: Implements data file list support in variants.
- | Implements "-e rdn=value".
----------+--------------+------------------------------------------------------
-28/03/01 | JL Schwing | 1.61: Fix traces.
----------+--------------+------------------------------------------------------
-28/03/01 | JL Schwing | 1.62: Support -e commoncounter with -e rdn/object
- | Increment counters in doGenldif().
- | Perfs tunning in doGenldif().
----------+--------------+------------------------------------------------------
-02/04/01 | JL Schwing | 1.63: Bug fix : large files support for -e genldif.
- | Add new function ldclt_write_genldif().
----------+--------------+------------------------------------------------------
-11/04/01 | JL Schwing | 1.64: Implement [INCRFROMFILE<NOLOOP>(myfile)]
----------+--------------+------------------------------------------------------
-11/04/01 | JL Schwing | 1.65: Bug fix - should not crash if variable not set.
----------+--------------+------------------------------------------------------
-03/05/01 | JL Schwing | 1.66: Implement -e randombinddnfromfile=filename.
- | Add new function getBindAndPasswdFromFile().
----------+--------------+------------------------------------------------------
-04/05/01 | JL Schwing | 1.67: Implement -e bindonly.
- | Add new function doBindOnly().
----------+--------------+------------------------------------------------------
-04/05/01 | JL Schwing | 1.68: Lint cleanup.
----------+--------------+------------------------------------------------------
*/
diff --git a/ldap/servers/slapd/tools/ldclt/ldclt.c b/ldap/servers/slapd/tools/ldclt/ldclt.c
index aab798b..595b93a 100644
--- a/ldap/servers/slapd/tools/ldclt/ldclt.c
+++ b/ldap/servers/slapd/tools/ldclt/ldclt.c
@@ -57,219 +57,6 @@
functionnality aspect of the product, but rather on the
stress and long-term operation.
LOCAL : None.
- HISTORY :
----------+--------------+------------------------------------------------------
-dd/mm/yy | Author | Comments
----------+--------------+------------------------------------------------------
-03/12/98 | JL Schwing | Creation
----------+--------------+------------------------------------------------------
-10/12/98 | JL Schwing | 1.2 : Add statistics report when exiting.
----------+--------------+------------------------------------------------------
-10/12/98 | JL Schwing | 1.3 : Trap SIGQUIL to issue statistics without exit.
- | Bug fix - call ldap_err2string() to decode ldap errs.
----------+--------------+------------------------------------------------------
-11/12/98 | JL Schwing | 1.4 : Implement max errors threshold.
- | fflush(stdout) after each printf.
- | Will exit(0) on SIGINT
----------+--------------+------------------------------------------------------
-14/12/98 | JL Schwing | 1.5 : Implement "-e close".
- | Ensure thread not dead prior to issue "no activity"
- | Add statts for the number of dead threads.
----------+--------------+------------------------------------------------------
-16/12/98 | JL Schwing | 1.6 : Implement "-e add" and "-e delete".
- | Improve printout of options.
----------+--------------+------------------------------------------------------
-24/12/98 | JL Schwing | 1.7 : Fix memory problem.
----------+--------------+------------------------------------------------------
-28/12/98 | JL Schwing | 1.8 : Add more statistics.
----------+--------------+------------------------------------------------------
-29/12/98 | JL Schwing | 1.9 : Implement -Q.
----------+--------------+------------------------------------------------------
-29/12/98 | JL Schwing | 1.10: Don't print pending stats if not asynchronous.
----------+--------------+------------------------------------------------------
-29/12/98 | JL Schwing | 1.11: Fix typo.
----------+--------------+------------------------------------------------------
-30/12/98 | JL Schwing | 1.12: Protect messages "no activity for %d seconds"
- | by SUPER_QUIET mode.
----------+--------------+------------------------------------------------------
-11/01/99 | JL Schwing | 1.13: Implement "-e emailPerson".
----------+--------------+------------------------------------------------------
-13/01/99 | JL Schwing | 1.14: Implement "-e string".
----------+--------------+------------------------------------------------------
-14/01/99 | JL Schwing | 1.15: Implement "-s <scope>".
----------+--------------+------------------------------------------------------
-18/01/99 | JL Schwing | 1.16: Implement "-e randombase".
----------+--------------+------------------------------------------------------
-18/01/99 | JL Schwing | 1.17: Implement "-e v2".
----------+--------------+------------------------------------------------------
-21/01/99 | JL Schwing | 1.18: Implement "-e ascii".
----------+--------------+------------------------------------------------------
-26/01/99 | JL Schwing | 1.19: Implement "-e noloop".
----------+--------------+------------------------------------------------------
-28/01/99 | JL Schwing | 1.20: Implement "-T <total>".
----------+--------------+------------------------------------------------------
-04/05/99 | JL Schwing | 1.21: Implement operations list.
----------+--------------+------------------------------------------------------
-06/05/99 | JL Schwing | 1.25: Add proper shutdwon (wait for check threads).
- | Implement "-P <master port>".
----------+--------------+------------------------------------------------------
-06/05/99 | JL Schwing | 1.26: Implement "-e modrdn".
----------+--------------+------------------------------------------------------
-06/05/99 | F. Pistolesi | 1.27: Some fixes.
----------+--------------+------------------------------------------------------
-07/05/99 | JL Schwing | 1.28: Some fixes.
----------+--------------+------------------------------------------------------
-19/05/99 | JL Schwing | 1.30: Implement "-e rename".
- | Set the threads status to DEAD when nb of opers done.
- | Lint-cleanup.
----------+--------------+------------------------------------------------------
-21/05/99 | JL Schwing | 1.31: Fix Unitialized Memory Read for head's mutex.
----------+--------------+------------------------------------------------------
-27/05/99 | JL Schwing | 1.32 : Add statistics to check threads.
----------+--------------+------------------------------------------------------
-28/05/99 | JL Schwing | 1.33 : Add new option -W (wait).
----------+--------------+------------------------------------------------------
-02/06/99 | JL Schwing | 1.34 : Add flag in main ctx to know if slave was
- | connected or not.
- | Add counter of operations received in check threads.
----------+--------------+------------------------------------------------------
-06/03/00 | JL Schwing | 1.35: Test malloc() and strdup() return value.
----------+--------------+------------------------------------------------------
-04/08/00 | JL Schwing | 1.36: Add stats on nb inactivity per thread.
----------+--------------+------------------------------------------------------
-08/08/00 | JL Schwing | 1.37: Print global statistics every 1000 loops.
----------+--------------+------------------------------------------------------
-18/08/00 | JL Schwing | 1.38: Print global statistics every 90 loops.
- | Bug fix in this new feature.
- | Print ldclt version.
- | Print date of begin and of end.
- | Add new function ldcltExit().
----------+--------------+------------------------------------------------------
-25/08/00 | JL Schwing | 1.39: Implement consistent exit status...
----------+--------------+------------------------------------------------------
-25/08/00 | JL Schwing | 1.40: Will only load images if -e emailPerson
----------+--------------+------------------------------------------------------
-11/10/00 | B Kolics | 1.41: Implement "-Z certfile".
----------+--------------+------------------------------------------------------
-26/10/00 | B Kolics | 1.42: Move SSL client initialization to basicInit()
--------------------------------------------------------------------------------
-07/11/00 | JL Schwing | 1.43: Add handlers for dynamic load of ssl-related
- | functions.
- | Add new function sslDynLoadInit().
------------------------------------------------------------------------------
-07/11/00 | JL Schwing | 1.44: Implement "-e inetOrgPerson".
----------+--------------+------------------------------------------------------
-08/11/00 | JL Schwing | 1.45: Improve error message when initiating ssl.
----------+--------------+------------------------------------------------------
-13/11/00 | JL Schwing | 1.46: Add new options "-e randombaselow and ...high"
- | Made use of exit (EXIT_PARAMS) in main().
----------+--------------+------------------------------------------------------
-14/11/00 | JL Schwing | 1.47: Port on AIX.
----------+--------------+------------------------------------------------------
-16/11/00 | JL Schwing | 1.48: Implement "-e imagesdir=path".
----------+--------------+------------------------------------------------------
-17/11/00 | JL Schwing | 1.49: Implement "-e smoothshutdown".
- | Forget to add mode decoding.
- | Add new function shutdownThreads().
----------+--------------+------------------------------------------------------
-21/11/00 | JL Schwing | 1.50: Implement "-e attreplace=name:mask"
- | Add new function parseFilter().
----------+--------------+------------------------------------------------------
-22/11/00 | JL Schwing | 1.51: Will now use LD_LIBRARY_PATH to load libssl.
----------+--------------+------------------------------------------------------
-24/11/00 | B Kolics | 1.52: Added SSL client authentication
----------+--------------+------------------------------------------------------
-29/11/00 | JL Schwing | 1.53: Port on NT 4.
----------+--------------+------------------------------------------------------
-30/11/00 | JL Schwing | 1.54: Bug fix - bad error message if -eimagesdir=path
----------+--------------+------------------------------------------------------
-01/12/00 | JL Schwing | 1.55: Port on Linux.
----------+--------------+------------------------------------------------------
-01/12/00 | JL Schwing | 1.56: Port on HP-UX.
----------+--------------+------------------------------------------------------
-07/12/00 | JL Schwing | 1.57: Bug fix - crash SIGBUS in main:1840 if no
- | filter is provided to the tool.
- | Build the argv list before parsing.
----------+--------------+------------------------------------------------------
-15/12/00 | JL Schwing | 1.58: Implement "-e counteach".
- | Implement "-e withnewparent".
----------+--------------+------------------------------------------------------
-18/12/00 | JL Schwing | 1.59: Fix an exit status problem.
----------+--------------+------------------------------------------------------
-18/12/00 | JL Schwing | 1.60: Minor fix/improvement in -I management.
----------+--------------+------------------------------------------------------
-19/12/00 | JL Schwing | 1.61: Implement "-e noglobalstats".
----------+--------------+------------------------------------------------------
-19/12/00 | JL Schwing | 1.62: Add comments.
----------+--------------+------------------------------------------------------
-03/01/01 | JL Schwing | 1.63: Implement "-e attrsonly=value".
----------+--------------+------------------------------------------------------
-05/01/01 | JL Schwing | 1.64: Implement "-e randombinddn" and associated
- | "-e randombinddnlow/high"
----------+--------------+------------------------------------------------------
-08/01/01 | JL Schwing | 1.65: Implement "-e scalab01".
- | Replace all exit() by ldcltExit()
----------+--------------+------------------------------------------------------
-12/01/01 | JL Schwing | 1.66: Second set of options for -e scalab01
- | Sanity check in decodeExecParams().
----------+--------------+------------------------------------------------------
-26/02/01 | JL Schwing | 1.67: Use ldclt_sleep() not sleep() (NT issue).
----------+--------------+------------------------------------------------------
-08/03/01 | JL Schwing | 1.68: Change referrals handling.
- | Use a static char[] to store ldclt version.
- | Add new function decodeReferralParams().
----------+--------------+------------------------------------------------------
-14/03/01 | JL Schwing | 1.69: Implement "-e commoncounter"
- | Add a control for referral mode.
----------+--------------+------------------------------------------------------
-14/03/01 | JL Schwing | 1.70: Implement "-e dontsleeponserverdown".
----------+--------------+------------------------------------------------------
-14/03/01 | JL Schwing | 1.71: Misc fixes for HP-UX compilation.
----------+--------------+------------------------------------------------------
-15/03/01 | JL Schwing | 1.72: Implement "-e attrlist=name:name:name"
- | Implement "-e randomattrlist=name:name:name"
----------+--------------+------------------------------------------------------
-19/03/01 | JL Schwing | 1.73: Implement "-e object=filename"
- | Bug fix - understand EXIT_INIT in ldcltExit().
- | Implement "-e genldif=filename"
- | Add new function tttctxInit().
----------+--------------+------------------------------------------------------
-21/03/01 | JL Schwing | 1.74: Implements variables in "-e object=filename"
- | Add new function copyVersObject().
----------+--------------+------------------------------------------------------
-23/03/01 | JL Schwing | 1.75: Implements data file list support in variants.
- | Implements "-e rdn=value".
- | Add new functions copyVersAttribute() decodeRdnParam()
----------+--------------+------------------------------------------------------
-28/03/01 | JL Schwing | 1.76: Update options checking for "-e rdn=value".
----------+--------------+------------------------------------------------------
-28/03/01 | JL Schwing | 1.77: Support -e commoncounter with -e rdn/object
- | Remove MAX_ATTRLIST - use MAX_ATTRIBS.
- | Bug fix - forget to initiate some fields in -e rdn=
----------+--------------+------------------------------------------------------
-02/04/01 | JL Schwing | 1.78: Bug fix : large files support for -e genldif.
----------+--------------+------------------------------------------------------
-03/04/01 | JL Schwing | 1.79: Port on _WIN32 and OSF1.
----------+--------------+------------------------------------------------------
-05/04/01 | JL Schwing | 1.80: Bug fix - forget to print genldif file name.
----------+--------------+------------------------------------------------------
-05/04/01 | JL Schwing | 1.81: Implement -e append.
----------+--------------+------------------------------------------------------
-11/04/01 | JL Schwing | 1.82: Bug fix in -e append.
----------+--------------+------------------------------------------------------
-23/04/01 | JL Schwing | 1.83: Improved arguments print at startup.
- | Add new function buildArgListString().
----------+--------------+------------------------------------------------------
-23/04/01 | JL Schwing | 1.84: Exit on error 2 if extra arguments provided.
----------+--------------+------------------------------------------------------
-03/05/01 | JL Schwing | 1.85: Implement -e randombinddnfromfile=filename.
----------+--------------+------------------------------------------------------
-04/05/01 | JL Schwing | 1.86: Implement -e bindonly.
----------+--------------+------------------------------------------------------
-04/05/01 | JL Schwing | 1.87: Fix options check.
----------+--------------+------------------------------------------------------
-16/06/01 | JL Schwing | 1.89: Allow SSL for HP-UX.
----------+--------------+------------------------------------------------------
*/
#include <stdlib.h> /* exit(), etc... */
@@ -1086,7 +873,6 @@ trapVector (
int
initMainThread (void)
{
-#ifndef _WIN32 /*JLS 29-11-00*/
struct sigaction act;
/*
@@ -1130,7 +916,6 @@ initMainThread (void)
fflush (stderr);
return (-1);
}
-#endif /* _WIN32 */ /*JLS 29-11-00*/
return (0);
}
@@ -1259,7 +1044,7 @@ basicInit (void)
oflags = O_APPEND|O_WRONLY|O_CREAT; /*JLS 05-04-01*/
else /*JLS 05-04-01*/
oflags = O_EXCL|O_WRONLY|O_CREAT; /*JLS 05-04-01*/
-#if !defined(OSF1) && !defined(__LP64__) && !defined(_LP64) /*JLS 05-04-01*/
+#if !defined(__LP64__) && !defined(_LP64) /*JLS 05-04-01*/
oflags |= O_LARGEFILE; /*JLS 05-04-01*/
#endif /*JLS 03-04-01*/
mctx.genldifFile = open (mctx.genldifName, oflags, 0666); /*JLS 05-04-01*/
diff --git a/ldap/servers/slapd/tools/ldclt/opCheck.c b/ldap/servers/slapd/tools/ldclt/opCheck.c
index aa7f780..6f8505d 100644
--- a/ldap/servers/slapd/tools/ldclt/opCheck.c
+++ b/ldap/servers/slapd/tools/ldclt/opCheck.c
@@ -54,49 +54,6 @@
server to the attributes memorized for one operation,
etc...
LOCAL : None.
- HISTORY :
----------+--------------+------------------------------------------------------
-dd/mm/yy | Author | Comments
----------+--------------+------------------------------------------------------
-04/05/99 | JL Schwing | Creation
----------+--------------+------------------------------------------------------
-05/05/99 | F. Pistolesi | 1.8 : Add communication with remote host.
- | Implement operations check.
----------+--------------+------------------------------------------------------
-06/05/99 | JL Schwing | 1.10: Implements opDecOper().
- | Add more traces in VERY_VERBOSE
----------+--------------+------------------------------------------------------
-20/05/99 | JL Schwing | 1.18: Add params (newRdn and newParent) to opAdd()
- | Decode operations in Cnnn messages.
- | No more exit on EINTR in accept()
- | Fix memory leak in thOperFree()
----------+--------------+------------------------------------------------------
-21/05/99 | JL Schwing | 1.19: Minor fixes in messages.
- | Purify cleanup - Free memory read in opCheckLoop()
- | Fix thOperFree() - pb when head of list to delete
- | Fix memory leak in opNext().
----------+--------------+------------------------------------------------------
-26/05/99 | JL Schwing | 1.21: Bug fix - return(-1) bad place in opNext().
- | Minor fixes in messages.
----------+--------------+------------------------------------------------------
-27/05/99 | JL Schwing | 1.22 : Add statistics to check threads.
----------+--------------+------------------------------------------------------
-27/05/99 | F. Pistolesi | 1.23 : Fix statistics and other algorythms.
----------+--------------+------------------------------------------------------
-31/05/99 | JL Schwing | 1.25 : Bug fix - should test opRead() returned pointer
----------+--------------+------------------------------------------------------
-02/06/99 | JL Schwing | 1.26 : Add flag in main ctx to know if slave was
- | connected or not.
- | Add counter of operations received in check threads.
----------+--------------+------------------------------------------------------
-06/03/00 | JL Schwing | 1.27: Test malloc() return value.
----------+--------------+------------------------------------------------------
-18/08/00 | JL Schwing | 1.28: Print begin and end dates.
----------+--------------+------------------------------------------------------
-17/11/00 | JL Schwing | 1.29: Implement "-e smoothshutdown".
----------+--------------+------------------------------------------------------
-29/11/00 | JL Schwing | 1.30: Port on NT 4.
----------+--------------+------------------------------------------------------
*/
#include <pthread.h> /* Posix threads */
@@ -124,10 +81,6 @@ dd/mm/yy | Author | Comments
enum {SINGLE=0,FIRST,MIDDLE,LAST};
-
-
-
-
/* ****************************************************************************
FUNCTION : opDecOper
PURPOSE : This function decodes an LDAP operation and return a
@@ -151,12 +104,6 @@ opDecOper (
}
}
-
-
-
-
-
-
/* ****************************************************************************
FUNCTION : LDAPMod2attributes
PURPOSE : Convert a LDAPMod-like array of attributes to the
@@ -230,14 +177,6 @@ LDAPMod2attributes (
return (0);
}
-
-
-
-
-
-
-
-
/* ****************************************************************************
FUNCTION : freeAttributesArray
PURPOSE : This function is targeted to free an array of
@@ -263,14 +202,6 @@ freeAttributesArray (
return (0);
}
-
-
-
-
-
-
-
-
/* ****************************************************************************
FUNCTION : opAdd
PURPOSE : Add a new operation to the list.
@@ -387,12 +318,6 @@ opAdd (
return (0);
}
-
-
-
-
-
-
/* ****************************************************************************
FUNCTION : opNext
PURPOSE : Return the next available operation. May return NULL
@@ -481,14 +406,6 @@ opNext (
return (0);
}
-
-
-
-
-
-
-
-
/* ****************************************************************************
FUNCTION : opRead
PURPOSE : Read the n'th operation from the head.
@@ -522,11 +439,6 @@ opRead (
return (0);
}
-
-
-
-
-
/* ****************************************************************************
FUNCTION : thOperAdd
PURPOSE : This function copies an operation to the late
@@ -590,11 +502,6 @@ thOperAdd ( thoper *head, oper *elem, int f)
return head;
}
-
-
-
-
-
/* ****************************************************************************
FUNCTION : thOperFree
PURPOSE : This function frees memory for a late operation
@@ -626,11 +533,6 @@ thOperFree (thoper *head, thoper *elem)
return head;
}
-
-
-
-
-
/* ****************************************************************************
FUNCTION : opCheckLoop
PURPOSE : This function is the per slave check function
@@ -858,11 +760,6 @@ opCheckLoop ( void* arg)
pthread_exit(NULL);
}
-
-
-
-
-
/* ****************************************************************************
FUNCTION : opCheckMain
PURPOSE : This function is the main function of the check
@@ -881,9 +778,6 @@ opCheckMain (
#ifdef LINUX
struct hostent *stupidlinux=NULL;
#endif
-#ifdef AIX
- struct hostent_data stupidaix;
-#endif
struct linger lopt;
uint32_t ipaddr;
int newfd,sockfd,ncctx,i,err;
@@ -923,11 +817,7 @@ opCheckMain (
retry = 1;
while (retry)
{
-#ifdef AIX
- if ((newfd=accept(sockfd,(struct sockaddr *)&claddr,(unsigned long *)&i))>=0)
-#else
if ((newfd=accept(sockfd,(struct sockaddr *)&claddr,&i))>=0)
-#endif
retry = 0;
else
if (errno != EINTR)
@@ -941,10 +831,6 @@ opCheckMain (
*/
ipaddr=ntohl(claddr.sin_addr.s_addr);
-#ifdef AIX
- gethostbyaddr_r((char*)&ipaddr,sizeof(ipaddr),AF_INET,&cltaddr,
- &stupidaix);
-#else
#ifdef LINUX
gethostbyaddr_r((char*)&ipaddr,sizeof(ipaddr),AF_INET,&cltaddr,
buffer,128, &stupidlinux, &err);
@@ -956,7 +842,6 @@ opCheckMain (
buffer,128,&err);
#endif
#endif
-#endif
i=1;
if(setsockopt(newfd,IPPROTO_TCP, TCP_NODELAY,(void *)&i,sizeof(int))!=0)
@@ -1009,9 +894,3 @@ opCheckMain (
close(sockfd);
}
-
-
-
-
-
-/* End of file */
diff --git a/ldap/servers/slapd/tools/ldclt/port.h b/ldap/servers/slapd/tools/ldclt/port.h
index cacbf91..b63eff9 100644
--- a/ldap/servers/slapd/tools/ldclt/port.h
+++ b/ldap/servers/slapd/tools/ldclt/port.h
@@ -51,27 +51,11 @@
DESCRIPTION :
This file contains the include (interface) definitions
of port.c
- LOCAL : None.
- HISTORY :
----------+--------------+------------------------------------------------------
-dd/mm/yy | Author | Comments
----------+--------------+------------------------------------------------------
-28/11/00 | JL Schwing | Creation
----------+--------------+------------------------------------------------------
-01/12/00 | JL Schwing | 1.2 : Port on Linux.
----------+--------------+------------------------------------------------------
-01/12/00 | JL Schwing | 1.3 : Port on HP-UX.
----------+--------------+------------------------------------------------------
-03/04/01 | JL Schwing | 1.4 : Linux large file issue...
----------+--------------+------------------------------------------------------
*/
/*
* Tuning of the code
*/
-#ifdef AIX /*JLS 01-12-00*/
-#define LDCLT_CAST_SIGACTION 1 /*JLS 01-12-00*/
-#endif /*JLS 01-12-00*/
#ifdef HPUX /*JLS 01-12-00*/
#define LDCLT_CAST_SIGACTION 1 /*JLS 01-12-00*/
diff --git a/ldap/servers/slapd/tools/ldclt/remote.h b/ldap/servers/slapd/tools/ldclt/remote.h
index d10dcaa..accb99b 100644
--- a/ldap/servers/slapd/tools/ldclt/remote.h
+++ b/ldap/servers/slapd/tools/ldclt/remote.h
@@ -49,17 +49,6 @@
DESCRIPTION :
This file contains the definitions used by the remote
control module of ldclt.
- LOCAL : None.
- HISTORY :
----------+--------------+------------------------------------------------------
-dd/mm/yy | Author | Comments
----------+--------------+------------------------------------------------------
-04/05/99 | JL Schwing | Creation
----------+--------------+------------------------------------------------------
-05/05/99 | F. Pistolesi | 1.3 : Implements communication with remote part.
----------+--------------+------------------------------------------------------
-06/05/99 | JL Schwing | 1.4 : Port on Solaris 2.5.1
----------+--------------+------------------------------------------------------
*/
/*
@@ -69,14 +58,7 @@ dd/mm/yy | Author | Comments
#include <sys/types.h>
#include <fcntl.h>
#include <sys/stat.h>
-#ifdef OSF1
-#ifndef _UINT32_T
-#define _UINT32_T
-typedef unsigned long uint32_t;
-#endif /* _UINT32_T */
-#else /* OS_RELEASE */
#include <inttypes.h>
-#endif /* OS_RELEASE */
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>
diff --git a/ldap/servers/slapd/tools/ldclt/utils.c b/ldap/servers/slapd/tools/ldclt/utils.c
index 80a429c..c3a0dce 100644
--- a/ldap/servers/slapd/tools/ldclt/utils.c
+++ b/ldap/servers/slapd/tools/ldclt/utils.c
@@ -57,18 +57,6 @@
framework and data structures, and thus to provide a
kind of library suitable for any command.
LOCAL : None.
- HISTORY :
----------+--------------+------------------------------------------------------
-dd/mm/yy | Author | Comments
----------+--------------+------------------------------------------------------
-14/11/00 | JL Schwing | Creation
----------+--------------+------------------------------------------------------
-14/11/00 | JL Schwing | 1.2 : Port on AIX.
----------+--------------+------------------------------------------------------
-16/11/00 | JL Schwing | 1.3 : lint cleanup.
----------+--------------+------------------------------------------------------
-11/01/01 | JL Schwing | 1.4 : Add new function rndlim().
----------+--------------+------------------------------------------------------
*/
#include "utils.h" /* Basic definitions for this file */
@@ -81,50 +69,8 @@ dd/mm/yy | Author | Comments
/*
* Some global variables...
*/
-#ifdef AIX
-pthread_mutex_t ldcltrand48_mutex; /* ldcltrand48() */ /*JLS 14-11-00*/
-#endif
-
-
-#ifdef AIX /* New */ /*JLS 14-11-00*/
-/* ****************************************************************************
- FUNCTION : ldcltrand48
- PURPOSE : Implement a thread-save version of lrand48()
- INPUT : None.
- OUTPUT : None.
- RETURN : A random value.
- DESCRIPTION :
- *****************************************************************************/
-long int
-ldcltrand48 (void)
-{
- long int val;
- int ret;
-
- if ((ret = pthread_mutex_lock (&ldcltrand48_mutex)) != 0)
- {
- fprintf (stderr,
- "Cannot pthread_mutex_lock(ldcltrand48_mutex), error=%d (%s)\n",
- ret, strerror (ret));
- fflush (stderr);
- ldcltExit (99);
- }
- val = lrand48();
- if ((ret = pthread_mutex_unlock (&ldcltrand48_mutex)) != 0)
- {
- fprintf (stderr,
- "Cannot pthread_mutex_unlock(ldcltrand48_mutex), error=%d (%s)\n",
- ret, strerror (ret));
- fflush (stderr);
- ldcltExit (99);
- }
-
- return (val);
-}
-
-#else /* AIX */
#define ldcltrand48() lrand48()
-#endif /* AIX */
+
/* ****************************************************************************
@@ -138,21 +84,6 @@ ldcltrand48 (void)
int
utilsInit (void)
{
-#ifdef AIX /*JLS 14-11-00*/
- int ret; /*JLS 14-11-00*/
-
- /*
- * Initiate the mutex that protect ldcltrand48()
- */
- if ((ret = pthread_mutex_init(&ldcltrand48_mutex, NULL)) != 0)/*JLS 14-11-00*/
- { /*JLS 14-11-00*/
- fprintf (stderr, "ldclt: %s\n", strerror (ret)); /*JLS 14-11-00*/
- fprintf (stderr, /*JLS 14-11-00*/
- "Error: cannot initiate ldcltrand48_mutex\n"); /*JLS 14-11-00*/
- fflush (stderr); /*JLS 14-11-00*/
- return (-1); /*JLS 14-11-00*/
- } /*JLS 14-11-00*/
-#endif /*JLS 14-11-00*/
/*
* No error
@@ -160,14 +91,6 @@ utilsInit (void)
return (0);
}
-
-
-
-
-
-
-
-
/* ****************************************************************************
FUNCTION : rndlim
PURPOSE : Returns a random number between the given limits.
@@ -185,14 +108,6 @@ rndlim (
return (low + ldcltrand48() % (high-low+1));
}
-
-
-
-
-
-
-
-
/* ****************************************************************************
FUNCTION : rnd
PURPOSE : Creates a random number string between the given
@@ -217,11 +132,6 @@ rnd (
(int)(low + (ldcltrand48() % (high-low+1)))); /*JLS 14-11-00*/
}
-
-
-
-
-
/* ****************************************************************************
FUNCTION : rndstr
PURPOSE : Return a random string, of length ndigits. The string
@@ -334,6 +244,3 @@ incr_and_wrap(int val, int min, int max, int incr)
return (((val + incr) - min) % range) + min;
}
-
-
-/* End of file */
diff --git a/ldap/servers/slapd/tools/migratecred.c b/ldap/servers/slapd/tools/migratecred.c
index 3c876f0..86e6fb2 100644
--- a/ldap/servers/slapd/tools/migratecred.c
+++ b/ldap/servers/slapd/tools/migratecred.c
@@ -150,15 +150,7 @@ main( int argc, char **argv)
shared_lib = ".sl";
#endif
#else
-#ifdef AIX
-#if OSVERSION >= 4200
shared_lib = ".so";
-#else
- shared_lib = "_shr.a";
-#endif
-#else
- shared_lib = ".so";
-#endif
#endif
if (!pluginpath) {
diff --git a/ldap/servers/slapd/tools/mkdep.c b/ldap/servers/slapd/tools/mkdep.c
index e5f49e0..7c79ee6 100644
--- a/ldap/servers/slapd/tools/mkdep.c
+++ b/ldap/servers/slapd/tools/mkdep.c
@@ -55,18 +55,11 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-
-#ifdef WINNT
-#include <windows.h>
-#include <winbase.h>
-#include <io.h>
-#else
#include <unistd.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>
-#endif
char __depname[512] = "\n\t@touch ";
@@ -80,12 +73,7 @@ struct path_struct {
char buffer[256-sizeof(int)];
} path = { 0, "" };
-
-#ifdef WINNT
-#define EXISTS(_fn) _access(_fn, 00)
-#else
#define EXISTS(_fn) access(_fn, F_OK)
-#endif
/*
* Handle an #include line.
@@ -233,65 +221,6 @@ pound_include_dquote:
}
}
-
-#ifdef WINNT
-
-/*
- * Alternate implementation of do_depend() for NT
- * (NT has its own wacky versions of open/mmap/close)
- */
-void do_depend(const char *filename, const char *command)
-{
- HANDLE fd, mapfd;
- BY_HANDLE_FILE_INFORMATION st;
- char *map;
-
- fd = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ, NULL,
- OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL);
- if (fd == INVALID_HANDLE_VALUE) {
- fprintf(stderr, "NT error opening '%s'\n", filename);
- return;
- }
- if (! GetFileInformationByHandle(fd, &st)) {
- fprintf(stderr, "NT error getting stat on '%s'\n", filename);
- CloseHandle(fd);
- return;
- }
- if (st.nFileSizeLow == 0) {
- fprintf(stderr, "%s is empty\n", filename);
- CloseHandle(fd);
- return;
- }
-
- mapfd = CreateFileMapping(fd, NULL, PAGE_READONLY, st.nFileSizeHigh,
- st.nFileSizeLow, NULL);
- if (mapfd == NULL) {
- fprintf(stderr, "NT error creating file mapping of '%s'\n",
- filename);
- CloseHandle(fd);
- return;
- }
- map = MapViewOfFile(mapfd, FILE_MAP_READ, 0, 0, 0);
- if (map == NULL) {
- fprintf(stderr, "NT error creating mapped view of '%s'\n",
- filename);
- CloseHandle(mapfd);
- CloseHandle(fd);
- return;
- }
-
- hasdep = 0;
- state_machine(map, map+st.nFileSizeLow);
- if (hasdep)
- puts(command);
-
- UnmapViewOfFile(map);
- CloseHandle(mapfd);
- CloseHandle(fd);
-}
-
-#else
-
/*
* Generate dependencies for one file.
*/
@@ -339,9 +268,6 @@ void do_depend(const char * filename, const char * command)
close(fd);
}
-#endif
-
-
/*
* Generate dependencies for all files.
*/
diff --git a/ldap/servers/slapd/util.c b/ldap/servers/slapd/util.c
index 271f342..958ee6f 100644
--- a/ldap/servers/slapd/util.c
+++ b/ldap/servers/slapd/util.c
@@ -1051,9 +1051,6 @@ Description:
In UNIX this is accomplished by using select()
which should be supported across all UNIX platforms.
- In WIN32 we simply use the Sleep() function which yields
- for the number of milliseconds specified.
-
************************************************************************/
void
DS_Sleep(PRIntervalTime ticks)
diff --git a/ldap/systools/idsktune.c b/ldap/systools/idsktune.c
index f36b780..1a28045 100644
--- a/ldap/systools/idsktune.c
+++ b/ldap/systools/idsktune.c
@@ -46,26 +46,17 @@
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
static char *build_date = "23-FEBRUARY-2012";
-#if defined(__FreeBSD__) || defined(__bsdi)
-#define IDDS_BSD_INCLUDE 1
-#define IDDS_BSD_SYSCTL 1
-#endif
-
#if defined(linux) || defined(__linux) || defined(__linux__)
#define IDDS_LINUX_INCLUDE 1
#define IDDS_LINUX_SYSCTL 1
#endif
-#if defined(__sun) || defined(__sun__) || defined(_AIX) || defined(__hpux) || defined(_nec_ews_svr4) || defined(__osf__) || defined(__sgi) || defined(sgi)
+#if defined(__sun) || defined(__sun__)|| defined(__hpux)
#define IDDS_SYSV_INCLUDE 1
#endif
#include <sys/types.h>
-#if defined(IDDS_BSD_INCLUDE)
-#include <sys/time.h>
-#endif
-
#if !defined(__VMS)
#include <sys/resource.h>
#include <unistd.h>
@@ -74,7 +65,7 @@ static char *build_date = "23-FEBRUARY-2012";
#include <string.h>
#include <errno.h>
#include <ctype.h>
-#if !defined(_WIN32) && !defined(__VMS) && !defined(IDDS_LINUX_INCLUDE) && !defined(IDDS_BSD_INCLUDE)
+#if !defined(__VMS) && !defined(IDDS_LINUX_INCLUDE)
#if defined(__hpux) && defined(f_type)
#undef f_type
#endif
@@ -88,7 +79,7 @@ static char *build_date = "23-FEBRUARY-2012";
#include <sys/param.h>
#endif
-#if defined(__sun) || defined(__sun__) || defined(__osf__) || defined(_nec_ews_svr4) || defined(__sgi) || defined(sgi)
+#if defined(__sun) || defined(__sun__)
/* not available on HP-UX or AIX */
#include <sys/systeminfo.h>
#endif
@@ -128,52 +119,6 @@ static char *build_date = "23-FEBRUARY-2012";
#define IDDS_MNTENT_MNTTAB "/etc/mnttab"
#endif
-#if defined(_AIX)
-#include <pthread.h>
-#include <signal.h>
-#include <sys/inttypes.h>
-#include <odmi.h>
-#include <fstab.h>
-
-struct CuAt {
- __long32_t _id;
- __long32_t _reserved;
- __long32_t _scratch;
- char name[16];
- char attribute[16];
- char value[256];
- char type[8];
- char generic[8];
- char rep[8];
- short nls_index;
-};
-#define CuAt_Descs 7
-
-struct fix {
- __long32_t _id;
- __long32_t _reserved;
- __long32_t _scratch;
- char name[16];
- char abstract[60];
- char type[2];
- char *filesets;
- char *symptom;
- };
-
-#define fix_Descs 5
-
-struct Class CuAt_CLASS[];
-extern struct Class fix_CLASS[];
-
-static void idds_aix_odm_get_cuat (char *query,char *buf);
-
-#define IDDS_MNTENT fstab
-#define IDDS_MNTENT_DIRNAME fs_file
-/* AIX does not have /etc/mnttab */
-/* #define IDDS_MNTENT_OPTIONS */
-
-#endif
-
#if defined(__VMS)
#error "This program is not available for VMS"
#endif
@@ -248,11 +193,7 @@ int mem_rec = 1024;
#define NAME_TCP_KEEPALIVE_INTERVAL "net.ipv4.tcp_keepalive_time"
#endif
-#if defined(IDDS_BSD_SYSCTL)
-#define NAME_TCP_SMALLEST_ANON_PORT "net.inet.ip.portrange.hifirst"
-#endif
-
-#if defined(__sun) || defined(__hpux) || defined(IDDS_BSD_SYSCTL) || defined(IDDS_LINUX_SYSCTL)
+#if defined(__sun) || defined(__hpux) || defined(IDDS_LINUX_SYSCTL)
long ndd_tcp_conn_req_max_q = 0;
long ndd_tcp_conn_req_max_q0 = 0;
@@ -326,251 +267,6 @@ struct iii_pinfo_hp {
static void hp_check_qpk(void);
#endif
-#if defined(_AIX)
-
-static struct ClassElem CuAt_ClassElem[] = {
- { "name",ODM_CHAR, 12,16, NULL,NULL,0,NULL ,-1,0},
- { "attribute",ODM_CHAR, 28,16, NULL,NULL,0,NULL ,-1,0},
- { "value",ODM_CHAR, 44,256, NULL,NULL,0,NULL ,-1,0},
- { "type",ODM_CHAR, 300,8, NULL,NULL,0,NULL ,-1,0},
- { "generic",ODM_CHAR, 308,8, NULL,NULL,0,NULL ,-1,0},
- { "rep",ODM_CHAR, 316,8, NULL,NULL,0,NULL ,-1,0},
- { "nls_index",ODM_SHORT, 324, 2, NULL,NULL,0,NULL ,-1,0},
-};
-
-static struct ClassElem fix_ClassElem[] = {
- { "name",ODM_CHAR, 12,16, NULL,NULL,0,NULL ,-1,0},
- { "abstract",ODM_CHAR, 28,60, NULL,NULL,0,NULL ,-1,0},
- { "type",ODM_CHAR, 88,2, NULL,NULL,0,NULL ,-1,0},
- { "filesets",ODM_VCHAR, 92,64, NULL,NULL,0,NULL ,-1,0},
- { "symptom",ODM_VCHAR, 96,64, NULL,NULL,0,NULL ,-1,0},
- };
-struct StringClxn fix_STRINGS[] = {
- "fix.vc", 0,NULL,NULL,0,0,0
- };
-
-#ifdef __64BIT__
-struct Class CuAt_CLASS[] = {
- ODMI_MAGIC, "CuAt", 328, CuAt_Descs, CuAt_ClassElem, NULL,FALSE,NULL,NULL,0,0,NULL,0,"", 0,-ODMI_MAGIC
-};
-struct Class fix_CLASS[] = {
- ODMI_MAGIC, "fix", 100, fix_Descs, fix_ClassElem, fix_STRINGS,FALSE,NULL,NULL,0,0,NULL,0,"", 0,-ODMI_MAGIC
- };
-
-#else
-struct Class CuAt_CLASS[] = {
- ODMI_MAGIC, "CuAt", sizeof(struct CuAt), CuAt_Descs, CuAt_ClassElem, NULL,FALSE,NULL,NULL,0,0,NULL,0,"", 0,-ODMI_MAGIC
-};
-struct Class fix_CLASS[] = {
- ODMI_MAGIC, "fix", sizeof(struct fix), fix_Descs, fix_ClassElem, fix_STRINGS,FALSE,NULL,NULL,0,0,NULL,0,"", 0,-ODMI_MAGIC
- };
-
-#endif
-
-void idds_aix_odm_get_cuat (char *query,char *buf)
-{
- struct CuAt cuat,*cp;
-
- cp = odm_get_first(CuAt_CLASS,query,&cuat);
-
- if (cp == NULL || cp == (struct CuAt *)-1) {
- if (flag_debug) {
- printf("DEBUG : query of %s failed, error %d\n",query,odmerrno);
- }
- *buf = '\0';
- return;
- } else {
- if (flag_debug) {
- printf("DEBUG : query of %s resulted in %s\n",query,cuat.value);
- }
- }
- strcpy(buf,cuat.value);
-}
-
-int idds_aix_odm_get_fix (char *query)
-{
- struct fix fix,*cp;
-
- cp = odm_get_first(fix_CLASS,query,&fix);
-
- if (cp == NULL || cp == (struct fix *)-1) {
- if (flag_debug) {
- printf("DEBUG : query of %s failed, error %d\n",query,odmerrno);
- }
- return 0;
- } else {
- if (flag_debug) {
- printf("DEBUG : query of %s resulted in data\n",query);
- }
- }
- return 1;
-}
-
-#define AIX_CHECK_PATCH_CMD "/usr/bin/lslpp -c -L bos.rte.libpthreads bos.rte.libc"
-
-
-/* called once for each patch
- * a is always "bos"
- * b is "bos.rte.libpthreads:4.3.3.25: : :C:F:libpthreads Library"
- */
-
-/* We assume the patch is in 4.3.3.1 and later. We don't check for AIX 5.0 */
-/* Since the next major release after 4.3.3 is 5.0, we assume there won't be a
- * 4.10 or a 4.4.10.
- */
-
-int aix_check_patch_bos(char *a,char *b)
-{
- char *c;
- char *d;
- char *e;
- int d3;
- int d4;
-
- c = strchr(b,':');
- if (c == NULL) return 0;
- *c = '\0';
- c++;
-
- d = strchr(c,':');
- if (d != NULL) *d = '\0';
-
- if (c[0] >= '5') {
- /* AIX 5.x */
- if (flag_debug) printf("DEBUG : %s is version 5 or later (%s)\n",
- b,c);
- return 0;
- } else if (c[0] != '4') {
- /* AIX 3.x or earlier */
- printf("ERROR : Incorrect version of %s: %s\n\n",
- b,c);
- flag_os_bad = 1;
- return 0;
- } else if (c[2] >= '4') {
- /* AIX 4.4 and later */
- if (flag_debug) printf("DEBUG : %s is version 4.4 or later (%s)\n",
- b,c);
- return 0;
- } else if (c[2] != '3') {
- /* AIX 4.2 and earlier */
- printf("ERROR : Incorrect version of %s: %s\n\n",
- b,c);
- flag_os_bad = 1;
- return 0;
- }
-
- /* It's 4.3.x.x */
-
- e = strchr(c+4,'.');
- if (e != NULL) {
- *e = '\0';
- e++;
- d4 = atoi(e);
- } else {
- d4 = 0;
- }
-
- d3 = atoi(c+4);
-
- if (d3 > 4) {
- if (flag_debug) printf("DEBUG : %s is version 4.3.4 or later (%s)\n",
- b,c);
- return 0;
- } else if (d3 < 3) {
- printf("ERROR : Incorrect version of %s: %s.%d; must be 4.3.3.1 or later\n\n",
- b,c,d4);
- flag_os_bad = 1;
- return 0;
- }
- if (d4 >= 27) {
- if (flag_debug) printf("DEBUG : %s is version 4.3.3.27 or later (%s.%d)\n",
- b,c,d4);
- } else if (d4 > 0) {
- if (flag_debug) printf("ERROR : Incorrect version of %s: %s.%d; must be 4.3.3.27 or later\n\n",
- b,c,d4);
- } else { /* d4 = 0 */
- printf("ERROR : Incorrect version of %s: %s.%d; must be 4.3.3.1 or later\n\n",
- b,c,d4);
- flag_os_bad = 1;
- }
-
- return 0;
-}
-
-struct iii_pio_parsetab ptb_aixpatch[] = {
- {"bos", aix_check_patch_bos}
-};
-
-static void aix_check_patches(void)
-{
- if (flag_debug) printf("DEBUG : %s\n",AIX_CHECK_PATCH_CMD);
-
- if (iii_pio_procparse(AIX_CHECK_PATCH_CMD,
- III_PIO_SZ(ptb_aixpatch),
- ptb_aixpatch) == -1) {
- perror(AIX_CHECK_PATCH_CMD);
- }
-
- if (flag_os_bad) {
- printf("NOTICE : AIX APARs and fixes can be obtained from\n"
- " http://service.software.ibm.com/cgi-bin/support/rs6000.support/downloads or \n");
- printf(" http://techsupport.services.ibm.com/rs6k/ml.fixes.html\n\n");
- }
-}
-
-static void idds_aix_pio_get_oslevel(char *osl)
-{
- FILE *fp;
- char *rp;
- char rls[128];
- int i;
- int rm = 0;
-
- osl[0] = '\0';
-
- fp = popen("/usr/bin/oslevel","r");
-
- if (fp == NULL) {
- perror("/usr/bin/oslevel");
- return;
- }
-
- if (fgets(osl,128,fp) == NULL) {
- pclose(fp);
- return;
- }
- pclose(fp);
-
- rp = strchr(osl,'\n');
- if (rp) *rp = '\0';
-
- i = 0;
- for (rp = osl;*rp;rp++) {
- if (*rp != '.') {
- rls[i] = *rp;
- i++;
- }
- }
- rls[i] = '\0';
- /* rls now contains a value such as 4330 */
-
- for (i = 1;i<99;i++) {
- char rmtest[128];
- char ifout[BUFSIZ];
-
- sprintf(rmtest,"name=%s-%02d_AIX_ML",rls,i);
-
- if (idds_aix_odm_get_fix(rmtest) == 0) break;
- rm = i;
- }
-
- rp = osl + strlen(osl);
- sprintf(rp,".%02d",rm);
-
-}
-
-#endif
-
#if defined(__sun)
static void ids_get_platform_solaris(char *buf)
@@ -857,35 +553,6 @@ void sun_check_mu(void)
}
switch(solaris_version) {
- case 26:
- if (strcmp(solaris_release_string,"s297s_smccServer_37cshwp") == 0) {
- printf("NOTICE : This machine appears to be running Solaris 2.6 FCS. Solaris 2.6\nMaintenance Update 2 has been released subsequent to this.\n\n");
- } else if (strcmp(solaris_release_string,"s297s_hw2smccDesktop_09") == 0) {
- printf("NOTICE : This machine appears to be running Solaris 2.6 3/98. Solaris 2.6\nMaintenance Update 2 has been released subsequent to this.\n\n");
- } else if (strcmp(solaris_release_string,"s297s_hw3smccDesktop_09") == 0) {
- if (flag_debug) printf("DEBUG : Solaris 2.6 5/98\n");
- } else if (strcmp(solaris_release_string,"s297s_smccServer_37cshwp") == 0) {
- if (flag_debug) printf("DEBUG : Solaris 2.6 MU2\n");
- } else {
- if (flag_debug) printf("DEBUG : Solaris 2.6 Unrecognized\n");
- }
- break;
- case 27:
- if (strcmp(solaris_release_string,"s998s_SunServer_21al2b") == 0) {
- /* FCS */
- printf("NOTICE : This machine appears to be running Solaris 7 FCS. Solaris 7 11/99\nhas been released subsequent to this.\n\n");
- } else if (strcmp(solaris_release_string,"s998s_u1SunServer_10") == 0) {
- printf("NOTICE : This machine appears to be running Solaris 7 3/99. Solaris 7 11/99\nhas been released subsequent to this.\n\n");
- } else if (strcmp(solaris_release_string,"s998s_u2SunServer_09") == 0) {
- printf("NOTICE : This machine appears to be running Solaris 7 5/99. Solaris 7 11/99\nhas been released subsequent to this.\n\n");
- } else if (strcmp(solaris_release_string,"s998s_u3SunServer_11") == 0) {
- printf("NOTICE : This machine appears to be running Solaris 7 8/99. Solaris 7 11/99\nhas been released subsequent to this.\n\n");
- } else if (strcmp(solaris_release_string,"s998s_u4SunServer_10") == 0) {
- if (flag_debug) printf("DEBUG : 11/99\n");
- } else {
- if (flag_debug) printf("DEBUG : Solaris 7 Unrecognized\n");
- }
- break;
case 28:
if (strcmp(solaris_release_string,"s28_27b") == 0) {
printf("ERROR : This machine appears to be running Solaris 8 Beta.\n\n");
@@ -1163,129 +830,9 @@ done:
#endif /* IDDS_LINUX_INCLUDE */
-
-#if defined(__osf__)
-
-#ifndef SLS_BUFSIZ
-#define SLS_BUFSIZ 8192
-#endif
-
-static void ids_get_platform_tru64(char *buf)
-{
- struct utsname u;
- int r,start = 0;
- unsigned long pt;
- struct cpu_info cpu_info;
- char platname[SLS_BUFSIZ];
- char *sp;
-
- r = getsysinfo(GSI_CPU_INFO,(caddr_t)&cpu_info,sizeof(struct cpu_info),&start,NULL);
-
- start = 0;
-
- r = getsysinfo(GSI_PLATFORM_NAME,(caddr_t)&platname[0],SLS_BUFSIZ,&start,NULL);
-
- start = 0;
-
- r = getsysinfo(GSI_PROC_TYPE,(caddr_t)&pt,sizeof(long),&start,NULL);
-
- switch(pt & 0xff) {
- default:
- sprintf(buf,"alpha-");
- break;
- case EV4_CPU:
- sprintf(buf,"alpha_ev4_21064_%dMhz-",cpu_info.mhz);
- break;
- case EV45_CPU:
- sprintf(buf,"alpha_ev4.5_21064_%dMhz-",cpu_info.mhz);
- break;
- case EV5_CPU:
- sprintf(buf,"alpha_ev5_21164_%dMHz-",cpu_info.mhz);
- break;
- case EV56_CPU:
- sprintf(buf,"alpha_ev5.6_21164A_%dMHz-",cpu_info.mhz);
- break;
- case EV6_CPU:
- sprintf(buf,"alpha_ev6_21264_%dMHz-",cpu_info.mhz);
- break;
- }
-
- sp = buf+strlen(buf);
-
- for (r = 0; platname[r] != '\0';r++) {
- if (platname[r] == ' ' || platname[r] == '-') {
- *sp = '_';
- sp++;
- } else {
- *sp = platname[r];
- sp++;
- }
- }
-
- sprintf(sp,"-tru64_");
-
- if (uname(&u) == 0) {
- strcat(buf,u.release);
- strcat(buf,"_");
- strcat(buf,u.version);
- }
-
- /* XXX GSI_LMF see sys/lmf.h and sys/lmfklic.h */
-}
-
-/* returns number of k in swap area */
-static int idds_osf_get_swapk (void)
-{
- int src,i;
- struct swaptable *swtab;
- int res = 0;
-
- src = swapctl(SC_GETNSWP,NULL);
- if (src < 1) {
- return 0;
- }
-
- swtab = calloc(1,sizeof(int) + ((src+1) * sizeof(struct swapent)));
- swtab->swt_n = src;
- for (i = 0; i < src; i++) {
- swtab->swt_ent[i].ste_path = calloc(1024,sizeof(char));
- }
-
- if (swapctl(SC_LIST,swtab) < 0) {
- res = 0;
- } else {
- for (i = 0; i< src; i++) {
- if (swtab->swt_ent[i].ste_flags & ST_INDEL) continue;
- res += (swtab->swt_ent[i].ste_length / 2);
- }
- }
-
- for (i = 0; i < src; i++) {
- free(swtab->swt_ent[i].ste_path);
- }
- free(swtab);
- return res;
-}
-
-
-int idds_osf_get_memk(void)
-{
- int start = 0, physmem = 0,r;
- r = getsysinfo(GSI_PHYSMEM,(caddr_t)&physmem,sizeof(physmem),&start,NULL);
- if (r == -1) {
- return 0;
- }
- return physmem;
-}
-
-#endif
-
static void gen_tests (void)
{
-#ifndef _WIN32
uid_t uid;
-#endif
-
if (flag_html) printf("<P>\n");
@@ -1380,10 +927,6 @@ static void gen_tests (void)
linux_check_release();
#endif
-#if defined(_AIX)
- aix_check_patches();
-#endif
-
if (access("/usr/sbin/prtconf",X_OK) == 0) {
if (flag_debug) printf("DEBUG : /usr/sbin/prtconf\n");
@@ -1394,37 +937,6 @@ if (access("/usr/sbin/prtconf",X_OK) == 0) {
}
-#if defined(__osf__)
- phys_mb = (idds_osf_get_memk())/1024;
-#else
-#if defined(_AIX)
- if (1) {
- char buf[BUFSIZ];
- unsigned long l;
-
- idds_aix_odm_get_cuat("attribute=realmem",buf);
-
- if (buf) {
- phys_mb = atoi(buf);
- phys_mb = (phys_mb /1024) * (PAGESIZE / 1024);
- }
-
- l = psdanger(0);
- swap_mb = PAGESIZE/1024;
- swap_mb = swap_mb * (l / 1024);
- }
-#else
-#if defined(_SC_PHYS_PAGES)
- if (1) {
- int pk,l;
-
- pk = sysconf(_SC_PAGESIZE);
- pk /= 1024;
- l = sysconf(_SC_PHYS_PAGES);
- if (l < 0) l = 0;
- phys_mb = (l * pk) / 1024;
- }
-#else
#if defined(__hpux)
hp_check_qpk();
if (pstat_getdynamic(&pst_dyn,sizeof(pst_dyn),1,0) == -1 ||
@@ -1460,9 +972,6 @@ if (access("/usr/sbin/prtconf",X_OK) == 0) {
/* swap_mb from vm.stats.vm.v_page_count * v_page_size / 1048576 */
#endif
#endif
-#endif
-#endif
-#endif
if (flag_html) printf("<P>\n");
@@ -1481,7 +990,6 @@ if (access("/usr/sbin/prtconf",X_OK) == 0) {
if (flag_html) printf("</P>\n");
-#if !defined(_WIN32)
if (access("/usr/sbin/swap",X_OK) == 0) {
if (flag_debug) printf("DEBUG : /usr/sbin/swap -s\n");
if (iii_pio_procparse("/usr/sbin/swap -s",
@@ -1490,11 +998,7 @@ if (access("/usr/sbin/prtconf",X_OK) == 0) {
perror("/usr/sbin/swap -s");
}
}
-#endif
-#if defined(__osf__)
- swap_mb = (idds_osf_get_swapk()) / 1024;
-#else
#if defined(IDDS_LINUX_INCLUDE)
if (1) {
struct sysinfo linux_si;
@@ -1504,7 +1008,6 @@ if (access("/usr/sbin/prtconf",X_OK) == 0) {
}
}
#endif
-#endif
if (client == 0 && swap_mb < 0) {
if (flag_html) printf("<P>\n");
@@ -1513,7 +1016,7 @@ if (access("/usr/sbin/prtconf",X_OK) == 0) {
if (flag_html) printf("</P>\n");
} else if (client == 0 && swap_mb && swap_mb < phys_mb) {
-#if defined(_AIX) || defined(__hpux) || defined(__sun)
+#if defined(__hpux) || defined(__sun)
#else
if (flag_html) printf("<P>\n");
printf("%s: There is %dMB of physical memory but only %dMB of swap space.\n\n",
@@ -1565,7 +1068,7 @@ if (access("/usr/sbin/prtconf",X_OK) == 0) {
-#if defined(__sun) || defined(__hpux) || defined(IDDS_BSD_SYSCTL) || defined(IDDS_LINUX_SYSCTL)
+#if defined(__sun) || defined(__hpux) || defined(IDDS_LINUX_SYSCTL)
static int ndd_get_tcp (char *a,long *vPtr)
{
@@ -1577,7 +1080,7 @@ static int ndd_get_tcp (char *a,long *vPtr)
#if defined(__hpux)
sprintf(buf,"/usr/bin/ndd /dev/tcp %s",a);
#else
-#if defined(IDDS_BSD_SYSCTL) || defined(IDDS_LINUX_SYSCTL)
+#if defined(IDDS_LINUX_SYSCTL)
sprintf(buf,"/sbin/sysctl -n %s",a);
#else
sprintf(buf,"ndd /dev/tcp %s",a);
@@ -1620,203 +1123,6 @@ static int patch_get_ver(int n)
}
#endif
-#if defined(__osf__)
-
-int tru64_check_tcbhashsize(char *a,char *b)
-{
- int i;
-
- if (strcmp(b,"unknown attribute") == 0) {
- printf("WARNING: TCP tuning parameters are missing.\n\n");
- flag_warnings++;
- return 0;
- }
- i = atoi(b);
-
- if (i < 32) {
- printf("WARNING: The inet tuning parameter tcbhashsize is set too low (%d),\nand should be raised to between 512 and 1024.\n\n",i);
- flag_tru64_tuning_needed = 1;
- flag_warnings++;
- } else if (i < 512) {
- printf("NOTICE : The inet tuning parameter tcbhashsize is set too low (%d),\nand should be raised to between 512 and 1024.\n\n",i);
- flag_tru64_tuning_needed = 1;
- } else {
- if (flag_debug) printf("DEBUG : tcbhashsize %d\n",i);
- }
-
- return 0;
-}
-
-int tru64_check_present_smp(char *a,char *b)
-{
- if (strcmp(b,"unknown attribute") == 0) {
- printf("WARNING: If this is a multiprocessor system, additional tuning patches need\nto be installed, as sysconfig -q inet tuning parameter %s is missing.\n",
- a);
- printf("NOTICE : If this is a uniprocessor system, the above warning can be ignored.\n\n");
- flag_warnings++;
- } else {
- if (flag_debug) printf("DEBUG : %s %s\n", a, b);
- }
-
- return 0;
-}
-
-int tru64_check_msl(char *a,char *b)
-{
- int i;
-
- if (strcmp(b,"unknown attribute") == 0) {
- printf("WARNING: TCP tuning parameters are missing.\n\n");
- flag_warnings++;
- return 0;
- }
- i = atoi(b);
-
- if (i >= 60) {
- printf("NOTICE : If running in a LAN or private network, the inet tcp_msl value can be\nreduced from %d (%d seconds) to increase performance.\n\n",
- i, i/2);
- flag_tru64_tuning_needed = 1;
- }
-
- return 0;
-}
-
-int tru64_check_present_client(char *a,char *b)
-{
- if (strcmp(b,"unknown attribute") == 0) {
- printf("ERROR : This system is lacking necessary tuning patches. Upgrade to 4.0E\nor later is required.\n\n");
- flag_os_bad = 1;
- } else {
- if (flag_debug) {
- printf("DEBUG : %s %s\n",a,b);
- }
- }
-
- return 0;
-}
-
-int tru64_check_conn(char *a,char *b)
-{
- int i;
-
- i = atoi(b);
-
- if (strcmp(a,"somaxconn") == 0 && i && i < 32767) {
- printf("NOTICE : Increasing the socket tuning parameter somaxconn from %d to 65500\n is recommended.\n\n",i);
- flag_tru64_tuning_needed = 1;
- }
-
- if (flag_debug) printf("DEBUG : %s %s\n",a,b);
-
- return 0;
-}
-
-int tru64_check_threads(char *a,char *b)
-{
- int i;
-
- i = atoi(b);
-
- if (i < 512) {
- printf("WARNING: The proc tuning parameter max-threads-per-user should be raised from\n%d to at least 512.\n\n",i);
- flag_tru64_tuning_needed = 1;
- flag_warnings++;
- } else {
- if (flag_debug) printf("DEBUG : %s %s\n",a,b);
- }
-
- return 0;
-}
-
-struct iii_pio_parsetab ptb_sysconfig_inet[] = {
- {"tcbhashsize ",tru64_check_tcbhashsize},
- {"tcbhashnum ",tru64_check_present_smp},
- {"ipqs ",tru64_check_present_smp},
- {"tcp_msl ",tru64_check_msl},
- {"ipport_userreserved_min ",tru64_check_present_client}
-};
-
-struct iii_pio_parsetab ptb_sysconfig_socket[] = {
- {"sominconn ",tru64_check_conn},
- {"somaxconn ",tru64_check_conn}
-};
-
-struct iii_pio_parsetab ptb_sysconfig_proc[] = {
- {"max-threads-per-user ",tru64_check_threads}
-};
-
-static void sysconfig_tests (void)
-{
- struct utsname u;
-
- if (uname(&u) == 0) {
- if ((u.release[0] == 'T' || u.release[0] == 'V') && u.release[1] == '5') {
- if (flag_debug) printf("DEBUG : Tru64 UNIX %s %s\n",
- u.release,u.version);
- } else if (strcmp(u.release,"V4.0") == 0) {
- int iv;
-
- /* Digital UNIX 4.x */
- iv = atoi(u.version);
-
- if (iv < 564) {
- printf("ERROR : Digital UNIX versions prior to 4.0D are not supported as they lack\nnecessary kernel tuning parameters. Upgrade to 4.0E or later.\n\n");
- flag_tru64_40b = 1;
- flag_os_bad = 1;
- } else if (iv < 878) {
- printf("WARNING: Tru64 UNIX versions prior to 4.0D require a patch to provide \noptimal Internet performance.\n\n");
- flag_tru64_40b = 1;
- flag_warnings++;
- } else {
- if (flag_debug) printf("DEBUG : Digital UNIX %s %s\n",
- u.release,u.version);
- }
-
- } else if (u.release[0] == 'V' && u.release[1] == '3') {
- printf("ERROR : Digital UNIX versions prior to 4.0D are not supported as they lack\nnecessary kernel tuning parameters. Upgrade to 4.0E or later.\n\n");
- flag_os_bad = 1;
-
- } else {
- printf("%s: Tru64 UNIX release %s is not recognized.\n",
- "NOTICE ", u.release);
- }
- }
-
- /* inet subsystem raise tcbhashsize from 32/512 to 1024 */
- /* inet subsystem raise tcbhashnum to 16 if multiprocessor, also ipqs
- * not on 4.0D */
- /* inet subsystem lower tcp_msl from 60 (30 secs) if on LAN */
- /* client: inet subsystem raise ipport_userreserved_min from 5000 to 65000
- * requires E or later */
- if (iii_pio_procparse("/sbin/sysconfig -q inet",
- III_PIO_SZ(ptb_sysconfig_inet),
- ptb_sysconfig_inet) == -1) {
- perror("/sbin/sysconfig");
- }
-
- /* socket raise sominconn to 65535 */
- /* socket subsystem raise somaxconn from 1024 to 32767 */
- if (iii_pio_procparse("/sbin/sysconfig -q socket",
- III_PIO_SZ(ptb_sysconfig_socket),
- ptb_sysconfig_socket) == -1) {
- perror("/sbin/sysconfig");
- }
-
-
- /* proc max-threads-per-user from 256 to 512 or 4096 */
- if (iii_pio_procparse("/sbin/sysconfig -q proc",
- III_PIO_SZ(ptb_sysconfig_proc),
- ptb_sysconfig_proc) == -1) {
- perror("/sbin/sysconfig");
- }
-
- if (1) {
- printf("NOTICE : More information on tuning is available on the web from Compaq at\nhttp://www.unix.digital.com/internet/tuning.htm\n\n");
- printf("NOTICE : Additional performance recommendations can be obtained from the\nsys_check kit from Compaq, located at the following web site:\nftp://ftp.digital.com/pub/DEC/IAS/sys_check/sys_check.html\n\n");
- }
-}
-#endif
-
#if defined(__hpux)
#include <dirent.h>
@@ -2076,7 +1382,7 @@ static void sun_check_network_device(void)
}
#endif
-#if defined(__sun) || defined(__hpux) || defined(IDDS_BSD_SYSCTL) || defined(IDDS_LINUX_SYSCTL)
+#if defined(__sun) || defined(__hpux)|| defined(IDDS_LINUX_SYSCTL)
static void ndd_tests (void)
{
@@ -2621,10 +1927,6 @@ static int get_disk_avail(char *dir)
if (statfs(dir,&sfs) == 0) {
return ((sfs.f_bfree * (sfs.f_bsize / 1024)) / 1024);
}
-#else
-#if defined(_WIN32)
- /* could use GetDiskFreeSpaceEx */
-#endif
#endif
#endif
#endif
@@ -2847,15 +2149,11 @@ static void disk_tests(void)
}
if (install_dir[0] == '\0') {
-#if defined(_WIN32)
- /* TBD */
-#else
if (access("/usr/" VENDOR,X_OK) == 0) {
sprintf(install_dir,"/usr/" VENDOR);
} else {
sprintf(install_dir,"/opt");
}
-#endif
}
if (check_fs_options(install_dir,mntbuf) == 0) {
@@ -3042,10 +2340,10 @@ static void limits_tests(void)
static void ids_get_platform(char *buf)
{
-#if defined(IDDS_LINUX_INCLUDE) || defined(__osf__) || defined(_AIX) || defined(__hpux) || defined(IDDS_BSD_INCLUDE)
+#if defined(IDDS_LINUX_INCLUDE) || defined(__osf__) || defined(__hpux) || defined(IDDS_BSD_INCLUDE)
struct utsname u;
#endif
-#if defined(__hpux) || defined(_AIX)
+#if defined(__hpux)
char model[128];
char procstr[128];
char oslevel[128];
@@ -3067,42 +2365,11 @@ static void ids_get_platform(char *buf)
#else
#if defined(__sun)
ids_get_platform_solaris(buf);
-#else
-#if defined(_AIX)
-
- if (getenv("ODMPATH") == NULL) {
- putenv("ODMPATH=/usr/lib/objrepos:/etc/objrepos");
- }
-
- /* i386, powerpc, rs6000 */
- idds_aix_odm_get_cuat("name=proc0",procstr);
- idds_aix_odm_get_cuat("attribute=modelname",model);
- oslevel[0] = '\0';
- idds_aix_pio_get_oslevel(oslevel);
-
- if (uname(&u) == 0) {
- if (oslevel[0]) {
- sprintf(buf,"%s-%s-%s%s",
- procstr[0] ? procstr : "unknown" ,
- model[0] ? model : "ibm",
- u.sysname,oslevel);
-
- } else {
- sprintf(buf,"%s-%s-%s%s.%s",
- procstr[0] ? procstr : "unknown" ,
- model[0] ? model : "ibm",
- u.sysname,u.version,u.release);
- }
- } else {
- sprintf(buf,"%s-unknown-aix", procstr[0] ? procstr : "unknown");
- }
-#else
-#if defined(IDDS_BSD_INCLUDE)
+#elif defined(IDDS_BSD_INCLUDE)
uname(&u);
sprintf(buf,"%s-unknown-%s%s",
u.machine,u.sysname,u.release);
-#else
-#if defined(__hpux)
+#elif defined(__hpux)
uname(&u);
confstr(_CS_MACHINE_MODEL,model,128);
cpuvers = sysconf(_SC_CPU_VERSION);
@@ -3179,40 +2446,14 @@ static void ids_get_platform(char *buf)
#endif /* VMS */
#endif /* HPUX */
#endif /* FREEBSD */
-#endif /* AIX */
-#endif /* SUN */
-#endif /* LINUX */
}
static int count_processors(void)
{
int nproc = 0;
-#if defined(_SC_NPROCESSORS_ONLN) && !defined(__osf__)
nproc = sysconf(_SC_NPROCESSORS_ONLN);
-#endif
-
-#if defined(_WIN32)
- SYSTEM_INFO sysinfo;
- GetSystemInfo(&sysinfo);
- nproc = sysinfo.dwNumberOfProcessors;
-#endif
-
-#if defined(IDDS_BSD_SYSCTL) && defined(__FreeBSD__)
- int fblen = sizeof(int);
- int tmp;
- sysctlbyname("hw.ncpu",&nproc,&fblen,NULL,0);
-#endif
-
-#if defined(__osf__)
- struct cpu_info cpu_info;
- int start = 0;
-
- cpu_info.cpus_in_box = 0;
- getsysinfo(GSI_CPU_INFO,(caddr_t)&cpu_info,sizeof(struct cpu_info),&start,NULL);
- nproc = cpu_info.cpus_in_box;
-#endif
return nproc;
}
@@ -3268,15 +2509,6 @@ int main(int argc,char *argv[])
}
}
-#if defined(_AIX)
- if (1) {
- char *s = getenv("ODMPATH");
- if (s == NULL) {
- putenv("ODMPATH=/usr/lib/objrepos:/etc/objrepos");
- }
- }
-#endif
-
if (flag_quick == 0) {
char sysbuf[BUFSIZ];
int nproc;
@@ -3296,7 +2528,7 @@ int main(int argc,char *argv[])
gen_tests();
-#if defined(__sun) || defined(__hpux) || defined(IDDS_BSD_SYSCTL) || defined(IDDS_LINUX_SYSCTL)
+#if defined(__sun) || defined(__hpux) || defined(IDDS_LINUX_SYSCTL)
ndd_tests();
#endif
@@ -3304,10 +2536,6 @@ int main(int argc,char *argv[])
hp_pthreads_tests();
#endif
-#if defined(__osf__)
- sysconfig_tests();
-#endif
-
limits_tests();
disk_tests();
diff --git a/ldap/systools/viewcore.c b/ldap/systools/viewcore.c
index 45e4cce..6764a94 100644
--- a/ldap/systools/viewcore.c
+++ b/ldap/systools/viewcore.c
@@ -50,11 +50,9 @@
#if defined(__osf__)
#include <elf_abi.h>
#else
-#ifndef _AIX
#include <libelf.h>
#endif
#endif
-#endif
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
@@ -62,7 +60,7 @@
#if defined(sparc) || defined(__sparc)
#include <sys/elf_SPARC.h>
#else
-#if !defined(linux) && !defined(_AIX) && !defined(__osf__)
+#if !defined(linux) && !defined(__osf__)
#include <sys/elf_386.h>
#endif
#endif
@@ -245,7 +243,7 @@ int seek_debug(char *erf,int start, int mx)
return 0;
}
-#if !defined(_AIX) && !defined(__osf__)
+#if !defined(__osf__)
void add_segment(Elf32_Phdr *phdr,char *base,int which)
{
int i;
@@ -353,7 +351,7 @@ void try_adb(char *pf,char *cf)
void
main(int argc, char ** argv)
{
-#if !defined(_AIX) && !defined(__osf__)
+#if !defined(__osf__)
Elf32_Ehdr * ehdr;
Elf32_Phdr * phdr;
Elf * elf;
diff --git a/lib/base/dnsdmain.cpp b/lib/base/dnsdmain.cpp
index 7430077..9d184c5 100644
--- a/lib/base/dnsdmain.cpp
+++ b/lib/base/dnsdmain.cpp
@@ -69,13 +69,11 @@ extern int getdomainname(char *, size_t);
#else
extern int getdomainname(char *, int);
#endif /* Linux */
-#if defined(HPUX) || defined (UnixWare) || defined(Linux) || defined(IRIX6_5) || defined(SOLARIS_GCC)
+#if defined(HPUX) || defined(Linux) || defined(SOLARIS_GCC)
extern int gethostname (char *name, size_t namelen);
#else
-#ifndef AIX
extern int gethostname (char *name, int namelen);
#endif
-#endif
NSPR_END_EXTERN_C
diff --git a/lib/base/file.cpp b/lib/base/file.cpp
index b3f7234..62a8a06 100644
--- a/lib/base/file.cpp
+++ b/lib/base/file.cpp
@@ -140,12 +140,7 @@ NSAPI_PUBLIC int system_nocoredumps(void)
rl.rlim_max = 0;
return setrlimit(RLIMIT_CORE, &rl);
#else
-#if defined(SNI)
-/* C++ compiler seems to find more that one overloaded instance of exit() ?! */
-#define EXITFUNC ::exit
-#else
#define EXITFUNC exit
-#endif
signal(SIGQUIT, EXITFUNC);
signal(SIGILL, EXITFUNC);
signal(SIGTRAP, EXITFUNC);
@@ -248,9 +243,9 @@ NSAPI_PUBLIC int file_notfound(void)
return (errno == ENOENT);
}
-#if !defined(SNI) && !defined(LINUX)
+#if !defined(LINUX)
extern char *sys_errlist[];
-#endif /* SNI */
+#endif
#define ERRMSG_SIZE 35
#ifdef THREAD_ANY
@@ -303,14 +298,6 @@ NSAPI_PUBLIC int system_errmsg_fn(char **buff, size_t maxlen)
lmsg = static_error;
}
} else {
-/* replaced
-#if defined(SNI) || defined(LINUX)
- / C++ platform has no definition for sys_errlist /
- lmsg = strerror(errno);
-#else
- lmsg = sys_errlist[errno];
-#endif
-with lmsg =strerror(errno);*/
lmsg=strerror(errno);
errno = 0;
}
diff --git a/lib/base/systhr.cpp b/lib/base/systhr.cpp
index 6bf64bd..10e1caa 100644
--- a/lib/base/systhr.cpp
+++ b/lib/base/systhr.cpp
@@ -86,13 +86,9 @@ void systhread_set_default_stacksize(unsigned long size)
NSPR_BEGIN_EXTERN_C
NSAPI_PUBLIC SYS_THREAD
-#ifdef UnixWare /* for ANSI C++ standard, see base/systrh.h */
-systhread_start(int prio, int stksz, ArgFn_systhread_start fn, void *arg)
-#else
systhread_start(int prio, int stksz, void (*fn)(void *), void *arg)
-#endif
{
-#if (defined(Linux) || defined(SNI) || defined(UnixWare)) && !defined(USE_PTHREADS)
+#if defined(Linux) && !defined(USE_PTHREADS)
prio /= 8; /* quick and dirty fix for user thread priority scale problem */
if (prio > 3) prio = 3;
#endif
diff --git a/lib/ldaputil/examples/Certmap.mak b/lib/ldaputil/examples/Certmap.mak
deleted file mode 100644
index 03139cc..0000000
--- a/lib/ldaputil/examples/Certmap.mak
+++ /dev/null
@@ -1,286 +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
-#
-# Microsoft Developer Studio Generated NMAKE File, Format Version 4.20
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-!IF "$(CFG)" == ""
-CFG=Certmap - Win32 Debug
-!MESSAGE No configuration specified. Defaulting to Certmap - Win32 Debug.
-!ENDIF
-
-!IF "$(CFG)" != "Certmap - Win32 Release" && "$(CFG)" !=\
- "Certmap - Win32 Debug"
-!MESSAGE Invalid configuration "$(CFG)" specified.
-!MESSAGE You can specify a configuration when running NMAKE on this makefile
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "Certmap.mak" CFG="Certmap - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "Certmap - Win32 Release" (based on\
- "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "Certmap - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-!ERROR An invalid configuration is specified.
-!ENDIF
-
-!IF "$(OS)" == "Windows_NT"
-NULL=
-!ELSE
-NULL=nul
-!ENDIF
-################################################################################
-# Begin Project
-# PROP Target_Last_Scanned "Certmap - Win32 Debug"
-CPP=cl.exe
-RSC=rc.exe
-MTL=mktyplib.exe
-
-!IF "$(CFG)" == "Certmap - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Target_Dir ""
-OUTDIR=.\Release
-INTDIR=.\Release
-
-ALL : "$(OUTDIR)\Certmap.dll"
-
-CLEAN :
- -@erase "$(INTDIR)\init.obj"
- -@erase "$(INTDIR)\plugin.obj"
- -@erase "$(OUTDIR)\Certmap.dll"
- -@erase "$(OUTDIR)\Certmap.exp"
- -@erase "$(OUTDIR)\Certmap.lib"
-
-"$(OUTDIR)" :
- if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
-
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "c:\$(VENDOR)\servers\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
-CPP_PROJ=/nologo /MT /W3 /GX /O2 /I "c:\$(VENDOR)\servers\include" /D "WIN32"\
- /D "NDEBUG" /D "_WINDOWS" /Fp"$(INTDIR)/Certmap.pch" /YX /Fo"$(INTDIR)/" /c
-CPP_OBJS=.\Release/
-CPP_SBRS=.\.
-# ADD BASE MTL /nologo /D "NDEBUG" /win32
-# ADD MTL /nologo /D "NDEBUG" /win32
-MTL_PROJ=/nologo /D "NDEBUG" /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-BSC32_FLAGS=/nologo /o"$(OUTDIR)/Certmap.bsc"
-BSC32_SBRS= \
-
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
-LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
- advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
- odbccp32.lib /nologo /subsystem:windows /dll /incremental:no\
- /pdb:"$(OUTDIR)/Certmap.pdb" /machine:I386 /out:"$(OUTDIR)/Certmap.dll"\
- /implib:"$(OUTDIR)/Certmap.lib"
-LINK32_OBJS= \
- "$(INTDIR)\init.obj" \
- "$(INTDIR)\plugin.obj" \
- "C:\$(VENDOR)\servers\lib\nsldap32v10.lib"
-
-"$(OUTDIR)\Certmap.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
- $(LINK32) @<<
- $(LINK32_FLAGS) $(LINK32_OBJS)
-<<
-
-!ELSEIF "$(CFG)" == "Certmap - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Target_Dir ""
-OUTDIR=.\Debug
-INTDIR=.\Debug
-
-ALL : "$(OUTDIR)\Certmap.dll"
-
-CLEAN :
- -@erase "$(INTDIR)\init.obj"
- -@erase "$(INTDIR)\plugin.obj"
- -@erase "$(INTDIR)\vc40.idb"
- -@erase "$(INTDIR)\vc40.pdb"
- -@erase "$(OUTDIR)\Certmap.dll"
- -@erase "$(OUTDIR)\Certmap.exp"
- -@erase "$(OUTDIR)\Certmap.ilk"
- -@erase "$(OUTDIR)\Certmap.lib"
- -@erase "$(OUTDIR)\Certmap.pdb"
-
-"$(OUTDIR)" :
- if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
-
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "c:\$(VENDOR)\servers\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
-CPP_PROJ=/nologo /MTd /W3 /Gm /GX /Zi /Od /I "c:\$(VENDOR)\servers\include" /D\
- "WIN32" /D "_DEBUG" /D "_WINDOWS" /Fp"$(INTDIR)/Certmap.pch" /YX\
- /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c
-CPP_OBJS=.\Debug/
-CPP_SBRS=.\.
-# ADD BASE MTL /nologo /D "_DEBUG" /win32
-# ADD MTL /nologo /D "_DEBUG" /win32
-MTL_PROJ=/nologo /D "_DEBUG" /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-BSC32_FLAGS=/nologo /o"$(OUTDIR)/Certmap.bsc"
-BSC32_SBRS= \
-
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386
-LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
- advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
- odbccp32.lib /nologo /subsystem:windows /dll /incremental:yes\
- /pdb:"$(OUTDIR)/Certmap.pdb" /debug /machine:I386 /out:"$(OUTDIR)/Certmap.dll"\
- /implib:"$(OUTDIR)/Certmap.lib"
-LINK32_OBJS= \
- "$(INTDIR)\init.obj" \
- "$(INTDIR)\plugin.obj" \
- "C:\$(VENDOR)\servers\lib\nsldap32v10.lib"
-
-"$(OUTDIR)\Certmap.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
- $(LINK32) @<<
- $(LINK32_FLAGS) $(LINK32_OBJS)
-<<
-
-!ENDIF
-
-.c{$(CPP_OBJS)}.obj:
- $(CPP) $(CPP_PROJ) $<
-
-.cpp{$(CPP_OBJS)}.obj:
- $(CPP) $(CPP_PROJ) $<
-
-.cxx{$(CPP_OBJS)}.obj:
- $(CPP) $(CPP_PROJ) $<
-
-.c{$(CPP_SBRS)}.sbr:
- $(CPP) $(CPP_PROJ) $<
-
-.cpp{$(CPP_SBRS)}.sbr:
- $(CPP) $(CPP_PROJ) $<
-
-.cxx{$(CPP_SBRS)}.sbr:
- $(CPP) $(CPP_PROJ) $<
-
-################################################################################
-# Begin Target
-
-# Name "Certmap - Win32 Release"
-# Name "Certmap - Win32 Debug"
-
-!IF "$(CFG)" == "Certmap - Win32 Release"
-
-!ELSEIF "$(CFG)" == "Certmap - Win32 Debug"
-
-!ENDIF
-
-################################################################################
-# Begin Source File
-
-SOURCE=.\plugin.c
-DEP_CPP_PLUGI=\
- ".\plugin.h"\
- "c:\$(VENDOR)\servers\include\certmap.h"\
- "c:\$(VENDOR)\servers\include\lber.h"\
- "c:\$(VENDOR)\servers\include\ldap.h"\
- {$(INCLUDE)}"\sys\types.h"\
-
-
-"$(INTDIR)\plugin.obj" : $(SOURCE) $(DEP_CPP_PLUGI) "$(INTDIR)"
-
-
-# End Source File
-################################################################################
-# Begin Source File
-
-SOURCE=.\init.c
-DEP_CPP_INIT_=\
- ".\plugin.h"\
- "c:\$(VENDOR)\servers\include\certmap.h"\
- "c:\$(VENDOR)\servers\include\lber.h"\
- "c:\$(VENDOR)\servers\include\ldap.h"\
- {$(INCLUDE)}"\sys\types.h"\
-
-
-"$(INTDIR)\init.obj" : $(SOURCE) $(DEP_CPP_INIT_) "$(INTDIR)"
-
-
-# End Source File
-################################################################################
-# Begin Source File
-
-SOURCE=C:\$(VENDOR)\servers\lib\nsldap32v10.lib
-
-!IF "$(CFG)" == "Certmap - Win32 Release"
-
-!ELSEIF "$(CFG)" == "Certmap - Win32 Debug"
-
-!ENDIF
-
-# End Source File
-# End Target
-# End Project
-################################################################################
diff --git a/lib/ldaputil/examples/Makefile b/lib/ldaputil/examples/Makefile
index 7cb7d21..64b327c 100644
--- a/lib/ldaputil/examples/Makefile
+++ b/lib/ldaputil/examples/Makefile
@@ -75,11 +75,6 @@ CC_CMD = cc -DSOLARIS -D_REENTRANT
LD_SHAREDCMD = ld -G
endif
-ifeq ($(ARCH), IRIX)
-CC_CMD = cc
-LD_SHAREDCMD = ld -32 -shared
-endif
-
ifeq ($(ARCH), HPUX)
BIN = certmap.sl
else
diff --git a/lib/ldaputil/examples/init.c b/lib/ldaputil/examples/init.c
index d58c70a..10e99aa 100644
--- a/lib/ldaputil/examples/init.c
+++ b/lib/ldaputil/examples/init.c
@@ -44,7 +44,6 @@
#include <stdio.h>
#include <string.h>
#include <ctype.h>
-
#include "certmap.h" /* Public Certmap API */
#include "plugin.h" /* must define extern "C" functions */
@@ -57,11 +56,7 @@ NSAPI_PUBLIC int plugin_init_fn (void *certmap_info, const char *issuerName,
/* Make sure CertmapDLLInit is initialized only once */
if (!initialized) {
-#ifdef WIN32
- CertmapDLLInit(rv, libname);
-
- if (rv != LDAPU_SUCCESS) return rv;
-#endif
+
initialized = 1;
}
diff --git a/lib/ldaputil/examples/plugin.c b/lib/ldaputil/examples/plugin.c
index 21ea9d1..9646bdd 100644
--- a/lib/ldaputil/examples/plugin.c
+++ b/lib/ldaputil/examples/plugin.c
@@ -44,13 +44,9 @@
#include <stdio.h>
#include <string.h>
#include <ctype.h>
-
#include "certmap.h" /* Public Certmap API */
#include "plugin.h" /* must define extern "C" functions */
-#ifdef WIN32
-CertmapDLLInitFnTbl /* Initialize Certmap Function Table */
-#endif
CertSearchFn_t default_searchfn = 0;
diff --git a/lib/libaccess/symbols.cpp b/lib/libaccess/symbols.cpp
index a1cba9d..d98d596 100644
--- a/lib/libaccess/symbols.cpp
+++ b/lib/libaccess/symbols.cpp
@@ -249,11 +249,7 @@ void symTableRemoveSym(void * table, Symbol_t * sym)
*/
void symTableEnumerate(void * table, void * argp,
-#ifdef UnixWare /* Fix bug in UnixWare compiler for name mangeling - nedh(a)sco.com */
- ArgFn_symTableEnum func)
-#else
int (*func)(Symbol_t * sym, void * parg))
-#endif
{
SymTable_t * st = (SymTable_t *)table;
SymTableEnum_t ste; /* enumeration arguments */
8 years, 10 months
dirsrvtests/tickets
by thierry bordaz
dirsrvtests/tickets/ticket47833_test.py | 266 ++++++++++++++++++++++++++++++++
1 file changed, 266 insertions(+)
New commits:
commit 065b511f21219212a6b4ce5f730414db73f6fda1
Author: Thierry Bordaz <tbordaz(a)redhat.com>
Date: Tue Jun 16 13:13:56 2015 +0200
Ticket 47833: TEST CASE only (modrdn fails if renamed entry member of a group and is out of memberof scope)
Bug Description:
When an entry is not in the scope of memberof plugin, but the group
it belongs to is in the scope; then during MODRDN of the entry the postop plugin fails.
err=16
Fix Description:
memberof_postop_modrdn fails because it tries to remove 'memberof' that does not
exits
This bug was fixed by a patch of https://fedorahosted.org/389/ticket/47526
https://fedorahosted.org/389/ticket/47833
Reviewed by: Noriko accepted that I push only the testcase (without review)
because neither 47526/48012 have test case
Platforms tested: F17
Flag Day: no
Doc impact: no
diff --git a/dirsrvtests/tickets/ticket47833_test.py b/dirsrvtests/tickets/ticket47833_test.py
new file mode 100644
index 0000000..99e5eae
--- /dev/null
+++ b/dirsrvtests/tickets/ticket47833_test.py
@@ -0,0 +1,266 @@
+import os
+import sys
+import time
+import ldap
+import logging
+import pytest
+from lib389 import DirSrv, Entry, tools, tasks
+from lib389.tools import DirSrvTools
+from lib389._constants import *
+from lib389.properties import *
+from lib389.tasks import *
+from lib389.utils import *
+
+SCOPE_IN_CN = 'in'
+SCOPE_OUT_CN = 'out'
+SCOPE_IN_DN = 'cn=%s,%s' % (SCOPE_IN_CN, SUFFIX)
+SCOPE_OUT_DN = 'cn=%s,%s' % (SCOPE_OUT_CN, SUFFIX)
+
+PROVISIONING_CN = "provisioning"
+PROVISIONING_DN = "cn=%s,%s" % (PROVISIONING_CN, SCOPE_IN_DN)
+
+ACTIVE_CN = "accounts"
+STAGE_CN = "staged users"
+DELETE_CN = "deleted users"
+ACTIVE_DN = "cn=%s,%s" % (ACTIVE_CN, SCOPE_IN_DN)
+STAGE_DN = "cn=%s,%s" % (STAGE_CN, PROVISIONING_DN)
+DELETE_DN = "cn=%s,%s" % (DELETE_CN, PROVISIONING_DN)
+
+STAGE_USER_CN = "stage guy"
+STAGE_USER_DN = "cn=%s,%s" % (STAGE_USER_CN, STAGE_DN)
+
+ACTIVE_USER_CN = "active guy"
+ACTIVE_USER_DN = "cn=%s,%s" % (ACTIVE_USER_CN, ACTIVE_DN)
+
+OUT_USER_CN = "out guy"
+OUT_USER_DN = "cn=%s,%s" % (OUT_USER_CN, SCOPE_OUT_DN)
+
+STAGE_GROUP_CN = "stage group"
+STAGE_GROUP_DN = "cn=%s,%s" % (STAGE_GROUP_CN, STAGE_DN)
+
+ACTIVE_GROUP_CN = "active group"
+ACTIVE_GROUP_DN = "cn=%s,%s" % (ACTIVE_GROUP_CN, ACTIVE_DN)
+
+OUT_GROUP_CN = "out group"
+OUT_GROUP_DN = "cn=%s,%s" % (OUT_GROUP_CN, SCOPE_OUT_DN)
+
+
+logging.getLogger(__name__).setLevel(logging.DEBUG)
+log = logging.getLogger(__name__)
+
+installation1_prefix = None
+
+
+class TopologyStandalone(object):
+ def __init__(self, standalone):
+ standalone.open()
+ self.standalone = standalone
+
+
+(a)pytest.fixture(scope="module")
+def topology(request):
+ global installation1_prefix
+ if installation1_prefix:
+ args_instance[SER_DEPLOYED_DIR] = installation1_prefix
+
+ # Creating standalone instance ...
+ standalone = DirSrv(verbose=False)
+ if installation1_prefix:
+ args_instance[SER_DEPLOYED_DIR] = installation1_prefix
+ args_instance[SER_HOST] = HOST_STANDALONE
+ args_instance[SER_PORT] = PORT_STANDALONE
+ args_instance[SER_SERVERID_PROP] = SERVERID_STANDALONE
+ args_instance[SER_CREATION_SUFFIX] = DEFAULT_SUFFIX
+ args_standalone = args_instance.copy()
+ standalone.allocate(args_standalone)
+ instance_standalone = standalone.exists()
+ if instance_standalone:
+ standalone.delete()
+ standalone.create()
+ standalone.open()
+
+ # Clear out the tmp dir
+ standalone.clearTmpDir(__file__)
+
+ return TopologyStandalone(standalone)
+
+
+def _header(topology, label):
+ topology.standalone.log.info("\n\n###############################################")
+ topology.standalone.log.info("#######")
+ topology.standalone.log.info("####### %s" % label)
+ topology.standalone.log.info("#######")
+ topology.standalone.log.info("###############################################")
+
+def _add_user(topology, type='active'):
+ if type == 'active':
+ topology.standalone.add_s(Entry((ACTIVE_USER_DN, {
+ 'objectclass': "top person inetuser".split(),
+ 'sn': ACTIVE_USER_CN,
+ 'cn': ACTIVE_USER_CN})))
+ elif type == 'stage':
+ topology.standalone.add_s(Entry((STAGE_USER_DN, {
+ 'objectclass': "top person inetuser".split(),
+ 'sn': STAGE_USER_CN,
+ 'cn': STAGE_USER_CN})))
+ else:
+ topology.standalone.add_s(Entry((OUT_USER_DN, {
+ 'objectclass': "top person inetuser".split(),
+ 'sn': OUT_USER_CN,
+ 'cn': OUT_USER_CN})))
+
+def _find_memberof(topology, user_dn=None, group_dn=None, find_result=True):
+ assert(topology)
+ assert(user_dn)
+ assert(group_dn)
+ ent = topology.standalone.getEntry(user_dn, ldap.SCOPE_BASE, "(objectclass=*)", ['memberof'])
+ found = False
+ if ent.hasAttr('memberof'):
+
+ for val in ent.getValues('memberof'):
+ topology.standalone.log.info("!!!!!!! %s: memberof->%s" % (user_dn, val))
+ if val == group_dn:
+ found = True
+ break
+
+ if find_result:
+ assert(found)
+ else:
+ assert(not found)
+
+def _find_member(topology, user_dn=None, group_dn=None, find_result=True):
+ assert(topology)
+ assert(user_dn)
+ assert(group_dn)
+ ent = topology.standalone.getEntry(group_dn, ldap.SCOPE_BASE, "(objectclass=*)", ['member'])
+ found = False
+ if ent.hasAttr('member'):
+
+ for val in ent.getValues('member'):
+ topology.standalone.log.info("!!!!!!! %s: member ->%s" % (group_dn, val))
+ if val == user_dn:
+ found = True
+ break
+
+ if find_result:
+ assert(found)
+ else:
+ assert(not found)
+
+def _modrdn_entry(topology=None, entry_dn=None, new_rdn=None, del_old=0, new_superior=None):
+ assert topology != None
+ assert entry_dn != None
+ assert new_rdn != None
+
+
+ topology.standalone.log.info("\n\n######################### MODRDN %s ######################\n" % new_rdn)
+ if new_superior:
+ topology.standalone.rename_s(entry_dn, new_rdn, newsuperior=new_superior, delold=del_old)
+ else:
+ topology.standalone.rename_s(entry_dn, new_rdn, delold=del_old)
+
+def _check_memberof(topology=None, action=None, user_dn=None, group_dn=None, find_result=None):
+ assert(topology)
+ assert(user_dn)
+ assert(group_dn)
+ if action == ldap.MOD_ADD:
+ txt = 'add'
+ elif action == ldap.MOD_DELETE:
+ txt = 'delete'
+ else:
+ txt = 'replace'
+ topology.standalone.log.info('\n%s entry %s' % (txt, user_dn))
+ topology.standalone.log.info('to group %s' % group_dn)
+
+ topology.standalone.modify_s(group_dn, [(action, 'member', user_dn)])
+ time.sleep(1)
+ _find_memberof(topology, user_dn=user_dn, group_dn=group_dn, find_result=find_result)
+
+
+
+
+def test_ticket47829_init(topology):
+ topology.standalone.add_s(Entry((SCOPE_IN_DN, {
+ 'objectclass': "top nscontainer".split(),
+ 'cn': SCOPE_IN_DN})))
+ topology.standalone.add_s(Entry((SCOPE_OUT_DN, {
+ 'objectclass': "top nscontainer".split(),
+ 'cn': SCOPE_OUT_DN})))
+ topology.standalone.add_s(Entry((PROVISIONING_DN, {
+ 'objectclass': "top nscontainer".split(),
+ 'cn': PROVISIONING_CN})))
+ topology.standalone.add_s(Entry((ACTIVE_DN, {
+ 'objectclass': "top nscontainer".split(),
+ 'cn': ACTIVE_CN})))
+ topology.standalone.add_s(Entry((STAGE_DN, {
+ 'objectclass': "top nscontainer".split(),
+ 'cn': STAGE_DN})))
+ topology.standalone.add_s(Entry((DELETE_DN, {
+ 'objectclass': "top nscontainer".split(),
+ 'cn': DELETE_CN})))
+
+ # add groups
+ topology.standalone.add_s(Entry((ACTIVE_GROUP_DN, {
+ 'objectclass': "top groupOfNames".split(),
+ 'cn': ACTIVE_GROUP_CN})))
+ topology.standalone.add_s(Entry((STAGE_GROUP_DN, {
+ 'objectclass': "top groupOfNames".split(),
+ 'cn': STAGE_GROUP_CN})))
+ topology.standalone.add_s(Entry((OUT_GROUP_DN, {
+ 'objectclass': "top groupOfNames".split(),
+ 'cn': OUT_GROUP_CN})))
+
+ # add users
+ _add_user(topology, 'active')
+ _add_user(topology, 'stage')
+ _add_user(topology, 'out')
+
+
+
+ # enable memberof of with scope account
+ topology.standalone.plugins.enable(name=PLUGIN_MEMBER_OF)
+ dn = "cn=%s,%s" % (PLUGIN_MEMBER_OF, DN_PLUGIN)
+ topology.standalone.modify_s(dn, [(ldap.MOD_REPLACE, 'memberOfEntryScope', ACTIVE_DN)])
+
+
+
+ topology.standalone.restart(timeout=10)
+
+
+
+
+def test_ticket47829_mod_stage_user_modrdn_stage_user_1(topology):
+ _header(topology, 'add an Stage user to a Active group. Then move Stage user to Stage')
+
+ old_stage_user_dn = STAGE_USER_DN
+ old_stage_user_rdn = "cn=%s" % STAGE_USER_CN
+ new_stage_user_rdn = "cn=x%s" % STAGE_USER_CN
+ new_stage_user_dn = "%s,%s" % (new_stage_user_rdn, STAGE_DN)
+
+ # add Stage user to active group
+ _check_memberof(topology, action=ldap.MOD_ADD, user_dn=old_stage_user_dn, group_dn=ACTIVE_GROUP_DN, find_result=False)
+ _find_member (topology, user_dn=old_stage_user_dn, group_dn=ACTIVE_GROUP_DN, find_result=True)
+
+ # move the Stage entry to Stage, expect no 'member' and 'memberof'
+ _modrdn_entry (topology, entry_dn=old_stage_user_dn, new_rdn=new_stage_user_rdn, new_superior=STAGE_DN)
+ _find_memberof(topology, user_dn=new_stage_user_dn, group_dn=ACTIVE_GROUP_DN, find_result=False)
+ _find_member (topology, user_dn=new_stage_user_dn, group_dn=ACTIVE_GROUP_DN, find_result=False)
+
+
+def test_ticket47833_final(topology):
+ topology.standalone.delete()
+ log.info('Testcase PASSED')
+
+
+def run_isolated():
+ global installation1_prefix
+ installation1_prefix = None
+
+ topo = topology(True)
+ test_ticket47829_init(topo)
+ test_ticket47829_mod_stage_user_modrdn_stage_user_1(topo)
+ test_ticket47833_final(topo)
+
+if __name__ == '__main__':
+ run_isolated()
+
8 years, 10 months
include/base ldap/servers lib/base
by Mark Reynolds
include/base/eventhandler.h | 110 -
include/base/eventlog.h | 57
include/base/nterr.h | 58
include/base/nterrors.h | 104 -
ldap/servers/plugins/acl/acldllmain.c | 80
ldap/servers/plugins/acl/libacl.def | 48
ldap/servers/plugins/chainingdb/cbdllmain.c | 78
ldap/servers/plugins/chainingdb/libcb.def | 47
ldap/servers/plugins/collation/collation.def | 42
ldap/servers/plugins/collation/dllmain.c | 84
ldap/servers/plugins/cos/cos.def | 43
ldap/servers/plugins/cos/dllmain.c | 56
ldap/servers/plugins/distrib/Makefile | 55
ldap/servers/plugins/distrib/Makefile.WINNT | 76
ldap/servers/plugins/distrib/distrib.dsp | 153 -
ldap/servers/plugins/distrib/dllmain.c | 54
ldap/servers/plugins/distrib/libdistrib.def | 41
ldap/servers/plugins/http/dllmain.c | 56
ldap/servers/plugins/http/http.def | 45
ldap/servers/plugins/pam_passthru/libpam_passthru.def | 45
ldap/servers/plugins/pam_passthru/pam_ptdllmain.c | 81
ldap/servers/plugins/passthru/libpassthru.def | 46
ldap/servers/plugins/passthru/ptdllmain.c | 83
ldap/servers/plugins/presence/dllmain.c | 55
ldap/servers/plugins/presence/presence.def | 43
ldap/servers/plugins/pwdstorage/dllmain.c | 55
ldap/servers/plugins/pwdstorage/libpwdstorage.def | 56
ldap/servers/plugins/referint/dllmain.c | 55
ldap/servers/plugins/referint/referint.def | 44
ldap/servers/plugins/replication/dllmain.c | 128 -
ldap/servers/plugins/replication/replication.def | 48
ldap/servers/plugins/retrocl/dllmain.c | 55
ldap/servers/plugins/retrocl/retrocl.def | 47
ldap/servers/plugins/rever/dllmain.c | 55
ldap/servers/plugins/rever/libdes.def | 45
ldap/servers/plugins/roles/dllmain.c | 54
ldap/servers/plugins/roles/roles.def | 42
ldap/servers/plugins/statechange/dllmain.c | 56
ldap/servers/plugins/statechange/statechange.def | 42
ldap/servers/plugins/syntaxes/dllmain.c | 84
ldap/servers/plugins/syntaxes/libsyntax.def | 56
ldap/servers/plugins/uiduniq/libuiduniq.def | 47
ldap/servers/plugins/vattrsp_template/dllmain.c | 55
ldap/servers/plugins/vattrsp_template/vattrsp.def | 42
ldap/servers/plugins/views/dllmain.c | 55
ldap/servers/plugins/views/views.def | 42
ldap/servers/slapd/back-ldbm/dllmain.c | 86
ldap/servers/slapd/back-ldbm/libback-ldbm.def | 45
ldap/servers/slapd/back-ldif/dllmain.c | 65
ldap/servers/slapd/back-ldif/libback-ldif.def | 44
ldap/servers/slapd/libslapd.def | 1204 ------------
ldap/servers/slapd/ntmsgdll/ntslapdmessages.c | 53
ldap/servers/slapd/ntmsgdll/ntslapdmessages.mc | 315 ---
ldap/servers/slapd/ntperfdll/exports.def | 41
ldap/servers/slapd/ntperfdll/nsldapctr.cpp | 1054 ----------
ldap/servers/slapd/ntperfdll/nsldapctrdef.h | 72
ldap/servers/slapd/ntperfdll/nsldapctrmc.h | 159 -
ldap/servers/slapd/ntperfdll/nsldapctrmc.mc | 106 -
ldap/servers/slapd/ntperfdll/nsldapctrmsg.h | 97
ldap/servers/slapd/ntperfdll/nsldapctrs.h | 108 -
ldap/servers/slapd/ntperfdll/nsldapctrs.ini | 89
ldap/servers/slapd/ntperfdll/nsldapctrutil.cpp | 401 ----
ldap/servers/slapd/ntperfdll/nsldapctrutil.h | 157 -
ldap/servers/slapd/ntperfdll/nsldapreg.ini | 50
ldap/servers/slapd/ntwdog/cron_conf.c | 691 ------
ldap/servers/slapd/ntwdog/cron_conf.h | 122 -
ldap/servers/slapd/ntwdog/ntcron.c | 193 -
ldap/servers/slapd/ntwdog/ntwatchdog.c | 1194 ------------
ldap/servers/slapd/snmp_collator.c | 1
ldap/servers/slapd/test-plugins/Makefile.WINNT | 77
ldap/servers/slapd/test-plugins/Makefile.server | 54
ldap/servers/slapd/test-plugins/dllmain.c | 66
ldap/servers/slapd/test-plugins/testplugin.def | 48
ldap/servers/slapd/test-plugins/testplugin.dsp | 175 -
ldap/servers/slapd/test-plugins/testplugin.mak | 463 ----
ldap/servers/snmp/ntagt/msrvdefs.mak | 523 -----
ldap/servers/snmp/ntagt/nslagtcom_nt.h | 69
ldap/servers/snmp/ntagt/nsldapagt_nt.c | 1778 ------------------
ldap/servers/snmp/ntagt/nsldapagt_nt.def | 56
ldap/servers/snmp/ntagt/nsldapagt_nt.h | 268 --
ldap/servers/snmp/ntagt/nsldapmib_nt.c | 1078 ----------
ldap/servers/snmp/ntagt/nsldapmib_nt.h | 167 -
lib/base/eventlog.cpp | 106 -
lib/base/nterrors.cpp | 120 -
84 files changed, 4 insertions(+), 14194 deletions(-)
New commits:
commit 3c0d3c5d08635430a68693b9d44a586843b01793
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Mon Jun 15 13:20:50 2015 -0400
Ticket 47998 - remove "windows" files
Description: Remove windows definition and dll files, etc.
https://fedorahosted.org/389/ticket/47998
Reviewed by: nhosoi(Thanks!)
diff --git a/include/base/eventhandler.h b/include/base/eventhandler.h
deleted file mode 100644
index f4de0c2..0000000
--- a/include/base/eventhandler.h
+++ /dev/null
@@ -1,110 +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 **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/*
- * eventhandler.h: Handle registration of event handlers
- *
- * This is a facility in the NT server to provide a way to register event
- * handling functions. Often there is a need to send a control signal of some
- * kind to the server. This could be a signal for the server to rotate its
- * logs, or a signal to collect and return statistical information of some kind
- * such as perfmon stats.
- *
- * This file specifies the structures and functions necessary to set up this
- * kind of asynchronous special event handling.
- *
- * Aruna Victor 2/21/96
- */
-
-#ifndef EVENTHANDLER_H
-#define EVENTHANDLER_H
-
-#include "netsite.h"
-
-/* ------------------------------ Structures ------------------------------ */
-
-/* EVENT_HANDLER specifies
- 1. The name of the event. This is the event that the event handler will
- create and wait on for a signal.
- 2. The name of the function should be called to handle the event.
- 3. The argument that should be passed to this function.
- 4. The next EVENT_HANDLER on the list this structure is on. */
-
-typedef struct event_handler {
- int event_number;
- char *event_name;
- void (*_event_handler)(void *);
- void *argument;
- struct event_handler *next;
-} EVENT_HANDLER;
-
-/* ------------------------------ Prototypes ------------------------------ */
-
-NSPR_BEGIN_EXTERN_C
-
-char *initialize_event_handler(char *serverid);
-
-char *terminate_event_handler();
-
-char *add_handler(char *event, void (*fn)(void *), void *arg);
-
-char *delete_handler(char *event);
-
-char *add_rotation_handler(char *event, void (*fn)(void *), void *arg);
-
-NSPR_END_EXTERN_C
-
-#endif /* !EVENTHANDLER */
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/include/base/eventlog.h b/include/base/eventlog.h
deleted file mode 100644
index bd75eb8..0000000
--- a/include/base/eventlog.h
+++ /dev/null
@@ -1,57 +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 **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-// EVENTLOG.H
-//
-// This file contains the defines that make NT an installable service.
-//
-// 1/12/95 aruna
-//
-
-// Functions in eventlog.c
-
-#ifndef _EVENTLOG_H_
-#define _EVENTLOG_H_
-
-#include "netsite.h"
-
-#endif
diff --git a/include/base/nterr.h b/include/base/nterr.h
deleted file mode 100644
index 90446e7..0000000
--- a/include/base/nterr.h
+++ /dev/null
@@ -1,58 +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 **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/*
- * Added function prototypes for nterror stuff.
- *
- * Robin Maxwell
- */
-
-#ifndef _NTERR_H
-#define _NTERR_H
-NSPR_BEGIN_EXTERN_C
-
-char * FindError(int error);
-NSAPI_PUBLIC void HashNtErrors();
-
-NSPR_END_EXTERN_C
-
-#endif /* _NTERR_H */
diff --git a/include/base/nterrors.h b/include/base/nterrors.h
deleted file mode 100644
index 895e26c..0000000
--- a/include/base/nterrors.h
+++ /dev/null
@@ -1,104 +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 **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/* DO NOT EDIT THIS FILE - it is automatically generated */
-
-typedef struct _NtError {
- int ErrorNumber;
- char *ErrorString;
- struct _NtError *next;
-} NtError;
-
-NtError NtErrorStrings[] = {
-{ 10004 , "WSAEINTR" },
-{ 10009 , "WSAEBADF" },
-{ 10013 , "WSAEACCES" },
-{ 10014 , "WSAEFAULT" },
-{ 10022 , "WSAEINVAL" },
-{ 10024 , "WSAEMFILE" },
-{ 10035 , "WSAEWOULDBLOCK" },
-{ 10036 , "WSAEINPROGRESS" },
-{ 10037 , "WSAEALREADY" },
-{ 10038 , "WSAENOTSOCK" },
-{ 10039 , "WSAEDESTADDRREQ" },
-{ 10040 , "WSAEMSGSIZE" },
-{ 10041 , "WSAEPROTOTYPE" },
-{ 10042 , "WSAENOPROTOOPT" },
-{ 10043 , "WSAEPROTONOSUPPORT" },
-{ 10044 , "WSAESOCKTNOSUPPORT" },
-{ 10045 , "WSAEOPNOTSUPP" },
-{ 10046 , "WSAEPFNOSUPPORT" },
-{ 10047 , "WSAEAFNOSUPPORT" },
-{ 10048 , "WSAEADDRINUSE" },
-{ 10049 , "WSAEADDRNOTAVAIL" },
-{ 10050 , "WSAENETDOWN" },
-{ 10051 , "WSAENETUNREACH" },
-{ 10052 , "WSAENETRESET" },
-{ 10053 , "WSAECONNABORTED" },
-{ 10054 , "WSAECONNRESET" },
-{ 10055 , "WSAENOBUFS" },
-{ 10056 , "WSAEISCONN" },
-{ 10057 , "WSAENOTCONN" },
-{ 10058 , "WSAESHUTDOWN" },
-{ 10059 , "WSAETOOMANYREFS" },
-{ 10060 , "WSAETIMEDOUT" },
-{ 10061 , "WSAECONNREFUSED" },
-{ 10062 , "WSAELOOP" },
-{ 10063 , "WSAENAMETOOLONG" },
-{ 10064 , "WSAEHOSTDOWN" },
-{ 10065 , "WSAEHOSTUNREACH" },
-{ 10066 , "WSAENOTEMPTY" },
-{ 10067 , "WSAEPROCLIM" },
-{ 10068 , "WSAEUSERS" },
-{ 10069 , "WSAEDQUOT" },
-{ 10070 , "WSAESTALE" },
-{ 10071 , "WSAEREMOTE" },
-{ 10101 , "WSAEDISCON" },
-{ 10091 , "WSASYSNOTREADY" },
-{ 10092 , "WSAVERNOTSUPPORTED" },
-{ 10093 , "WSANOTINITIALISED" },
-{ 11001 , "WSAHOST_NOT_FOUND" },
-{ 11002 , "WSATRY_AGAIN" },
-{ 11003 , "WSANO_RECOVERY" },
-{ 11004 , "WSANO_DATA" },
-{ 0, NULL }
-};
diff --git a/ldap/servers/plugins/acl/acldllmain.c b/ldap/servers/plugins/acl/acldllmain.c
deleted file mode 100644
index ac219ad..0000000
--- a/ldap/servers/plugins/acl/acldllmain.c
+++ /dev/null
@@ -1,80 +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 **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include "acl.h"
-#include <stdio.h>
-
-int CALLBACK
-LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
-{
- /*UnlockData( 0 );*/
- return( 1 );
-}
-
-#ifdef LDAP_DEBUG
-#include <stdarg.h>
-
-void LDAPDebug( int level, char* fmt, ... )
-{
- static char debugBuf[1024];
-
- if (module_ldap_debug && (*module_ldap_debug & level))
- {
- va_list ap;
- va_start (ap, fmt);
- _snprintf (debugBuf, sizeof(debugBuf), fmt, ap);
- debugBuf[sizeof(debugBuf)-1] = 0;
- va_end (ap);
-
- OutputDebugString (debugBuf);
- }
-}
-#endif
-
-
-void perror( const char *msg )
-{
- char buf[128];
- wsprintf( buf, "%s: error %d\n", msg, WSAGetLastError()) ;
- OutputDebugString( buf );
-}
-
diff --git a/ldap/servers/plugins/acl/libacl.def b/ldap/servers/plugins/acl/libacl.def
deleted file mode 100644
index e9eefc3..0000000
--- a/ldap/servers/plugins/acl/libacl.def
+++ /dev/null
@@ -1,48 +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 'Dirsrv 1.0 ACL Plugin'
-;CODE SHARED READ EXECUTE
-;DATA SHARED READ WRITE
-EXPORTS
- acl_preopInit @1
-; unused @2
- acl_init @3
- plugin_init_debug_level @4
diff --git a/ldap/servers/plugins/chainingdb/cbdllmain.c b/ldap/servers/plugins/chainingdb/cbdllmain.c
deleted file mode 100644
index 16ccc5c..0000000
--- a/ldap/servers/plugins/chainingdb/cbdllmain.c
+++ /dev/null
@@ -1,78 +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 **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include "cb.h"
-#include <stdio.h>
-
-int CALLBACK
-LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
-{
- /*UnlockData( 0 );*/
- return( 1 );
-}
-
-
-#ifdef LDAP_DEBUG
-#include <stdarg.h>
-
-void LDAPDebug( int level, char* fmt, ... )
-{
- static char debugBuf[1024];
-
- if (module_ldap_debug && (*module_ldap_debug & level))
- {
- va_list ap;
- va_start (ap, fmt);
- _snprintf (debugBuf, sizeof(debugBuf), fmt, ap);
- va_end (ap);
-
- OutputDebugString (debugBuf);
- }
-}
-#endif
-
-void perror( const char *msg )
-{
- char buf[128];
- wsprintf( buf, "%s: error %d\n", msg, WSAGetLastError()) ;
- OutputDebugString( buf );
-}
diff --git a/ldap/servers/plugins/chainingdb/libcb.def b/ldap/servers/plugins/chainingdb/libcb.def
deleted file mode 100644
index b38527b..0000000
--- a/ldap/servers/plugins/chainingdb/libcb.def
+++ /dev/null
@@ -1,47 +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 'Dirsrv 1.0 Chaining Database Plugin'
-;CODE SHARED READ EXECUTE
-;DATA SHARED READ WRITE
-EXPORTS
- chaining_back_init @1
- plugin_init_debug_level @2
- cb_be_state_change @3
diff --git a/ldap/servers/plugins/collation/collation.def b/ldap/servers/plugins/collation/collation.def
deleted file mode 100644
index e62011b..0000000
--- a/ldap/servers/plugins/collation/collation.def
+++ /dev/null
@@ -1,42 +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 'Dirsrv 1.0 Collation Plugin'
-EXPORTS
- orderingRule_init @2
- plugin_init_debug_level @3
diff --git a/ldap/servers/plugins/collation/dllmain.c b/ldap/servers/plugins/collation/dllmain.c
deleted file mode 100644
index f8cca09..0000000
--- a/ldap/servers/plugins/collation/dllmain.c
+++ /dev/null
@@ -1,84 +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 **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/*
- * Microsoft Windows specifics for collation DLL
- */
-#include "ldap.h"
-#include <stdio.h>
-
-int CALLBACK
-LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
-{
- /*UnlockData( 0 );*/
- return( 1 );
-}
-
-#ifdef LDAP_DEBUG
-
-#include <stdarg.h>
-
-void LDAPDebug( int level, char* fmt, ... )
-{
- static char debugBuf[1024];
-
- if (module_ldap_debug && (*module_ldap_debug & level))
- {
- va_list ap;
- va_start (ap, fmt);
- _snprintf (debugBuf, sizeof(debugBuf), fmt, ap);
- debugBuf[sizeof(debugBuf)-1] = 0;
- va_end (ap);
-
- OutputDebugString (debugBuf);
- }
-}
-#endif
-
-
-void perror( const char *msg )
-{
- char buf[128];
- wsprintf( buf, "%s: error %d\n", msg, WSAGetLastError()) ;
- OutputDebugString( buf );
-}
-
diff --git a/ldap/servers/plugins/cos/cos.def b/ldap/servers/plugins/cos/cos.def
deleted file mode 100644
index 6e285a9..0000000
--- a/ldap/servers/plugins/cos/cos.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
-;
-DESCRIPTION 'Dirsrv 1.0 Class Of Service Plugin'
-EXPORTS
- cos_init @2
- plugin_init_debug_level @3
- cos_version @4
diff --git a/ldap/servers/plugins/cos/dllmain.c b/ldap/servers/plugins/cos/dllmain.c
deleted file mode 100644
index d23057a..0000000
--- a/ldap/servers/plugins/cos/dllmain.c
+++ /dev/null
@@ -1,56 +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 **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/*
- * Microsoft Windows specifics for BACK-LDBM DLL
- */
-#include "ldap.h"
-#include "lber.h"
-
-
-int CALLBACK
-LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
-{
- /*UnlockData( 0 );*/
- return( 1 );
-}
-
diff --git a/ldap/servers/plugins/distrib/Makefile b/ldap/servers/plugins/distrib/Makefile
index 60e9ad6..c2ad31f 100644
--- a/ldap/servers/plugins/distrib/Makefile
+++ b/ldap/servers/plugins/distrib/Makefile
@@ -52,10 +52,6 @@ LIBDIR = $(LDAP_PLUGIN_RELDIR)
include $(BUILD_ROOT)/nsconfig.mk
include $(LDAP_SRC)/nsldap.mk
-ifeq ($(ARCH), WINNT)
-DEF_FILE:=./libdistrib.def
-endif
-
CFLAGS+=$(SLCFLAGS)
INCLUDES += -I$(LDAP_SRC)/servers/slapd
@@ -66,74 +62,27 @@ DIS_OBJS= \
OBJS = $(addprefix $(OBJDEST)/, $(DIS_OBJS))
-ifeq ($(ARCH), WINNT)
-LIBDIS_DLL_OBJ = $(addprefix $(OBJDEST)/, dllmain.o)
-endif
-
# The sample distribution plugin is not part of DS.
# So we generate the shared library outside of $(LIBDIR)
# so that it's not retrieved by the packaging makefiles.
#LIBDIS = $(addprefix $(LIBDIR)/, $(DIS_DLL).$(DLL_SUFFIX))
LIBDIS = $(addprefix $(OBJDEST)/, $(DIS_DLL).$(DLL_SUFFIX))
-ifeq ($(ARCH), WINNT)
-EXTRA_LIBS_DEP += \
- $(LIBSLAPD_DEP) \
- $(LDAP_LIBUTIL_DEP) \
- $(LDAP_COMMON_LIBS_DEP)
-EXTRA_LIBS_DEP += \
- $(LDAPSDK_DEP) \
- $(SECURITY_DEP)
-EXTRA_LIBS += \
- $(LIBSLAPD) \
- $(LDAP_SDK_LIBLDAP_DLL) \
- $(LIBUTIL) \
- $(NSPRLINK) \
- $(LDAP_COMMON_LIBS)
-endif
-ifeq ($(ARCH), AIX)
-EXTRA_LIBS_DEP += \
- $(LIBSLAPD_DEP) \
- $(LDAP_LIBUTIL_DEP) \
- $(LDAP_COMMON_LIBS_DEP)
-EXTRA_LIBS_DEP += \
- $(LDAPSDK_DEP)
-EXTRA_LIBS += \
- $(LIBSLAPDLINK) \
- $(LDAP_SDK_LIBLDAP_DLL) \
- $(LIBUTIL) \
- $(NSPRLINK) \
- $(LDAP_COMMON_LIBS)
-endif
-
ifeq ($(ARCH), HPUX)
EXTRA_LIBS_DEP += $(LIBSLAPD_DEP) $(LDAPSDK_DEP) $(NSPR_DEP)
EXTRA_LIBS += $(LDAPLINK) $(NSPRLINK) $(ICULINK)
endif
-ifeq ($(ARCH), WINNT)
-DLL_LDFLAGS += -def:"./libdistrib.def"
-CFLAGS+= /WX
-endif # WINNT
-
-ifeq ($(ARCH), AIX)
-LD=ld
-endif
-
-clientSDK:
all: $(OBJDEST) $(LIBDIR) $(LIBDIS)
-$(LIBDIS): $(OBJS) $(LIBDIS_DLL_OBJ) $(DEF_FILE)
- $(LINK_DLL) $(LIBDIS_DLL_OBJ) $(EXTRA_LIBS)
+$(LIBDIS): $(OBJS) $(DEF_FILE)
+ $(LINK_DLL) $(EXTRA_LIBS)
veryclean: clean
clean:
$(RM) $(OBJS)
-ifeq ($(ARCH), WINNT)
- $(RM) $(LIBDIS_DLL_OBJ)
-endif
$(RM) $(LIBDIS)
$(OBJDEST):
diff --git a/ldap/servers/plugins/distrib/Makefile.WINNT b/ldap/servers/plugins/distrib/Makefile.WINNT
deleted file mode 100644
index 4b873dd..0000000
--- a/ldap/servers/plugins/distrib/Makefile.WINNT
+++ /dev/null
@@ -1,76 +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 Directory Server plug-in
-#
-
-CC = cl
-LD = link
-
-
-TARGET=libdistrib
-
-OBJS=distrib.obj
-
-
-INC = ..\..\include
-CFLAGS = /nologo -I $(INC) /c
-LDFLAGS = /dll /nologo
-LIBS=/DEFAULTLIB:kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib ..\..\lib\libslapd.lib ..\..\lib\libnspr4.lib
-
-
-all: \
- init \
- $(TARGET).dll
-
-init:
- "c:\program files\microsoft visual studio\vc98\bin\vcvars32.bat"
-
-
-$(TARGET).dll: $(OBJS)
- $(LD) $(LDFLAGS) /def:$(TARGET).def /out:$(TARGET).dll $(LIBS) $(OBJS)
- -rm -f $(OBJS2) *~
-
-.c.obj:
- $(CC) $(CFLAGS) $<
-
-clean:
- del -f $(OBJS) $(TARGET).dll *~
-
-
-
diff --git a/ldap/servers/plugins/distrib/distrib.dsp b/ldap/servers/plugins/distrib/distrib.dsp
deleted file mode 100644
index e2ffa39..0000000
--- a/ldap/servers/plugins/distrib/distrib.dsp
+++ /dev/null
@@ -1,153 +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 ---
-# Microsoft Developer Studio Project File - Name="distrib" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 5.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=distrib - Win32 Release
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "distrib.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "distrib.mak" CFG="distrib - Win32 Release"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "distrib - Win32 Release" (based on\
- "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "distrib - Win32 Debug" (based on\
- "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "distrib - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir ".\Release"
-# PROP BASE Intermediate_Dir ".\Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir ".\Release"
-# PROP Intermediate_Dir ".\Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WIN32" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib ..\..\lib\libslapd.lib /nologo /subsystem:windows /dll /machine:I386
-
-!ELSEIF "$(CFG)" == "distrib - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir ".\Debug"
-# PROP BASE Intermediate_Dir ".\Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir ".\Debug"
-# PROP Intermediate_Dir ".\Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
-# ADD CPP /nologo /MD /W3 /Gm /GX /Zi /Od /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_WIN32" /YX /FD /c
-# ADD BASE MTL /nologo /D "_DEBUG" /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib ..\..\lib\libslapd.lib /nologo /subsystem:windows /dll /debug /machine:I386
-
-!ENDIF
-
-# Begin Target
-
-# Name "distrib - Win32 Release"
-# Name "distrib - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90"
-# Begin Source File
-
-SOURCE=.\dllmain.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\distrib.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libdistrib.def
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/ldap/servers/plugins/distrib/dllmain.c b/ldap/servers/plugins/distrib/dllmain.c
deleted file mode 100644
index 3e072ff..0000000
--- a/ldap/servers/plugins/distrib/dllmain.c
+++ /dev/null
@@ -1,54 +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 --- */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
- /*
- * Microsoft Windows specifics
- */
-#include "ldap.h"
-
-
-int CALLBACK
-LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
-{
- /*UnlockData( 0 );*/
- return( 1 );
-}
diff --git a/ldap/servers/plugins/distrib/libdistrib.def b/ldap/servers/plugins/distrib/libdistrib.def
deleted file mode 100644
index f3c4cd5..0000000
--- a/ldap/servers/plugins/distrib/libdistrib.def
+++ /dev/null
@@ -1,41 +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 'Dirsrv 1.0 distribution logic example'
-EXPORTS
- alpha_distribution @1
- hash_distribution @2
diff --git a/ldap/servers/plugins/http/dllmain.c b/ldap/servers/plugins/http/dllmain.c
deleted file mode 100644
index 86418cb..0000000
--- a/ldap/servers/plugins/http/dllmain.c
+++ /dev/null
@@ -1,56 +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 --- */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-
-/*
- * Microsoft Windows specifics for BACK-LDBM DLL
- */
-#include "ldap.h"
-#include "lber.h"
-
-
-int CALLBACK
-LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
-{
- /*UnlockData( 0 );*/
- return( 1 );
-}
diff --git a/ldap/servers/plugins/http/http.def b/ldap/servers/plugins/http/http.def
deleted file mode 100644
index c586cf7..0000000
--- a/ldap/servers/plugins/http/http.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 'Netscape Directory Server Http Client'
-EXPORTS
- http_client_init @2
- plugin_init_debug_level @3
- http_client_version @4
-
-
diff --git a/ldap/servers/plugins/pam_passthru/libpam_passthru.def b/ldap/servers/plugins/pam_passthru/libpam_passthru.def
deleted file mode 100644
index e78e1e2..0000000
--- a/ldap/servers/plugins/pam_passthru/libpam_passthru.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) 2005 Red Hat, Inc.
-; All rights reserved.
-; END COPYRIGHT BLOCK
-;
-;
-;
-DESCRIPTION 'Directory Server Pass Through Authentication Plugin'
-;CODE SHARED READ EXECUTE
-;DATA SHARED READ WRITE
-EXPORTS
- passthruauth_init @1
- plugin_init_debug_level @2
diff --git a/ldap/servers/plugins/pam_passthru/pam_ptdllmain.c b/ldap/servers/plugins/pam_passthru/pam_ptdllmain.c
deleted file mode 100644
index a17bc1b..0000000
--- a/ldap/servers/plugins/pam_passthru/pam_ptdllmain.c
+++ /dev/null
@@ -1,81 +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) 2005 Red Hat, Inc.
- * All rights reserved.
- * END COPYRIGHT BLOCK **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include "ldap.h"
-#include "lber.h"
-#include "passthru.h"
-#include <stdio.h>
-
-
-int CALLBACK
-LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
-{
- /*UnlockData( 0 );*/
- return( 1 );
-}
-
-
-#ifdef LDAP_DEBUG
-#include <stdarg.h>
-
-void LDAPDebug( int level, char* fmt, ... )
-{
- static char debugBuf[1024];
-
- if (module_ldap_debug && (*module_ldap_debug & level))
- {
- va_list ap;
- va_start (ap, fmt);
- _snprintf (debugBuf, sizeof(debugBuf), fmt, ap);
- debugBuf[sizeof(debugBuf)-1] = 0;
- va_end (ap);
-
- OutputDebugString (debugBuf);
- }
-}
-#endif
-
-void perror( const char *msg )
-{
- char buf[128];
- wsprintf( buf, "%s: error %d\n", msg, WSAGetLastError()) ;
- OutputDebugString( buf );
-}
diff --git a/ldap/servers/plugins/passthru/libpassthru.def b/ldap/servers/plugins/passthru/libpassthru.def
deleted file mode 100644
index ac54494..0000000
--- a/ldap/servers/plugins/passthru/libpassthru.def
+++ /dev/null
@@ -1,46 +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 'Dirsrv 1.0 Pass Through Authentication Plugin'
-;CODE SHARED READ EXECUTE
-;DATA SHARED READ WRITE
-EXPORTS
- passthruauth_init @1
- plugin_init_debug_level @2
diff --git a/ldap/servers/plugins/passthru/ptdllmain.c b/ldap/servers/plugins/passthru/ptdllmain.c
deleted file mode 100644
index ef471bc..0000000
--- a/ldap/servers/plugins/passthru/ptdllmain.c
+++ /dev/null
@@ -1,83 +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 **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include "ldap.h"
-#include "lber.h"
-#include "passthru.h"
-#include <stdio.h>
-
-int CALLBACK
-LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
-{
- /*UnlockData( 0 );*/
- return( 1 );
-}
-
-#ifdef LDAP_DEBUG
-#include <stdarg.h>
-
-void LDAPDebug( int level, char* fmt, ... )
-{
- static char debugBuf[1024];
-
- if (module_ldap_debug && (*module_ldap_debug & level))
- {
- va_list ap;
- va_start (ap, fmt);
- _snprintf (debugBuf, sizeof(debugBuf), fmt, ap);
- debugBuf[sizeof(debugBuf)-1] = 0;
- va_end (ap);
-
- OutputDebugString (debugBuf);
- }
-}
-#endif
-
-
-/* The 16-bit version of the RTL does not implement perror() */
-void perror( const char *msg )
-{
- char buf[128];
- wsprintf( buf, "%s: error %d\n", msg, WSAGetLastError()) ;
- OutputDebugString( buf );
-}
-
diff --git a/ldap/servers/plugins/presence/dllmain.c b/ldap/servers/plugins/presence/dllmain.c
deleted file mode 100644
index 21b45cc..0000000
--- a/ldap/servers/plugins/presence/dllmain.c
+++ /dev/null
@@ -1,55 +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 **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/*
- * Microsoft Windows specifics for BACK-LDBM DLL
- */
-#include "ldap.h"
-#include "lber.h"
-
-
-int CALLBACK
-LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
-{
- /*UnlockData( 0 );*/
- return( 1 );
-}
diff --git a/ldap/servers/plugins/presence/presence.def b/ldap/servers/plugins/presence/presence.def
deleted file mode 100644
index e40b64d..0000000
--- a/ldap/servers/plugins/presence/presence.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
-;
-DESCRIPTION 'Dirsrv 1.0 Presence Plugin'
-EXPORTS
- presence_init @2
- plugin_init_debug_level @3
- presence_version @4
diff --git a/ldap/servers/plugins/pwdstorage/dllmain.c b/ldap/servers/plugins/pwdstorage/dllmain.c
deleted file mode 100644
index 892c41f..0000000
--- a/ldap/servers/plugins/pwdstorage/dllmain.c
+++ /dev/null
@@ -1,55 +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 **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-
- /*
- * Microsoft Windows specifics for LIBPWDSTORAGE DLL
- */
-#include "ldap.h"
-
-
-int CALLBACK
-LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
-{
- /*UnlockData( 0 );*/
- return( 1 );
-}
diff --git a/ldap/servers/plugins/pwdstorage/libpwdstorage.def b/ldap/servers/plugins/pwdstorage/libpwdstorage.def
deleted file mode 100644
index 5493586..0000000
--- a/ldap/servers/plugins/pwdstorage/libpwdstorage.def
+++ /dev/null
@@ -1,56 +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 'Dirsrv 1.0 password storage scheme Plugin'
-EXPORTS
- sha_pwd_storage_scheme_init @2
- ssha_pwd_storage_scheme_init @3
-; crypt_pwd_storage_scheme_init @4
- clear_pwd_storage_scheme_init @5
- ns_mta_md5_pwd_storage_scheme_init @6
- clear_pw_cmp @7
-; crypt_pw_cmp @8
- ns_mta_md5_pw_cmp @9
- sha1_pw_cmp @10
- sha1_pw_enc @11
- salted_sha1_pw_enc @12
-; crypt_pw_enc @13
- clear_pw_enc @14
- mta_MD5Init @15
- mta_MD5Update @16
- mta_MD5Final @17
diff --git a/ldap/servers/plugins/referint/dllmain.c b/ldap/servers/plugins/referint/dllmain.c
deleted file mode 100644
index 4474511..0000000
--- a/ldap/servers/plugins/referint/dllmain.c
+++ /dev/null
@@ -1,55 +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 **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/*
- * Microsoft Windows specifics for BACK-LDBM DLL
- */
-#include "ldap.h"
-
-
-int CALLBACK
-LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
-{
- /*UnlockData( 0 );*/
- return( 1 );
-}
-#endif
diff --git a/ldap/servers/plugins/referint/referint.def b/ldap/servers/plugins/referint/referint.def
deleted file mode 100644
index 3c7558d..0000000
--- a/ldap/servers/plugins/referint/referint.def
+++ /dev/null
@@ -1,44 +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 'Dirsrv 1.0 Referint Plugin'
-CODE SHARED READ EXECUTE
-DATA SHARED READ WRITE
-EXPORTS
- referint_postop_init @2
- plugin_init_debug_level @3
diff --git a/ldap/servers/plugins/replication/dllmain.c b/ldap/servers/plugins/replication/dllmain.c
deleted file mode 100644
index 940b3e9..0000000
--- a/ldap/servers/plugins/replication/dllmain.c
+++ /dev/null
@@ -1,128 +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 **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-
- /*
- * Microsoft Windows specifics for LIBREPLICATION DLL
- */
-#include "ldap.h"
-
-
-#ifdef _WIN32
-/* Lifted from Q125688
- * How to Port a 16-bit DLL to a Win32 DLL
- * on the MSVC 4.0 CD
- */
-BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
-{
-
- switch (fdwReason)
- {
- case DLL_PROCESS_ATTACH:
- /* Code from LibMain inserted here. Return TRUE to keep the
- DLL loaded or return FALSE to fail loading the DLL.
-
- You may have to modify the code in your original LibMain to
- account for the fact that it may be called more than once.
- You will get one DLL_PROCESS_ATTACH for each process that
- loads the DLL. This is different from LibMain which gets
- called only once when the DLL is loaded. The only time this
- is critical is when you are using shared data sections.
- If you are using shared data sections for statically
- allocated data, you will need to be careful to initialize it
- only once. Check your code carefully.
-
- Certain one-time initializations may now need to be done for
- each process that attaches. You may also not need code from
- your original LibMain because the operating system may now
- be doing it for you.
- */
- /*
- * 16 bit code calls UnlockData()
- * which is mapped to UnlockSegment in windows.h
- * in 32 bit world UnlockData is not defined anywhere
- * UnlockSegment is mapped to GlobalUnfix in winbase.h
- * and the docs for both UnlockSegment and GlobalUnfix say
- * ".. function is oboslete. Segments have no meaning
- * in the 32-bit environment". So we do nothing here.
- */
-
- break;
-
- case DLL_THREAD_ATTACH:
- /* Called each time a thread is created in a process that has
- already loaded (attached to) this DLL. Does not get called
- for each thread that exists in the process before it loaded
- the DLL.
-
- Do thread-specific initialization here.
- */
- break;
-
- case DLL_THREAD_DETACH:
- /* Same as above, but called when a thread in the process
- exits.
-
- Do thread-specific cleanup here.
- */
- break;
-
- case DLL_PROCESS_DETACH:
- /* Code from _WEP inserted here. This code may (like the
- LibMain) not be necessary. Check to make certain that the
- operating system is not doing it for you.
- */
-
- break;
- }
- /* The return value is only used for DLL_PROCESS_ATTACH; all other
- conditions are ignored. */
- return TRUE; /* successful DLL_PROCESS_ATTACH */
-}
-#else
-int CALLBACK
-LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
-{
- /*UnlockData( 0 );*/
- return( 1 );
-}
-#endif
diff --git a/ldap/servers/plugins/replication/replication.def b/ldap/servers/plugins/replication/replication.def
deleted file mode 100644
index 94b0da7..0000000
--- a/ldap/servers/plugins/replication/replication.def
+++ /dev/null
@@ -1,48 +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 'Dirsrv 1.0 Replication Plugin'
-;CODE SHARED READ EXECUTE
-;DATA SHARED READ WRITE
-EXPORTS
- plugin_init_debug_level @1
- replication_legacy_plugin_init @2
- replication_multimaster_plugin_init @3
- repl_chain_on_update @4
diff --git a/ldap/servers/plugins/retrocl/dllmain.c b/ldap/servers/plugins/retrocl/dllmain.c
deleted file mode 100644
index c460cd5..0000000
--- a/ldap/servers/plugins/retrocl/dllmain.c
+++ /dev/null
@@ -1,55 +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 **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
- /*
- * Microsoft Windows specifics for LIBRETROCL DLL
- */
-#include "ldap.h"
-
-
-int CALLBACK
-LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
-{
- /*UnlockData( 0 );*/
- return( 1 );
-}
-
diff --git a/ldap/servers/plugins/retrocl/retrocl.def b/ldap/servers/plugins/retrocl/retrocl.def
deleted file mode 100644
index fffebea..0000000
--- a/ldap/servers/plugins/retrocl/retrocl.def
+++ /dev/null
@@ -1,47 +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 'Dirsrv 1.0 Retro-Changelog Plugin'
-;CODE SHARED READ EXECUTE
-;DATA SHARED READ WRITE
-EXPORTS
- plugin_init_debug_level @1
- retrocl_plugin_init @2
-
diff --git a/ldap/servers/plugins/rever/dllmain.c b/ldap/servers/plugins/rever/dllmain.c
deleted file mode 100644
index f107648..0000000
--- a/ldap/servers/plugins/rever/dllmain.c
+++ /dev/null
@@ -1,55 +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 **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-
- /*
- * Microsoft Windows specifics for LIBPWDSTORAGE DLL
- */
-#include "rever.h"
-
-
-int CALLBACK
-LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
-{
- /*UnlockData( 0 );*/
- return( 1 );
-}
diff --git a/ldap/servers/plugins/rever/libdes.def b/ldap/servers/plugins/rever/libdes.def
deleted file mode 100644
index 081eac0..0000000
--- a/ldap/servers/plugins/rever/libdes.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 'Directory Server 6.2.1 Local Credentials Reversible Encryption Plugin'
-EXPORTS
- des_cmp @2
- des_enc @3
- des_dec @4
- des_init @5
- migrateCredentials @6
diff --git a/ldap/servers/plugins/roles/dllmain.c b/ldap/servers/plugins/roles/dllmain.c
deleted file mode 100644
index de55d26..0000000
--- a/ldap/servers/plugins/roles/dllmain.c
+++ /dev/null
@@ -1,54 +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 **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/*
- * Microsoft Windows specifics for BACK-LDBM DLL
- */
-#include "ldap.h"
-#include "lber.h"
-
-int CALLBACK
-LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
-{
- /*UnlockData( 0 );*/
- return( 1 );
-}
diff --git a/ldap/servers/plugins/roles/roles.def b/ldap/servers/plugins/roles/roles.def
deleted file mode 100644
index 9a8c1c7..0000000
--- a/ldap/servers/plugins/roles/roles.def
+++ /dev/null
@@ -1,42 +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 'Dirsrv 1.0 Roles Plugin'
-EXPORTS
- roles_init @2
- plugin_init_debug_level @3
diff --git a/ldap/servers/plugins/statechange/dllmain.c b/ldap/servers/plugins/statechange/dllmain.c
deleted file mode 100644
index d23057a..0000000
--- a/ldap/servers/plugins/statechange/dllmain.c
+++ /dev/null
@@ -1,56 +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 **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/*
- * Microsoft Windows specifics for BACK-LDBM DLL
- */
-#include "ldap.h"
-#include "lber.h"
-
-
-int CALLBACK
-LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
-{
- /*UnlockData( 0 );*/
- return( 1 );
-}
-
diff --git a/ldap/servers/plugins/statechange/statechange.def b/ldap/servers/plugins/statechange/statechange.def
deleted file mode 100644
index 4a0daf6..0000000
--- a/ldap/servers/plugins/statechange/statechange.def
+++ /dev/null
@@ -1,42 +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 'Dirsrv 1.0 State Change Plugin'
-EXPORTS
- statechange_init @2
- plugin_init_debug_level @3
diff --git a/ldap/servers/plugins/syntaxes/dllmain.c b/ldap/servers/plugins/syntaxes/dllmain.c
deleted file mode 100644
index 0dd3ff0..0000000
--- a/ldap/servers/plugins/syntaxes/dllmain.c
+++ /dev/null
@@ -1,84 +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 **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/*
- * Microsoft Windows specifics for syntax-plugin DLL
- */
-#include "ldap.h"
-#include "syntax.h"
-#include <stdio.h>
-
-
-int CALLBACK
-LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
-{
- /*UnlockData( 0 );*/
- return( 1 );
-}
-
-#ifdef LDAP_DEBUG
-#include <stdarg.h>
-
-void LDAPDebug( int level, char* fmt, ... )
-{
- static char debugBuf[1024];
-
- if (module_ldap_debug && (*module_ldap_debug & level))
- {
- va_list ap;
- va_start (ap, fmt);
- _snprintf (debugBuf, sizeof(debugBuf), fmt, ap);
- debugBuf[sizeof(debugBuf)-1] = 0;
- va_end (ap);
-
- OutputDebugString (debugBuf);
- }
-}
-#endif
-
-
-void perror( const char *msg )
-{
- char buf[128];
- wsprintf( buf, "%s: error %d\n", msg, WSAGetLastError()) ;
- OutputDebugString( buf );
-}
diff --git a/ldap/servers/plugins/syntaxes/libsyntax.def b/ldap/servers/plugins/syntaxes/libsyntax.def
deleted file mode 100644
index 23dc0b7..0000000
--- a/ldap/servers/plugins/syntaxes/libsyntax.def
+++ /dev/null
@@ -1,56 +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 'Dirsrv 1.0 syntaxes Plugin'
-EXPORTS
- cis_init @2
- ces_init @3
- tel_init @4
- dn_init @5
- bin_init @6
- int_init @7
- plugin_init_debug_level @8
- octetstring_init @9
- boolean_init @10
- time_init @11
- uri_init @12
- country_init @13
- postal_init @14
- jpeg_init @15
- oid_init @16
- sicis_init @17
diff --git a/ldap/servers/plugins/uiduniq/libuiduniq.def b/ldap/servers/plugins/uiduniq/libuiduniq.def
deleted file mode 100644
index a687de0..0000000
--- a/ldap/servers/plugins/uiduniq/libuiduniq.def
+++ /dev/null
@@ -1,47 +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 'Dirsrv 1.0 Unique Attribute Checking Plugin'
-;CODE SHARED READ EXECUTE
-;DATA SHARED READ WRITE
-EXPORTS
- uidunique_init @1
- NSUniqueAttr_Init @2
- NS7bitAttr_Init @3
diff --git a/ldap/servers/plugins/vattrsp_template/dllmain.c b/ldap/servers/plugins/vattrsp_template/dllmain.c
deleted file mode 100644
index 21b45cc..0000000
--- a/ldap/servers/plugins/vattrsp_template/dllmain.c
+++ /dev/null
@@ -1,55 +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 **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/*
- * Microsoft Windows specifics for BACK-LDBM DLL
- */
-#include "ldap.h"
-#include "lber.h"
-
-
-int CALLBACK
-LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
-{
- /*UnlockData( 0 );*/
- return( 1 );
-}
diff --git a/ldap/servers/plugins/vattrsp_template/vattrsp.def b/ldap/servers/plugins/vattrsp_template/vattrsp.def
deleted file mode 100644
index e5734b6..0000000
--- a/ldap/servers/plugins/vattrsp_template/vattrsp.def
+++ /dev/null
@@ -1,42 +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 'Netscape Directory Server 6.2.1 Virtual Attribute Service Provider Template Plugin'
-EXPORTS
- vattrsp_init @2
- plugin_init_debug_level @3
diff --git a/ldap/servers/plugins/views/dllmain.c b/ldap/servers/plugins/views/dllmain.c
deleted file mode 100644
index 21b45cc..0000000
--- a/ldap/servers/plugins/views/dllmain.c
+++ /dev/null
@@ -1,55 +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 **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/*
- * Microsoft Windows specifics for BACK-LDBM DLL
- */
-#include "ldap.h"
-#include "lber.h"
-
-
-int CALLBACK
-LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
-{
- /*UnlockData( 0 );*/
- return( 1 );
-}
diff --git a/ldap/servers/plugins/views/views.def b/ldap/servers/plugins/views/views.def
deleted file mode 100644
index 71dd5d0..0000000
--- a/ldap/servers/plugins/views/views.def
+++ /dev/null
@@ -1,42 +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 'Dirsrv 1.0 State Change Plugin'
-EXPORTS
- views_init @2
- plugin_init_debug_level @3
diff --git a/ldap/servers/slapd/back-ldbm/dllmain.c b/ldap/servers/slapd/back-ldbm/dllmain.c
deleted file mode 100644
index b0e49dc..0000000
--- a/ldap/servers/slapd/back-ldbm/dllmain.c
+++ /dev/null
@@ -1,86 +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 **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/*
- * Microsoft Windows specifics for BACK-LDBM DLL
- */
-#include "back-ldbm.h"
-#include <stdio.h>
-
-int CALLBACK
-LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
-{
- /*UnlockData( 0 );*/
- return( 1 );
-}
-
-#ifdef LDAP_DEBUG
-#ifndef _WIN32
-#include <stdarg.h>
-#include <stdio.h>
-
-void LDAPDebug( int level, char* fmt, ... )
-{
- static char debugBuf[1024];
-
- if (slapd_ldap_debug & level)
- {
- va_list ap;
- va_start (ap, fmt);
- _snprintf (debugBuf, sizeof(debugBuf), fmt, ap);
- debugBuf[sizeof(debugBuf)-1] = 0;
- va_end (ap);
-
- OutputDebugString (debugBuf);
- }
-}
-#endif
-#endif
-
-/* The 16-bit version of the RTL does not implement perror() */
-void perror( const char *msg )
-{
- char buf[128];
- wsprintf( buf, "%s: error %d\n", msg, WSAGetLastError()) ;
- OutputDebugString( buf );
-}
-
diff --git a/ldap/servers/slapd/back-ldbm/libback-ldbm.def b/ldap/servers/slapd/back-ldbm/libback-ldbm.def
deleted file mode 100644
index 661973d..0000000
--- a/ldap/servers/slapd/back-ldbm/libback-ldbm.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 'Directory Server 2.0 DB Backend Plugin'
-EXPORTS
- ldbm_back_init @2
- plugin_init_debug_level @3
-; ldbm_back_changelog_init @4
-
-
diff --git a/ldap/servers/slapd/back-ldif/dllmain.c b/ldap/servers/slapd/back-ldif/dllmain.c
deleted file mode 100644
index 282dce9..0000000
--- a/ldap/servers/slapd/back-ldif/dllmain.c
+++ /dev/null
@@ -1,65 +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 **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/*
- * Microsoft Windows specifics for LIBLDAP DLL
- */
-#include "ldap.h"
-#include <stdio.h>
-
-
-int CALLBACK
-LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
-{
- /*UnlockData( 0 );*/
- return( 1 );
-}
-
-/* The 16-bit version of the RTL does not implement perror() */
-
-void perror( const char *msg )
-{
- char buf[128];
- wsprintf( buf, "%s: error %d\n", msg, WSAGetLastError()) ;
- OutputDebugString( buf );
-}
-
diff --git a/ldap/servers/slapd/back-ldif/libback-ldif.def b/ldap/servers/slapd/back-ldif/libback-ldif.def
deleted file mode 100644
index 6665d0b..0000000
--- a/ldap/servers/slapd/back-ldif/libback-ldif.def
+++ /dev/null
@@ -1,44 +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 'Directory Server LDIF Backend Plugin'
-EXPORTS
- ldif_back_init @2
- plugin_init_debug_level @3
-
-
diff --git a/ldap/servers/slapd/libslapd.def b/ldap/servers/slapd/libslapd.def
deleted file mode 100644
index 7e3c942..0000000
--- a/ldap/servers/slapd/libslapd.def
+++ /dev/null
@@ -1,1204 +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 'Dirsrv 1.0 Plug-in Utility Library'
-EXPORTS
- slapd_log_error_proc @2
- slapd_log_audit_proc @3
- ldapi_init_extended_ops @4
- audit_log_openf @5
- slapi_log_error @6
- slapi_log_access @7
- g_set_detached @8
- access_log_openf @9
- error_log_openf @10
- slapi_ch_strdup @11
- slapi_ch_malloc @12
- slapi_ch_calloc @13
- slapi_ch_realloc @14
- slapi_ch_free @15
- slapi_sdn_scope_test @16
- slapi_pblock_get @17
- slapi_pblock_set @18
- slapi_str2entry @19
- slapi_entry2str @20
- slapi_entry_alloc @21
- slapi_entry_free @22
- slapi_entry_dup @23
- slapi_entry_get_dn @24
- slapi_entry_set_dn @25
- slapi_entry_attr_find @26
- slapi_entry_first_attr @27
- slapi_entry_next_attr @28
- slapi_entry_attr_merge @29
- slapi_entry_schema_check @30
- slapi_entry_add_values @31
- slapi_entry_delete_values @32
- g_get_global_oc_nolock @34
- config_set_maxbersize @35
- g_get_global_lastmod @36
- current_time @37
- slapi_attr_free @38
- attr_syntax_create @39
- valueset_get_valuearray @40
- attrlist_merge @41
- attrlist_find @42
- attrlist_delete @43
- slapi_register_plugin @44
- csn_max @45
- slapi_dn_normalize @46
- slapi_dn_ignore_case @47
- slapi_dn_normalize_case @48
- slapi_dn_parent @49
- slapi_dn_issuffix @50
- slapi_attr_get_valueset @51
- slapi_read_buffer @52
- slapi_write_buffer @53
- add_control @54
- pblock_init @56
- pblock_init_common @57
- slapi_pblock_get_common @58
- slapi_valueset_count @59
- slapi_mtn_get_backend_name @60
- get_timestring @61
- free_timestring @62
- slapi_op_abandoned @63
- slapi_filter_get_choice @64
- slapi_filter_get_ava @65
- slapi_filter_get_type @66
- slapi_filter_get_subfilt @67
- slapi_filter_list_first @68
- slapi_filter_list_next @69
- slapi_filter_join @70
- slapi_filter_free @71
- slapi_filter_test @72
- slapi_access_allowed @73
- slapi_acl_check_mods @74
- dse_search @75
- slapi_pw_find @76
-; send_read_referrals @77
-; ref_array_dup @78
-; ref_array_dup_free @79
- slapi_dn_find_parent @79
- slapi_dn_beparent @80
- slapi_ldap_init @81
- slapi_ldap_unbind @82
- slapi_dn_isroot @83
- slapi_dn_isbesuffix @84
- slapi_value_new_berval @85
- plugin_call_plugins @86
- slapi_mtn_be_disable @87
- slapi_be_new @88
- get_operation_object_type @89
- be_flushall @90
- slapi_be_select @91
- charray_free @92
- charray_dup @93
- slapi_str2filter @94
- charray_add @95
- value_done @96
- rdn2ava @97
- pw_encodevals @98
- slapi_valueset_set_from_smod @99
- ava_done @100
- pw_name2scheme @101
- generate_componentid @102
- g_set_deftime @103
- g_set_defsize @104
- plugin_setup @105
- slapi_new_mutex @106
- slapi_destroy_mutex @107
- slapi_lock_mutex @108
- slapi_unlock_mutex @109
- slapi_valueset_set_valueset @110
- dse_modify @111
- plugin_call_acl_plugin @112
- get_filter @113
- be_unbindall @114
- plugin_call_exop_plugins @115
- filter_normalize @116
- plugin_call_acl_mods_access @117
- normalize_oc @118
- ref_adjust @119
- config_get_maxbersize @120
- entry_replace_values @121
- filter_strcpy_special @122
- be_addsuffix @123
- slapi_be_getsuffix @124
- slapi_entry_attr_hasvalue @125
- sym_load @126
- str2charray @127
- charray_merge @128
- libldap_init_debug_level @129
- slapi_seq_callback @130
- slapi_be_getentrypoint @131
- write_audit_log_entry @132
- rwl_new @133
- slapi_send_ldap_search_entry @134
- slapi_send_ldap_result @135
- slapi_send_ldap_referral @136
- g_log_init @137
- slapi_get_first_backend @138
- slapi_get_next_backend @139
- be_cleanupall @140
- slapi_attr_new @141
- slapi_acl_verify_aci_syntax @142
- plugin_call_acl_mods_update @143
- plugin_call_acl_verify_syntax @144
- poll_current_time @145
- slapi_dn_isparent @146
- freepmods @147
- get_ldapmessage_controls @148
- init_controls @149
- slapi_control_present @150
- plugin_closeall @151
- plugin_startall @152
- internal_res_callback @153
- internal_srch_entry_callback @154
- internal_ref_entry_callback @155
- slapi_search_internal_callback @156
- slapi_search_internal @157
- slapi_modify_internal @158
- normalize_mods2bvals @159
- slapi_add_internal @160
- slapi_delete_internal @161
- slapi_modrdn_internal @162
- slapi_compare_internal @163
- slapi_free_search_results_internal @164
- send_ldap_result @165
- send_ldapv3_referral @166
- send_ldap_referral @167
- send_ldap_search_entry @168
- slapi_mtn_be_enable @169
- slapi_attr_get_oid_copy @170
- set_db_default_result_handlers @171
- g_get_num_bytes_sent @172
- g_set_num_bytes_sent @173
- g_get_num_entries_sent @174
- g_set_num_entries_sent @175
- g_get_default_referral @178
- g_set_default_referral @179
- slapi_ch_bvdup @180
- rwl_free @181
- get_server_dataversion @182
- get_localhost_DNS @183
- get_localhost_DN @184
- slapi_pblock_new @185
- slapi_pblock_destroy @186
- slapi_ch_bvecdup @187
- slapi_mr_filter_index @188
- slapi_mr_indexer_create @189
- slapi_berval_cmp @190
- filter_print @191
- write_controls @192
- modify_schema_dse @193
- read_schema_dse @194
- attr_syntax_add @195
- addlenstr @196
- config_set_versionstring @197
- slapi_entry_attr_replace @198
- slapi_be_select_by_instance_name @199
- slapd_ssl_init @200
- slapd_SSL_client_init @201
- format_localTime @202
- parse_localTime @203
- strntoul @204
- time_plus_sec @205
- read_localTime @206
- get_entry @207
- slapi_get_supported_controls_copy @208
- attrlist_replace @209
- update_pw_retry @210
- g_get_global_snmp_vars @211
- snmp_collator_start @212
- snmp_collator_stop @213
- config_set_schema_ignore_trailing_spaces @214
- send_nobackend_ldap_result @215
- set_dll_entry_points @216
- slapi_add_entry_internal @217
- dse_register_callback @218
- slapi_entry_init @219
- slapd_ldap_debug @220 DATA
- slapd_ssl_init2 @221
- slapd_SSL_client_bind_s @222
- slapd_ssl_getCipherSuiteInfo @223
- slapi_mods_dump @224
- g_get_slapd_security_on @225
- slapi_register_supported_control @226
- slapi_get_supported_controls @227
- slapi_register_supported_saslmechanism @228
- slapi_get_supported_saslmechanisms_copy @229
- slapi_get_supported_saslmechanisms @230
- bervalarray_add_berval_fast @231
- slapi_get_supported_extended_ops_copy @232
- slapi_get_supported_extended_ops @233
- slapi_be_logchanges @234
- slapi_rdn_remove_attr @235
- slapd_security_library_is_initialized @236
- slapi_ch_bvfree @237
- slapi_config_register_callback @238
- slapi_entry_has_children @239
- slapi_config_remove_callback @240
- entry_apply_mods @241
- slapi_entry_set_flag @242
- slapi_entry_clear_flag @243
- write_localTime @244
- get_entry_object_type @245
- factory_create_extension @246
- factory_destroy_extension @247
- factory_register_type @248
- g_get_access_log @249
- g_get_error_log @250
- get_entry_point @251
- set_snmp_interaction_row @252
- slapi_attr_get_type @254
- slapi_attr_get_oid @255
- slapi_attr_get_values @256
- slapi_attr_get_flags @257
- slapi_attr_flag_is_set @258
- slapi_attr_value_cmp @259
- plugin_syntax_find @260
- plugin_syntax2oid @261
- plugin_call_syntax_filter_ava @262
- plugin_call_syntax_filter_sub @263
- slapi_call_syntax_values2keys @264
- slapi_call_syntax_assertion2keys_ava @265
- slapi_call_syntax_assertion2keys_sub @266
- slapi_attr_value_find @267
- slapi_attr_type2plugin @268
- slapd_re_comp @269
- slapd_re_exec @270
- slapd_re_modw @271
- slapd_re_subs @272
- FrontendConfig_init @273
- slapi_entry_get_dn_const @274
- slapi_register_object_extension @275
- slapi_get_object_extension @276
- slapi_be_delete_onexit @277
- slapi_be_exist @278
- slapi_sdn_add_rdn @279
- slapi_mods_add_string @280
- lenstr_free @281
- lenstr_new @282
- plugin_call_syntax_get_compare_fn @283
- slapi_attr_type_cmp @284
- slapi_attr_basetype @285
- snmp_collator_update @286
- escape_string @287
- eq_start @288
- eq_stop @289
- slapi_rdn2typeval @290
- slapi_entry_rdn_values_present @291
- slapi_entry_attr_get_long @292
- slapi_dn_plus_rdn @293
-; ref_array_replace @294
- slapi_setbit_uchar @295
- slapi_unsetbit_uchar @296
- slapi_isbitset_uchar @297
- slapi_setbit_int @298
- slapi_unsetbit_int @299
- referrals_free @300
- slapi_isbitset_int @301
- slapi_be_private @302
-; ref_array_moddn @304
- g_set_current_conn_count_mutex @305
- g_get_current_conn_count_mutex @306
- g_get_current_conn_count @307
- g_increment_current_conn_count @308
- g_decrement_current_conn_count @309
- g_set_accesslog_level @310
- slapi_entry_add_rdn_values @311
- slapd_re_init @312
- slapd_re_lock @313
- slapd_re_unlock @314
- escape_string_with_punctuation @315
- getFrontendConfig @316
- log_set_numlogsperdir @317
- log_set_logsize @318
- log_set_rotationtime @319
- log_set_rotationtimeunit @320
- log_set_maxdiskspace @321
- log_set_mindiskspace @322
- log_set_expirationtime @323
- log_set_expirationtimeunit @324
- log_update_accesslogdir @325
- log_update_errorlogdir @326
- dse_remove_callback @327
- log_get_loglist @328
- log_update_auditlogdir @329
- g_get_audit_log @330
- dse_new @331
- dse_deletedse @332
- dse_read_file @333
- slapi_attr_get_bervals_copy @334
- strarray2str @335
- operation_out_of_disk_space @336
- dse_delete @337
- oc_lock_read @338
- oc_lock_write @339
- oc_unlock @340
- slapi_entry_attr_set_long @341
- slapi_entry_attr_delete @342
- slapi_entry_attr_get_charptr @343
- slapi_entry_attr_set_charptr @344
- slapi_entry_attr_get_int @345
- slapi_get_global_syntax_plugins @346
- slapi_get_global_mr_plugins @347
- slapi_new_condvar @348
- slapi_destroy_condvar @349
- slapi_wait_condvar @350
- slapi_notify_condvar @351
- defbackend_init @352
- defbackend_get_backend @353
- log_set_logging @354
- slapi_pwpolicy_make_response_control @355
- delete_passwdPolicy @356
- g_get_user_backend @357
- new_passwdPolicy @358
- slapi_dn_normalize_to_end @359
- slapi_ch_free_string @360
- send_ldap_search_entry_ext @361
- send_ldap_result_ext @362
- slapd_pr_strerror @363
- slapd_system_strerror @364
- cool_charray_free @365
- cool_charray_dup @366
- ldapi_register_extended_op @367
- config_set_attrname_exceptions @368
- g_get_deftime @369
- g_get_defsize @370
- pw_val2scheme @371
- slapi_attr_add_value @372
- be_getconfigdn @373
- be_getmonitordn @374
- be_nbackends_public @375
- entry_add_rdn_csn @376
- slapd_versatile_strerror @377
- config_set_enquote_sup_oc @378
- config_get_enquote_sup_oc @379
- log_access_flush @380
- be_writeconfig @381
- plugin_extended_op_oid2string @382
- slapi_eq_get_arg @383
- g_set_shutdown @384
- g_get_shutdown @385
- compute_init @386
- compute_terminate @387
- slapi_compute_add_evaluator @388
- be_new_internal @389
- slapi_schema_expand_objectclasses @390
- slapi_compute_add_search_rewriter @391
- g_get_global_mrl @392
- g_set_global_mrl @393
- slapi_matchingrule_new @394
- slapi_matchingrule_free @395
- slapi_matchingrule_register @396
- slapi_matchingrule_unregister @397
- slapi_matchingrule_get @398
- slapi_matchingrule_set @399
- config_set_port @400
- slapi_ch_smprintf @401
- config_set_secureport @402
- config_set_SSLclientAuth @403
- config_set_workingdir @404
- config_set_localhost @405
- config_set_listenhost @406
- config_set_securelistenhost @407
- config_set_srvtab @408
- config_set_sizelimit @409
- config_set_pw_storagescheme @410
- slapi_filter_test_ext @411
- config_set_pw_change @412
- config_set_pw_history @413
- config_set_pw_must_change @414
- config_set_pw_syntax @415
- config_set_pw_minlength @416
- config_set_pw_maxfailure @417
- config_set_pw_inhistory @418
- config_set_pw_lockduration @419
- config_set_pw_resetfailurecount @420
- config_set_pw_exp @421
- config_set_pw_unlock @422
- config_set_pw_lockout @423
- config_set_lastmod @424
- config_set_nagle @425
- config_set_accesscontrol @426
- config_set_result_tweak @427
- config_set_pw_gracelimit @428
- config_get_auditlog_logging_enabled @429
- config_set_security @430
- config_set_pwpolicy_local @431
- config_set_readonly @432
- config_set_schemacheck @433
- config_set_rootdn @434
- config_set_rootpw @435
- config_set_rootpwstoragescheme @436
- slapi_build_control @437
- slapi_entry_get_ndn @438
- dse_unset_dont_ever_write_dse_files @439
-; config_set_instancedir @440
- config_set_encryptionalias @441
- config_set_threadnumber @442
- config_set_maxthreadsperconn @443
- slapi_eq_repeat @444
- config_set_reservedescriptors @445
- config_set_ioblocktimeout @446
- config_set_idletimeout @447
- config_set_groupevalnestlevel @448
- config_set_defaultreferral @449
- config_set_userat @450
- config_set_timelimit @451
- config_set_useroc @452
- config_set_accesslog @453
- config_set_errorlog @454
- config_set_auditlog @455
- config_set_pw_maxage @456
- config_set_pw_minage @457
- config_set_pw_warning @458
- config_set_errorlog_level @459
- config_set_accesslog_level @460
- compute_rewrite_search_filter @461
- slapi_entry_get_sdn_const @462
- dse_set_dont_ever_write_dse_files @463
- slapi_eq_once @464
- config_get_port @465
- config_get_pw_is_global_policy @466
- config_get_secureport @467
- config_get_SSLclientAuth @468
- config_get_workingdir @469
- config_get_localhost @470
- config_get_listenhost @471
- config_get_securelistenhost @472
- config_get_srvtab @473
- config_get_sizelimit @474
- config_get_pw_storagescheme @475
- slapi_eq_cancel @476
- config_get_pw_change @477
- config_get_pw_history @478
- config_get_pw_must_change @479
- config_get_pw_syntax @480
- config_get_pw_minlength @481
- config_get_pw_maxfailure @482
- config_get_pw_inhistory @483
- config_get_pw_lockduration @484
- config_get_pw_resetfailurecount @485
- config_get_pw_exp @486
- config_get_pw_unlock @487
- config_get_pw_lockout @488
- config_get_lastmod @489
- config_get_nagle @490
- config_get_accesscontrol @491
- config_get_result_tweak @492
- config_get_conntablesize @493
- config_get_pw_gracelimit @494
- config_get_security @495
- slapi_config_get_readonly @496
- config_get_schemacheck @497
- config_get_rootdn @498
- config_get_rootpw @499
- config_get_rootpwstoragescheme @500
- slapi_entry_set_sdn @501
- slapi_sdn_copy @502
- config_set_basedn @503
-; config_get_instancedir @504
- config_get_encryptionalias @505
- config_get_threadnumber @506
- config_get_maxthreadsperconn @507
- config_get_basedn @508
- config_get_reservedescriptors @509
- config_get_ioblocktimeout @510
- config_get_idletimeout @511
- config_get_groupevalnestlevel @512
- config_get_defaultreferral @513
- config_get_userat @514
- config_get_timelimit @515
- config_get_useroc @516
- config_get_accesslog @517
- config_get_errorlog @518
- config_get_auditlog @519
- config_get_pw_maxage @520
- config_get_pw_minage @521
- config_get_pw_warning @522
- config_get_errorlog_level @523
- config_get_accesslog_level @524
- slapi_sdn_compare @525
- slapi_sdn_dup @526
- slapi_sdn_set_dn_passin @527
- slapi_entry_get_sdn @528
- slapi_sdn_get_ndn_len @529
- charray_inlist @530
- config_set_referral_mode @531
- config_get_referral_mode @532
- config_check_referral_mode @533
- attr_set_deletion_csn @534
- slapi_mod_dump @535
-; config_is_slapd_lite @536
-; config_set_slapd_type @537
- config_get_versionstring @538
- slapi_is_rootdse @539
- slapi_find_matching_paren @540
- str2simple @541
- substr_dn_normalize @542
- get_data_source @543
- slapi_sdn_get_backend_parent @544
- slapi_sdn_new_dn_passin @545
- slapi_sdn_isempty @546
- slapi_sdn_isparent @547
- attr_value_find_wsi @548
- entry_computed_attr_init @549
- slapi_attr_init @550
- slapi_value_init @551
- valueset_isempty @552
- valueset_add_string @553
- attr_done @554
- operation_clear_flag @555
- operation_set_flag @556
- slapi_sdn_get_rdn @557
- slapi_sdn_set_rdn @558
- slapi_sdn_set_parent @559
- slapi_entry_delete_string @560
- attr_get_deletion_csn @561
- entry_add_present_attribute_wsi @562
- slapi_value_get_length @563
- operation_parameters_dup @564
- operation_parameters_free @565
- operation_is_flag_set @566
- counters_as_entry @567
- counters_to_errors_log @568
- counters_as_entry @567
- counters_to_errors_log @568
- slapi_value_new_string @569
- charray_utf8_inlist @570
- charray_get_index @571
-; LDAPU ENTRY POINTS
- ldapu_member_certificate_match @580
-; ref_register_callback @581
-; ref_remove_callback @582
- slapi_is_encoded @583
- slapi_encode @584
-; UniqueID ENTRY POINTS
- slapi_uniqueIDNew @585
- slapi_uniqueIDDestroy @586
- slapi_uniqueIDCompare @587
- slapi_uniqueIDFormat @588
- slapi_uniqueIDScan @589
- slapi_uniqueIDIsUUID @590
- slapi_uniqueIDSize @591
- slapi_uniqueIDDup @592
- uniqueIDGenInit @593
- uniqueIDGenCleanup @594
- slapi_uniqueIDCompareString @595
- slapi_uniqueIDGenerate @596
- slapi_uniqueIDGenerateString @597
- slapi_uniqueIDGenerateFromName @600
- slapi_uniqueIDGenerateFromNameString @601
-; MORE ENTRY ENTRY POINTS
- slapi_entry_get_uniqueid @602
- slapi_entry_set_uniqueid @603
- slapi_entry_merge_values_sv @604
-; Slapi_DN entry points
- slapi_sdn_new @605
- slapi_sdn_init @606
- slapi_sdn_new_dn_byval @607
- slapi_sdn_new_ndn_byval @608
-; slapi_sdn_new_cndn_byval @609
- slapi_sdn_new_dn_byref @610
- slapi_sdn_new_ndn_byref @611
-; slapi_sdn_new_cndn_byref @612
- slapi_sdn_set_dn_byval @613
- slapi_sdn_set_dn_byref @614
- slapi_sdn_set_ndn_byval @615
- slapi_sdn_set_ndn_byref @616
-; slapi_sdn_set_cndn_byval @617
-; slapi_sdn_set_cndn_byref @618
- slapi_sdn_done @619
- slapi_sdn_free @620
- slapi_sdn_get_dn @621
- slapi_sdn_get_ndn @622
-; slapi_sdn_get_cndn @623
- slapi_sdn_get_parent @624
-; Slapi_Mod & Slapi_Mods entry points
- slapi_mods_init @625
- slapi_mods_insert_at @626
- slapi_mods_insert_before @627
- slapi_mods_insert_after @628
- slapi_mods_add @629
- slapi_mods_add_ldapmod @630
- slapi_mods_add_modbvps @631
- slapi_mods_remove @632
- slapi_mods_get_first_mod @633
- slapi_mods_get_next_mod @634
- slapi_mods_iterator_backone @635
- slapi_mods_get_ldapmods_byref @636
- slapi_mods_get_num_mods @637
- slapi_mod_init @638
- slapi_mod_add_value @639
- slapi_mod_remove_value @640
- slapi_mod_get_first_value @641
- slapi_mod_get_next_value @642
- slapi_mod_get_num_values @643
- entry_purge_state_information @644
- attr_set_csn @645
- entry_get_dncsn @646
- entry_get_dncsnset @647
- entry_add_dncsn @648
- value_contains_csn @649
- csnset_get_previous_csn @650
- task_init @651
- attrlist_merge_valuearray @652
- slapi_value_new_value @653
- entry_get_maxcsn @654
- entry_set_maxcsn @655
- entry_assign_operation_csn @656
- slapi_operation_set_csngen_handler @657
- slapi_operation_set_replica_attr_handler @658
- slapi_operation_get_replica_attr @659
- plugin_call_syntax_filter_sub_sv @664
- plugin_call_syntax_filter_ava_sv @665
- slapi_pw_find_sv @666
- csn_new_by_string @667
- csn_set_replicaid @668
- valuearray_get_bervalarray @670
- slapi_call_syntax_values2keys_sv @671
- valuearray_init_bervalarray @672
- slapi_valueset_free @673
- slapi_entry_add_values_sv @674
- entry_set_csn @675
- csn_as_string @676
- entry_attr_find_wsi @678
- csn_get_time @679
- csn_new @680
- csn_set_time @681
- csn_get_seqnum @682
- csn_free @683
- slapi_search_internal_get_entry @684
- csn_compare @685
- csn_set_seqnum @686
- csn_dup @687
- slapi_valueset_first_value @688
- slapi_valueset_next_value @689
- slapi_valueset_done @690
- slapi_utf8StrToLower @691
- slapi_utf8ToLower @692
- slapi_utf8isUpper @693
- slapi_utf8StrToUpper @694
- slapi_utf8ToUpper @695
- slapi_utf8isLower @696
- slapi_utf8casecmp @697
- slapi_utf8ncasecmp @698
- slapi_has8thBit @699
- slapi_sdn_init_dn_byref @700
- slapi_sdn_init_dn_byval @701
- slapi_sdn_init_dn_passin @702
- slapi_attr_first_value @703
- slapi_attr_next_value @704
- slapi_value_get_berval @705
- slapi_attr_get_numvalues @706
- value_get_csn @707
- value_update_csn @708
- slapi_value_set_berval @709
- slapi_mods_init_byref @711
- slapi_mods_init_passin @712
- slapi_value_new @713
- slapi_value_free @714
- value_add_csn @715
- value_remove_csn @716
- slapi_sdn_issuffix @717
- slapi_mods_new @718
- slapi_mods_free @719
- slapi_mods_insert_smod_at @720
- slapi_mods_insert_smod_before @721
- slapi_mods_insert_smod_after @722
- slapi_mods_add_smod @723
- slapi_mods_get_first_smod @724
- slapi_mods_get_next_smod @725
- slapi_mod_new @726
- slapi_mod_init_byref @727
- slapi_mod_init_passin @728
- slapi_value_init_string @729
- slapi_mod_get_ldapmod_passout @730
- slapi_mod_get_type @731
- slapi_mod_get_operation @732
- slapi_mod_set_type @733
- slapi_mod_set_operation @734
- slapi_mod_get_ldapmod_byref @735
- slapi_mod_free @736
- csn_time_difference @737
- slapi_mod_isvalid @738
- slapi_entry_size @739
- attr_first_deleted_value @740
- attr_next_deleted_value @741
- slapi_mods_get_ldapmods_passout @742
- slapi_value_init_berval @743
- entry_add_dncsn_ext @744
- slapi_value_set @745
- operation_get_csn @750
- entry_apply_mods_wsi @751
- slapi_mod_done @752
- slapi_mods_done @753
- operation_set_csn @754
- valueset_add_valuearray @755
- entry_first_deleted_attribute @756
- entry_next_deleted_attribute @757
- valuearray_remove_value @758
-; config_set_storestateinfo @759
- slapi_value_set_string @760
- slapi_is_loglevel_set @761
- operation_set_target_spec @762
- operation_set_target_spec_str @763
- operation_get_target_spec @764
- operation_set_abandoned_op @765
- operation_get_abandoned_op @766
- slapi_value_get_string @767
- slapi_value_get_int @768
- slapi_value_set_int @769
- slapi_add_internal_pb @770
- slapi_add_internal_set_pb @771
- slapi_modify_internal_set_pb @772
- slapi_modify_internal_pb @773
- slapi_modrdn_internal_pb @774
- slapi_rename_internal_set_pb @775
- slapi_delete_internal_set_pb @776
- slapi_delete_internal_pb @777
- slapi_search_internal_pb @778
- slapi_search_internal_set_pb @779
- slapi_search_internal_callback_pb @780
- plugin_build_operation_action_bitmap @781
- plugin_get_server_plg @782
- slapi_add_pwd_control @783
- pw_mod_allowchange_aci @784
- do_add @785
- do_modify @786
- do_delete @787
- do_modrdn @788
- op_shared_search @789
- slapi_mod_init_byval @790
- slapi_add_entry_internal_set_pb @792
- config_set_return_exact_case @793
- slapi_rdn_new @794
- slapi_rdn_new_dn @795
- slapi_rdn_new_sdn @796
- slapi_rdn_new_rdn @797
- slapi_rdn_init @798
- slapi_rdn_init_dn @799
- slapi_rdn_init_sdn @800
- slapi_rdn_init_rdn @801
- slapi_rdn_set_dn @802
- slapi_rdn_set_sdn @803
- slapi_rdn_set_rdn @804
- slapi_rdn_free @805
- slapi_rdn_done @806
- slapi_rdn_get_first @807
- slapi_rdn_get_next @808
- slapi_rdn_get_index @809
- slapi_rdn_contains @810
- slapi_rdn_add @811
- slapi_rdn_remove_index @812
- slapi_rdn_remove @813
- slapi_rdn_isempty @814
- slapi_rdn_get_num_components @815
- slapi_rdn_compare @816
- slapi_rdn_get_rdn @817
- slapi_rdn_get_nrdn @819
- slapi_value_dup @820
- slapi_value_set_value @821
- rel2abspath @822
- slapi_value_compare @823
- attr_get_present_values @824
- dl_get @825
- dl_new @826
- dl_free @827
- dl_init @828
- dl_cleanup @829
- dl_add @830
- dl_get_first @831
- dl_get_next @832
- dl_delete @833
- dl_get_count @834
- slapi_entry2mods @837
- slapi_mods2entry @838
- operation_parameters_new @839
- operation_parameters_done @840
- snmp_as_entry @843
- slapi_filter_compare @844
-; probably temporary:
- set_hash_filters @845
- operation_new @846
- operation_free @847
- operation_set_type @848
- slapi_mods_add_mod_values @849
- slapi_sdn_init_ndn_byref @850
- slapi_sdn_init_ndn_byval @851
- objset_new @852
- objset_delete @853
- objset_add_obj @854
- objset_remove_obj @855
- objset_find @856
- objset_first_obj @857
- objset_next_obj @858
- objset_is_empty @859
- object_new @860
- object_acquire @861
- object_release @862
- object_get_data @863
- slapi_UTF8STRTOLOWER @864
- slapi_UTF8TOLOWER @865
- slapi_UTF8ISUPPER @866
- slapi_UTF8STRTOUPPER @867
- slapi_UTF8TOUPPER @868
- slapi_UTF8ISLOWER @869
- slapi_UTF8CASECMP @870
- slapi_UTF8NCASECMP @871
- slapi_apib_get_interface @872
- slapi_apib_unregister @873
- slapi_apib_register @874
- slapi_attr_types_equivalent @875
- dse_read_next_entry @895
- config_set_entry @896
- config_set @897
- init_schema_dse @898
- PL_HashTableLookup_const @899
-; dse_add_entry_pb @900
- vattr_init @901
- vattr_cleanup @902
- slapi_vattrspi_register @903
- plugin_get_by_name @904
- objset_size @905
- slapi_attr_dup @906
- slapi_entry_add_value @907
- slapi_entry_add_string @908
-; be_create_instance @909
-; be_remove_instance @910
- mapping_tree_init @911
- slapi_mapping_tree_select @912
- slapi_sdn_isgrandparent @913
- config_set_storagescheme @914
- slapi_berval_get_string_copy @918
- slapi_vattr_value_compare @919
- slapi_vattr_value_compare_sp @920
- slapi_vattr_values_get_sp @921
- slapi_vattr_values_get @922
- slapi_vattr_values_free @923
- slapi_vattr_list_attrs @924
- slapi_vattr_attrs_free @925
- slapi_vattrspi_regattr @926
- slapi_be_get_instance_info @927
- slapi_be_set_instance_info @928
- slapi_be_setentrypoint @929
- plugin_get_dn @930
- operation_get_type @931
- slapi_be_set_flag @932
- slapi_be_is_flag_set @933
- free_pw_scheme @934
- slapi_vattrspi_add_type @935
- mapping_tree_free @936
- slapi_get_mapping_tree_node_by_dn @937
- slapi_get_mapping_tree_node_configdn @938
- slapi_valueset_init @939
- slapi_valueset_add_value @940
- slapi_filter_get_attribute_type @941
- slapi_filter_apply @942
- slapi_attr_syntax_normalize @943
- charray_remove @946
-; csn_next_in_sequence @947
- csngen_new @948
- csngen_free @949
- csngen_new_csn @950
- csngen_abort_csn @951
- csngen_adjust_time @952
- csngen_is_local_csn @953
- csngen_register_callbacks @954
- csngen_unregister_callbacks @955
- csngen_update_time @956
- csngen_get_state @957
- csn_init_by_csn @958
- csn_init_by_string @959
- csn_get_replicaid @960
- csn_string_size @961
- csn_as_attr_option_string @962
- slapi_get_mapping_tree_node_root @963
- slapi_get_mapping_tree_config_root @964
- mapping_tree_get_extension_type @965
- slapi_mapping_tree_node_is_set @966
- slapi_entry_flag_is_set @967
- slapi_task_status_changed @968
- slapi_valueset_new @969
- slapi_be_issuffix @970
- slapi_be_addsuffix @971
- slapi_reslimit_register @972
- slapi_reslimit_get_integer_limit @973
- reslimit_cleanup @974
- search_register_reslimits @975
- bind_credentials_set @976
- bind_credentials_clear @977
- pw_add_allowchange_aci @978
- slapi_valueset_add_value_ext @979
- is_abspath @980
- slapi_dup_control @981
- slapi_get_first_suffix @982
- slapi_get_next_suffix @983
- slapi_is_root_suffix @984
- slapi_be_get_name @985
- slapi_entry2str_with_options @986
- slapi_destructive_rename @987
- slapi_moddn_get_newdn @988
- plugin_get_default_component_id @989
- slapi_be_gettype @990
- csnset_get_first_csn @991
- csnset_get_next_csn @992
- value_get_csnset @993
- entry_add_deleted_attribute_wsi @994
- attr_add_deleted_value @995
- slapi_disconnect_server @996
- eq_init @997
- slapi_set_object_extension @998
- task_shutdown @999
- slapi_mtn_set_referral @1000
- slapi_mtn_set_state @1001
- slapi_mtn_get_referral @1002
- slapi_mtn_get_state @1003
- slapi_mtn_be_started @1004
- slapi_mtn_be_stopping @1005
- slapi_start_bulk_import @1006
- slapi_stop_bulk_import @1007
- slapi_import_entry @1008
- slapi_entry_add_valueset @1009
- vattr_typethang_get_flags @1010
- vattr_typethang_get_name @1011
- vattr_typethang_next @1012
- vattr_typethang_first @1013
- charray_subtract @1014
- slapi_schema_list_attribute_names @1015
- config_get_ds4_compatible_schema @1016
- config_set_ds4_compatible_schema @1017
- pw_apply_mods @1018
- pw_set_componentID @1019
- pw_get_componentID @1020
- parse_genTime @1021
- format_genTime @1022
- be_set_sizelimit @1023
- be_set_timelimit @1024
- slapi_be_free @1025
- slapi_be_Unlock @1026
- slapi_task_log_status @1027
- slapi_task_log_notice @1028
- plugin_add_descriptive_attributes @1029
-
- slapi_get_rootdn @1030
- slapi_mtn_be_set_readonly @1031
- slapi_be_set_readonly @1032
- slapi_be_get_readonly @1033
- slapi_op_get_type @1034
- slapi_entry_attr_get_ulong @1035
- slapi_entry_attr_get_uint @1036
- slapi_entry_attr_set_int @1037
- slapi_entry_attr_set_ulong @1038
- slapi_entry_attr_set_uint @1039
- slapi_value_get_ulong @1040
- slapi_value_get_uint @1041
-
- config_set_rewrite_rfc1274 @1042
- config_get_rewrite_rfc1274 @1043
- slapi_mapping_tree_find_backend_for_sdn @1044
- slapi_register_backend_state_change @1045
- slapi_unregister_backend_state_change @1046
-
- slapd_ssl_handshakeCallback @1047
- slapd_ssl_badCertHook @1048
- slapd_ssl_peerCertificate @1049
- slapd_ssl_getChannelInfo @1050
- pblock_done @1051
- pw_rever_decode @1052
- slapd_ssl_listener_is_initialized @1053
- op_shared_log_error_access @1054
- slapd_ssl_importFD @1055
- slapd_ssl_resetHandshake @1056
- slapi_build_control_from_berval @1057
-; MORE ENTRY ENTRY POINTS
- slapi_entry_delete_values_sv @1058
- slapi_entry_attr_replace_sv @1059
-
- valuearray_find @1060
- valuearray_free @1061
- slapd_Client_auth @1062
- slapi_rand_r @1063
- slapi_rand @1064
- slapi_copy @1065
- slapd_get_tmp_dir @1066
- slapi_call_syntax_assertion2keys_ava_sv @1067
- slapi_call_syntax_assertion2keys_sub_sv @1068
- slapi_value_get_long @1069
- valuearray_add_valuearray @1070
- pw_rever_encode @1071
-
- slapd_nss_init @1072
- slapd_pk11_configurePKCS11 @1073
- slapd_pk11_freeSlot @1074
- slapd_pk11_freeSymKey @1075
- slapd_pk11_findSlotByName @1076
- slapd_pk11_createPBEAlgorithmID @1077
- slapd_pk11_pbeKeyGen @1078
- slapd_pk11_algtagToMechanism @1079
- slapd_pk11_paramFromAlgid @1080
- slapd_pk11_mapPBEMechanismToCryptoMechanism @1081
- slapd_pk11_getBlockSize @1082
- slapd_pk11_createContextBySymKey @1083
- slapd_pk11_cipherOp @1084
- slapd_pk11_finalize @1085
- slapd_pk11_getInternalKeySlot @1086
- slapd_pk11_getInternalSlot @1087
- slapd_pk11_authenticate @1088
- slapd_pk11_setSlotPWValues @1089
- slapd_pk11_isFIPS @1090
- slapd_pk11_findCertFromNickname @1091
- slapd_pk11_findKeyByAnyCert @1092
- slapd_pk11_fortezzaHasKEA @1093
- filter_flag_is_set @1094
- slapd_sasl_ext_client_bind @1095
- checkPrefix @1096
- DS_Sleep @1097
- slapi_mtn_get_dn @1098
- dl_add_index @1099
- dl_replace @1100
- send_referrals_from_entry @1101
- slapi_escape_filter_value @1102
- slapd_pk11_destroyContext @1103
- secoid_destroyAlgorithmID @1104
- op_shared_is_allowed_attr @1105
- get_config_DN @1106
- slapi_sdn_init_dn_ndn_byref @1107
- check_log_max_size @1108
- attrlist_find_ex @1109
- slapi_entry_vattrcache_merge_sv @1110
- slapi_entry_vattrcache_find_values_and_type_ex @1111
- slapi_entry_vattrcache_watermark_isvalid @1112
- slapi_entry_vattrcache_watermark_set @1113
- slapi_entry_vattrcache_watermark_invalidate @1114
- slapi_entrycache_vattrcache_watermark_invalidate @1115
- slapi_filter_test_simple @1116
- slapi_register_role_check @1117
- slapi_role_check @1118
- slapi_valueset_find @1119
- slapi_vattr_filter_test @1120
- slapi_attr_set_valueset @1121
- slapi_vattrcache_iscacheable @1122
- slapi_value_new_string_passin @1123
- slapi_value_init_string_passin @1124
- slapi_value_set_string_passin @1125
- slapi_entry_attr_has_syntax_value @1126
- plugin_call_entryfetch_plugins @1127
- plugin_call_entrystore_plugins @1128
- config_get_buildnum @1129
- plugin_print_versions @1130
- slapi_ch_array_free @1131
- slapi_vattrcache_cache_all @1132
- slapi_vattrcache_cache_none @1133
- slapi_filter_dup @1134
- slapi_filter_to_string @1135
- slapi_filter_join_ex @1136
- slapi_vattr_schema_check_type @1137
- slapi_vattr_filter_test_ext @1138
- index_subsys_evaluate_filter @1139
- slapi_index_entry_list_create @1140
- slapi_index_entry_list_add @1141
- slapi_index_register_decoder @1142
- slapi_index_register_index @1143
- slapi_entry_attr_get_charray @1144
- getSupportedCiphers @1145
- slapi_operation_set_flag @1146
- slapi_operation_clear_flag @1147
- slapi_operation_is_flag_set @1148
- slapi_op_reserved @1149
- c_set_shutdown @1150
- c_get_shutdown @1151
- slapi_vattr_namespace_values_get @1152
- slapi_vattr_namespace_value_compare @1153
- slapi_vattr_namespace_values_get_sp @1154
- slapi_vattr_namespace_value_compare_sp @1155
- slapi_vattrspi_register_ex @1156
- slapi_filter_changetype @1157
- slapi_rand_array @1158
- slapi_entries_diff @1159
- dup_global_schema_csn @1160
- slapd_pk11_CERT_DestroyCertificate @1161
- slapd_CERT_ExtractPublicKey @1162
- slapd_pk11_FindPrivateKeyFromCert @1163
- slapd_pk11_GetInternalKeySlot @1164
- slapd_pk11_PubWrapSymKey @1165
- slapd_pk11_KeyGen @1166
- slapd_pk11_FreeSlot @1167
- slapd_pk11_FreeSymKey @1168
- slapd_pk11_DestroyContext @1169
- slapd_pk11_ParamFromIV @1170
- slapd_pk11_PubUnwrapSymKey @1171
- slapd_SECKEY_PublicKeyStrength @1172
- slapd_pk11_Finalize @1173
- slapd_pk11_DigestFinal @1174
- sasl_map_config_add @1175
- sasl_map_config_delete @1176
- sasl_map_domap @1177
- sasl_map_init @1178
- sasl_map_done @1179
- slapd_SECITEM_FreeItem @1180
- slapi_op_type_to_string @1181
- slapi_attr_get_syntax_oid_copy @1182
-; password syntax functions
- config_set_pw_mindigits @1190
- config_set_pw_minalphas @1191
- config_set_pw_minuppers @1192
- config_set_pw_minlowers @1193
- config_set_pw_minspecials @1194
- config_set_pw_min8bit @1195
- config_set_pw_maxrepeats @1196
- config_set_pw_mincategories @1197
- config_set_pw_mintokenlength @1198
- config_get_pw_mindigits @1199
- config_get_pw_minalphas @1200
- config_get_pw_minuppers @1201
- config_get_pw_minlowers @1202
- config_get_pw_minspecials @1203
- config_get_pw_min8bit @1204
- config_get_pw_maxrepeats @1205
- config_get_pw_mincategories @1206
- config_get_pw_mintokenlength @1207
- slapi_check_account_lock @1208
- slapi_is_ldapi_conn @1209
-; slapi connection functions
- slapi_connection_acquire @1211
- slapi_connection_remove_operation @1212
-
diff --git a/ldap/servers/slapd/ntmsgdll/ntslapdmessages.c b/ldap/servers/slapd/ntmsgdll/ntslapdmessages.c
deleted file mode 100644
index 3a3ddc3..0000000
--- a/ldap/servers/slapd/ntmsgdll/ntslapdmessages.c
+++ /dev/null
@@ -1,53 +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 **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-
-/* This is the required stub entry point for the message-table DLL */
-#if defined( _WIN32 )
-#include <windows.h>
-
-BOOL WINAPI DllMain(HINSTANCE hDLL, DWORD dwReason, LPVOID lpReserved)
-{
- return(TRUE);
-}
-
-#endif /* _WIN32 */
diff --git a/ldap/servers/slapd/ntmsgdll/ntslapdmessages.mc b/ldap/servers/slapd/ntmsgdll/ntslapdmessages.mc
deleted file mode 100644
index 7f5c2d6..0000000
--- a/ldap/servers/slapd/ntmsgdll/ntslapdmessages.mc
+++ /dev/null
@@ -1,315 +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
-;
-; Microsoft Developer Support
-; Copyright (c) 1992 Microsoft Corporation
-;
-; This file contains the message definitions for the Win32
-; messages.exe sample program.
-
-
-;-------------------------------------------------------------------------
-; HEADER SECTION
-;
-; The header section defines names and language identifiers for use
-; by the message definitions later in this file. The MessageIdTypedef,
-; SeverityNames, FacilityNames, and LanguageNames keywords are
-; optional and not required.
-;
-;
-;
-; The MessageIdTypedef keyword gives a typedef name that is used in a
-; type cast for each message code in the generated include file. Each
-; message code appears in the include file with the format: #define
-; name ((type) 0xnnnnnnnn) The default value for type is empty, and no
-; type cast is generated. It is the programmer's responsibility to
-; specify a typedef statement in the application source code to define
-; the type. The type used in the typedef must be large enough to
-; accomodate the entire 32-bit message code.
-;
-MessageIdTypedef=DWORD
-;
-; The SeverityNames keyword defines the set of names that are allowed
-; as the value of the Severity keyword in the message definition. The
-; set is delimited by left and right parentheses. Associated with each
-; severity name is a number that, when shifted left by 30, gives the
-; bit pattern to logical-OR with the Facility value and MessageId
-; value to form the full 32-bit message code. The default value of
-; this keyword is:
-;
-; SeverityNames=(
-; Success=0x0
-; Informational=0x1
-; Warning=0x2
-; Error=0x3
-; )
-;
-; Severity values occupy the high two bits of a 32-bit message code.
-; Any severity value that does not fit in two bits is an error. The
-; severity codes can be given symbolic names by following each value
-; with :name
-;
-SeverityNames=(Success=0x0:STATUS_SEVERITY_SUCCESS
- Informational=0x1:STATUS_SEVERITY_INFORMATIONAL
- Warning=0x2:STATUS_SEVERITY_WARNING
- Error=0x3:STATUS_SEVERITY_ERROR
- )
-;
-; The FacilityNames keyword defines the set of names that are allowed
-; as the value of the Facility keyword in the message definition. The
-; set is delimited by left and right parentheses. Associated with each
-; facility name is a number that, when shift it left by 16 bits, gives
-; the bit pattern to logical-OR with the Severity value and MessageId
-; value to form the full 32-bit message code. The default value of
-; this keyword is:
-;
-; FacilityNames=(
-; System=0x0FF
-; Application=0xFFF
-; )
-;
-; Facility codes occupy the low order 12 bits of the high order
-; 16-bits of a 32-bit message code. Any facility code that does not
-; fit in 12 bits is an error. This allows for 4,096 facility codes.
-; The first 256 codes are reserved for use by the system software. The
-; facility codes can be given symbolic names by following each value
-; with :name
-;
-FacilityNames=(System=0x0FF:FACILITY_SYSTEM
- Runtime=0x200:FACILITY_RUNTIME
- Cgi=0x201:FACILITY_CGI
- Slapd=0x202:FACILITY_SERVICE
- Network=0x203:FACILITY_NETWORK
- Startup=0x204:FACILITY_STARTUP
- Filesytem=0x205:FACILITY_FILESYSTEM
- Registry=0x206:FACILITY_REGISTRY
- )
-;
-; The LanguageNames keyword defines the set of names that are allowed
-; as the value of the Language keyword in the message definition. The
-; set is delimited by left and right parentheses. Associated with each
-; language name is a number and a file name that are used to name the
-; generated resource file that contains the messages for that
-; language. The number corresponds to the language identifier to use
-; in the resource table. The number is separated from the file name
-; with a colon. The initial value of LanguageNames is:
-;
-; LanguageNames=(English=1:MSG00001)
-;
-; Any new names in the source file which don't override the built-in
-; names are added to the list of valid languages. This allows an
-; application to support private languages with descriptive names.
-;
-;
-;-------------------------------------------------------------------------
-; MESSAGE DEFINITION SECTION
-;
-; Following the header section is the body of the Message Compiler
-; source file. The body consists of zero or more message definitions.
-; Each message definition begins with one or more of the following
-; statements:
-;
-; MessageId = [number|+number]
-; Severity = severity_name
-; Facility = facility_name
-; SymbolicName = name
-;
-; The MessageId statement marks the beginning of the message
-; definition. A MessageID statement is required for each message,
-; although the value is optional. If no value is specified, the value
-; used is the previous value for the facility plus one. If the value
-; is specified as +number then the value used is the previous value
-; for the facility, plus the number after the plus sign. Otherwise, if
-; a numeric value is given, that value is used. Any MessageId value
-; that does not fit in 16 bits is an error.
-;
-; The Severity and Facility statements are optional. These statements
-; specify additional bits to OR into the final 32-bit message code. If
-; not specified they default to the value last specified for a message
-; definition. The initial values prior to processing the first message
-; definition are:
-;
-; Severity=Success
-; Facility=Application
-;
-; The value associated with Severity and Facility must match one of
-; the names given in the FacilityNames and SeverityNames statements in
-; the header section. The SymbolicName statement allows you to
-; associate a C/C++ symbolic constant with the final 32-bit message
-; code.
-; */
-
-MessageId=0x1
-Severity=Success
-Facility=Startup
-SymbolicName=MSG_SERVER_STARTED
-Language=English
-Directory Server: %1.
-The directory server has successfully started.
-.
-MessageId=0x2
-Severity=Success
-Facility=Slapd
-SymbolicName=MSG_SERVER_SHUTDOWN
-Language=English
-Directory Server: %1.
-The directory server has shutdown.
-.
-MessageId=0x3
-Severity=Success
-Facility=Slapd
-SymbolicName=MSG_SERVER_STOPPED
-Language=English
-Directory Server: %1.
-The directory server has stopped.
-.
-MessageId=0x4
-Severity=Success
-Facility=Startup
-SymbolicName=MSG_SERVER_STARTING
-Language=English
-Directory Server: %1.
-The directory server is starting.
-.
-MessageId=0x5
-Severity=Error
-Facility=Startup
-SymbolicName=MSG_SERVER_START_FAILED
-Language=English
-Directory Server: %1.
-The directory server has failed on startup. %2
-.
-MessageId=0x6
-Severity=Error
-Facility=Startup
-SymbolicName=MSG_SERVER_START_FAILED_CTRL_HANDLER
-Language=English
-Directory Server: %1.
-The directory server has failed on startup. Failed to Register with Service Control handler.
-.
-MessageId=0x7
-Severity=Error
-Facility=Startup
-SymbolicName=MSG_SERVER_PASSWORD_DIALOG_FAILED
-Language=English
-Directory Server: %1.
-The directory server failed to create the Key Database Passphrase dialog.
-.
-MessageId=0x8
-Severity=Error
-Facility=Registry
-SymbolicName=MSG_WD_REGISTRY
-Language=English
-Directory Server: %1.
-Could not open registry key: %2
-.
-MessageId=0x9
-Severity=Error
-Facility=Startup
-SymbolicName=MSG_WD_BADCMDLINE
-Language=English
-Directory Server: %1
-Invalid command line specified: %2
-.
-MessageId=0xA
-Severity=Error
-Facility=Startup
-SymbolicName=MSG_WD_BADPASSWORD
-Language=English
-Directory Server: %1.
-Incorrect SSL password entered.
-.
-MessageId=0xB
-Severity=Error
-Facility=Startup
-SymbolicName=MSG_WD_STRING
-Language=English
-Directory Server: %1.
-%2
-.
-MessageId=0xC
-Severity=Error
-Facility=Startup
-SymbolicName=MSG_WD_STARTFAILED
-Language=English
-Directory Server: %1.
-The directory server could not be started.
-Command line used: %2
-.
-MessageId=0xD
-Severity=Error
-Facility=Startup
-SymbolicName=MSG_WD_RESTART
-Language=English
-Directory Server: %1.
-The directory server terminated abnormally with error code %2.
-An attempt will be made to restart it.
-.
-MessageId=0xE
-Severity=Error
-Facility=Startup
-SymbolicName=MSG_CRON_STARTFAILED
-Language=English
-Directory Server: %1.
-The scheduled job (%2) could not be started.
-.
-MessageId=0xF
-Severity=Error
-Facility=Slapd
-SymbolicName=MSG_SERVER_SHUTDOWN_STARTING
-Language=English
-Directory Server: %1.
-The directory server is shutting down.
-.
-MessageId=0x10
-Severity=Error
-Facility=Startup
-SymbolicName=MSG_SERVER_KEYDB_PASSPHRASE_WRONG
-Language=English
-Directory Server: %1.
-The specified key database passphrase is incorrect.
-.
-MessageId=0x11
-Severity=Error
-Facility=Slapd
-SymbolicName=MSG_SERVER_FAILED_TO_WRITE_LOG
-Language=English
-Directory Server: %1.
-Failed to write log: %2.
-.
diff --git a/ldap/servers/slapd/ntperfdll/exports.def b/ldap/servers/slapd/ntperfdll/exports.def
deleted file mode 100644
index 2a20e0a..0000000
--- a/ldap/servers/slapd/ntperfdll/exports.def
+++ /dev/null
@@ -1,41 +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
-;
-EXPORTS OpenNSPerformanceData
-EXPORTS CollectNSPerformanceData
-EXPORTS CloseNSPerformanceData
diff --git a/ldap/servers/slapd/ntperfdll/nsldapctr.cpp b/ldap/servers/slapd/ntperfdll/nsldapctr.cpp
deleted file mode 100644
index 8477ac4..0000000
--- a/ldap/servers/slapd/ntperfdll/nsldapctr.cpp
+++ /dev/null
@@ -1,1054 +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 **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/*
- nsctr.c
-
- Netscape server performance monitor hooks.
-
-
- ***********************************************************************
- HOW TO ADD A NEW PERFMON STATISTIC
- 1. add to StatSlot or StatHeader struct
- 2. add new counter definition to NS_DATA_DEFINITION in nsctrs.h
- 3. define the offset of your new counter in nsctrdef.h
- 4. add your counter initialization to NSDataDefinition in nsctr.cpp
- 5. update CollectNSPerformanceData to collect your data
- 6. modify nsctrs.ini to contain the text info for your counter
- these are keyed off the "tag" you used in step 3
- ***********************************************************************
- HOW TO UPDATE THE REGISTRY
- 1. run regini nsreg.ini
- 2. run lodctr nsctrs.ini
- ***********************************************************************
- */
-
-#define UNICODE
-
-#include <windows.h>
-#include <string.h>
-#include <winperf.h>
-#include <stdio.h>
-#include <regstr.h>
-#include "nsldapctrs.h"
-#include "nsldapctrmsg.h"
-#include "nsldapctrutil.h"
-#include "nsldapctrmc.h"
-#include "nsldapctrdef.h"
-
-#include "nt/regparms.h"
-
-#include "../agtmmap.h"
-
-#define NUM_INSTANCES 0
-#define MAGT_MAX_LINELEN 255
-
-
-/* --- Constant Performance Counter Declaration --------------------------------------------*/
-
-NS_DATA_DEFINITION NSDataDefinition = {
-
- { sizeof(NS_DATA_DEFINITION) + SIZE_OF_NS_PERFORMANCE_DATA,
- sizeof(NS_DATA_DEFINITION),
- sizeof(PERF_OBJECT_TYPE),
- NS_OBJ,
- 0,
- NS_OBJ,
- 0,
- PERF_DETAIL_NOVICE,
- (sizeof(NS_DATA_DEFINITION)-sizeof(PERF_OBJECT_TYPE))/
- sizeof(PERF_COUNTER_DEFINITION),
- 4L,
- NUM_INSTANCES,
- 0,
- 0,
- 0
- },
- {
- sizeof(PERF_COUNTER_DEFINITION),
- CONN_RATE,
- 0,
- CONN_RATE,
- 0,
- 0,
- PERF_DETAIL_NOVICE,
- PERF_COUNTER_COUNTER,
- sizeof(DWORD),
- NUM_CONN_RATE_OFFSET
- },
- {
- sizeof(PERF_COUNTER_DEFINITION),
- THROUGHPUT,
- 0,
- THROUGHPUT,
- 0,
- -3,
- PERF_DETAIL_NOVICE,
- PERF_COUNTER_COUNTER,
- sizeof(DWORD),
- NUM_THROUGHPUT_OFFSET
- },
- {
- sizeof(PERF_COUNTER_DEFINITION),
- TOTAL_BYTES_WRITTEN,
- 0,
- TOTAL_BYTES_WRITTEN,
- 0,
- -3,
- PERF_DETAIL_NOVICE,
- PERF_COUNTER_RAWCOUNT,
- sizeof(DWORD),
- NUM_TOTAL_BYTES_WRITTEN_OFFSET
- },
- {
- sizeof(PERF_COUNTER_DEFINITION),
- TOTAL_BYTES_READ,
- 0,
- TOTAL_BYTES_READ,
- 0,
- -3,
- PERF_DETAIL_NOVICE,
- PERF_COUNTER_RAWCOUNT,
- sizeof(DWORD),
- NUM_TOTAL_BYTES_READ_OFFSET
- },
- {
- sizeof(PERF_COUNTER_DEFINITION),
- OP_RATE,
- 0,
- OP_RATE,
- 0,
- -1,
- PERF_DETAIL_NOVICE,
- PERF_COUNTER_COUNTER,
- sizeof(DWORD),
- NUM_OP_RATE_OFFSET
- },
- {
- sizeof(PERF_COUNTER_DEFINITION),
- TOTAL_ERRORS,
- 0,
- TOTAL_ERRORS,
- 0,
- 0,
- PERF_DETAIL_NOVICE,
- PERF_COUNTER_RAWCOUNT,
- sizeof(DWORD),
- NUM_TOTAL_ERRORS_OFFSET
- },
- {
- sizeof(PERF_COUNTER_DEFINITION),
- SEARCH_RATE,
- 0,
- SEARCH_RATE,
- 0,
- -1,
- PERF_DETAIL_NOVICE,
- PERF_COUNTER_COUNTER,
- sizeof(DWORD),
- NUM_SEARCH_RATE_OFFSET
- } ,
- {
- sizeof(PERF_COUNTER_DEFINITION),
- ADD_RATE,
- 0,
- ADD_RATE,
- 0,
- 0,
- PERF_DETAIL_NOVICE,
- PERF_COUNTER_COUNTER,
- sizeof(DWORD),
- ADD_RATE_OFFSET
- },
- {
- sizeof(PERF_COUNTER_DEFINITION),
- DELETE_RATE,
- 0,
- DELETE_RATE,
- 0,
- 0,
- PERF_DETAIL_NOVICE,
- PERF_COUNTER_COUNTER,
- sizeof(DWORD),
- DELETE_RATE_OFFSET
- },
- {
- sizeof(PERF_COUNTER_DEFINITION),
- MODIFY_RATE,
- 0,
- MODIFY_RATE,
- 0,
- 0,
- PERF_DETAIL_NOVICE,
- PERF_COUNTER_COUNTER,
- sizeof(DWORD),
- MODIFY_RATE_OFFSET
- },
- {
- sizeof(PERF_COUNTER_DEFINITION),
- COMPARE_RATE,
- 0,
- COMPARE_RATE,
- 0,
- -1,
- PERF_DETAIL_NOVICE,
- PERF_COUNTER_COUNTER,
- sizeof(DWORD),
- COMPARE_RATE_OFFSET
- },
- {
- sizeof(PERF_COUNTER_DEFINITION),
- MODDN_RATE,
- 0,
- MODDN_RATE,
- 0,
- 0,
- PERF_DETAIL_NOVICE,
- PERF_COUNTER_COUNTER,
- sizeof(DWORD),
- MODDN_RATE_OFFSET
- },
- {
- sizeof(PERF_COUNTER_DEFINITION),
- CONNECTIONS,
- 0,
- CONNECTIONS,
- 0,
- 0,
- PERF_DETAIL_NOVICE,
- PERF_COUNTER_RAWCOUNT,
- sizeof(DWORD),
- CONNECTIONS_OFFSET
- },
- {
- sizeof(PERF_COUNTER_DEFINITION),
- CONNECTIONSMAXTHREADS,
- 0,
- CONNECTIONSMAXTHREADS,
- 0,
- 0,
- PERF_DETAIL_NOVICE,
- PERF_COUNTER_RAWCOUNT,
- sizeof(DWORD),
- CONNECTIONSMAXTHREADS_OFFSET
- },
- {
- sizeof(PERF_COUNTER_DEFINITION),
- CONNECTIONSHITMAXTHREADS,
- 0,
- CONNECTIONSHITMAXTHREADS,
- 0,
- 0,
- PERF_DETAIL_NOVICE,
- PERF_COUNTER_RAWCOUNT,
- sizeof(DWORD),
- CONNECTIONSHITMAXTHREADS_OFFSET
- },
- {
- sizeof(PERF_COUNTER_DEFINITION),
- BIND_RATE,
- 0,
- BIND_RATE,
- 0,
- -1,
- PERF_DETAIL_NOVICE,
- PERF_COUNTER_COUNTER,
- sizeof(DWORD),
- BIND_RATE_OFFSET
- },
- {
- sizeof(PERF_COUNTER_DEFINITION),
- ENTRIES_RETURNED,
- 0,
- ENTRIES_RETURNED,
- 0,
- 0,
- PERF_DETAIL_NOVICE,
- PERF_COUNTER_RAWCOUNT,
- sizeof(DWORD),
- ENTRIES_RETURNED_OFFSET
- },
- {
- sizeof(PERF_COUNTER_DEFINITION),
- ENTRIES_RETURNED_RATE,
- 0,
- ENTRIES_RETURNED_RATE,
- 0,
- -1,
- PERF_DETAIL_NOVICE,
- PERF_COUNTER_COUNTER,
- sizeof(DWORD),
- ENTRIES_RETURNED_RATE_OFFSET
- },
- {
- sizeof(PERF_COUNTER_DEFINITION),
- REFERRALS_RETURNED,
- 0,
- REFERRALS_RETURNED,
- 0,
- 0,
- PERF_DETAIL_NOVICE,
- PERF_COUNTER_RAWCOUNT,
- sizeof(DWORD),
- REFERRALS_RETURNED_OFFSET
- },
- {
- sizeof(PERF_COUNTER_DEFINITION),
- REFERRALS_RETURNED_RATE,
- 0,
- REFERRALS_RETURNED_RATE,
- 0,
- -1,
- PERF_DETAIL_NOVICE,
- PERF_COUNTER_COUNTER,
- sizeof(DWORD),
- REFERRALS_RETURNED_RATE_OFFSET
- },
- {
- sizeof(PERF_COUNTER_DEFINITION),
- BYTES_READ_RATE,
- 0,
- BYTES_READ_RATE,
- 0,
- -3,
- PERF_DETAIL_NOVICE,
- PERF_COUNTER_COUNTER,
- sizeof(DWORD),
- BYTES_READ_RATE_OFFSET
- },
- {
- sizeof(PERF_COUNTER_DEFINITION),
- BYTES_WRITTEN_RATE,
- 0,
- BYTES_WRITTEN_RATE,
- 0,
- -3,
- PERF_DETAIL_NOVICE,
- PERF_COUNTER_COUNTER,
- sizeof(DWORD),
- BYTES_WRITTEN_RATE_OFFSET
- }
-
-
-};
-
-/* --- Data structs ----------------------------------------------------------------------- */
-typedef struct instance_list_t {
- PERF_INSTANCE_DEFINITION instance;
- PWSTR pInstanceName;
- PWSTR pConfPath;
- agt_stats_t * pData;
- struct instance_list_t * pNext;
-} instance_list_t;
-
-
-/* --- Globals ---------------------------------------------------------------------------- */
-static BOOL bInitialized = FALSE;
-static DWORD dwOpenCount = 0; /* Count of threads holding DLL open */
-static DWORD dwInstanceCount = 0;
-static instance_list_t *pInstanceList = NULL;
-
-#define export extern "C"
-
-
-/*-------------------------------------------------------------------------
- *
- * MagtReadLine: Reads one line of text (up to n chars) from specified
- * file.
- *
- * Returns: Len read - No error
- * -1 - Errors
- *
- *-----------------------------------------------------------------------*/
-
-int MagtReadLine(char *buf, int n, FILE *fp)
-{
- if (fgets(buf, n, fp) != NULL)
- {
- return(strlen(buf));
- }
- else
- {
- return(-1);
- }
-}
-
-
-
-/* --- strips quotes off of a quoted string -------------------------------------- */
-
-
-char *dequote(char *quoted_string)
-{
- char *return_string = (char *)malloc((strlen(quoted_string) - 2) * sizeof(char) );
- char *pQuo = quoted_string;
- char *pRet = return_string;
-
- for(; *pQuo; pQuo++) {
- if (*pQuo != '\"')
- *(pRet++) = *pQuo;
- }
- *pRet = '\0';
-
- return return_string;
-
-}
-
-/* --- gets the instance dir from conf file ------------------------------------- */
-
-
-/*
- * The body of this function is pretty much copied from
- * ldapserver/ldap/servers/snmp/ntagt/nsldapagt_nt.c
- *
- */
-char *getRootDirFromConfFile(PWSTR confpath)
-{
- char *rootDir = NULL;
- const char *config = "\\config\0" ;
- char instanceDir[MAGT_MAX_LINELEN + 1] = "";
- size_t len ;
- char filename[256];
-
- if (confpath) {
- sprintf(filename, "%S", confpath);
- len = strlen(filename) - strlen(config) ;
- strncpy(instanceDir, filename, len);
- rootDir = _strdup(instanceDir) ; // allocate memory for rootDir and set up to value pointed by instanceDir
- return rootDir ;
- }
- else return NULL ;
-}
-
-static DWORD MapSharedMem(char* path, agt_stats_t **ptr)
-{
- HANDLE hFile = NULL;
- HANDLE hMapFile = NULL;
- LPVOID memory = NULL;
-
- *ptr = NULL;
- /* Open existing disk file for read */
- hFile = CreateFileA(path,
- GENERIC_READ | GENERIC_WRITE,
- FILE_SHARE_READ | FILE_SHARE_WRITE,
- NULL,
- OPEN_EXISTING,
- FILE_ATTRIBUTE_NORMAL,
- NULL);
-
- if ( hFile == INVALID_HANDLE_VALUE || hFile == NULL ) return GetLastError();
-
- /* Create mapped file handle for reading */
- hMapFile = CreateFileMapping( hFile, NULL, PAGE_READONLY, 0,
- sizeof(struct agt_stats_t),
- NULL);
- if ( hMapFile == NULL ) {
- CloseHandle( hFile );
- return GetLastError();
- }
-
- /* Create addr ptr to the start of the file */
- memory = MapViewOfFileEx( hMapFile, FILE_MAP_READ, 0, 0,
- sizeof(struct agt_stats_t), NULL );
- CloseHandle( hMapFile );
- CloseHandle( hFile );
- if ( memory == NULL ) {
- return GetLastError();
- }
- *ptr = (agt_stats_t *)memory;
- return 0;
-}
-
-static DWORD UnmapSharedMem(agt_stats_t **ptr)
-{
- return UnmapViewOfFile( (LPVOID)*ptr) ? 0 : -1;
-}
-
-/* --- Open Function --------------------------------------------------------------------- */
-
-
-/* _FindNetscapeServers()
- * Function to loop through registry looking for netscape servers
- * Stores them into pInstanceList as it finds them.
- */
-
-#define MAX_KEY_SIZE 128
-DWORD
-_FindNetscapeServers()
-{
- LONG regStatus,
- status;
- HKEY hKeyNetscape = NULL,
- hKeyNetscapeConf;
- DWORD dwKey,
- type,
- dwServerKeySize,
- size,
- dwServerCount = 0;
- WCHAR szServerKeyName[MAX_KEY_SIZE],
- szConfKeyName[MAX_KEY_SIZE + sizeof(KEY_SOFTWARE_NETSCAPE)],
- szPath[MAX_KEY_SIZE];
- FILETIME fileTime;
- instance_list_t *pNew;
- DWORD iUniqueID = 0;
-
- regStatus = RegOpenKeyEx(
- HKEY_LOCAL_MACHINE,
- TEXT(KEY_SOFTWARE_NETSCAPE) TEXT("\\") TEXT(DS_KEY_ROOT),
- 0L,
- KEY_ALL_ACCESS,
- &hKeyNetscape);
-
- if (regStatus != ERROR_SUCCESS) {
- goto ExitPoint;
- }
-
- dwKey = 0;
- do {
- dwServerKeySize = MAX_KEY_SIZE;
- regStatus = RegEnumKeyEx(
- hKeyNetscape,
- dwKey,
- szServerKeyName,
- &dwServerKeySize,
- NULL,
- 0,
- 0,
- &fileTime);
- dwKey++;
-
- if (regStatus == ERROR_SUCCESS) {
-
- regStatus = RegOpenKeyEx(
- hKeyNetscape,
- szServerKeyName,
- 0L,
- KEY_ALL_ACCESS,
- &hKeyNetscapeConf);
-
- if (regStatus != ERROR_SUCCESS) {
- continue;
- }
-
- /* Now look for "ConfigurationPath" to find 3.0 netscape servers */
- size = MAX_KEY_SIZE;
- status = RegQueryValueEx(
- hKeyNetscapeConf,
- TEXT(VALUE_CONFIG_PATH),
- 0L,
- &type,
- (LPBYTE)szPath,
- &size);
- if ( status == ERROR_SUCCESS ) {
- /* this is a netscape server */
- if ( (pNew = (instance_list_t *)malloc(sizeof(instance_list_t))) == NULL) {
- status = (unsigned long)-1;
- RegCloseKey(hKeyNetscapeConf);
- goto ExitPoint;
- }
- if ( (pNew->pInstanceName = (PWCH)malloc(sizeof(WCHAR) *(dwServerKeySize+1))) == NULL) {
- status = (unsigned long)-1;
- RegCloseKey(hKeyNetscapeConf);
- goto ExitPoint;
- }
-
- if ( (pNew->pConfPath = (PWCH)malloc(sizeof(WCHAR) *(size+1))) == NULL) {
- status = (unsigned long)-1;
- RegCloseKey(hKeyNetscapeConf);
- goto ExitPoint;
- }
-
-
- pNew->pData = NULL;
-
- pNew->instance.ParentObjectTitleIndex = 0;
- pNew->instance.ParentObjectInstance = 0;
- pNew->instance.UniqueID = -1;
- pNew->instance.NameOffset = sizeof(PERF_INSTANCE_DEFINITION);
- lstrcpy(pNew->pInstanceName, szServerKeyName);
- lstrcpy(pNew->pConfPath, szPath);
-
- pNew->instance.NameLength = (dwServerKeySize+1) * sizeof(WCHAR);
- pNew->instance.ByteLength = sizeof(PERF_INSTANCE_DEFINITION) +
- (((pNew->instance.NameLength + sizeof(DWORD)-1)/sizeof(DWORD))*sizeof(DWORD));
- pNew->instance.UniqueID = iUniqueID++;
-
- pNew->pNext = pInstanceList;
- pInstanceList = pNew;
-
- dwServerCount++;
- }
-
- RegCloseKey(hKeyNetscapeConf);
- }
-
- } while ( regStatus != ERROR_NO_MORE_ITEMS );
-
-ExitPoint:
- if (hKeyNetscape)
- RegCloseKey (hKeyNetscape);
-
- return dwServerCount;
-}
-
-/* _OpenNetscapeServers()
- * Once the pInstanceList has been created, this routine will open the instances
- * of the netscape servers;
- */
-#define MAX_FILE_LEN 128
-DWORD
-_OpenNetscapeServers()
-{
- LONG status;
- DWORD dwServerCount = 0;
- instance_list_t *pInstance;
- char *szRootDir;
- char tmpstatsfile[MAX_FILE_LEN];
- int err;
-
- for (pInstance = pInstanceList; pInstance; pInstance = pInstance->pNext) {
-
- /* open the memory map */
-
- /*
- * Get directory for our stats file
- */
-
- szRootDir = getRootDirFromConfFile(pInstance->pConfPath);
- if( szRootDir == NULL){
- status = GetLastError();
- continue ;
- }
- wsprintfA(tmpstatsfile, "%s/logs/%s", szRootDir, AGT_STATS_FILE);
- err = MapSharedMem(tmpstatsfile,&pInstance->pData);
- if ( 0 != err ) {
- REPORT_ERROR (NSPERF_UNABLE_MAP_VIEW_OF_FILE, LOG_USER);
- status = GetLastError(); // return error
- continue;
- } else {
- dwServerCount++;
- }
-
- if(szRootDir != NULL){
- free(szRootDir);
- }
-
- }
-
- return dwServerCount;
-}
-
-export DWORD APIENTRY
-OpenNSPerformanceData(LPWSTR lpDeviceNames)
-{
- LONG status;
- TCHAR szMappedObject[] = TEXT(SVR_ID_SERVICE) TEXT("Statistics");
- HKEY hKeyDriverPerf;
- DWORD size;
- DWORD type;
- DWORD dwFirstCounter;
- DWORD dwFirstHelp;
-
- if (!dwOpenCount) {
-
- hEventLog = MonOpenEventLog();
-
-
- if ( !_FindNetscapeServers() ) {
- /* No netscape servers found */
- status = (unsigned long)-1;
- goto OpenExitPoint;
- }
-
- if ( !(dwInstanceCount = _OpenNetscapeServers()) ) {
- /* No netscape servers are active */
- status = (unsigned long)-1;
- goto OpenExitPoint;
- }
-
- /* Now load help keys from registry */
-
- status = RegOpenKeyEx (
- HKEY_LOCAL_MACHINE,
- TEXT("System\\CurrentControlSet\\Services") TEXT("\\") TEXT(SVR_ID_SERVICE) TEXT(SVR_VERSION) TEXT("\\") TEXT(KEY_PERFORMANCE),
- 0L,
- KEY_ALL_ACCESS,
- &hKeyDriverPerf);
-
- if (status != ERROR_SUCCESS) {
- REPORT_ERROR_DATA (NSPERF_UNABLE_OPEN_DRIVER_KEY, LOG_USER,
- &status, sizeof(status));
- goto OpenExitPoint;
- }
-
- size = sizeof (DWORD);
- status = RegQueryValueEx(
- hKeyDriverPerf,
- TEXT("First Counter"),
- 0L,
- &type,
- (LPBYTE)&dwFirstCounter,
- &size);
-
- if (status != ERROR_SUCCESS) {
- REPORT_ERROR_DATA (NSPERF_UNABLE_READ_FIRST_COUNTER, LOG_USER,
- &status, sizeof(status));
- goto OpenExitPoint;
- }
-
- size = sizeof (DWORD);
- status = RegQueryValueEx(
- hKeyDriverPerf,
- TEXT("First Help"),
- 0L,
- &type,
- (LPBYTE)&dwFirstHelp,
- &size);
-
- if (status != ERROR_SUCCESS) {
- REPORT_ERROR_DATA (NSPERF_UNABLE_READ_FIRST_HELP, LOG_USER,
- &status, sizeof(status));
- goto OpenExitPoint;
- }
-
- NSDataDefinition.NS_ObjectType.ObjectNameTitleIndex += dwFirstCounter;
- NSDataDefinition.NS_ObjectType.ObjectHelpTitleIndex += dwFirstHelp;
-
- NSDataDefinition.connection_rate.CounterNameTitleIndex += dwFirstCounter;
- NSDataDefinition.connection_rate.CounterHelpTitleIndex += dwFirstHelp;
- NSDataDefinition.throughput.CounterNameTitleIndex += dwFirstCounter;
- NSDataDefinition.throughput.CounterHelpTitleIndex += dwFirstHelp;
- NSDataDefinition.total_bytes_written.CounterNameTitleIndex += dwFirstCounter;
- NSDataDefinition.total_bytes_written.CounterHelpTitleIndex += dwFirstHelp;
- NSDataDefinition.total_bytes_read.CounterNameTitleIndex += dwFirstCounter;
- NSDataDefinition.total_bytes_read.CounterHelpTitleIndex += dwFirstHelp;
- NSDataDefinition.operation_rate.CounterNameTitleIndex += dwFirstCounter;
- NSDataDefinition.operation_rate.CounterHelpTitleIndex += dwFirstHelp;
- NSDataDefinition.total_errors.CounterNameTitleIndex += dwFirstCounter;
- NSDataDefinition.total_errors.CounterHelpTitleIndex += dwFirstHelp;
- NSDataDefinition.search_rate.CounterNameTitleIndex += dwFirstCounter;
- NSDataDefinition.search_rate.CounterHelpTitleIndex += dwFirstHelp;
- NSDataDefinition.add_rate.CounterNameTitleIndex += dwFirstCounter;
- NSDataDefinition.add_rate.CounterHelpTitleIndex += dwFirstHelp;
- NSDataDefinition.delete_rate.CounterNameTitleIndex += dwFirstCounter;
- NSDataDefinition.delete_rate.CounterHelpTitleIndex += dwFirstHelp;
- NSDataDefinition.modify_rate.CounterNameTitleIndex += dwFirstCounter;
- NSDataDefinition.modify_rate.CounterHelpTitleIndex += dwFirstHelp;
- NSDataDefinition.compare_rate.CounterNameTitleIndex += dwFirstCounter;
- NSDataDefinition.compare_rate.CounterHelpTitleIndex += dwFirstHelp;
- NSDataDefinition.moddn_rate.CounterNameTitleIndex += dwFirstCounter;
- NSDataDefinition.moddn_rate.CounterHelpTitleIndex += dwFirstHelp;
- NSDataDefinition.connections.CounterNameTitleIndex += dwFirstCounter;
- NSDataDefinition.connections.CounterHelpTitleIndex += dwFirstHelp;
- NSDataDefinition.connectionsmaxthreads.CounterNameTitleIndex += dwFirstCounter;
- NSDataDefinition.connectionsmaxthreads.CounterHelpTitleIndex += dwFirstHelp;
- NSDataDefinition.connectionshitmaxthreads.CounterNameTitleIndex += dwFirstCounter;
- NSDataDefinition.connectionshitmaxthreads.CounterHelpTitleIndex += dwFirstHelp;
- NSDataDefinition.bind_rate.CounterNameTitleIndex += dwFirstCounter;
- NSDataDefinition.bind_rate.CounterHelpTitleIndex += dwFirstHelp;
- NSDataDefinition.entries_returned.CounterNameTitleIndex += dwFirstCounter;
- NSDataDefinition.entries_returned.CounterHelpTitleIndex += dwFirstHelp;
- NSDataDefinition.entries_returned_rate.CounterNameTitleIndex += dwFirstCounter;
- NSDataDefinition.entries_returned_rate.CounterHelpTitleIndex += dwFirstHelp;
- NSDataDefinition.referrals_returned.CounterNameTitleIndex += dwFirstCounter;
- NSDataDefinition.referrals_returned.CounterHelpTitleIndex += dwFirstHelp;
- NSDataDefinition.referrals_returned_rate.CounterNameTitleIndex += dwFirstCounter;
- NSDataDefinition.referrals_returned_rate.CounterHelpTitleIndex += dwFirstHelp;
- NSDataDefinition.bytes_read_rate.CounterNameTitleIndex += dwFirstCounter;
- NSDataDefinition.bytes_read_rate.CounterHelpTitleIndex += dwFirstHelp;
- NSDataDefinition.bytes_written_rate.CounterNameTitleIndex += dwFirstCounter;
- NSDataDefinition.bytes_written_rate.CounterHelpTitleIndex += dwFirstHelp;
-
- RegCloseKey (hKeyDriverPerf);
-
- bInitialized = TRUE;
- }
-
- dwOpenCount++;
-
- status = ERROR_SUCCESS;
-
-OpenExitPoint:
-
- return status;
-}
-
-/* --- Close Function -------------------------------------------------------------------- */
-export DWORD APIENTRY
-CloseNSPerformanceData()
-{
- instance_list_t *pInstance, *pDead;
-
- if (!(--dwOpenCount)) {
-
- for (pDead = NULL, pInstance = pInstanceList; pInstance; pInstance=pInstance->pNext) {
- if (pDead)
- free(pDead);
-
- /* I probably need to free stats too... make sure to add that later */
- if (pInstance->pData)
- UnmapSharedMem(&pInstance->pData);
-
- free(pInstance->pInstanceName);
- free(pInstance->pConfPath);
- pDead = pInstance;
- }
- if (pDead) /* cleanup last instance */
- free(pDead);
-
- MonCloseEventLog();
-
- bInitialized = FALSE;
- }
-
- return ERROR_SUCCESS;
-}
-
-struct _status_struct_s {
- DWORD connection_rate;
- DWORD throughput;
- DWORD tot_bytes_written;
- DWORD tot_bytes_read;
- DWORD op_rate;
- DWORD tot_errs;
- DWORD search_rate;
- DWORD add_rate;
- DWORD delete_rate;
- DWORD modify_rate;
- DWORD compare_rate;
- DWORD moddn_rate;
- DWORD connections;
- DWORD connectionsmaxthreads;
- DWORD connectionshitmaxthreads;
- DWORD bind_rate;
- DWORD entries_returned;
- DWORD entries_returned_rate;
- DWORD referrals_returned;
- DWORD referrals_returned_rate;
- DWORD bytes_read_rate;
- DWORD bytes_written_rate;
-};
-
-void
-Get_Actual_Data(agt_stats_t *smem,
- struct _status_struct_s *results)
-{
- /* Copy over the counters from the shared memory region */
- struct ops_stats_t *pOpsStats = &(smem->ops_stats);
-
- results->search_rate = pOpsStats->dsSearchOps;
- results->modify_rate = pOpsStats->dsModifyEntryOps;
- results->add_rate = pOpsStats->dsAddEntryOps ;
- results->compare_rate = pOpsStats->dsCompareOps ;
- results->moddn_rate = pOpsStats->dsModifyRDNOps ;
- results->delete_rate = pOpsStats->dsRemoveEntryOps ;
- results->bind_rate = pOpsStats->dsAnonymousBinds + pOpsStats->dsStrongAuthBinds + pOpsStats->dsSimpleAuthBinds ;
- results->op_rate = results->search_rate + results->add_rate + results->delete_rate +
- results->modify_rate + results->compare_rate + results->moddn_rate + results->bind_rate;
- results->connections = 0;
- results->tot_errs = pOpsStats->dsErrors ;
- results->connections = pOpsStats->dsConnections ;
- results->connectionsmaxthreads = pOpsStats->dsConnectionsInMaxThreads ;
- results->connectionshitmaxthreads = pOpsStats->dsMaxThreadsHit ;
- results->tot_bytes_written = pOpsStats->dsBytesSent ;
- results->tot_bytes_read = pOpsStats->dsBytesRecv ;
- results->throughput = pOpsStats->dsBytesSent + pOpsStats->dsBytesRecv;
- results->connection_rate = pOpsStats->dsConnectionSeq ;
- results->entries_returned = pOpsStats->dsEntriesReturned ;
- results->entries_returned_rate = pOpsStats->dsEntriesReturned ;
- results->referrals_returned = pOpsStats->dsReferralsReturned ;
- results->referrals_returned_rate = pOpsStats->dsReferralsReturned ;
- results->bytes_read_rate = pOpsStats->dsBytesRecv ;
- results->bytes_written_rate = pOpsStats->dsBytesSent ;
- /* Still to do : connections, throughput, db hit ratio, entry cache hit ratio */
-}
-
-/* --- Collect Function ------------------------------------------------------------------- */
-export DWORD APIENTRY
-CollectNSPerformanceData(
- IN LPWSTR lpValueName,
- IN OUT LPVOID *lppData,
- IN OUT LPDWORD lpcbTotalBytes,
- IN OUT LPDWORD lpNumObjectTypes
-)
-{
- ULONG SpaceNeeded;
- PDWORD pdwCounter;
- PERF_COUNTER_BLOCK *pPerfCounterBlock;
- NS_DATA_DEFINITION *pNSDataDefinition;
- DWORD dwQueryType;
- instance_list_t *pInstance;
-
- if (!bInitialized) {
- *lpcbTotalBytes = (DWORD) 0;
- *lpNumObjectTypes = (DWORD) 0;
- return ERROR_SUCCESS;
- }
-
- dwQueryType = GetQueryType (lpValueName);
-
- if (dwQueryType == QUERY_FOREIGN) {
- // this routine does not service requests for data from
- // Non-NT computers
- *lpcbTotalBytes = (DWORD) 0;
- *lpNumObjectTypes = (DWORD) 0;
- return ERROR_SUCCESS;
- }
-
- if (dwQueryType == QUERY_ITEMS){
- if ( !(IsNumberInUnicodeList (NSDataDefinition.NS_ObjectType.ObjectNameTitleIndex, lpValueName))) {
- // request received for data object not provided by this routine
- *lpcbTotalBytes = (DWORD) 0;
- *lpNumObjectTypes = (DWORD) 0;
- return ERROR_SUCCESS;
- }
- }
- /* -------- OK DO THE REAL WORK HERE ---------- */
-
-
- /* -------------------------------------------- */
- /* | PERF_DATA_BLOCK (header) | */
- /* -------------------------------------------- */
- /* | PERF_OBJECT_TYPE 1 | */
- /* -------------------------------------------- */
- /* | PERF_OBJECT_TYPE 2 | */
- /* -------------------------------------------- */
- /* | . | */
- /* | . | */
- /* | . | */
- /* | | */
- /* | | */
- /* -------------------------------------------- */
-
-
- /* -------------------------------------------- */
- /* | PERF_OBJECT_TYPE (header) | */
- /* -------------------------------------------- */
- /* | PERF_COUNTER_DEFINITION 1 | */
- /* -------------------------------------------- */
- /* | PERF_COUNTER_DEFINITION 2 | */
- /* -------------------------------------------- */
- /* | . | */
- /* | . | */
- /* | . | */
- /* | | */
- /* -------------------------------------------- */
- /* | PERF_INSTANCE_DEFINITION 1 | */
- /* -------------------------------------------- */
- /* | PERF_INSTANCE_DEFINITION 2 | */
- /* -------------------------------------------- */
- /* | . | */
- /* | . | */
- /* | . | */
- /* | | */
- /* | | */
- /* -------------------------------------------- */
-
-
- /* -------------------------------------------- */
- /* | PERF_INSTANCE_DEFINITION (header) | */
- /* -------------------------------------------- */
- /* | Instance Name (variable) | */
- /* -------------------------------------------- */
- /* | PERF_COUNTER_BLOCK (header) | */
- /* -------------------------------------------- */
- /* | Counter Data (variable) | */
- /* -------------------------------------------- */
-
-
-
- /* Check to see if there is enough space in caller's buffer */
-
- pNSDataDefinition = (NS_DATA_DEFINITION *) *lppData;
-
- SpaceNeeded = sizeof(NS_DATA_DEFINITION) + (dwInstanceCount *
- (SIZE_OF_NS_PERFORMANCE_DATA + MAX_KEY_SIZE + sizeof(PERF_COUNTER_BLOCK) +
- sizeof(PERF_INSTANCE_DEFINITION)));
-
- if ( *lpcbTotalBytes < SpaceNeeded ) {
- *lpcbTotalBytes = (DWORD) 0;
- *lpNumObjectTypes = (DWORD) 0;
- return ERROR_MORE_DATA;
- }
-
- /* Set the PERF_OBJECT_TYPE definition and PERF_COUNTER_DEFINITIONs */
- NSDataDefinition.NS_ObjectType.NumInstances = dwInstanceCount;
- memmove(pNSDataDefinition, &NSDataDefinition, sizeof(NS_DATA_DEFINITION));
-
- pdwCounter = (PDWORD) &(pNSDataDefinition[1]);
-
- for ( pInstance = pInstanceList; pInstance; pInstance=pInstance->pNext) {
-
- if ( pInstance->pData ) {
-
- /* Set the PERF_INSTANCE_DEFINITION */
- memmove(pdwCounter, &(pInstance->instance), sizeof(PERF_INSTANCE_DEFINITION));
- pdwCounter += ((sizeof(PERF_INSTANCE_DEFINITION))/sizeof(DWORD));
-
- /* Set the Instance Name */
- memmove(pdwCounter, pInstance->pInstanceName, pInstance->instance.NameLength);
- pdwCounter = pdwCounter + ((pInstance->instance.NameLength + sizeof(DWORD)-1)/sizeof(DWORD));
-
- /* Set the PERF_COUNTER_BLOCK */
- pPerfCounterBlock = (PERF_COUNTER_BLOCK *) pdwCounter;
- pPerfCounterBlock->ByteLength = SIZE_OF_NS_PERFORMANCE_DATA + sizeof(PERF_COUNTER_BLOCK);
- pdwCounter = (PDWORD) (&pPerfCounterBlock[1]);
-
- /* Set the Instance Data */
- Get_Actual_Data(pInstance->pData,(struct _status_struct_s*)pdwCounter);
-
- {
- DWORD x = (SIZE_OF_NS_PERFORMANCE_DATA) / sizeof(DWORD);
-
- pdwCounter += x;
- }
- }
- }
-
- *lppData = (PVOID)(pdwCounter);
- *lpNumObjectTypes = 1;
- *lpcbTotalBytes = (PBYTE) pdwCounter - (PBYTE) pNSDataDefinition;
- pNSDataDefinition->NS_ObjectType.TotalByteLength = *lpcbTotalBytes;
-
- return ERROR_SUCCESS;
-}
-
diff --git a/ldap/servers/slapd/ntperfdll/nsldapctrdef.h b/ldap/servers/slapd/ntperfdll/nsldapctrdef.h
deleted file mode 100644
index 1785561..0000000
--- a/ldap/servers/slapd/ntperfdll/nsldapctrdef.h
+++ /dev/null
@@ -1,72 +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 **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/*
- * nsctrdef.h
- *
- * Defines offsets of netscape server performance monitor counters.
- */
-
-#define NS_OBJ 0
-#define CONN_RATE 2
-#define THROUGHPUT 4
-#define TOTAL_BYTES_WRITTEN 6
-#define TOTAL_BYTES_READ 8
-#define OP_RATE 10
-#define TOTAL_ERRORS 12
-#define SEARCH_RATE 14
-#define ADD_RATE 16
-#define DELETE_RATE 18
-#define MODIFY_RATE 20
-#define COMPARE_RATE 22
-#define MODDN_RATE 24
-#define CONNECTIONS 26
-#define BIND_RATE 28
-#define ENTRIES_RETURNED 30
-#define ENTRIES_RETURNED_RATE 32
-#define REFERRALS_RETURNED 34
-#define REFERRALS_RETURNED_RATE 36
-#define BYTES_READ_RATE 38
-#define BYTES_WRITTEN_RATE 40
-#define CONNECTIONSMAXTHREADS 42
-#define CONNECTIONSHITMAXTHREADS 44
-
diff --git a/ldap/servers/slapd/ntperfdll/nsldapctrmc.h b/ldap/servers/slapd/ntperfdll/nsldapctrmc.h
deleted file mode 100644
index 22e64b6..0000000
--- a/ldap/servers/slapd/ntperfdll/nsldapctrmc.h
+++ /dev/null
@@ -1,159 +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 **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/*
- * nsctrs.h
- */
-//
-#ifndef _NSCTRMC_H_
-#define _NSCTRMC_H_
-//
-//
-// Perfutil messages
-//
-//
-// Values are 32 bit values layed out as follows:
-//
-// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
-// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
-// +---+-+-+-----------------------+-------------------------------+
-// |Sev|C|R| Facility | Code |
-// +---+-+-+-----------------------+-------------------------------+
-//
-// where
-//
-// Sev - is the severity code
-//
-// 00 - Success
-// 01 - Informational
-// 10 - Warning
-// 11 - Error
-//
-// C - is the Customer code flag
-//
-// R - is a reserved bit
-//
-// Facility - is the facility code
-//
-// Code - is the facility's status code
-//
-//
-// Define the facility codes
-//
-
-
-//
-// Define the severity codes
-//
-
-
-//
-// MessageId: UTIL_LOG_OPEN
-//
-// MessageText:
-//
-// An extensible counter has opened the Event Log for NSCTRS.DLL
-//
-#define UTIL_LOG_OPEN ((DWORD)0x4000076CL)
-
-//
-//
-// MessageId: UTIL_CLOSING_LOG
-//
-// MessageText:
-//
-// An extensible counter has closed the Event Log for NSCTRS.DLL
-//
-#define UTIL_CLOSING_LOG ((DWORD)0x400007CFL)
-
-//
-//
-// MessageId: NSPERF_OPEN_FILE_MAPPING_ERROR
-//
-// MessageText:
-//
-// Unable to open mapped file containing NS driver performance data.
-//
-#define NSPERF_OPEN_FILE_MAPPING_ERROR ((DWORD)0xC00007D0L)
-
-//
-//
-// MessageId: NSPERF_UNABLE_MAP_VIEW_OF_FILE
-//
-// MessageText:
-//
-// Unable to map to shared memory file containing NS driver performance data.
-//
-#define NSPERF_UNABLE_MAP_VIEW_OF_FILE ((DWORD)0xC00007D1L)
-
-//
-//
-// MessageId: NSPERF_UNABLE_OPEN_DRIVER_KEY
-//
-// MessageText:
-//
-// Unable open "Performance" key of NS driver in registry. Status code is returned in data.
-//
-#define NSPERF_UNABLE_OPEN_DRIVER_KEY ((DWORD)0xC00007D2L)
-
-//
-//
-// MessageId: NSPERF_UNABLE_READ_FIRST_COUNTER
-//
-// MessageText:
-//
-// Unable to read the "First Counter" value under the NS\Performance Key. Status codes returned in data.
-//
-#define NSPERF_UNABLE_READ_FIRST_COUNTER ((DWORD)0xC00007D3L)
-
-//
-//
-// MessageId: NSPERF_UNABLE_READ_FIRST_HELP
-//
-// MessageText:
-//
-// Unable to read the "First Help" value under the NS\Performance Key. Status codes returned in data.
-//
-#define NSPERF_UNABLE_READ_FIRST_HELP ((DWORD)0xC00007D4L)
-
-//
-#endif // _NSCTRMC_H_
diff --git a/ldap/servers/slapd/ntperfdll/nsldapctrmc.mc b/ldap/servers/slapd/ntperfdll/nsldapctrmc.mc
deleted file mode 100644
index 343f84e..0000000
--- a/ldap/servers/slapd/ntperfdll/nsldapctrmc.mc
+++ /dev/null
@@ -1,106 +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
-;
-;/*
-; * nsctrs.h
-; */
-;//
-;#ifndef _NSCTRMC_H_
-;#define _NSCTRMC_H_
-;//
-MessageIdTypedef=DWORD
-;//
-;// Perfutil messages
-;//
-MessageId=1900
-Severity=Informational
-Facility=Application
-SymbolicName=UTIL_LOG_OPEN
-Language=English
-An extensible counter has opened the Event Log for NSCTRS.DLL
-.
-;//
-MessageId=1999
-Severity=Informational
-Facility=Application
-SymbolicName=UTIL_CLOSING_LOG
-Language=English
-An extensible counter has closed the Event Log for NSCTRS.DLL
-.
-;//
-MessageId=2000
-Severity=Error
-Facility=Application
-SymbolicName=NSPERF_OPEN_FILE_MAPPING_ERROR
-Language=English
-Unable to open mapped file containing NS driver performance data.
-.
-;//
-MessageId=+1
-Severity=Error
-Facility=Application
-SymbolicName=NSPERF_UNABLE_MAP_VIEW_OF_FILE
-Language=English
-Unable to map to shared memory file containing NS driver performance data.
-.
-;//
-MessageId=+1
-Severity=Error
-Facility=Application
-SymbolicName=NSPERF_UNABLE_OPEN_DRIVER_KEY
-Language=English
-Unable open "Performance" key of NS driver in registry. Status code is returned in data.
-.
-;//
-MessageId=+1
-Severity=Error
-Facility=Application
-SymbolicName=NSPERF_UNABLE_READ_FIRST_COUNTER
-Language=English
-Unable to read the "First Counter" value under the NS\Performance Key. Status codes returned in data.
-.
-;//
-MessageId=+1
-Severity=Error
-Facility=Application
-SymbolicName=NSPERF_UNABLE_READ_FIRST_HELP
-Language=English
-Unable to read the "First Help" value under the NS\Performance Key. Status codes returned in data.
-.
-;//
-;#endif // _NSCTRMC_H_
diff --git a/ldap/servers/slapd/ntperfdll/nsldapctrmsg.h b/ldap/servers/slapd/ntperfdll/nsldapctrmsg.h
deleted file mode 100644
index f1c3ee0..0000000
--- a/ldap/servers/slapd/ntperfdll/nsldapctrmsg.h
+++ /dev/null
@@ -1,97 +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 **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/*
- * nsctrmsg.h
- *
- * Defines EventLog error handling stuff for performance monitor dll.
- *
- */
-
-
-#ifndef _NSCTRMSG_H_
-#define _NSCTRMSG_H_
-//
-// Report error message ID's for Counters
-//
-
-#define APP_NAME "nsctrs"
-
-/* Levels: LOG_NONE = No event log messages ever
- * LOG_USER = User event log messages (e.g. errors)
- * LOG_DEBUG = Minimum Debugging
- * LOG_VERBOSE = Maximum Debugging
- */
-
-#define LOG_NONE 0
-#define LOG_USER 1
-#define LOG_DEBUG 2
-#define LOG_VERBOSE 3
-
-#define MESSAGE_LEVEL_DEFAULT LOG_USER
-
-#define REPORT_SUCCESS(i,l) (MESSAGE_LEVEL >= l ? ReportEvent (hEventLog, EVENTLOG_INFORMATION_TYPE, \
- 0, i, (PSID)NULL, 0, 0, NULL, (PVOID)NULL) : FALSE)
-
-#define REPORT_INFORMATION(i,l) (MESSAGE_LEVEL >= l ? ReportEvent (hEventLog, EVENTLOG_INFORMATION_TYPE, \
- 0, i, (PSID)NULL, 0, 0, NULL, (PVOID)NULL) : FALSE)
-
-#define REPORT_WARNING(i,l) (MESSAGE_LEVEL >= l ? ReportEvent (hEventLog, EVENTLOG_WARNING_TYPE, \
- 0, i, (PSID)NULL, 0, 0, NULL, (PVOID)NULL) : FALSE)
-
-#define REPORT_ERROR(i,l) (MESSAGE_LEVEL >= l ? ReportEvent (hEventLog, EVENTLOG_ERROR_TYPE, \
- 0, i, (PSID)NULL, 0, 0, NULL, (PVOID)NULL) : FALSE)
-
-#define REPORT_INFORMATION_DATA(i,l,d,s) (MESSAGE_LEVEL >= l ? ReportEvent (hEventLog, EVENTLOG_INFORMATION_TYPE, \
- 0, i, (PSID)NULL, 0, s, NULL, (PVOID)(d)) : FALSE)
-
-#define REPORT_WARNING_DATA(i,l,d,s) (MESSAGE_LEVEL >= l ? ReportEvent (hEventLog, EVENTLOG_WARNING_TYPE, \
- 0, i, (PSID)NULL, 0, s, NULL, (PVOID)(d)) : FALSE)
-
-#define REPORT_ERROR_DATA(i,l,d,s) (MESSAGE_LEVEL >= l ? ReportEvent (hEventLog, EVENTLOG_ERROR_TYPE, \
- 0, i, (PSID)NULL, 0, s, NULL, (PVOID)(d)) : FALSE)
-
-extern HANDLE hEventLog; /* handle to event log */
-extern DWORD dwLogUsers; /* counter of event log using routines */
-extern DWORD MESSAGE_LEVEL; /* event logging detail level */
-
-#endif /* _NSCTRMSG_H_ */
diff --git a/ldap/servers/slapd/ntperfdll/nsldapctrs.h b/ldap/servers/slapd/ntperfdll/nsldapctrs.h
deleted file mode 100644
index 897c985..0000000
--- a/ldap/servers/slapd/ntperfdll/nsldapctrs.h
+++ /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 **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/*
-
- nsctrs.h
-
- */
-
-#ifndef _NSCTRS_H_
-#define _NSCTRS_H_
-
-#pragma pack (4)
-
-#define NS_NUM_PERF_OBJECT_TYPES 1
-#define NUM_CONN_RATE_OFFSET sizeof(DWORD)
-#define NUM_THROUGHPUT_OFFSET NUM_CONN_RATE_OFFSET + sizeof(DWORD)
-#define NUM_TOTAL_BYTES_WRITTEN_OFFSET NUM_THROUGHPUT_OFFSET + sizeof(DWORD)
-#define NUM_TOTAL_BYTES_READ_OFFSET NUM_TOTAL_BYTES_WRITTEN_OFFSET + sizeof(DWORD)
-#define NUM_OP_RATE_OFFSET NUM_TOTAL_BYTES_READ_OFFSET + sizeof(DWORD)
-#define NUM_TOTAL_ERRORS_OFFSET NUM_OP_RATE_OFFSET + sizeof(DWORD)
-#define NUM_SEARCH_RATE_OFFSET NUM_TOTAL_ERRORS_OFFSET + sizeof(DWORD)
-#define ADD_RATE_OFFSET NUM_SEARCH_RATE_OFFSET + sizeof(DWORD)
-#define DELETE_RATE_OFFSET ADD_RATE_OFFSET + sizeof(DWORD)
-#define MODIFY_RATE_OFFSET DELETE_RATE_OFFSET + sizeof(DWORD)
-#define COMPARE_RATE_OFFSET MODIFY_RATE_OFFSET + sizeof(DWORD)
-#define MODDN_RATE_OFFSET COMPARE_RATE_OFFSET + sizeof(DWORD)
-#define CONNECTIONS_OFFSET MODDN_RATE_OFFSET + sizeof(DWORD)
-#define BIND_RATE_OFFSET CONNECTIONS_OFFSET + sizeof(DWORD)
-#define ENTRIES_RETURNED_OFFSET BIND_RATE_OFFSET + sizeof(DWORD)
-#define ENTRIES_RETURNED_RATE_OFFSET ENTRIES_RETURNED_OFFSET + sizeof(DWORD)
-#define REFERRALS_RETURNED_OFFSET ENTRIES_RETURNED_RATE_OFFSET + sizeof(DWORD)
-#define REFERRALS_RETURNED_RATE_OFFSET REFERRALS_RETURNED_OFFSET + sizeof(DWORD)
-#define BYTES_READ_RATE_OFFSET REFERRALS_RETURNED_RATE_OFFSET + sizeof(DWORD)
-#define BYTES_WRITTEN_RATE_OFFSET BYTES_READ_RATE_OFFSET + sizeof(DWORD)
-#define SIZE_OF_NS_PERFORMANCE_DATA BYTES_WRITTEN_RATE_OFFSET + sizeof(DWORD)
-#define CONNECTIONSMAXTHREADS_OFFSET SIZE_OF_NS_PERFORMANCE_DATA + sizeof(DWORD)
-#define CONNECTIONSHITMAXTHREADS_OFFSET CONNECTIONSMAXTHREADS_OFFSET + sizeof(DWORD)
-
-typedef struct _NS_DATA_DEFINITION {
- PERF_OBJECT_TYPE NS_ObjectType;
- PERF_COUNTER_DEFINITION connection_rate;
- PERF_COUNTER_DEFINITION throughput;
- PERF_COUNTER_DEFINITION total_bytes_written;
- PERF_COUNTER_DEFINITION total_bytes_read;
- PERF_COUNTER_DEFINITION operation_rate;
- PERF_COUNTER_DEFINITION total_errors;
- PERF_COUNTER_DEFINITION search_rate;
- PERF_COUNTER_DEFINITION add_rate;
- PERF_COUNTER_DEFINITION delete_rate;
- PERF_COUNTER_DEFINITION modify_rate;
- PERF_COUNTER_DEFINITION compare_rate;
- PERF_COUNTER_DEFINITION moddn_rate;
- PERF_COUNTER_DEFINITION connections;
- PERF_COUNTER_DEFINITION connectionsmaxthreads;
- PERF_COUNTER_DEFINITION connectionshitmaxthreads;
- PERF_COUNTER_DEFINITION bind_rate;
- PERF_COUNTER_DEFINITION entries_returned;
- PERF_COUNTER_DEFINITION entries_returned_rate;
- PERF_COUNTER_DEFINITION referrals_returned;
- PERF_COUNTER_DEFINITION referrals_returned_rate;
- PERF_COUNTER_DEFINITION bytes_read_rate;
- PERF_COUNTER_DEFINITION bytes_written_rate;
-} NS_DATA_DEFINITION;
-
-#pragma pack ()
-
-#endif /* _NSCTRS_H_ */
-
diff --git a/ldap/servers/slapd/ntperfdll/nsldapctrs.ini b/ldap/servers/slapd/ntperfdll/nsldapctrs.ini
deleted file mode 100644
index 587b671..0000000
--- a/ldap/servers/slapd/ntperfdll/nsldapctrs.ini
+++ /dev/null
@@ -1,89 +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
-#
-[info]
-drivername=slapd1
-symbolfile=nsldapctrdef.h
-
-[languages]
-009=English
-
-[text]
-NS_OBJ_009_NAME=Directory Server 1.0
-NS_OBJ_009_HELP=Directory Server
-CONN_RATE_009_NAME=Client Connections/sec
-CONN_RATE_009_HELP=Rate of incoming client connections
-THROUGHPUT_009_NAME=Server Network Throughput (bytes/sec)
-THROUGHPUT_009_HELP=Number of bytes both sent and received per second on client connections
-TOTAL_BYTES_WRITTEN_009_NAME=Total Bytes Sent
-TOTAL_BYTES_WRITTEN_009_HELP=Total number of Bytes sent by the server since startup
-TOTAL_BYTES_READ_009_NAME=Total Bytes Received
-TOTAL_BYTES_READ_009_HELP=Total number of Bytes received by the server since startup
-OP_RATE_009_NAME=Operations/sec
-OP_RATE_009_HELP=Number of Operations (total of search, bind, modify, compare, modDN, delete) serviced per second
-SEARCH_RATE_009_NAME=Searches/sec
-SEARCH_RATE_009_HELP=Number of Search operations performed per second
-TOTAL_ERRORS_009_NAME=Total Number of Errors
-TOTAL_ERRORS_009_HELP=Total number of Errors seen by the server since startup
-ADD_RATE_009_NAME=Adds/sec
-ADD_RATE_009_HELP=Number of Add operations performed per second
-DELETE_RATE_009_NAME=Deletes/sec
-DELETE_RATE_009_HELP=Number of Delete operations performed per second
-MODIFY_RATE_009_NAME=Modifies/sec
-MODIFY_RATE_009_HELP=Number of Modify operations performed per second
-COMPARE_RATE_009_NAME=Compares/sec
-COMPARE_RATE_009_HELP=Number of Compare operations performed per second
-MODDN_RATE_009_NAME=ModDNs/sec
-MODDN_RATE_009_HELP=Number of ModDN operations performed per second
-CONNECTIONS_009_NAME=Connected Clients
-CONNECTIONS_009_HELP=Number of client sessions currently connected
-BIND_RATE_009_NAME=Binds/sec
-BIND_RATE_009_HELP=Number of Bind operations performed per second
-ENTRIES_RETURNED_009_NAME=Entries Returned
-ENTRIES_RETURNED_009_HELP=Number of entries returned to clients since startup
-ENTRIES_RETURNED_RATE_009_NAME=Entries Returned/sec
-ENTRIES_RETURNED_RATE_009_HELP=Number of entries returned to clients per second
-REFERRALS_RETURNED_009_NAME=Referrals Returned
-REFERRALS_RETURNED_009_HELP=Number of referrals returned to clients since startup
-REFERRALS_RETURNED_RATE_009_NAME=Referrals Returned/sec
-REFERRALS_RETURNED_RATE_009_HELP=Number of referrals returned to clients per second
-BYTES_READ_RATE_009_NAME=Network Bytes Read/sec
-BYTES_READ_RATE_009_HELP=Number of bytes per second read from connected clients
-BYTES_WRITTEN_RATE_009_NAME=Network Bytes Written/sec
-BYTES_WRITTEN_RATE_009_HELP=Number of bytes per second written to connected clients
diff --git a/ldap/servers/slapd/ntperfdll/nsldapctrutil.cpp b/ldap/servers/slapd/ntperfdll/nsldapctrutil.cpp
deleted file mode 100644
index df7dc67..0000000
--- a/ldap/servers/slapd/ntperfdll/nsldapctrutil.cpp
+++ /dev/null
@@ -1,401 +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 **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/*
-
- nsctrutil.c
-
- Performance Monitor utility functions
-
- This file implements the utility routines used to construct the
- common parts of a PERF_INSTANCE_DEFINITION (see winperf.h) and
- perform event logging functions.
-
- */
-
-#include <windows.h>
-#include <string.h>
-#include <winperf.h>
-#include "nsldapctrmc.h"
-#include "nsldapctrmsg.h"
-#include "nsldapctrutil.h"
-
-#define INITIAL_SIZE 1024L
-#define EXTEND_SIZE 1024L
-
-//
-// Global data definitions.
-//
-
-ULONG ulInfoBufferSize = 0;
-
-HANDLE hEventLog; // handle to event log
-
-DWORD dwLogUsers = 0; // count of functions using event log
-
-DWORD MESSAGE_LEVEL = 0;
-
-WCHAR GLOBAL_STRING[] = L"Global";
-WCHAR FOREIGN_STRING[] = L"Foreign";
-WCHAR COSTLY_STRING[] = L"Costly";
-
-WCHAR NULL_STRING[] = L"\0"; // pointer to null string
-
-// test for delimiter, end of line and non-digit characters
-// used by IsNumberInUnicodeList routine
-//
-#define DIGIT 1
-#define DELIMITER 2
-#define INVALID 3
-
-#define EvalThisChar(c,d) ( \
- (c == d) ? DELIMITER : \
- (c == 0) ? DELIMITER : \
- (c < (WCHAR)'0') ? INVALID : \
- (c > (WCHAR)'9') ? INVALID : \
- DIGIT)
-
-HANDLE
-MonOpenEventLog (
-)
-/*++
-
-Routine Description:
-
- Reads the level of event logging from the registry and opens the
- channel to the event logger for subsequent event log entries.
-
-Arguments:
-
- None
-
-Return Value:
-
- Handle to the event log for reporting events.
- NULL if open not successful.
-
---*/
-
-
-{
-
-
- HKEY hAppKey;
-
-
- TCHAR LogLevelKeyName[] = "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Perflib";
-
-
- TCHAR LogLevelValueName[] = "EventLogLevel";
-
- LONG lStatus;
-
- DWORD dwLogLevel;
- DWORD dwValueType;
- DWORD dwValueSize;
-
- // if global value of the logging level not initialized or is disabled,
- // check the registry to see if it should be updated.
-
- if (!MESSAGE_LEVEL) {
-
- lStatus = RegOpenKeyEx (HKEY_LOCAL_MACHINE,
- LogLevelKeyName,
- 0,
- KEY_READ,
- &hAppKey);
-
- dwValueSize = sizeof (dwLogLevel);
-
- if (lStatus == ERROR_SUCCESS) {
- lStatus = RegQueryValueEx (hAppKey,
- LogLevelValueName,
- (LPDWORD)NULL,
- &dwValueType,
- (LPBYTE)&dwLogLevel,
- &dwValueSize);
-
- if (lStatus == ERROR_SUCCESS) {
- MESSAGE_LEVEL = dwLogLevel;
- } else {
- MESSAGE_LEVEL = MESSAGE_LEVEL_DEFAULT;
- }
- RegCloseKey (hAppKey);
- } else {
-
-
- MESSAGE_LEVEL = MESSAGE_LEVEL_DEFAULT;
- }
- }
-
- if (hEventLog == NULL){
- hEventLog = RegisterEventSource (
- (LPTSTR)NULL, // Use Local Machine
- APP_NAME); // event log app name to find in registry
- }
-
- if (hEventLog != NULL) {
- dwLogUsers++; // increment count of perfctr log users
- }
- return (hEventLog);
-}
-
-VOID
-MonCloseEventLog (
-)
-/*++
-
-Routine Description:
-
- Closes the handle to the event logger if this is the last caller
-
-Arguments:
-
- None
-
-Return Value:
-
- None
-
---*/
-{
- if (hEventLog != NULL) {
- dwLogUsers--; // decrement usage
- if (dwLogUsers <= 0) { // and if we're the last, then close up log
- DeregisterEventSource (hEventLog);
- }
- }
-}
-
-DWORD
-GetQueryType (
- IN LPWSTR lpValue
-)
-/*++
-
-GetQueryType
-
- returns the type of query described in the lpValue string so that
- the appropriate processing method may be used
-
-Arguments
-
- IN lpValue
- string passed to PerfRegQuery Value for processing
-
-Return Value
-
- QUERY_GLOBAL
- if lpValue == 0 (null pointer)
- lpValue == pointer to Null string
- lpValue == pointer to "Global" string
-
- QUERY_FOREIGN
- if lpValue == pointer to "Foreign" string
-
- QUERY_COSTLY
- if lpValue == pointer to "Costly" string
-
- otherwise:
-
- QUERY_ITEMS
-
---*/
-{
- WCHAR *pwcArgChar, *pwcTypeChar;
- BOOL bFound;
-
- if (lpValue == 0) {
- return QUERY_GLOBAL;
- } else if (*lpValue == 0) {
- return QUERY_GLOBAL;
- }
-
- // check for "Global" request
-
- pwcArgChar = lpValue;
- pwcTypeChar = GLOBAL_STRING;
- bFound = TRUE; // assume found until contradicted
-
- // check to the length of the shortest string
-
- while ((*pwcArgChar != 0) && (*pwcTypeChar != 0)) {
- if (*pwcArgChar++ != *pwcTypeChar++) {
- bFound = FALSE; // no match
- break; // bail out now
- }
- }
-
- if (bFound) return QUERY_GLOBAL;
-
- // check for "Foreign" request
-
- pwcArgChar = lpValue;
- pwcTypeChar = FOREIGN_STRING;
- bFound = TRUE; // assume found until contradicted
-
- // check to the length of the shortest string
-
- while ((*pwcArgChar != 0) && (*pwcTypeChar != 0)) {
- if (*pwcArgChar++ != *pwcTypeChar++) {
- bFound = FALSE; // no match
- break; // bail out now
- }
- }
-
- if (bFound) return QUERY_FOREIGN;
-
- // check for "Costly" request
-
- pwcArgChar = lpValue;
- pwcTypeChar = COSTLY_STRING;
- bFound = TRUE; // assume found until contradicted
-
- // check to the length of the shortest string
-
- while ((*pwcArgChar != 0) && (*pwcTypeChar != 0)) {
- if (*pwcArgChar++ != *pwcTypeChar++) {
- bFound = FALSE; // no match
- break; // bail out now
- }
- }
-
- if (bFound) return QUERY_COSTLY;
-
- // if not Global and not Foreign and not Costly,
- // then it must be an item list
-
- return QUERY_ITEMS;
-
-}
-
-BOOL
-IsNumberInUnicodeList (
- IN DWORD dwNumber,
- IN LPWSTR lpwszUnicodeList
-)
-/*++
-
-IsNumberInUnicodeList
-
-Arguments:
-
- IN dwNumber
- DWORD number to find in list
-
- IN lpwszUnicodeList
- Null terminated, Space delimited list of decimal numbers
-
-Return Value:
-
- TRUE:
- dwNumber was found in the list of unicode number strings
-
- FALSE:
- dwNumber was not found in the list.
-
---*/
-{
- DWORD dwThisNumber;
- WCHAR *pwcThisChar;
- BOOL bValidNumber;
- BOOL bNewItem;
- //BOOL bReturnValue;
- WCHAR wcDelimiter; // could be an argument to be more flexible
-
- if (lpwszUnicodeList == 0) return FALSE; // null pointer, # not found
-
- pwcThisChar = lpwszUnicodeList;
- dwThisNumber = 0;
- wcDelimiter = (WCHAR)' ';
- bValidNumber = FALSE;
- bNewItem = TRUE;
-
- while (TRUE) {
- switch (EvalThisChar (*pwcThisChar, wcDelimiter)) {
- case DIGIT:
- // if this is the first digit after a delimiter, then
- // set flags to start computing the new number
- if (bNewItem) {
- bNewItem = FALSE;
- bValidNumber = TRUE;
- }
- if (bValidNumber) {
- dwThisNumber *= 10;
- dwThisNumber += (*pwcThisChar - (WCHAR)'0');
- }
- break;
-
- case DELIMITER:
- // a delimiter is either the delimiter character or the
- // end of the string ('\0') if when the delimiter has been
- // reached a valid number was found, then compare it to the
- // number from the argument list. if this is the end of the
- // string and no match was found, then return.
- //
- if (bValidNumber) {
- if (dwThisNumber == dwNumber) return TRUE;
- bValidNumber = FALSE;
- }
- if (*pwcThisChar == 0) {
- return FALSE;
- } else {
- bNewItem = TRUE;
- dwThisNumber = 0;
- }
- break;
-
- case INVALID:
- // if an invalid character was encountered, ignore all
- // characters up to the next delimiter and then start fresh.
- // the invalid number is not compared.
- bValidNumber = FALSE;
- break;
-
- default:
- break;
-
- }
- pwcThisChar++;
- }
-
-} // IsNumberInUnicodeList
diff --git a/ldap/servers/slapd/ntperfdll/nsldapctrutil.h b/ldap/servers/slapd/ntperfdll/nsldapctrutil.h
deleted file mode 100644
index 5d8586d..0000000
--- a/ldap/servers/slapd/ntperfdll/nsldapctrutil.h
+++ /dev/null
@@ -1,157 +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 **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-
-
-/*++ BUILD Version: 0001 // Increment this if a change has global effects
-
-Copyright (c) 1992 Microsoft Corporation
-
-Module Name:
-
- perfutil.h
-
-Abstract:
-
-
-
- This file supports routines used to parse and create Performance Monitor Data
- Structures. It actually supports Performance Object types with multiple instances
-
-
-
-Revision History:
-
---*/
-#ifndef _PERFUTIL_H_
-#define _PERFUTIL_H_
-
-// enable this define to log process heap data to the event log
-#ifdef PROBE_HEAP_USAGE
-#undef PROBE_HEAP_USAGE
-#endif
-//
-
-
-// Utility macro. This is used to reserve a DWORD multiple of bytes for Unicode strings
-// embedded in the definitional data, viz., object instance names.
-
-
-//
-
-
-#define DWORD_MULTIPLE(x) (((x+sizeof(DWORD)-1)/sizeof(DWORD))*sizeof(DWORD))
-
-
-
-// (assumes dword is 4 bytes long and pointer is a dword in size)
-
-
-#define ALIGN_ON_DWORD(x) ((VOID *)( ((DWORD) x & 0x00000003) ? ( ((DWORD) x & 0xFFFFFFFC) + 4 ) : ( (DWORD) x ) ))
-
-
-
-extern WCHAR GLOBAL_STRING[]; // Global command (get all local ctrs)
-extern WCHAR FOREIGN_STRING[]; // get data from foreign computers
-extern WCHAR COSTLY_STRING[];
-
-
-extern WCHAR NULL_STRING[];
-
-
-
-#define QUERY_GLOBAL 1
-#define QUERY_ITEMS 2
-#define QUERY_FOREIGN 3
-#define QUERY_COSTLY 4
-
-//
-
-
-// The definition of the only routine of perfutil.c, It builds part of a performance data
-// instance (PERF_INSTANCE_DEFINITION) as described in winperf.h
-
-
-//
-
-HANDLE MonOpenEventLog ();
-VOID MonCloseEventLog ();
-DWORD GetQueryType (IN LPWSTR);
-BOOL IsNumberInUnicodeList (DWORD, LPWSTR);
-
-typedef struct _LOCAL_HEAP_INFO_BLOCK {
- DWORD AllocatedEntries;
- DWORD AllocatedBytes;
- DWORD FreeEntries;
- DWORD FreeBytes;
-} LOCAL_HEAP_INFO, *PLOCAL_HEAP_INFO;
-
-
-//
-// Memory Probe macro
-//
-#ifdef PROBE_HEAP_USAGE
-
-#define HEAP_PROBE() { \
- DWORD dwHeapStatus[5]; \
- NTSTATUS CallStatus; \
- dwHeapStatus[4] = __LINE__; \
- if (!(CallStatus = memprobe (dwHeapStatus, 16L, NULL))) { \
- REPORT_INFORMATION_DATA (VGA_HEAP_STATUS, LOG_DEBUG, \
- &dwHeapStatus, sizeof(dwHeapStatus)); \
- } else { \
- REPORT_ERROR_DATA (VGA_HEAP_STATUS_ERROR, LOG_DEBUG, \
- &CallStatus, sizeof (DWORD)); \
- } \
-}
-
-#else
-
-#define HEAP_PROBE() ;
-
-
-
-
-
-#endif
-
-#endif //_PERFUTIL_H_
diff --git a/ldap/servers/slapd/ntperfdll/nsldapreg.ini b/ldap/servers/slapd/ntperfdll/nsldapreg.ini
deleted file mode 100644
index c508130..0000000
--- a/ldap/servers/slapd/ntperfdll/nsldapreg.ini
+++ /dev/null
@@ -1,50 +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
-#
-\Registry\Machine
- System
- CurrentControlSet
- Services
- slapd1
- Performance
- Close = REG_SZ CloseNSPerformanceData
- Collect = REG_SZ CollectNSPerformanceData
- Library = REG_SZ nsctr.dll
- Open = REG_SZ OpenNSPerformanceData
-
diff --git a/ldap/servers/slapd/ntwdog/cron_conf.c b/ldap/servers/slapd/ntwdog/cron_conf.c
deleted file mode 100644
index 02db64f..0000000
--- a/ldap/servers/slapd/ntwdog/cron_conf.c
+++ /dev/null
@@ -1,691 +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 **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-
-#include <windows.h>
-#include <stdio.h>
-#include <string.h>
-#include <process.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include "cron_conf.h"
-
-#define NSAPI_PUBLIC
-
-#ifndef BUF_SIZE
-#define BUF_SIZE 4096
-#endif
-
-#ifndef S_BUF_SIZE
-#define S_BUF_SIZE 1024
-#endif
-
-#ifdef XP_WIN32
-#pragma warning (disable: 4005) // macro redifinition //
-#define MALLOC(size) malloc(size)
-#define REALLOC(x, size) realloc(x, size)
-#define FREE(x) free((void*) x)
-#define STRDUP(x) strdup(x)
-#define strcasecmp(x, y) stricmp(x, y)
-#pragma warning (default: 4005) // macro redifinition //
-#endif
-
-static char *admroot;
-static char *nsroot;
-
-#define DAILY "Sun Mon Tue Wed Thu Fri Sat"
-
-static cron_conf_list *cclist = NULL;
-static cron_conf_list *cctail = NULL;
-static char *conffile = NULL;
-
-#ifndef CRON_CONF_STAND_ALONE
-static void set_roots()
-{
- char *ar = ADMCONFDIR;
- if(ar)
- admroot = STRDUP(ar);
-}
-#endif
-
-/* General note: strtok() is not MT safe on Unix , but it is okay to call
- here because this file is NT only and strtok() is MT safe on NT */
-
-static char *nocr(char *buf)
-{
- if (buf)
- {
- if(buf[strlen(buf) - 1] == '\n')
- buf[strlen(buf) - 1] = '\0';
- }
-
- return buf;
-}
-
-static int debug(char *fmt, ...)
-{
- va_list args;
- char buf[BUF_SIZE];
-
- va_start(args, fmt);
- vsprintf(buf, fmt, args);
- va_end(args);
-
- fprintf(stdout, "<<DEBUG>> %s <<DEBUG>>\n", buf);
- fflush(stdout);
-
- return 1;
-}
-
-static char *get_conf_file()
-{
- static char conffile [S_BUF_SIZE];
- char nsconfile[S_BUF_SIZE];
- char buf [BUF_SIZE];
- char *r, *p;
- FILE *fp;
- int flag = 0;
-
- if (admroot)
- sprintf(nsconfile, "%s/ns-cron.conf", admroot);
- else
- sprintf(nsconfile, "%s/admin-serv/config/ns-cron.conf", nsroot);
-
- if (!(fp = fopen(nsconfile, "r")))
- return NULL;
-
- while(fgets(buf, sizeof(buf), fp))
- {
- r = strtok(buf, " \t\n");
- if (!r) /* bad line, ignore */
- continue;
-
- p = strtok(NULL, " \t\n");
- if (!p) /* bad line, ignore */
- continue;
-
- if (!strcasecmp(r, "ConfFile"))
- {
- /* if filename without path is specified, default to admin svr dir */
- if((strchr(p, '\\') == NULL) &&
- (strchr(p, '/') == NULL))
- sprintf(conffile, "%s/%s", admroot, p);
- else
- sprintf(conffile, "%s", p);
- flag++;
- break;
- }
- }
-
- fclose(fp);
-
- if (!flag)
- return NULL;
-
- return conffile;
-}
-
-
-#ifndef CRON_CONF_STAND_ALONE
-NSAPI_PUBLIC
-#endif
-cron_conf_obj *cron_conf_create_obj(char *name, char *command, char *dir,
- char *user, char *start_time, char *days)
-{
- cron_conf_obj *object;
- char *d = NULL;
-
- object = (cron_conf_obj*)MALLOC(sizeof(cron_conf_obj));
-
- object->name = (name) ? STRDUP(name) : NULL;
- object->command = (command) ? STRDUP(command) : NULL;
- object->dir = (dir) ? STRDUP(dir) : NULL;
- object->user = (user) ? STRDUP(user) : NULL;
- object->start_time = (start_time) ? STRDUP(start_time) : NULL;
-
-#if 1
- if (days)
- {
- if (!(strcasecmp(days, "Daily")))
- d = STRDUP(DAILY);
- else
- d = STRDUP(days);
- }
-#else
- d = STRDUP("Wed Thu");
-#endif
-
- object->days = d;
-
- return object;
-}
-
-
-static void cron_conf_free_listobj(cron_conf_list *lobj)
-{
- cron_conf_obj *obj = lobj->obj;
-
-
- if (obj)
- {
- if(obj->name) FREE(obj->name);
- if(obj->command) FREE(obj->command);
- if(obj->dir) FREE(obj->dir);
- if(obj->user) FREE(obj->user);
- if(obj->start_time) FREE(obj->start_time);
- if(obj->days) FREE(obj->days);
-
- FREE(obj);
- }
-
- FREE(lobj);
-}
-
-
-static cron_conf_obj *get_object(FILE *fp)
-{
- cron_conf_obj *object;
- char name [S_BUF_SIZE];
- char command [S_BUF_SIZE];
- char dir [S_BUF_SIZE];
- char user [S_BUF_SIZE];
- char start_time[S_BUF_SIZE];
- char days [S_BUF_SIZE];
- char buf [BUF_SIZE];
- char *p, *q;
- int flag = 0;
- int hascom, hasdir, hasuser, hastime, hasdays;
-
- p = fgets(buf, sizeof(buf), fp);
-
- if (!p)
- return NULL;
- /* else debug("Read line '%s'", nocr(buf)); */
-
- if (strncmp(buf, "<Object", 7))
- return NULL;
-
- hascom = hasdir = hasuser = hastime = hasdays = 0;
-
- p = strtok(buf, "<=>\n\t ");
- if (!p)
- return NULL;
-
- p = strtok(NULL, "<=>\n\t ");
- if (!p)
- return NULL;
-
- p = strtok(NULL, "<=>\n\t ");
- if (!p)
- return NULL;
-
- sprintf(name, "%s", p);
- /* debug("Setting name to '%s'", name); */
-
- while(fgets(buf, sizeof(buf), fp))
- {
- /* debug("Read line '%s'", nocr(buf)); */
-
- p = strtok(buf, " \t\n");
-
- if (!p)
- continue;
-
- if (!strcasecmp(p, "</Object>"))
- {
- flag++;
- break;
- }
-
- if(!strcasecmp(p, "Command"))
- {
- q = strtok(NULL, "\n");
-
- if (q)
- q = strchr(q, '\"');
-
- if (q)
- q++;
-
- if (q)
- {
- if (!hascom)
- {
- /* get rid of quotes */
- p = strrchr(q, '\"');
-
- if (p)
- *p = '\0';
-
- if (q)
- {
- PR_snprintf(command, S_BUF_SIZE, "%s", q);
- /* debug("Setting command to '%s'", command); */
- hascom++;
- }
- }
- else /* already has a command */
- ; /* ignore */
- }
- continue;
- }
-
- if(!strcasecmp(p, "Dir"))
- {
- q = strtok(NULL, "\n");
-
- if (q)
- q = strchr(q, '\"');
-
- if (q)
- q++;
-
- if (q)
- {
- if (!hasdir)
- {
- /* get rid of quotes */
- p = strrchr(q, '\"');
-
- if (p)
- *p = '\0';
-
- if (q)
- {
- PR_snprintf(dir, S_BUF_SIZE, "%s", q);
- /* debug("Setting dir to '%s'", dir); */
- hasdir++;
- }
- }
- else /* already has a dir */
- ; /* ignore */
- }
- continue;
- }
-
- else if(!strcasecmp(p, "User"))
- {
- q = strtok(NULL, " \t\n");
-
- if (q)
- {
- if (!hasuser)
- {
- PR_snprintf(user, S_BUF_SIZE, "%s", q);
- /* debug("Setting user to '%s'", user); */
- hasuser++;
- }
- else /* already has a user */
- ; /* ignore */
- }
- continue;
- }
-
- else if(!strcasecmp(p, "Time"))
- {
- q = strtok(NULL, "\n");
-
- if (q)
- {
- if (!hastime)
- {
- PR_snprintf(start_time, S_BUF_SIZE, "%s", q);
- /* debug("Setting time to '%s'", start_time); */
- hastime++;
- }
- else /* already has a time */
- ; /* ignore */
- }
- continue;
- }
-
- else if(!strcasecmp(p, "Days"))
- {
- q = strtok(NULL, "\n");
-
- if (q)
- {
- if (!hasdays)
- {
- PR_snprintf(days, S_BUF_SIZE, "%s", q);
- /* debug("Setting days to '%s'", days); */
- hasdays++;
- }
- else /* already has days */
- ; /* ignore */
- }
- continue;
- }
-
- else
- {
- /* gibberish... ignore... will be fixed when
- file is rewritten */
- continue;
- }
- }
-
- object = cron_conf_create_obj(name,
- (hascom) ? command : NULL,
- (hasdir) ? dir : NULL,
- (hasuser) ? user : NULL,
- (hastime) ? start_time : NULL,
- (hasdays) ? days : NULL);
-
- return object;
-}
-
-
-static void cron_conf_write_stream(FILE *fp)
-{
- cron_conf_obj *obj;
- cron_conf_list *lobj;
-
- for(lobj = cclist; lobj; lobj = lobj->next)
- {
- obj = lobj->obj;
-
- fprintf(fp, "<Object name=%s>\n", (obj->name) ? obj->name : "?");
- fprintf(fp, " Command \"%s\"\n", (obj->command) ? obj->command : "?");
- if (obj->dir)
- fprintf(fp, " Dir \"%s\"\n", obj->dir);
- if (obj->user)
- fprintf(fp, " User %s\n", obj->user);
- fprintf(fp, " Time %s\n", (obj->start_time) ? obj->start_time : "?");
- fprintf(fp, " Days %s\n", (obj->days) ? obj->days : "?");
- fprintf(fp, "</Object>\n");
- }
-}
-
-
-static void cron_conf_delete(char *name, cron_conf_obj *cco)
-{
- cron_conf_list *lobj = NULL;
- cron_conf_list *pobj = NULL;
-
- if (!cclist)
- return;
-
- if (!strcmp(cclist->name, name))
- {
- lobj = cclist;
- cclist = cclist->next;
- if (cctail == lobj)
- cctail = cclist;
-
- cron_conf_free_listobj(lobj);
- }
- else
- {
- pobj = cclist;
-
- for(lobj = cclist->next; lobj; lobj = lobj->next)
- {
- if(!strcmp(lobj->name, name))
- {
- if (lobj == cctail)
- cctail = pobj;
-
- pobj->next = lobj->next;
- cron_conf_free_listobj(lobj);
-
- break;
- }
-
- pobj = lobj;
- }
- }
-
- return;
-}
-
-#ifndef CRON_CONF_STAND_ALONE
-NSAPI_PUBLIC
-#endif
-int cron_conf_read()
-{
- FILE *fp;
- cron_conf_obj *obj;
- cron_conf_list *lobj;
-
-#ifndef CRON_CONF_STAND_ALONE
- set_roots();
-#endif
-
- if (!(conffile = get_conf_file()))
- {
- /* debug("Conffile is null"); */
- return 0;
- }
- /* else debug("Conffile: '%s'", conffile); */
-
- if (!(fp = fopen(conffile, "r")))
- {
- /* debug("Couldn't open conffile"); */
- return 0;
- }
-
- while((obj = get_object(fp)))
- {
- lobj = (cron_conf_list*)MALLOC(sizeof(struct cron_conf_list));
- lobj->name = obj->name;
- lobj->obj = obj;
- lobj->next = NULL;
-
- /* debug("Created a list object named '%s'", lobj->name); */
-
- if(cclist == NULL) /* first object */
- {
- cclist = cctail = lobj;
- }
- else
- {
- cctail->next = lobj;
- cctail = lobj;
- }
-
- /* debug("List now, head: '%s', tail: '%s'",
- cclist->name, cctail->name); */
- }
-
- fclose(fp);
-
- return 1;
-}
-
-#ifndef CRON_CONF_STAND_ALONE
-NSAPI_PUBLIC
-#endif
-cron_conf_obj *cron_conf_get(char *name)
-{
- cron_conf_obj *obj = NULL;
- cron_conf_list *lobj = NULL;
-
- /* find object */
- for(lobj = cclist; lobj; lobj = lobj->next)
- {
- if(!strcmp(lobj->name, name))
- {
- obj = lobj->obj;
- break;
- }
- }
-
-#if 0
- if (obj)
- {
- debug("Found object %s", obj->name);
- debug("obj->command = %s", (obj->command) ? obj->command : "NULL");
- debug("obj->dir = %s", (obj->dir) ? obj->dir : "NULL");
- debug("obj->user = %s", (obj->user) ? obj->user : "NULL");
- debug("obj->start_time = %s", (obj->start_time) ? obj->start_time : "NULL");
- debug("obj->days = %s", (obj->days) ? obj->days : "NULL");
- }
-#endif
-
- return obj;
-}
-
-
-#ifndef CRON_CONF_STAND_ALONE
-NSAPI_PUBLIC
-#endif
-cron_conf_list *cron_conf_get_list()
-{
- return cclist;
-}
-
-#ifndef CRON_CONF_STAND_ALONE
-NSAPI_PUBLIC
-#endif
-cron_conf_obj *cron_conf_set(char *name, cron_conf_obj *cco)
-{
- cron_conf_obj *obj = NULL;
- cron_conf_list *lobj = NULL;
-
- if (!name)
- return NULL;
-
- if (!cco)
- {
- cron_conf_delete(name, cco);
- return NULL;
- }
- else /* cco exists */
- {
- /* find object */
- obj = cron_conf_get(name);
-
-
- if (obj) /* found it */
- {
- if (cco->command)
- {
- FREE(obj->command);
- obj->command = cco->command;
- }
-
- if (cco->dir)
- {
- FREE(obj->dir);
- obj->dir = cco->dir;
- }
-
- if (cco->user)
- {
- FREE(obj->user);
- obj->user = cco->user;
- }
-
- if (cco->start_time)
- {
- FREE(obj->start_time);
- obj->start_time = cco->start_time;
- }
-
- if (cco->days)
- {
- FREE(obj->days);
- obj->days = cco->days;
- }
-
- FREE(cco);
- }
- else /* couldn't find it */
- {
- obj = cco;
-
- lobj = (cron_conf_list*)MALLOC(sizeof(cron_conf_list));
- lobj->name = obj->name;
- lobj->obj = obj;
- lobj->next = NULL;
-
- if(cclist == NULL) /* first object */
- {
- cclist = cctail = lobj;
- }
- else
- {
- cctail->next = lobj;
- cctail = lobj;
- }
- }
- }
-
- return obj;
-}
-
-void cron_conf_write()
-{
- FILE *fp;
-
- if (!conffile)
- conffile = get_conf_file();
-
- if(!(fp = fopen(conffile, "w")))
- return;
-
- cron_conf_write_stream(fp);
-
- fclose(fp);
-}
-
-
-#ifndef CRON_CONF_STAND_ALONE
-NSAPI_PUBLIC
-#endif
-void cron_conf_free()
-{
- cron_conf_list *lobj = NULL;
-
- /* find object */
- while(cclist)
- {
- lobj = cclist;
- cclist = cclist->next;
-
- cron_conf_free_listobj(lobj);
- }
-
- cclist = cctail = NULL;
-}
-
diff --git a/ldap/servers/slapd/ntwdog/cron_conf.h b/ldap/servers/slapd/ntwdog/cron_conf.h
deleted file mode 100644
index 1cc43ee..0000000
--- a/ldap/servers/slapd/ntwdog/cron_conf.h
+++ /dev/null
@@ -1,122 +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 **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/***********************************************************************
-** $Id: cron_conf.h,v 1.6 2006/11/10 23:45:49 nhosoi Exp $
-**
-**
-** NAME
-** cron_conf.h
-**
-** DESCRIPTION
-**
-**
-** AUTHOR
-** <robw(a)netscape.com>
-**
-***********************************************************************/
-
-#ifndef _CRON_CONF_H_
-#define _CRON_CONF_H_
-
-/***********************************************************************
-** Includes
-***********************************************************************/
-/* read and write to cron.conf, cron_conf.c */
-/* Alex Feygin, 3/22/96 */
-typedef struct cron_conf_obj
-{
- char *name;
- char *command;
- char *dir;
- char *user;
- char *start_time;
- char *days;
-}
-cron_conf_obj;
-
-typedef struct cron_conf_list
-{
- char *name;
- cron_conf_obj *obj;
- struct cron_conf_list *next;
-}
-cron_conf_list;
-
-/* Reads cron.conf to a null terminated list of cron_conf_objects; returns
- 0 if unable to do a read; 1 otherwise */
-int cron_conf_read();
-
-/* gets a cron object, NULL if it doesnt exist */
-cron_conf_obj *cron_conf_get(char *name);
-
-/* returns a NULL-terminated cron_conf_list of all the cron conf objects */
-cron_conf_list *cron_conf_get_list();
-
-/* Creates a cron conf object; all these args get STRDUP'd in the function
- so make sure to free up the space later if need be */
-cron_conf_obj *cron_conf_create_obj(char *name, char *command,
- char *dir, char *user,
- char *start_time, char *days);
-
-/* Puts a cron conf object into list or updates it if it already in there.
- Returns either the object passed or the object in there already;
- cco may be FREE'd during this operation so if you need the object
- back, call it like so:
-
- cco = cron_conf_set(cco->name, cco);
-
- calling cron_conf_set with a NULL cco will cause the 'name' object
- to be deleted.
-*/
-cron_conf_obj *cron_conf_set(char *name, cron_conf_obj *cco);
-
-/* write out current list of cron_conf_objects to cron.conf file */
-void cron_conf_write();
-
-/* free all cron conf data structures */
-void cron_conf_free();
-
-#define ADMCONFDIR "../config/"
-
-
-#endif /* _CRON_CONF_H_ */
diff --git a/ldap/servers/slapd/ntwdog/ntcron.c b/ldap/servers/slapd/ntwdog/ntcron.c
deleted file mode 100644
index 8977936..0000000
--- a/ldap/servers/slapd/ntwdog/ntcron.c
+++ /dev/null
@@ -1,193 +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 **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-// //
-// Name: NTCRON //
-// Platforms: WIN32 //
-// Description: unix cron functionality in a separate thread //
-// Notes: //
-// The following assumptions are made: //
-// - gszServerRoot is set to c:\netscape\server //
-// - ns-cron.conf and cron.conf are available //
-// Todo: //
-// - handle time format variations of hh:mm //
-// - keep track of children //
-// ...................................................................... //
-// Revision History: //
-// 03-26-96 Initial Version, Andy Hakim (ahakim(a)netscape.com) //
-// 07-10-96 Modified for Directory Server, pkennedy(a)netscape.com //
-//--------------------------------------------------------------------------//
-#include <windows.h>
-#include "ntwatchdog.h"
-#include "ntslapdmessages.h" // event log msgs constants //
-#include "cron_conf.h"
-
-static cron_conf_list *cclist = NULL;
-
-
-//--------------------------------------------------------------------------//
-// //
-//--------------------------------------------------------------------------//
-BOOL CRON_CheckDay(LPSYSTEMTIME lpstNow, char *szDays)
-{
- BOOL bReturn = FALSE;
- char szToday[16];
- if(GetDateFormat((LCID)NULL, 0, lpstNow, "ddd", szToday, sizeof(szToday)) != 0)
- {
- strlwr(szDays);
- strlwr(szToday);
- if(strstr(szDays, szToday) != NULL)
- bReturn = TRUE;
- }
- return(bReturn);
-}
-
-
-
-//--------------------------------------------------------------------------//
-// //
-//--------------------------------------------------------------------------//
-BOOL CRON_CheckTime(LPSYSTEMTIME lpstNow, char *szTime)
-{
- BOOL bReturn = FALSE;
- char szCurrentTime[16];
- char szStartTime[16];
-
- strncpy(szStartTime, szTime, sizeof(szStartTime)-1);
-
- if(szTime[1] == ':')
- wsprintf(szStartTime, "0%s", szTime);
-
- if(GetTimeFormat((LCID)LOCALE_SYSTEM_DEFAULT, TIME_FORCE24HOURFORMAT, lpstNow, "hh:mm", szCurrentTime, sizeof(szCurrentTime)) != 0)
- {
- if(strcmp(szCurrentTime, szStartTime) == 0)
- bReturn = TRUE;
- }
- return(bReturn);
-}
-
-
-
-//--------------------------------------------------------------------------//
-// //
-//--------------------------------------------------------------------------//
-BOOL CRON_StartJob(PROCESS_INFORMATION *pi, cron_conf_obj *cco)
-{
- BOOL bReturn = FALSE;
- STARTUPINFO sui;
-
- sui.cb = sizeof(STARTUPINFO);
- sui.lpReserved = 0;
- sui.lpDesktop = NULL;
- sui.lpTitle = NULL;
- sui.dwX = 0;
- sui.dwY = 0;
- sui.dwXSize = 0;
- sui.dwYSize = 0;
- sui.dwXCountChars = 0;
- sui.dwYCountChars = 0;
- sui.dwFillAttribute = 0;
- sui.dwFlags = STARTF_USESHOWWINDOW;
- sui.wShowWindow = SW_SHOWMINIMIZED;
- sui.cbReserved2 = 0;
- sui.lpReserved2 = 0;
- sui.hStdInput = 0;
- sui.hStdOutput = 0;
- sui.hStdError = 0;
-
- bReturn = CreateProcess(NULL, cco->command, NULL, NULL,
- TRUE, 0, NULL, cco->dir, &sui, pi );
- if(!bReturn)
- WD_SysLog(EVENTLOG_ERROR_TYPE, MSG_CRON_STARTFAILED, cco->name);
-
- return(bReturn);
-}
-
-
-//--------------------------------------------------------------------------//
-// //
-//--------------------------------------------------------------------------//
-BOOL CRON_CheckConfFile()
-{
- BOOL bReturn = FALSE;
- PROCESS_INFORMATION pi;
- SYSTEMTIME stNow;
-
- GetLocalTime(&stNow); // note: this provides time adjusted for local time zone
-
- if(cron_conf_read())
- cclist = cron_conf_get_list();
-
- while((cclist) && (cclist->obj))
- {
- cron_conf_obj *cco = cclist->obj;
- if((cco->days) && (cco->start_time) && (cco->command))
- {
- if(CRON_CheckDay(&stNow, cco->days) && CRON_CheckTime(&stNow, cco->start_time))
- {
- bReturn = CRON_StartJob(&pi, cco);
- CLOSEHANDLE(pi.hProcess);
- CLOSEHANDLE(pi.hThread);
- }
- }
- cclist = cclist->next;
- }
- cron_conf_free();
- return bReturn;
-}
-
-
-
-//--------------------------------------------------------------------------//
-// //
-//--------------------------------------------------------------------------//
-LPTHREAD_START_ROUTINE CRON_ThreadProc(HANDLE hevWatchDogExit)
-{
- BOOL bExit = FALSE;
- while(!bExit)
- {
- CRON_CheckConfFile();
- if(WaitForSingleObject(hevWatchDogExit, 1000*DEFAULT_CRON_TIME) != WAIT_TIMEOUT)
- bExit = TRUE;
- }
- return 0;
-}
diff --git a/ldap/servers/slapd/ntwdog/ntwatchdog.c b/ldap/servers/slapd/ntwdog/ntwatchdog.c
deleted file mode 100644
index b607c3e..0000000
--- a/ldap/servers/slapd/ntwdog/ntwatchdog.c
+++ /dev/null
@@ -1,1194 +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 **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#pragma warning(disable : 4001)
-// disable warning C4001: nonstandard extension 'single line comment' was used
-
-// //
-// Name: NTWATCHDOG //
-// Platforms: WIN32 //
-// Description: shell for nt directory server, runs as service, launches //
-// server, monitors it, re-launches if server crashes, //
-// Notes: //
-// ...................................................................... //
-// Watchdog can be run as an application or a service. When run as a //
-// service, it uses the service name from the SCM for the server name. //
-// When run as an application, it uses the command line to determine //
-// the server name. The command line can be one of two formats: //
-// c:\navgold\server\slapd-kennedy\config //
-// or //
-// slapd-kennedy //
-// ...................................................................... //
-// server file "lib\base\servssl.c" was changed //
-// - added code to get password from WatchDog process //
-// ...................................................................... //
-// server file "httpd\src\ntmain.c" was changed //
-// - server always runs as an application //
-// - changed hServerDoneEvent global name to "NS_service_name" //
-// this was necessary so that WatchDog can trap the "service_name" event //
-// - above changes were also made in MultipleInstances() //
-// ...................................................................... //
-// server file "lib\libmessages\messages.mc" was changed //
-// - added a couple of extra messages for watchdog event logging //
-// - watchdog is dependent on the server's eventlog source name //
-// ...................................................................... //
-// Revision History: //
-// 01-12-96 Initial Version, Andy Hakim (ahakim(a)netscape.com) //
-// 02-01-96 changed restart logic, now based on infant mortality time //
-// instead of server exit code //
-// 07-10-96 Modified for Directory Server, pkennedy(a)netscape.com //
-// //
-//--------------------------------------------------------------------------//
-#include <windows.h>
-#include <stdio.h>
-#include <string.h>
-#include <process.h>
-#include "ntslapdmessages.h" // event log msgs constants //
-#include "regparms.h" // product name, etc //
-#include "ntwatchdog.h"
-#include "version.h"
-#include "ntresource.h"
-#include "proto-ntutil.h"
-
-#ifdef PUMPKIN_HOUR
-#include <time.h>
-#endif
-
-//--------------------------------------------------------------------------//
-// global variables //
-//--------------------------------------------------------------------------//
-SERVICE_STATUS_HANDLE gsshServiceStatus = 0L;
-HWND ghWndMain = NULL;
-HANDLE ghevWatchDogExit = NULL;
-HINSTANCE ghInstance = NULL;
-HANDLE ghdlgPassword = NULL; // handle to password dialog window
-HANDLE ghDuplicateProcess = NULL; // process handle with PROCESS_VM_READ access
-HANDLE ghServerProcess = NULL; // used by app window in TerminateProcess()
-HANDLE ghServerThread0 = NULL; // used by app window in Suspend/ResumeThread()
-HANDLE ghWdogProcess = NULL;
-char gszServerConfig[MAX_LINE]; // ex: c:\netscape\server\slapd-kennedy\config
-char gszServerName[MAX_LINE]; // ex: slapd-kennedy
-char gszServerRoot[MAX_LINE]; // ex: c:\netscape\server
-char gszPassword[2048];
-DWORD gdwServiceError = NO_ERROR; // return error code for service
-DWORD gdwLastStatus = SERVICE_RUNNING;
-
-//--------------------------------------------------------------------------//
-// This is the shutdown handler we register via SetConsoleCtrlHandler()
-// It is really the only guaranteed means we have of shutting down gracefully
-// when the sytem is shutting down. The Service Manager mechanism is not
-// guaranteed to work.
-//--------------------------------------------------------------------------//
-
-BOOL WINAPI WD_ControlHandler(DWORD dwCtrlType)
-{
- if (dwCtrlType == CTRL_SHUTDOWN_EVENT) {
- SetEvent(ghevWatchDogExit);
- WaitForSingleObject(ghWdogProcess, 1000 * DEFAULT_KILL_TIME);
- return TRUE;
- }
- return FALSE;
-}
-
-
-//--------------------------------------------------------------------------//
-// calc szServerRoot given szServerName //
-//--------------------------------------------------------------------------//
-BOOL WD_GetServerConfig(char *szServerId, char *szServerRoot, LPDWORD cbServerRoot)
-{
- BOOL bReturn = FALSE;
- HANDLE hSlapdKey = 0;
- char szSlapdKey[MAX_PATH];
- DWORD dwValueType;
- DWORD dwResult = 0;
-
- // don't want to monitor Admin server
- if(strcmp(ADM_KEY_ROOT, szServerId) == 0)
- return(bReturn);
-
- // query registry key to figure out config directory
- _snprintf(szSlapdKey, sizeof(szSlapdKey), "%s\\%s\\%s", KEY_SOFTWARE_NETSCAPE, SVR_KEY_ROOT,
- szServerId);
- szSlapdKey[sizeof(szSlapdKey)-1] = (char)0;
-
- dwResult = RegOpenKey(HKEY_LOCAL_MACHINE, szSlapdKey, &hSlapdKey);
- if(dwResult == ERROR_SUCCESS)
- {
- dwResult = RegQueryValueEx(hSlapdKey, VALUE_CONFIG_PATH, NULL,
- &dwValueType, (LPBYTE)szServerRoot, cbServerRoot);
- if(dwResult == ERROR_SUCCESS)
- bReturn = TRUE;
- RegCloseKey(hSlapdKey);
- }
- return(bReturn);
-}
-
-
-
-//--------------------------------------------------------------------------//
-// get server's id based on index value that corresponds to the order in //
-// which it is listed under the the registry \SOFTWARE\Netscape\.. //
-//--------------------------------------------------------------------------//
-BOOL WD_GetServerId(IN DWORD dwSubKey, OUT char *szServerId, IN OUT LPDWORD cbServerId)
-{
- BOOL bReturn = FALSE;
- static HANDLE hSlapdKey = 0;
- DWORD dwResult = ERROR_SUCCESS;
- FILETIME ftLastWrite;
- char szSlapdKey[MAX_LINE];
-
- if(dwSubKey == 0) {
- _snprintf(szSlapdKey, sizeof(szSlapdKey), "%s\\%s", KEY_SOFTWARE_NETSCAPE, SVR_KEY_ROOT);
- szSlapdKey[sizeof(szSlapdKey)-1] = (char)0;
- dwResult = RegOpenKey(HKEY_LOCAL_MACHINE, szSlapdKey,
- &hSlapdKey);
- }
-
- if(dwResult == ERROR_SUCCESS)
- {
- dwResult = RegEnumKeyEx(hSlapdKey, dwSubKey, szServerId,
- cbServerId, NULL, NULL, NULL, &ftLastWrite);
- if(dwResult == ERROR_SUCCESS)
- {
- bReturn = TRUE;
- }
- else
- {
- RegCloseKey(hSlapdKey);
- hSlapdKey = 0;
- }
- }
- return(bReturn);
-}
-
-
-
-//--------------------------------------------------------------------------//
-// //
-//--------------------------------------------------------------------------//
-BOOL WD_IsServiceRunning(char *szServerId)
-{
- BOOL bReturn = FALSE;
- SC_HANDLE hscManager;
- SC_HANDLE hscService;
- SERVICE_STATUS ssServiceStatus;
-
- if(hscManager = OpenSCManager(NULL, NULL, GENERIC_READ))
- {
- if(hscService = OpenService(hscManager, szServerId, SERVICE_QUERY_STATUS))
- {
- if(QueryServiceStatus(hscService, &ssServiceStatus))
- {
- if(ssServiceStatus.dwCurrentState != SERVICE_STOPPED)
- {
- bReturn = TRUE;
- }
- }
- CloseServiceHandle(hscService);
- }
- CloseServiceHandle(hscManager);
- }
- return(bReturn);
-}
-
-
-
-
-
-//--------------------------------------------------------------------------//
-// get a list of installed servers //
-//--------------------------------------------------------------------------//
-int WD_GetRunningServerCount(void)
-{
- int nServerCount = 0;
- int nEnumIndex = 0;
- char szServerId[MAX_PATH];
- DWORD cbServerId = sizeof(szServerId);
- char szServerRoot[MAX_PATH];
- DWORD cbServerRoot = sizeof(szServerRoot);
-
- while(WD_GetServerId(nEnumIndex++, szServerId, &cbServerId))
- {
- cbServerId = sizeof(szServerId);
- // we have an entry that MIGHT be a server, but check to see if it really is one
- if(WD_GetServerConfig(szServerId, szServerRoot, &cbServerRoot))
- {
- if(WD_IsServiceRunning(szServerId))
- nServerCount++;
- }
- cbServerRoot = sizeof(szServerRoot);
- }
-
- return(nServerCount);
-}
-
-
-
-//--------------------------------------------------------------------------//
-// //
-//--------------------------------------------------------------------------//
-DWORD WD_GetDefaultKeyValue(char *szServerName, char *szKeyName, DWORD dwDefault)
-{
- HANDLE hSlapdKey = 0;
- char szSlapdKey[MAX_LINE];
- DWORD dwValueType;
- DWORD dwValue = dwDefault;
- DWORD cbValue = sizeof(dwValue);
-
- // query registry key to figure out config directory
- _snprintf(szSlapdKey, sizeof(szSlapdKey), "%s\\%s\\%s", KEY_SOFTWARE_NETSCAPE, SVR_KEY_ROOT,
- szServerName);
- szSlapdKey[sizeof(szSlapdKey)-1] = (char)0;
- if(RegOpenKey(HKEY_LOCAL_MACHINE, szSlapdKey, &hSlapdKey) == ERROR_SUCCESS)
- {
- RegQueryValueEx(hSlapdKey, szKeyName, NULL, &dwValueType,
- (LPBYTE)&dwValue, &cbValue);
- RegCloseKey(hSlapdKey);
- }
-
- return(dwValue);
-}
-
-
-//--------------------------------------------------------------------------//
-// figure out if we are running under Windows NT //
-//--------------------------------------------------------------------------//
-BOOL WD_IsWindowsNT(void)
-{
- BOOL bReturn = FALSE;
- OSVERSIONINFO osVersionInfo;
-
- osVersionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
- if(GetVersionEx(&osVersionInfo))
- {
- bReturn = (osVersionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT);
- }
- return(bReturn);
-}
-
-
-
-//--------------------------------------------------------------------------//
-// figure out if we have enough physical memory to operate server //
-//--------------------------------------------------------------------------//
-BOOL WD_IsEnoughResources(void)
-{
- BOOL bReturn = TRUE;
- MEMORYSTATUS ms;
- DWORD dwMinRamFree = 0;
- DWORD dwMinRamTotal = DEFAULT_MINRAMTOTAL;
- DWORD dwMinRamPerServer = DEFAULT_MINRAMPERSERVER;
-
- dwMinRamFree = WD_GetDefaultKeyValue(gszServerName, MINRAMFREE_KEY, DEFAULT_MINRAMFREE);
- dwMinRamTotal = WD_GetDefaultKeyValue(gszServerName, MINRAMTOTAL_KEY, DEFAULT_MINRAMTOTAL);
- dwMinRamPerServer = WD_GetDefaultKeyValue(gszServerName, MINRAMPERSERVER_KEY, DEFAULT_MINRAMPERSERVER);
-
- ZeroMemory((PVOID)&ms, sizeof(ms));
- GlobalMemoryStatus(&ms);
-
- if((ms.dwTotalPhys < (dwMinRamTotal * 1024)) || (ms.dwAvailPhys < (dwMinRamFree * 1024)))
- bReturn = FALSE;
-
- if(ms.dwTotalPhys < (WD_GetRunningServerCount() * dwMinRamPerServer * 1024))
- bReturn = FALSE;
-
- return(bReturn);
-}
-
-
-
-//--------------------------------------------------------------------------//
-// write error to EventLog service //
-//--------------------------------------------------------------------------//
-BOOL WD_SysLog(WORD fwEventType, DWORD IDEvent, char *szData)
-{
- BOOL bReturn = FALSE;
- HANDLE hEventSource;
- WORD fwCategory = 0; // event category
- PSID pUserSid = NULL; // user security identifier (optional)
- WORD cStrings = 1; // number of strings to merge with message
- DWORD cbData = 0; // size of binary data, in bytes
- LPCTSTR lpszStrings[64]; // array of strings to merge with message
- LPVOID lpvData = 0; // address of binary data
-
- hEventSource = RegisterEventSource(NULL, TEXT(EVENTLOG_APPNAME));
- if( hEventSource != NULL)
- {
- lpszStrings[0] = (LPCTSTR)gszServerName;
- if(szData != NULL)
- {
- lpszStrings[1] = (LPCTSTR)szData;
- cStrings++;
- }
-
- bReturn = ReportEvent(hEventSource, fwEventType, fwCategory,
- IDEvent, pUserSid, cStrings, cbData,
- lpszStrings, lpvData);
- DeregisterEventSource(hEventSource);
- }
-
- return(bReturn);
-}
-
-
-
-//--------------------------------------------------------------------------//
-// converts '/' chars to '\' //
-//--------------------------------------------------------------------------//
-void WD_UnixToDosPath(char *szText)
-{
- if(szText)
- {
- while(*szText)
- {
- if(*szText == '/')
-
- *szText = '\\';
- szText++;
- }
- }
-}
-
-
-
-//--------------------------------------------------------------------------//
-// calc szServerRoot given szServerConfig, and store szServerRoot in //
-// SLAPD_ROOT environment variable. //
-//--------------------------------------------------------------------------//
-BOOL WD_GetServerRoot(char *szServerRoot, char *szServerConfig)
-{
- char szTemp[MAX_LINE], szServerRootEnvVar[MAX_LINE];
- BOOL bReturn = FALSE;
- char *szChar = NULL;
-
- strncpy(szTemp, szServerConfig, sizeof(szTemp));
- szTemp[sizeof(szTemp)-1] = (char)0;
- // szTemp should be something like c:\navgold\server\slapd-kennedy\config
- if(szChar = strrchr(szTemp,'\\'))
- {
- *szChar = 0;
- // szTemp should be c:\navgold\server\slapd-kennedy
- if(szChar = strrchr(szTemp, '\\'))
- {
- *szChar = 0;
- // szTemp should be c:\navgold\server
- strncpy( szServerRoot, szTemp, sizeof(gszServerRoot) );
- szServerRoot[sizeof(gszServerRoot)-1] = (char)0;
- wsprintf(szServerRootEnvVar, "%s=%s", SLAPD_ROOT, szTemp);
- putenv(szServerRootEnvVar);
- bReturn = TRUE;
- }
- }
- return(bReturn);
-}
-
-
-
-//--------------------------------------------------------------------------//
-// calc szServerConfig given szServerName //
-//--------------------------------------------------------------------------//
-BOOL WD_GetConfigFromRegistry(char *szServerConfig, char *szServerName)
-{
- BOOL bReturn = FALSE;
- HANDLE hSlapdKey = 0;
- char szSlapdKey[MAX_LINE];
- DWORD dwValueType;
- char szValueString[MAX_LINE];
- DWORD cbValueString = sizeof(szValueString);
- DWORD dwResult = 0;
-
- // query registry key to figure out config directory
- _snprintf(szSlapdKey, sizeof(szSlapdKey), "%s\\%s\\%s", KEY_SOFTWARE_NETSCAPE, SVR_KEY_ROOT,
- szServerName);
- szSlapdKey[sizeof(szSlapdKey)-1] = (char)0;
-
- dwResult = RegOpenKey(HKEY_LOCAL_MACHINE, szSlapdKey, &hSlapdKey);
- if(dwResult != ERROR_SUCCESS)
- {
- WD_SysLog(EVENTLOG_ERROR_TYPE, MSG_WD_REGISTRY, szSlapdKey);
- return(bReturn);
- }
-
- dwResult = RegQueryValueEx(hSlapdKey, VALUE_CONFIG_PATH, NULL,
- &dwValueType, szValueString, &cbValueString);
- if(dwResult != ERROR_SUCCESS)
- {
- WD_SysLog(EVENTLOG_ERROR_TYPE, MSG_WD_REGISTRY, szSlapdKey);
- }
- else
- {
- strncpy(szServerConfig, szValueString, sizeof(gszServerConfig));
- szServerConfig[sizeof(gszServerConfig)-1] = (char)0;
- WD_UnixToDosPath(szServerConfig);
- WD_GetServerRoot(gszServerRoot, szServerConfig);
- bReturn = TRUE;
- }
- RegCloseKey(hSlapdKey);
- return(bReturn);
-}
-
-
-//--------------------------------------------------------------------------//
-// calc szServerConfig and szServerName given szCmdLine //
-//--------------------------------------------------------------------------//
-BOOL WD_GetConfigFromCmdline(char *szServerConfig, char *szServerName, char *szCmdLine)
-{
- BOOL bReturn = FALSE;
- char *szChar = NULL;
-
- if(!szCmdLine || !(strcmp(szCmdLine, "")) )
- {
- WD_SysLog(EVENTLOG_ERROR_TYPE, MSG_WD_BADCMDLINE, szCmdLine);
- return(bReturn);
- }
-
- strncpy(szServerConfig, szCmdLine, sizeof(gszServerConfig));
- szServerConfig[sizeof(gszServerConfig)-1] = (char)0;
- WD_UnixToDosPath(szCmdLine);
- WD_GetServerRoot(gszServerRoot, szCmdLine);
-
- // szCmdLine should be something like c:\navgold\server\slapd-kennedy\config
- if(szChar = strrchr(szCmdLine, '\\'))
- {
- *szChar = 0;
- // szCmdLine should be c:\navgold\server\slapd-kennedy
- if(szChar = strrchr(szCmdLine, '\\'))
- {
- szChar++;
- // szChar should point to slapd-kennedy
- strncpy(szServerName, szChar, sizeof(gszServerName));
- szServerName[sizeof(gszServerName)-1] = (char)0;
- WD_GetConfigFromRegistry(szServerConfig, szServerName);
- bReturn = TRUE;
-
- }
- }
- else
- {
- // szCmdLine should be something like slapd-kennedy
- strncpy(szServerName, szCmdLine, sizeof(gszServerName));
- szServerName[sizeof(gszServerName)-1] = (char)0;
- bReturn = WD_GetConfigFromRegistry(szServerConfig, szServerName);
- }
-
- if(strlen(szServerName) == 0)
- {
- WD_SysLog(EVENTLOG_ERROR_TYPE, MSG_WD_BADCMDLINE, szCmdLine);
- bReturn = FALSE;
- }
-
- return(bReturn);
-}
-
-
-
-//--------------------------------------------------------------------------//
-// parse server config file to see if it security is enabled //
-//--------------------------------------------------------------------------//
-BOOL WD_IsServerSecure(void)
-{
- BOOL bReturn = FALSE;
- char szFileName[MAX_PATH];
- char szText[MAX_LINE];
- char szSeperators[] = " \t\n";
- char *szTemp;
- FILE *fh = NULL;
-
- _snprintf(szFileName, sizeof(szFileName), "%s\\%s", gszServerConfig, SLAPD_CONF);
- szFileName[sizeof(szFileName)-1] = (char)0;
- if(fh = fopen(szFileName, "r"))
- {
- while(!feof(fh))
- {
- if(fgets(szText, sizeof(szText), fh))
- {
- strlwr(szText);
-
- /* strtok() is not MT safe on Unix , but it is okay to call
- here because this file is NT only and strtok() is MT safe on NT */
-
- if(szTemp = strtok(szText, szSeperators))
- {
- if(strcmp(szTemp, "security") == 0)
- {
- if(szTemp = strtok(NULL, szSeperators))
- {
- if(strcmp(szTemp, "on") == 0)
- bReturn = TRUE;
- }
- break;
- }
- }
- }
- }
- fclose(fh);
- }
-
- return(bReturn);
-}
-
-//--------------------------------------------------------------------------//
-// message proc window for app window //
-//--------------------------------------------------------------------------//
-LONG APIENTRY WD_MainWndProc(HWND hWnd, UINT message, UINT wParam, LONG lParam)
-{
- switch(message)
- {
- case WM_CREATE:
- break;
-
- case WM_CLOSE:
- SetEvent(ghevWatchDogExit);
- break;
-
- case WM_COMMAND:
- {
- switch(LOWORD(wParam))
- {
- case ID_SERVER_SHUTDOWN:
- {
- HANDLE hevShutdown = NULL;
- char szShutdownEvent[MAX_LINE];
-
- // shutdown web server, it should exit with 0, WatchDog won't restart it
- _snprintf(szShutdownEvent, sizeof(szShutdownEvent), "NS_%s", gszServerName);
- szShutdownEvent[sizeof(szShutdownEvent)-1] = (char)0;
- hevShutdown = OpenEvent(EVENT_MODIFY_STATE, FALSE, szShutdownEvent);
- if(hevShutdown)
- {
- SetEvent(hevShutdown); // try to exit gracefully
- CLOSEHANDLE(hevShutdown);
- }
- break;
- }
-
- case ID_SERVER_RESTART:
- {
- // shutdown web server, it should exit with 2, WatchDog will restart it
- if(ghServerProcess)
- {
- CLOSEHANDLE(ghServerProcess);
- TerminateProcess(ghServerProcess, 2);
- }
- break;
- }
-
- case ID_SERVER_SUSPEND:
- {
- if(ghServerThread0)
- SuspendThread(ghServerThread0);
- break;
- }
-
- case ID_SERVER_RESUME:
- {
- if(ghServerThread0)
- ResumeThread(ghServerThread0);
- break;
- }
-
- case ID_FILE_EXIT:
- PostMessage(hWnd, WM_CLOSE, 0, 0);
- break;
- }
- break;
- }
-
- default:
- return(DefWindowProc(hWnd, message, wParam, lParam));
- }
- return(0);
-}
-
-
-
-//--------------------------------------------------------------------------//
-// This window serves as an IPC method with the server process. It has //
-// pointers in it's storage area that the server uses to access the SSL //
-// password. Quite strange, but it works perfectly well. //
-//--------------------------------------------------------------------------//
-HWND WD_CreateWindow()
-{
- HWND hWndMain = NULL;
- WNDCLASS wc;
-
- wc.style = 0;
- wc.lpfnWndProc = (WNDPROC)WD_MainWndProc;
- wc.cbClsExtra = 0;
- wc.cbWndExtra = sizeof(LONG) * 4;
- wc.hIcon = LoadIcon(ghInstance, MAKEINTRESOURCE(IDI_LOGO));
- wc.hInstance = ghInstance;
- wc.hCursor = LoadCursor(NULL, IDC_ARROW);
- wc.hbrBackground = GetStockObject(GRAY_BRUSH);
- wc.lpszMenuName = MAKEINTRESOURCE(IDR_MENU);
- wc.lpszClassName = "slapd";
-
- RegisterClass(&wc); // class may be registered if more than one instance
-
- hWndMain = CreateWindow(
- wc.lpszClassName, /* See RegisterClass() call. */
- gszServerName, /* Text for window title bar. */
- WS_OVERLAPPEDWINDOW | /* Window style. */
- WS_POPUP, /* Window style. */
- CW_USEDEFAULT, /* Default horizontal position. */
- CW_USEDEFAULT, /* Default vertical position. */
- 320, /* Default width. */
- 0, /* Default height. */
- NULL, /* Overlapped windows have no parent. */
- NULL, /* Use the window class menu. */
- ghInstance, /* This instance owns this window. */
- NULL /* Pointer not needed. */
- );
-
- if(hWndMain)
- {
-#ifdef SHOW_DEBUG_WINDOW
- ShowWindow(hWndMain, SW_SHOWDEFAULT);
-#else
- ShowWindow(hWndMain, SW_HIDE);
-#endif
- UpdateWindow(hWndMain);
- }
- return hWndMain;
-}
-
-
-
-//--------------------------------------------------------------------------//
-// //
-//--------------------------------------------------------------------------//
-void WD_WindowThreadProc(LPDWORD lpdwParam)
-{
- HANDLE hevWindowCreated = (HANDLE)lpdwParam;
- MSG msg;
-
- // the ghWndMain global is used all over the place
- ghWndMain = WD_CreateWindow();
-
- // inform parent that window creation is complete because it is waiting on us
- SetEvent(hevWindowCreated);
-
- if(ghWndMain)
- {
- while(GetMessage(&msg, ghWndMain, 0, 0) == TRUE)
- {
- TranslateMessage(&msg); // Translates virtual key codes
- DispatchMessage(&msg); // Dispatches message to window
- }
- }
-}
-
-
-
-//--------------------------------------------------------------------------//
-// //
-//--------------------------------------------------------------------------//
-void WD_PasswordThreadProc(LPDWORD lpdwParam)
-{
- // app window must be created sometime during initialization
- if(ghWndMain)
- {
- ZeroMemory(gszPassword, sizeof(gszPassword));
- SetWindowLong(ghWndMain, GWL_PASSWORD_ADDR, (LONG)gszPassword);
- SetWindowLong(ghWndMain, GWL_PASSWORD_LENGTH, (LONG)0);
- }
-}
-
-
-
-//--------------------------------------------------------------------------//
-// //
-//--------------------------------------------------------------------------//
-BOOL WD_StartServer(PROCESS_INFORMATION *pi)
-{
- BOOL bReturn = FALSE;
- char szCmdLine[MAX_LINE];
- char szServerPath[MAX_PATH];
- char szInstancePath [MAX_PATH];
- char *szChar;
- STARTUPINFO sui;
- DWORD fdwCreate = DETACHED_PROCESS; /* flags for CreateProcess */
- int i;
- char *posfile;
- UNALIGNED long *posfhnd;
-
- if(!WD_IsEnoughResources())
- {
- WD_SysLog(EVENTLOG_ERROR_TYPE, MSG_WD_STRING, MSG_RESOURCES);
- gdwServiceError = ERROR_SERVICE_NOT_ACTIVE;
- return(FALSE);
- }
-
- strncpy(szServerPath, gszServerConfig, sizeof(szServerPath));
- szServerPath[sizeof(szServerPath)-1] = (char)0;
- WD_UnixToDosPath(szServerPath);
-
- // szServerPath should now be something similar to
- // c:\navgold\server\slapd-kennedy\config
- if(szChar = strrchr(szServerPath, '\\'))
- {
- *szChar = 0;
- strncpy (szInstancePath, szServerPath, sizeof(szInstancePath));
- szInstancePath[sizeof(szInstancePath)-1] = (char)0;
- if(szChar = strrchr(szServerPath, '\\'))
- {
- *szChar = 0;
- }
- }
-
- // For Directory Server, service-name is defined as slapd.exe,
- // in ldapserver/include/nt/regpargms.h
- _snprintf( szCmdLine, sizeof(szCmdLine), "%s\\bin\\%s\\server\\%s -D \"%s\"", szServerPath,
- PRODUCT_NAME, SERVICE_EXE, szInstancePath );
- szCmdLine[sizeof(szCmdLine)-1] = (char)0;
- // szCmdLine ex: c:\navgold\server\bin\slapd\slapd.exe
- // -f c:\navgold\server\slapd-kennedy\config
-
- memset(&sui,0,sizeof(sui));
- sui.cb = sizeof(STARTUPINFO);
-
- /* All of this, to CreateProcess(), allows us to run a console
- app (slapd.exe) from the service (ns-slapd.exe), without a
- new console being opened for the app.
- See dospawn.c in the crt src for more details.
- */
- sui.cbReserved2 = (WORD)(sizeof( int ) + (3 *
- (sizeof( char ) + sizeof( long ))));
-
- sui.lpReserved2 = calloc( sui.cbReserved2, 1 );
-
- *((UNALIGNED int *)(sui.lpReserved2)) = 3;
-
- posfile = (char *)(sui.lpReserved2 + sizeof( int ));
-
- posfhnd = (UNALIGNED long *)(sui.lpReserved2 + sizeof( int ) +
- (3 * sizeof( char )));
-
- for ( i = 0,
- posfile = (char *)(sui.lpReserved2 + sizeof( int )),
- posfhnd = (UNALIGNED long *)(sui.lpReserved2 + sizeof( int )
- + (3 * sizeof( char ))) ;
- i < 3 ;
- i++, posfile++, posfhnd++ )
- {
- *posfile = 0;
- *posfhnd = (long)INVALID_HANDLE_VALUE;
- }
-
- fdwCreate |= CREATE_SUSPENDED;
- bReturn = CreateProcess(NULL, szCmdLine, NULL, NULL,
- TRUE, fdwCreate, NULL, NULL, &sui, pi );
- if(bReturn)
- {
- ghServerProcess = pi->hProcess; // used by app window
- ghServerThread0 = pi->hThread; // used by app window
- if(DuplicateHandle(GetCurrentProcess(), GetCurrentProcess(),
- pi->hProcess, (LPHANDLE)&ghDuplicateProcess,
- (DWORD)PROCESS_VM_READ | PROCESS_VM_WRITE |
- PROCESS_ALL_ACCESS, FALSE, (DWORD)0))
- {
- SetWindowLong(ghWndMain, GWL_PROCESS_HANDLE,
- (LONG)ghDuplicateProcess);
- }
- ResumeThread(pi->hThread);
- }
- else
- {
- WD_SysLog(EVENTLOG_ERROR_TYPE, MSG_WD_STARTFAILED, szCmdLine);
- }
-
- free( sui.lpReserved2 );
-
- return(bReturn);
-}
-
-
-
-
-//------------------------------------------------------z--------------------//
-// //
-//--------------------------------------------------------------------------//
-BOOL WD_CreatePasswordThread(void)
-{
- #define NUM_WAIT_OBJECTS 2
- enum { CHILD_PROCESS, EXIT_EVENT };
-
- BOOL bReturn = FALSE;
- HANDLE lphObject[NUM_WAIT_OBJECTS];
- HANDLE hPasswordThread;
- DWORD dwThreadID;
- DWORD dwResult;
-
- lphObject[EXIT_EVENT] = ghevWatchDogExit;
-
- hPasswordThread = CreateThread((LPSECURITY_ATTRIBUTES)NULL, 0,
- (LPTHREAD_START_ROUTINE)WD_PasswordThreadProc, NULL, 0, &dwThreadID);
- if(hPasswordThread)
- {
- lphObject[CHILD_PROCESS] = hPasswordThread;
- dwResult = WaitForMultipleObjects(NUM_WAIT_OBJECTS, lphObject, FALSE, INFINITE);
- CLOSEHANDLE(hPasswordThread);
- if(dwResult == WAIT_OBJECT_0 + EXIT_EVENT) // user stopped service
- {
- EndDialog(ghdlgPassword, 1);
- }
- bReturn = TRUE;
- }
- else
- {
- WD_SysLog(EVENTLOG_ERROR_TYPE, MSG_WD_BADPASSWORD, NULL);
- }
- return(bReturn);
-}
-
-
-//--------------------------------------------------------------------------//
-// //
-//--------------------------------------------------------------------------//
-BOOL WD_CreateWindowThread(void)
-{
- BOOL bReturn = FALSE;
- DWORD dwThreadID;
- HANDLE hWindowThread;
- HANDLE hevWindowCreated = NULL;
-
- if(hevWindowCreated = CreateEvent(NULL, FALSE, FALSE, NULL))
- {
- if(hWindowThread = CreateThread((LPSECURITY_ATTRIBUTES)NULL, 0,
- (LPTHREAD_START_ROUTINE)WD_WindowThreadProc, (LPVOID)hevWindowCreated, 0, &dwThreadID))
- {
- // make sure ghHwndMain is created otherwise
- // SetWindowLong(ghWndMain) will fail in other threads
- WaitForSingleObject(hevWindowCreated, INFINITE);
- CLOSEHANDLE(hWindowThread);
- bReturn = TRUE;
- }
- }
- return(bReturn);
-}
-
-
-
-//--------------------------------------------------------------------------//
-// //
-//--------------------------------------------------------------------------//
-BOOL WD_CreateCronThread(HANDLE hevWatchDogExit)
-{
- BOOL bReturn = FALSE;
- DWORD dwThreadID = 0;
- HANDLE hWindowThread = NULL;
-#if 0
- if(hWindowThread = CreateThread((LPSECURITY_ATTRIBUTES)NULL, 0,
- (LPTHREAD_START_ROUTINE)CRON_ThreadProc, (LPVOID)hevWatchDogExit, 0, &dwThreadID))
- {
- CLOSEHANDLE(hWindowThread);
- bReturn = TRUE;
- }
-#endif
- return(bReturn);
-}
-
-
-//--------------------------------------------------------------------------//
-// //
-//--------------------------------------------------------------------------//
-BOOL WD_MonitorServer(void)
-{
- #define NUM_WAIT_OBJECTS 2
- enum { SERVER_PROCESS, WATCHDOG_EXIT };
-
- BOOL bReturn = FALSE;
- HANDLE lphObject[NUM_WAIT_OBJECTS];
- DWORD dwResult = 0;
- DWORD dwExitCode = 0;
- PROCESS_INFORMATION pi;
- HANDLE hevServerDone = NULL;
- char szServerDoneEvent[MAX_LINE];
- char szText[MAX_LINE];
- DWORD dwTickCount = 0;
-
- lphObject[WATCHDOG_EXIT] = ghevWatchDogExit;
-
- while(WD_StartServer(&pi))
- {
- dwTickCount = GetTickCount();
- lphObject[SERVER_PROCESS] = pi.hProcess;
- dwResult = WaitForMultipleObjects(NUM_WAIT_OBJECTS, lphObject, FALSE, INFINITE);
-
- //WS_SendSNMPTrapSignal();
-
- if(dwResult == WAIT_OBJECT_0 + WATCHDOG_EXIT)
- {
- // shutdown web server
- //CLOSEHANDLE(pi.hProcess); // XXXahakim close them after TerminateProcess()
- //CLOSEHANDLE(pi.hThread);
- _snprintf(szServerDoneEvent, sizeof(szServerDoneEvent), "NS_%s", gszServerName);
- szServerDoneEvent[sizeof(szServerDoneEvent)-1] = (char)0;
- hevServerDone = OpenEvent(EVENT_MODIFY_STATE, FALSE, szServerDoneEvent);
- if(hevServerDone)
- {
- SetEvent(hevServerDone); // try to exit gracefully
- CLOSEHANDLE(hevServerDone);
- WaitForSingleObject(lphObject[SERVER_PROCESS], 1000 * DEFAULT_KILL_TIME);
- }
- // but just in case it's still alive, swat it again, harder!
- TerminateProcess(lphObject[SERVER_PROCESS], 1);
- CLOSEHANDLE(pi.hProcess); // XXXahakim moved from above 03/06/96
- CLOSEHANDLE(pi.hThread);
- bReturn = TRUE;
- }
- else
- if(dwResult == WAIT_OBJECT_0 + SERVER_PROCESS)
- {
- // why did web server shutdown?
- // GetExitCodeProcess(lphObject[SERVER_PROCESS], &dwExitCode);
- // if(dwExitCode != 0)
- // checking the exit code is bogus because a crashed process can return
- // anything, including 0, so we use another method to determine if the
- // server shutdown legitimately, which is similar to how unix works
- // according to robm.
-
- // check to see if a specified amount of time has elapsed since the server
- // started. If it's "infant mortality" don't bother restarting it
- // because chances are it will continue to fail (such as when the password
- // is bad, or if there is some other severe startup problem)
- if(GetTickCount() - dwTickCount > 1000 * WD_GetDefaultKeyValue(gszServerName, MORTALITY_KEY, DEFAULT_MORTALITY_TIME))
- {
- sprintf(szText, "%d", dwExitCode);
- WD_SysLog(EVENTLOG_ERROR_TYPE, MSG_WD_RESTART, szText);
- CLOSEHANDLE(pi.hProcess);
- CLOSEHANDLE(pi.hThread);
- CLOSEHANDLE(ghDuplicateProcess);
- Sleep(DEFAULT_RESTART_TIME * 1000);
- continue;
- }
- // server closed legitimately
- else
- bReturn = TRUE;
- }
- CLOSEHANDLE(pi.hProcess);
- CLOSEHANDLE(pi.hThread);
- CLOSEHANDLE(ghDuplicateProcess);
- break;
- }
-
- return(bReturn);
-}
-
-
-
-//--------------------------------------------------------------------------//
-// //
-//--------------------------------------------------------------------------//
-BOOL WD_SetServiceStatus(DWORD dwCurrentState, DWORD dwError)
-{
- BOOL bReturn = FALSE;
- SERVICE_STATUS ssStatus;
-
- if(gsshServiceStatus)
- {
- gdwLastStatus = dwCurrentState;
- ssStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
- ssStatus.dwCurrentState = dwCurrentState;
- ssStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP |
- SERVICE_ACCEPT_PAUSE_CONTINUE |
- SERVICE_ACCEPT_SHUTDOWN;
- ssStatus.dwWin32ExitCode = dwError;
- ssStatus.dwServiceSpecificExitCode = (NO_ERROR ? 0 : 1);
- ssStatus.dwCheckPoint = 0;
- ssStatus.dwWaitHint = (1000 * ((dwCurrentState==SERVICE_STOP_PENDING)?600:DEFAULT_KILL_TIME + 1));
- bReturn = SetServiceStatus(gsshServiceStatus, &ssStatus);
- }
- return(FALSE);
-}
-
-
-
-//--------------------------------------------------------------------------//
-// //
-//--------------------------------------------------------------------------//
-VOID WINAPI WD_ServiceHandler(DWORD fdwControl)
-{
- switch(fdwControl)
- {
- case SERVICE_CONTROL_STOP:
- case SERVICE_CONTROL_SHUTDOWN:
- WD_SetServiceStatus(SERVICE_STOP_PENDING, gdwServiceError);
- SetEvent(ghevWatchDogExit);
- return;
-
- case SERVICE_CONTROL_PAUSE:
- if(ghServerThread0)
- {
- WD_SetServiceStatus(SERVICE_PAUSE_PENDING, gdwServiceError);
- SuspendThread(ghServerThread0);
- WD_SetServiceStatus(SERVICE_PAUSED, gdwServiceError);
- return;
- }
- break;
-
- case SERVICE_CONTROL_CONTINUE:
- if(ghServerThread0)
- {
- WD_SetServiceStatus(SERVICE_CONTINUE_PENDING, gdwServiceError);
- ResumeThread(ghServerThread0);
- WD_SetServiceStatus(SERVICE_RUNNING, gdwServiceError);
- return;
- }
- break;
-
- case SERVICE_CONTROL_INTERROGATE:
- WD_SetServiceStatus(gdwLastStatus, gdwServiceError);
- return;
-
- default:
- WD_SysLog(EVENTLOG_ERROR_TYPE, MSG_WD_RESTART, "unknown service event");
- return;
- }
- WD_SetServiceStatus(SERVICE_RUNNING, gdwServiceError);
-}
-
-
-
-//--------------------------------------------------------------------------//
-// //
-//--------------------------------------------------------------------------//
-VOID WD_ServiceMain(DWORD dwArgc, LPTSTR *lpszArgv)
-{
- BOOL bOkToProceed = TRUE;
- // if SCM calls us lpszArgv will not be NULL
- BOOL bIsService = (lpszArgv != NULL);
-
- // register our custom control handler to handle shutdown
- ghWdogProcess = GetCurrentProcess();
- SetConsoleCtrlHandler(WD_ControlHandler, TRUE);
-
- if(bIsService)
- {
- gsshServiceStatus = RegisterServiceCtrlHandler(lpszArgv[0],
- (LPHANDLER_FUNCTION)WD_ServiceHandler);
- bOkToProceed = (gsshServiceStatus != (SERVICE_STATUS_HANDLE)NULL);
- if(bOkToProceed)
- {
- strncpy(gszServerName, lpszArgv[0], sizeof(gszServerName));
- gszServerName[sizeof(gszServerName)-1] = (char)0;
- bOkToProceed = WD_GetConfigFromRegistry(gszServerConfig,
- gszServerName);
- }
- }
-
- WD_SetServiceStatus(SERVICE_START_PENDING, gdwServiceError);
-
- if(bOkToProceed)
- {
- if(ghevWatchDogExit = CreateEvent(NULL, TRUE, FALSE, gszServerName))
- {
- WD_SetServiceStatus(SERVICE_RUNNING, gdwServiceError);
- WD_CreateWindowThread();
-#if 0
- WD_CreateCronThread(ghevWatchDogExit);
-#endif
-
- if(WD_IsServerSecure())
- {
- bOkToProceed = WD_CreatePasswordThread();
- }
-
- if(bOkToProceed)
- {
- WD_MonitorServer();
- }
- CLOSEHANDLE(ghevWatchDogExit);
- }
- }
- WD_SetServiceStatus(SERVICE_STOPPED, gdwServiceError);
-}
-
-
-
-//--------------------------------------------------------------------------//
-// //
-//--------------------------------------------------------------------------//
-WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,
- int nCmdShow)
-{
- SERVICE_TABLE_ENTRY steServiceTable[2];
-
-#ifdef PUMPKIN_HOUR
- if(time(NULL) > (PUMPKIN_HOUR - 10))
- {
- char szMessage[256];
- sprintf( szMessage, " ** This beta software has expired **\n");
- MessageBox(GetDesktopWindow(), szMessage,
- DS_NAME_FULL_VERSION, MB_ICONEXCLAMATION | MB_OK);
- exit(1);
- }
-#endif
-
- if(!hPrevInstance) // other instances of app running?
- {
- ghInstance = hInstance;
- memset(gszPassword, 0, sizeof(gszPassword));
- memset(gszServerConfig, 0, sizeof(gszServerConfig));
- memset(gszServerName, 0, sizeof(gszServerName));
- if(WD_IsWindowsNT() && (lpCmdLine) && (strlen(lpCmdLine) == 0))
- {
- // run as service
- steServiceTable[0].lpServiceName = TEXT(PRODUCT_NAME);
- steServiceTable[0].lpServiceProc =
- (LPSERVICE_MAIN_FUNCTION)WD_ServiceMain;
- steServiceTable[1].lpServiceName = NULL;
- steServiceTable[1].lpServiceProc = NULL;
- StartServiceCtrlDispatcher(steServiceTable);
- }
- else
- {
- // run as application
- if(WD_GetConfigFromCmdline(gszServerConfig,
- gszServerName, lpCmdLine))
- {
- WD_ServiceMain(0, (LPTSTR *)NULL);
- }
- }
- }
- return(FALSE);
-}
diff --git a/ldap/servers/slapd/snmp_collator.c b/ldap/servers/slapd/snmp_collator.c
index f40d867..05a3afc 100644
--- a/ldap/servers/slapd/snmp_collator.c
+++ b/ldap/servers/slapd/snmp_collator.c
@@ -69,7 +69,6 @@
#define SNMP_NUM_SEM_WAITS 10
#include "snmp_collator.h"
-#include "../snmp/ntagt/nslagtcom_nt.h"
/* stevross: safe to assume port should be at most 5 digits ? */
#define PORT_LEN 5
diff --git a/ldap/servers/slapd/test-plugins/Makefile.WINNT b/ldap/servers/slapd/test-plugins/Makefile.WINNT
deleted file mode 100644
index 6dd08ec..0000000
--- a/ldap/servers/slapd/test-plugins/Makefile.WINNT
+++ /dev/null
@@ -1,77 +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 Directory Server plug-in
-#
-
-CC = cl
-LD = link
-
-
-TARGET=testplugin
-
-OBJS=testsaslbind.obj testextendedop.obj testpreop.obj testpostop.obj testentry.obj testbind.obj testgetip.obj testdatainterop.obj testdbinterop.obj
-
-
-INC = ../include
-CFLAGS = /nologo -I $(INC) /c
-LDFLAGS = /dll /nologo
-LIBS=/DEFAULTLIB:kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib ../lib/libslapd.lib ../lib/libnspr4.lib ./lib/libdb42.lib
-
-
-all: \
- init \
- $(TARGET).dll
-
-init:
- "c:\program files\microsoft visual studio\vc98\bin\vcvars32.bat"
-
-
-$(TARGET).dll: $(OBJS)
- $(LD) $(LDFLAGS) /def:$(TARGET).def /out:$(TARGET).dll $(EXTRA_LIBS) $(LIBS) $(OBJS)
- -rm -f $(OBJS2) *~
-
-%.obj:%.c
- $(CC) $(CFLAGS) $<
-
-clean:
- del -f $(OBJS) $(TARGET).dll *~
-
-
-
diff --git a/ldap/servers/slapd/test-plugins/Makefile.server b/ldap/servers/slapd/test-plugins/Makefile.server
index 3e1ab7f..69224e3 100644
--- a/ldap/servers/slapd/test-plugins/Makefile.server
+++ b/ldap/servers/slapd/test-plugins/Makefile.server
@@ -53,10 +53,6 @@ LIBDIR = $(LIB_RELDIR)
include $(BUILD_ROOT)/nsconfig.mk
include $(LDAP_SRC)/nsldap.mk
-ifeq ($(ARCH), WINNT)
-DEF_FILE:=./libdistrib.def
-endif
-
CFLAGS+=$(SLCFLAGS)
INCLUDES += -I$(LDAP_SRC)/servers/slapd -I$(DB_INCLUDE)
@@ -66,72 +62,26 @@ DIS_OBJS= \
OBJS = $(addprefix $(OBJDEST)/, $(DIS_OBJS))
-ifeq ($(ARCH), WINNT)
-LIBDIS_DLL_OBJ = $(addprefix $(OBJDEST)/, dllmain.o)
-endif
-
# The sample distribution plugin is not part of DS.
# So we generate the shared library outside of $(LIBDIR)
# so that it's not retrieved by the packaging makefiles.
#LIBDIS = $(addprefix $(LIBDIR)/, $(DIS_DLL).$(DLL_SUFFIX))
LIBDIS = $(addprefix $(OBJDEST)/, $(TEST_PLUGIN_DLL).$(DLL_SUFFIX))
-ifeq ($(ARCH), WINNT)
-EXTRA_LIBS_DEP += \
- $(LIBSLAPD_DEP) \
- $(LDAP_LIBUTIL_DEP) \
- $(LDAP_COMMON_LIBS_DEP)
-EXTRA_LIBS_DEP += \
- $(LDAPSDK_DEP) \
- $(SECURITY_DEP)
-EXTRA_LIBS += \
- $(LIBSLAPD) \
- $(LDAP_SDK_LIBLDAP_DLL) \
- $(LIBUTIL) \
- $(NSPRLINK) \
- $(LDAP_COMMON_LIBS)
-endif
-ifeq ($(ARCH), AIX)
-EXTRA_LIBS_DEP += \
- $(LIBSLAPD_DEP) \
- $(LDAP_LIBUTIL_DEP) \
- $(LDAP_COMMON_LIBS_DEP)
-EXTRA_LIBS_DEP += \
- $(LDAPSDK_DEP)
-EXTRA_LIBS += \
- $(LIBSLAPDLINK) \
- $(LDAP_SDK_LIBLDAP_DLL) \
- $(LIBUTIL) \
- $(NSPRLINK) \
- $(LDAP_COMMON_LIBS)
-endif
-
EXTRA_LIBS_DEP += $(LIBSLAPD_DEP) $(LDAPSDK_DEP) $(NSPR_DEP) $(DB_LIB_DEP)
EXTRA_LIBS += $(DYN_NSHTTPD) $(ADMINUTIL_LINK) $(LDAPLINK) $(NSPRLINK) $(ICULINK) $(DB_LIB)
-ifeq ($(ARCH), WINNT)
-DLL_LDFLAGS += -def:"./libdistrib.def"
-CFLAGS+= /WX
-endif # WINNT
-
-ifeq ($(ARCH), AIX)
-LD=ld
-endif
-
clientSDK:
all: $(OBJDEST) $(LIBDIR) $(LIBDIS)
-$(LIBDIS): $(OBJS) $(LIBDIS_DLL_OBJ) $(DEF_FILE)
- $(LINK_DLL) $(LIBDIS_DLL_OBJ) $(EXTRA_LIBS)
+$(LIBDIS): $(OBJS) $(LIBDIS_DLL_OBJ)
+ $(LINK_DLL) $(EXTRA_LIBS)
veryclean: clean
clean:
$(RM) $(OBJS)
-ifeq ($(ARCH), WINNT)
- $(RM) $(LIBDIS_DLL_OBJ)
-endif
$(RM) $(LIBDIS)
$(OBJDEST):
diff --git a/ldap/servers/slapd/test-plugins/dllmain.c b/ldap/servers/slapd/test-plugins/dllmain.c
deleted file mode 100644
index d42d227..0000000
--- a/ldap/servers/slapd/test-plugins/dllmain.c
+++ /dev/null
@@ -1,66 +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 **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/*
- * Microsoft Windows specifics for sample plug-ins DLL
- */
-#include "ldap.h"
-#include "lber.h"
-#include <stdio.h>
-
-
-int CALLBACK
-LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
-{
- /*UnlockData( 0 );*/
- return( 1 );
-}
-
-/* The 16-bit version of the RTL does not implement perror() */
-void perror( const char *msg )
-{
- char buf[128];
- wsprintf( buf, "%s: error %d\n", msg, WSAGetLastError()) ;
- OutputDebugString( buf );
-}
-
-
diff --git a/ldap/servers/slapd/test-plugins/testplugin.def b/ldap/servers/slapd/test-plugins/testplugin.def
deleted file mode 100644
index f7dfb77..0000000
--- a/ldap/servers/slapd/test-plugins/testplugin.def
+++ /dev/null
@@ -1,48 +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 'Dirsrv 1 test plugin'
-EXPORTS
- testentry_scramble @2
- testentry_unscramble @3
- testexop_init @4
- testpostop_init @5
- testpreop_init @6
- testsasl_init @7
- testbind_init @8
- nullsuffix_init @9
diff --git a/ldap/servers/slapd/test-plugins/testplugin.dsp b/ldap/servers/slapd/test-plugins/testplugin.dsp
deleted file mode 100644
index 5e14056..0000000
--- a/ldap/servers/slapd/test-plugins/testplugin.dsp
+++ /dev/null
@@ -1,175 +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
-#
-# Microsoft Developer Studio Project File - Name="testplugin" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 5.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=testplugin - Win32 Release
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "testplugin.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "testplugin.mak" CFG="testplugin - Win32 Release"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "testplugin - Win32 Release" (based on\
- "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "testplugin - Win32 Debug" (based on\
- "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "testplugin - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir ".\Release"
-# PROP BASE Intermediate_Dir ".\Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir ".\Release"
-# PROP Intermediate_Dir ".\Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WIN32" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib ..\lib\libslapd.lib /nologo /subsystem:windows /dll /machine:I386
-
-!ELSEIF "$(CFG)" == "testplugin - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir ".\Debug"
-# PROP BASE Intermediate_Dir ".\Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir ".\Debug"
-# PROP Intermediate_Dir ".\Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
-# ADD CPP /nologo /MD /W3 /Gm /GX /Zi /Od /I "..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_WIN32" /YX /FD /c
-# ADD BASE MTL /nologo /D "_DEBUG" /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib ..\lib\libslapd.lib /nologo /subsystem:windows /dll /debug /machine:I386
-
-!ENDIF
-
-# Begin Target
-
-# Name "testplugin - Win32 Release"
-# Name "testplugin - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90"
-# Begin Source File
-
-SOURCE=.\dllmain.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\testbind.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\testentry.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\testextendedop.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\testplugin.def
-# End Source File
-# Begin Source File
-
-SOURCE=.\testpostop.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\testpreop.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\testsaslbind.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/ldap/servers/slapd/test-plugins/testplugin.mak b/ldap/servers/slapd/test-plugins/testplugin.mak
deleted file mode 100644
index 6dda603..0000000
--- a/ldap/servers/slapd/test-plugins/testplugin.mak
+++ /dev/null
@@ -1,463 +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
-#
-# Microsoft Developer Studio Generated NMAKE File, Based on testplugin.dsp
-!IF "$(CFG)" == ""
-CFG=testplugin - Win32 Release
-!MESSAGE No configuration specified. Defaulting to testplugin - Win32 Release.
-!ENDIF
-
-!IF "$(CFG)" != "testplugin - Win32 Release" && "$(CFG)" !=\
- "testplugin - Win32 Debug"
-!MESSAGE Invalid configuration "$(CFG)" specified.
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "testplugin.mak" CFG="testplugin - Win32 Release"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "testplugin - Win32 Release" (based on\
- "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "testplugin - Win32 Debug" (based on\
- "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-!ERROR An invalid configuration is specified.
-!ENDIF
-
-!IF "$(OS)" == "Windows_NT"
-NULL=
-!ELSE
-NULL=nul
-!ENDIF
-
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "testplugin - Win32 Release"
-
-OUTDIR=.\Release
-INTDIR=.\Release
-# Begin Custom Macros
-OutDir=.\.\Release
-# End Custom Macros
-
-!IF "$(RECURSE)" == "0"
-
-ALL : "$(OUTDIR)\testplugin.dll"
-
-!ELSE
-
-ALL : "$(OUTDIR)\testplugin.dll"
-
-!ENDIF
-
-CLEAN :
- -@erase "$(INTDIR)\dllmain.obj"
- -@erase "$(INTDIR)\testbind.obj"
- -@erase "$(INTDIR)\testentry.obj"
- -@erase "$(INTDIR)\testextendedop.obj"
- -@erase "$(INTDIR)\testpostop.obj"
- -@erase "$(INTDIR)\testpreop.obj"
- -@erase "$(INTDIR)\testsaslbind.obj"
- -@erase "$(INTDIR)\vc50.idb"
- -@erase "$(OUTDIR)\testplugin.dll"
- -@erase "$(OUTDIR)\testplugin.exp"
- -@erase "$(OUTDIR)\testplugin.lib"
-
-"$(OUTDIR)" :
- if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
-
-CPP_PROJ=/nologo /MD /W3 /GX /O2 /I "..\include" /D "WIN32" /D "NDEBUG" /D\
- "_WINDOWS" /D "_WIN32" /Fp"$(INTDIR)\testplugin.pch" /YX /Fo"$(INTDIR)\\"\
- /Fd"$(INTDIR)\\" /FD /c
-CPP_OBJS=.\Release/
-CPP_SBRS=.
-MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32
-BSC32=bscmake.exe
-BSC32_FLAGS=/nologo /o"$(OUTDIR)\testplugin.bsc"
-BSC32_SBRS= \
-
-LINK32=link.exe
-LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
- advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
- odbccp32.lib wsock32.lib ..\lib\libslapd.lib /nologo /subsystem:windows /dll\
- /incremental:no /pdb:"$(OUTDIR)\testplugin.pdb" /machine:I386\
- /def:".\testplugin.def" /out:"$(OUTDIR)\testplugin.dll"\
- /implib:"$(OUTDIR)\testplugin.lib"
-DEF_FILE= \
- ".\testplugin.def"
-LINK32_OBJS= \
- "$(INTDIR)\dllmain.obj" \
- "$(INTDIR)\testbind.obj" \
- "$(INTDIR)\testentry.obj" \
- "$(INTDIR)\testextendedop.obj" \
- "$(INTDIR)\testpostop.obj" \
- "$(INTDIR)\testpreop.obj" \
- "$(INTDIR)\testsaslbind.obj"
-
-"$(OUTDIR)\testplugin.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
- $(LINK32) @<<
- $(LINK32_FLAGS) $(LINK32_OBJS)
-<<
-
-!ELSEIF "$(CFG)" == "testplugin - Win32 Debug"
-
-OUTDIR=.\Debug
-INTDIR=.\Debug
-# Begin Custom Macros
-OutDir=.\.\Debug
-# End Custom Macros
-
-!IF "$(RECURSE)" == "0"
-
-ALL : "$(OUTDIR)\testplugin.dll"
-
-!ELSE
-
-ALL : "$(OUTDIR)\testplugin.dll"
-
-!ENDIF
-
-CLEAN :
- -@erase "$(INTDIR)\dllmain.obj"
- -@erase "$(INTDIR)\testbind.obj"
- -@erase "$(INTDIR)\testentry.obj"
- -@erase "$(INTDIR)\testextendedop.obj"
- -@erase "$(INTDIR)\testpostop.obj"
- -@erase "$(INTDIR)\testpreop.obj"
- -@erase "$(INTDIR)\testsaslbind.obj"
- -@erase "$(INTDIR)\vc50.idb"
- -@erase "$(INTDIR)\vc50.pdb"
- -@erase "$(OUTDIR)\testplugin.dll"
- -@erase "$(OUTDIR)\testplugin.exp"
- -@erase "$(OUTDIR)\testplugin.ilk"
- -@erase "$(OUTDIR)\testplugin.lib"
- -@erase "$(OUTDIR)\testplugin.pdb"
-
-"$(OUTDIR)" :
- if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
-
-CPP_PROJ=/nologo /MD /W3 /Gm /GX /Zi /Od /I "..\include" /D "WIN32" /D "_DEBUG"\
- /D "_WINDOWS" /D "_WIN32" /Fp"$(INTDIR)\testplugin.pch" /YX /Fo"$(INTDIR)\\"\
- /Fd"$(INTDIR)\\" /FD /c
-CPP_OBJS=.\Debug/
-CPP_SBRS=.
-MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32
-BSC32=bscmake.exe
-BSC32_FLAGS=/nologo /o"$(OUTDIR)\testplugin.bsc"
-BSC32_SBRS= \
-
-LINK32=link.exe
-LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
- advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
- odbccp32.lib wsock32.lib ..\lib\libslapd.lib /nologo /subsystem:windows /dll\
- /incremental:yes /pdb:"$(OUTDIR)\testplugin.pdb" /debug /machine:I386\
- /def:".\testplugin.def" /out:"$(OUTDIR)\testplugin.dll"\
- /implib:"$(OUTDIR)\testplugin.lib"
-DEF_FILE= \
- ".\testplugin.def"
-LINK32_OBJS= \
- "$(INTDIR)\dllmain.obj" \
- "$(INTDIR)\testbind.obj" \
- "$(INTDIR)\testentry.obj" \
- "$(INTDIR)\testextendedop.obj" \
- "$(INTDIR)\testpostop.obj" \
- "$(INTDIR)\testpreop.obj" \
- "$(INTDIR)\testsaslbind.obj"
-
-"$(OUTDIR)\testplugin.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
- $(LINK32) @<<
- $(LINK32_FLAGS) $(LINK32_OBJS)
-<<
-
-!ENDIF
-
-.c{$(CPP_OBJS)}.obj::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
-
-.cpp{$(CPP_OBJS)}.obj::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
-
-.cxx{$(CPP_OBJS)}.obj::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
-
-.c{$(CPP_SBRS)}.sbr::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
-
-.cpp{$(CPP_SBRS)}.sbr::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
-
-.cxx{$(CPP_SBRS)}.sbr::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
-
-
-!IF "$(CFG)" == "testplugin - Win32 Release" || "$(CFG)" ==\
- "testplugin - Win32 Debug"
-SOURCE=.\dllmain.c
-
-!IF "$(CFG)" == "testplugin - Win32 Release"
-
-DEP_CPP_DLLMA=\
- {$(INCLUDE)}"lber.h"\
- {$(INCLUDE)}"ldap.h"\
-
-
-"$(INTDIR)\dllmain.obj" : $(SOURCE) $(DEP_CPP_DLLMA) "$(INTDIR)"
-
-
-!ELSEIF "$(CFG)" == "testplugin - Win32 Debug"
-
-DEP_CPP_DLLMA=\
- {$(INCLUDE)}"lber.h"\
- {$(INCLUDE)}"ldap.h"\
- {$(INCLUDE)}"sys\types.h"\
-
-NODEP_CPP_DLLMA=\
- "..\include\macsock.h"\
- "..\include\os2sock.h"\
-
-
-"$(INTDIR)\dllmain.obj" : $(SOURCE) $(DEP_CPP_DLLMA) "$(INTDIR)"
-
-
-!ENDIF
-
-SOURCE=.\testbind.c
-
-!IF "$(CFG)" == "testplugin - Win32 Release"
-
-DEP_CPP_TESTB=\
- "..\include\slapi-plugin.h"\
- {$(INCLUDE)}"lber.h"\
- {$(INCLUDE)}"ldap.h"\
-
-
-"$(INTDIR)\testbind.obj" : $(SOURCE) $(DEP_CPP_TESTB) "$(INTDIR)"
-
-
-!ELSEIF "$(CFG)" == "testplugin - Win32 Debug"
-
-DEP_CPP_TESTB=\
- "..\include\slapi-plugin.h"\
- {$(INCLUDE)}"lber.h"\
- {$(INCLUDE)}"ldap.h"\
- {$(INCLUDE)}"sys\types.h"\
-
-NODEP_CPP_TESTB=\
- "..\include\macsock.h"\
- "..\include\os2sock.h"\
-
-
-"$(INTDIR)\testbind.obj" : $(SOURCE) $(DEP_CPP_TESTB) "$(INTDIR)"
-
-
-!ENDIF
-
-SOURCE=.\testentry.c
-
-!IF "$(CFG)" == "testplugin - Win32 Release"
-
-DEP_CPP_TESTE=\
- "..\include\slapi-plugin.h"\
- {$(INCLUDE)}"lber.h"\
- {$(INCLUDE)}"ldap.h"\
-
-
-"$(INTDIR)\testentry.obj" : $(SOURCE) $(DEP_CPP_TESTE) "$(INTDIR)"
-
-
-!ELSEIF "$(CFG)" == "testplugin - Win32 Debug"
-
-DEP_CPP_TESTE=\
- "..\include\slapi-plugin.h"\
- {$(INCLUDE)}"lber.h"\
- {$(INCLUDE)}"ldap.h"\
- {$(INCLUDE)}"sys\types.h"\
-
-NODEP_CPP_TESTE=\
- "..\include\macsock.h"\
- "..\include\os2sock.h"\
-
-
-"$(INTDIR)\testentry.obj" : $(SOURCE) $(DEP_CPP_TESTE) "$(INTDIR)"
-
-
-!ENDIF
-
-SOURCE=.\testextendedop.c
-
-!IF "$(CFG)" == "testplugin - Win32 Release"
-
-DEP_CPP_TESTEX=\
- "..\include\slapi-plugin.h"\
- {$(INCLUDE)}"lber.h"\
- {$(INCLUDE)}"ldap.h"\
-
-
-"$(INTDIR)\testextendedop.obj" : $(SOURCE) $(DEP_CPP_TESTEX) "$(INTDIR)"
-
-
-!ELSEIF "$(CFG)" == "testplugin - Win32 Debug"
-
-DEP_CPP_TESTEX=\
- "..\include\slapi-plugin.h"\
- {$(INCLUDE)}"lber.h"\
- {$(INCLUDE)}"ldap.h"\
- {$(INCLUDE)}"sys\types.h"\
-
-NODEP_CPP_TESTEX=\
- "..\include\macsock.h"\
- "..\include\os2sock.h"\
-
-
-"$(INTDIR)\testextendedop.obj" : $(SOURCE) $(DEP_CPP_TESTEX) "$(INTDIR)"
-
-
-!ENDIF
-
-SOURCE=.\testpostop.c
-
-!IF "$(CFG)" == "testplugin - Win32 Release"
-
-DEP_CPP_TESTP=\
- "..\include\slapi-plugin.h"\
- {$(INCLUDE)}"lber.h"\
- {$(INCLUDE)}"ldap.h"\
-
-
-"$(INTDIR)\testpostop.obj" : $(SOURCE) $(DEP_CPP_TESTP) "$(INTDIR)"
-
-
-!ELSEIF "$(CFG)" == "testplugin - Win32 Debug"
-
-DEP_CPP_TESTP=\
- "..\include\slapi-plugin.h"\
- {$(INCLUDE)}"lber.h"\
- {$(INCLUDE)}"ldap.h"\
- {$(INCLUDE)}"sys\types.h"\
-
-NODEP_CPP_TESTP=\
- "..\include\macsock.h"\
- "..\include\os2sock.h"\
-
-
-"$(INTDIR)\testpostop.obj" : $(SOURCE) $(DEP_CPP_TESTP) "$(INTDIR)"
-
-
-!ENDIF
-
-SOURCE=.\testpreop.c
-
-!IF "$(CFG)" == "testplugin - Win32 Release"
-
-DEP_CPP_TESTPR=\
- "..\include\slapi-plugin.h"\
- {$(INCLUDE)}"lber.h"\
- {$(INCLUDE)}"ldap.h"\
-
-
-"$(INTDIR)\testpreop.obj" : $(SOURCE) $(DEP_CPP_TESTPR) "$(INTDIR)"
-
-
-!ELSEIF "$(CFG)" == "testplugin - Win32 Debug"
-
-DEP_CPP_TESTPR=\
- "..\include\slapi-plugin.h"\
- {$(INCLUDE)}"lber.h"\
- {$(INCLUDE)}"ldap.h"\
- {$(INCLUDE)}"sys\types.h"\
-
-NODEP_CPP_TESTPR=\
- "..\include\macsock.h"\
- "..\include\os2sock.h"\
-
-
-"$(INTDIR)\testpreop.obj" : $(SOURCE) $(DEP_CPP_TESTPR) "$(INTDIR)"
-
-
-!ENDIF
-
-SOURCE=.\testsaslbind.c
-
-!IF "$(CFG)" == "testplugin - Win32 Release"
-
-DEP_CPP_TESTS=\
- "..\include\slapi-plugin.h"\
- {$(INCLUDE)}"lber.h"\
- {$(INCLUDE)}"ldap.h"\
-
-
-"$(INTDIR)\testsaslbind.obj" : $(SOURCE) $(DEP_CPP_TESTS) "$(INTDIR)"
-
-
-!ELSEIF "$(CFG)" == "testplugin - Win32 Debug"
-
-DEP_CPP_TESTS=\
- "..\include\slapi-plugin.h"\
- {$(INCLUDE)}"lber.h"\
- {$(INCLUDE)}"ldap.h"\
- {$(INCLUDE)}"sys\types.h"\
-
-NODEP_CPP_TESTS=\
- "..\include\macsock.h"\
- "..\include\os2sock.h"\
-
-
-"$(INTDIR)\testsaslbind.obj" : $(SOURCE) $(DEP_CPP_TESTS) "$(INTDIR)"
-
-
-!ENDIF
-
-
-!ENDIF
-
diff --git a/ldap/servers/snmp/ntagt/msrvdefs.mak b/ldap/servers/snmp/ntagt/msrvdefs.mak
deleted file mode 100644
index 1e52dde..0000000
--- a/ldap/servers/snmp/ntagt/msrvdefs.mak
+++ /dev/null
@@ -1,523 +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
-#
-#############################################################################
-# Mail Server Common Rulesets #
-#############################################################################
-
-MSRV_RELEASE = 4.0
-
-ifeq ($(DEBUG), optimize)
-MSRV_DEBUG = no
-else
-MSRV_DEBUG = yes
-endif
-
-ifeq ($(MSRV_DEBUG), yes)
-DEBUG_DEST = DBG-
-else
-DEBUG_DEST =
-endif
-
-# this allows mixing DBG objects with non DBG libs, avoiding
-# a complete autobuild or other linking hacks. Any DBG libs
-# (under mailserv2) will get picked up first, followed by non-DBG
-# libs. In any event, no DBG libs will be linked if MSRV_DEBUG=no.
-NDBGDEST = $(MSRV_ROOT)/built/$(ARCH)
-
-# This is where we are generally supposed to put built stuff
-BLDDEST = $(MSRV_ROOT)/built/$(DEBUG_DEST)$(ARCH)
-
-# module specific locations for build stuff
-LIBDEST = $(BLDDEST)/lib
-NETDEST = $(BLDDEST)/network
-LOCDEST = $(BLDDEST)/local
-EXTDEST = $(BLDDEST)/extras
-BINDEST = $(BLDDEST)/bin
-OBJDEST = $(BLDDEST)/obj
-
-IMPORTS_DIR = $(MSRV_ROOT)/code/import
-
-
-# Extensions for generated files.
-
-SHLIB_SUFFIX = so
-ARCHIVE_SUFFIX = a
-OBJ_SUFFIX = o
-EXE_SUFFIX =
-
-export SHLIB_EXT ARCHIVE_EXT OBJ_EXT EXE_EXT
-
-RM = rm -f
-AR = ar cr
-MD = mkdir -p
-MAKE = gmake
-STRIP = strip
-CP = cp
-ECHO = echo
-
-# For reasons you really don't want to know, we put all the C++ core
-# modules into a static lib on Unix platforms. If the system supports
-# shared libs, we use it only for C-derived object modules.
-
-ifneq ($(ARCH), WINNT)
-STAT_LIB = libNSmObj.$(ARCHIVE_SUFFIX)
-endif
-
-ifeq ($(ARCH), WINNT)
-
-ifeq ($(DEBUG), full)
-ML_DEBUG = /DEBUG
-ifeq ($(NTDEBUGENV),ON)
-MC_DEBUGENV= /D__NTDebugEnv__
-else
-MC_DEBUGENV=
-endif
-ifeq ($(NTDEBUGSLEEP),ON)
-MC_DEBUG=/D__NTDebug__ /D__NTDebugSleep__ $(MC_DEBUGENV)
-else
-MC_DEBUG = /D__NTDebug__ $(MC_DEBUGENV)
-endif
-else
-ML_DEBUG =
-MC_DEBUG =
-endif
-
-endif
-### Solaris #############################################################
-
-ifeq ($(ARCH), SOLARIS)
- BUILD_SHARED = TRUE
- BUILDAPI_SHARED = FALSE
- PLUGIN_SHARED = TRUE
- CC = gcc
- CXX = g++
-
-ifeq ($(PURIFY), yes)
- CC = /stuff/iasrc3/xtern/purify/purify gcc
- CXX = /stuff/iasrc3/xtern/purify/purify g++
-endif
-
-ifeq ($(QUANTIFY), yes)
- CC = /stuff/iasrc3/xtern/quantify/quantify gcc
- CXX = /stuff/iasrc3/xtern/quantify/quantify g++
-endif
-
- LD = ld
- DLL_CFLAGS = -fpic
- DLL_CXXFLAGS = -fpic
- DLL_LDFLAGS = -G
- OPTIMIZE_FLAGS = -O2
- CFLAGS = $(DLL_CFLAGS) -DSVR4 -D__svr4__ -DSOLARIS \
- -DHAVE_NIS -DHAS_GETSPNAM -DHAS_FGETPWENT \
- -DSTATOBJS \
- -DMSRV_RELEASE=\"$(MSRV_RELEASE)\" \
- -DOSVERSION=$(OSVERSION) -D_REENTRANT
- LD_EXTRAS = -L/tools/ns/lib -lthread -lsocket -lnsl -lgen -ldl
- MADM_LDLIBS = -ldl
-endif
-
-### IRIX notes ##########################################################
-## Suppress warnings about statement unreachable (3203) and
-## unused parameters (3262). Increase Olimit
-## Suppress REALLY ANNOYING link warnings unless a debug build
-## 84 is unsed libs. 85 is duplicate symbol preemption.
-## This hides duplicate symbols in the link - so watch it
-##########################################################################
-ifeq ($(ARCH), IRIX)
- BUILD_SHARED = TRUE
- BUILDAPI_SHARED = FALSE
- PLUGIN_SHARED = TRUE
- CC = cc
-ifneq ($(MSRV_DEBUG),yes)
- CXX = CC -woff 3203,3262 -Wl,-woff,84 -Wl,-woff,85
-else
- CXX = CC
-endif
- LD = CC
- DLL_CFLAGS =
- DLL_CXXFLAGS =
- DLL_LDFLAGS = -shared
- OPTIMIZE_FLAGS = -O -Olimit 4096
- CFLAGS = $(DLL_CFLAGS) -DIRIX -DSTATOBJS \
- -DHAVE_NIS -DHAS_GETSPNAM -DHAS_FGETPWENT \
- -DMSRV_RELEASE=\"$(MSRV_RELEASE)\" \
- -DOSVERSION=$(OSVERSION)
-
- LD_EXTRAS =
-endif
-
-### HPUX notes ###########################################################
-## g++ does not support pic on a300 architecture
-## -Wl,+b,/usr/lib,+s is needed so that runtime can find shared lib
-## correctly
-## Also, gcc is used to compile and link modules with c-based main
-## to overcome a global constructor problem. Change in
-## admin/src/Makefile and code/network/IMAP4-Server/unix/Makefile
-## and code/tools/Makefile
-#########################################################################
-
-ifeq ($(ARCH), HPUX)
- SHLIB_SUFFIX = sl
- BUILD_SHARED = TRUE
- BUILDAPI_SHARED = FALSE
- PLUGIN_SHARED = TRUE
- CC = cc
- CXX = g++
- LD = ld
- NATIVE_CFLAGS = -Aa -D_HPUX_SOURCE
- DLL_CFLAGS = +z
- DLL_CXXFLAGS =
- DLL_LDFLAGS = -b
- OPTIMIZE_FLAGS = -O
- CFLAGS = -DHPUX -DSTATOBJS -DHAVE_NIS \
- -DHAS_FGETPWENT \
- -DMSRV_RELEASE=\"$(MSRV_RELEASE)\" \
- -DOSVERSION=$(OSVERSION)
- LD_EXTRAS = -Wl,+b,/usr/lib,+s \
- -L/tools/ns/lib -liostream -ldld -lm
- #-L/tools/ns/lib -liostream -ldld -lm -lpthread
- MSRV_INCLUDES = -I/tools/ns/lib/g++-include
-endif
-
-
-### OSF1 notes ############################################################
-## -taso options and -DIS_64 are needed to get 32 bit behavior on the alpha
-## ...otherwise libdbm will not work
-###########################################################################
-
-ifeq ($(ARCH), OSF1)
- BUILD_SHARED = TRUE
- BUILDAPI_SHARED = FALSE
- PLUGIN_SHARED = TRUE
- CC = cc -taso -DIS_64 -Olimit 4000
- CXX = g++
- LD = ld
- DLL_CFLAGS =
- DLL_CXXFLAGS =
- DLL_LDFLAGS =
- OPTIMIZE_FLAGS = -O
- CFLAGS = -DOSF1 -DSTATOBJS -DHAVE_NIS \
- -DHAS_FGETPWENT \
- -DMSRV_RELEASE=\"$(MSRV_RELEASE)\" \
- -DOSVERSION=$(OSVERSION)
- LD_EXTRAS = -lc_r -L/tools/ns/lib -liostream -Wl,-taso
- MSRV_INCLUDES = -I/tools/ns/lib/g++-include
-endif
-
-### AIX notes #############################################################
-## Yah, right. In your dreams...
-## What a horrid c++ platform. We need to supply our own g++ config file
-## because the systems supplied one is broken. Lots of surprises in store.
-## Needs a separate build tree on 3.2.5 because automount is broken.
-## Also, like HP - gcc is used to compile and link modules with c-based main
-## to overcome a global constructor problem. Change in
-## admin/src/Makefile and code/network/IMAP4-Server/unix/Makefile
-## and code/tools/Makefile
-##
-## DLL_CFLAGS type of stuff is set specifically in plugins/Makefile
-## and also local/SMTP-Router/Makefile to use a specific export list
-## (for the NSmatch plugin in this case). Also see further below for the
-## linker override option to use the import list instead of a named lib
-##########################################################################
-
-## AIX 4
-ifeq ($(ARCH), AIX)
- BUILD_SHARED = FALSE
- BUILDAPI_SHARED = FALSE
- PLUGIN_SHARED = TRUE
- SHLIB_SUFFIX = _shr.a
- CC = cc
- CXX = g++
-# CXX = g++ -I$(MSRV_ROOT)/code/include/aix
- LD = ld
- DLL_CLAGS =
- DLL_CXXFLAGS =
- OPTIMIZE_FLAGS = -O
- CFLAGS = -DAIX -DAIXV3 -DAIXV4 -DSTATOBJS \
- -DHAVE_NIS -mcpu=common\
- -DMSRV_RELEASE=\"$(MSRV_RELEASE)\" \
- -DOSVERSION=$(OSVERSION)
- LD_EXTRAS = -L/gnu/install/lib -L/gnu/install/lib/gcc-lib/powerpc-ibm-aix4.1.4.0/2.7.2.1/common -lstdc++ -ls -lsvld -lgcc -lc_r
-# LD_EXTRAS = -L/usr/gnu/lib -liostream -ls -ldl
- MSRV_INCLUDES = -I/gnu/install/lib/g++-include
-# MSRV_INCLUDES = -I/usr/gnu/lib/g++-include
-endif
-
-## AIX 3
-#ifeq ($(ARCH), AIX)
-# BUILD_SHARED = FALSE
-# BUILDAPI_SHARED = FALSE
-# PLUGIN_SHARED = TRUE
-# CC = svcc
-# CXX = g++ -I$(MSRV_ROOT)/code/include/aix
-# LD = ld
-# DLL_CLAGS =
-# DLL_CXXFLAGS =
-# OPTIMIZE_FLAGS = -O
-# CFLAGS = -DAIX -DAIXV3 -DSTATOBJS \
-# -DHAVE_NIS \
-# -DMSRV_RELEASE=\"$(MSRV_RELEASE)\"
-# LD_EXTRAS = -L/tools/ns/lib -liostream -ls
-# MSRV_INCLUDES = -I/tools/ns/lib/g++-include
-#endif
-
-
-ifeq ($(ARCH), WINNT)
-
- SHLIB_SUFFIX = dll
- ARCHIVE_SUFFIX = lib
- RM = del /q
- EXE_SUFFIX = .exe
- OBJ_SUFFIX = obj
-
- SHARED_LIB = NetscapeMTA30.$(SHLIB_SUFFIX)
- SHARED_IMPLIB = NetscapeMTA30.$(ARCHIVE_SUFFIX)
- SHARED_BASE_LIB = NetscapeMTAX30.$(SHLIB_SUFFIX)
- SHARED_BASE_IMPLIB = NetscapeMTAX30.$(ARCHIVE_SUFFIX)
- MATCH_LIB = NSMatch30.$(SHLIB_SUFFIX)
- MATCH_IMPLIB = NSMatch30.$(ARCHIVE_SUFFIX)
- POSEC_LIB = nsSupport30.$(SHLIB_SUFFIX)
- POSEC_IMPLIB = nsSupport30.$(ARCHIVE_SUFFIX)
- MDBAPI_LIB = NetscapeMDB30.$(SHLIB_SUFFIX)
- MDBAPI_IMPLIB = NetscapeMDB30.$(ARCHIVE_SUFFIX)
- BUILD_SHARED = TRUE
- BUILDAPI_SHARED = TRUE
- PLUGIN_SHARED = TRUE
- POSEC_SHARED = FALSE
- CFLAGS = /D__NT__ $(MC_DEBUG) \
- /DMSRV_RELEASE=\"$(MSRV_RELEASE)\" \
- /D$(NS_PRODUCT) $(XP_FLAG) \
- /D__USE_THREAD_HEAPS__ -Gy
- OPTIMIZE_FLAGS = -Ob1 -O2
- DLL_CFLAGS = /D__Lib__
- DLL_CXXFLAGS = /D__Lib__
- LD_EXTRAS = /INCREMENTAL:NO $(ML_DEBUG)
- LINK_CONSOLE = link /NOLOGO /SUBSYSTEM:CONSOLE $(ML_DEBUG) \
- /OUT:$@ /OPT:REF /MAP
-endif
-
-
-.SUFFIXES: .cxx
-
-# In Debug mode, always build archive libraries
-
-ifeq ($(MSRV_DEBUG), yes)
-
-ifneq ($(ARCH), WINNT)
-MSRV_DBG_DEFINES = -g -DMSRV_DEBUG $(DBG_FLAGS)
-BUILD_SHARED = FALSE
-PLUGIN_SHARED = FALSE
-else
-MSRV_DBG_DEFINES = /Od /Zi $(DBG_FLAGS)
-endif
-
-else
-MSRV_DBG_DEFINES = $(OPTIMIZE_FLAGS)
-endif
-
-
-ifneq ($(ARCH), WINNT)
-
-ifeq ($(BUILD_SHARED), TRUE)
- SHARED_LIB = libNSmail.$(SHLIB_SUFFIX)
-else
- SHARED_LIB = libNSmail.$(ARCHIVE_SUFFIX)
-endif
-
-ifeq ($(BUILDAPI_SHARED), TRUE)
- MDBAPI_LIB = libNSmdb.$(SHLIB_SUFFIX)
-else
- MDBAPI_LIB = libNSmdb.$(ARCHIVE_SUFFIX)
-endif
-
-
-ifeq ($(PLUGIN_SHARED), TRUE)
-ifeq ($(ARCH), AIX)
- MATCH_LIB = libNSmatch$(SHLIB_SUFFIX)
- HDR_LIB = libNShdr$(SHLIB_SUFFIX)
-else
- MATCH_LIB = libNSmatch.$(SHLIB_SUFFIX)
- HDR_LIB = libNShdr.$(SHLIB_SUFFIX)
-endif
-else
- MATCH_LIB = libNSmatch.$(ARCHIVE_SUFFIX)
- HDR_LIB = libNShdr.$(ARCHIVE_SUFFIX)
-endif
-
-
-ifeq ($(ARCH), HPUX)
-ifeq ($(MSRV_HPUX_CURSES_STATIC), TRUE)
-CURSES=/usr/lib/libHcurses.a
-else
-CURSES=/usr/lib/libcurses.sl
-endif
-else
-CURSES=-lcurses -ltermcap
-endif
-
-ifeq ($(ARCH), AIX)
-CURSES=-lcurses
-endif
-
-# Before merge stuff - nirmal 4/24
-#LD_LINKLIB = -L$(LIBDEST) -L/usr/lib -L$(NDBGDEST)/lib \
-# -lNSmdb -lNSmail -lNSmObj \
-# -lNSmail -lNSmdb -L$(NSCP_DISTDIR)/lib \
-# -llcache10 -lldap10 $(CURSES)
-#
-
-ifeq ($(ARCH), HPUX)
-LD_LINKLIB = -L$(LIBDEST) -L/usr/lib -L$(NDBGDEST)/lib \
- -lNSmdb -lNSmail -lNSmObj -lNSmail -lNSmdb \
- -L$(NSCP_DISTDIR)/lib -llcache10 \
- -lldap10 \
- $(CURSES)
-else
-LD_LINKLIB = -L$(LIBDEST) -L/usr/lib -L$(NDBGDEST)/lib \
- -lNSmdb -lNSmail -lNSmObj -lNSmail -lNSmdb \
- $(NSCP_DISTDIR)/lib/liblcache10.$(SHLIB_SUFFIX) \
- $(NSCP_DISTDIR)/lib/libldap10.$(SHLIB_SUFFIX) \
- $(CURSES)
-endif
-
-ifeq ($(ARCH), AIX)
-CURSES=-lcurses
-LD_LINKLIB = -L$(LIBDEST) -L/usr/lib -L$(NDBGDEST)/lib \
- -lNSmdb -lNSmail -lNSmObj \
- $(NSCP_DISTDIR)/lib/liblcache10$(SHLIB_SUFFIX) \
- $(NSCP_DISTDIR)/lib/libldap10$(SHLIB_SUFFIX) \
- $(NSCP_DISTDIR)/lib/libssldap10.a \
- $(CURSES)
-
-endif
-
-
-LD_MATCHLIB = -lNSmatch
-else # ARCH = WINNT section
-LD_POSECLIB = $(addprefix $(LIBDEST)/, $(POSEC_IMPLIB))
-LD_LINKLIB = $(addprefix $(LIBDEST)/, $(SHARED_IMPLIB))
-LD_MATCHLIB = $(addprefix $(LIBDEST)/, $(MATCH_IMPLIB))
-endif
-
-ifeq ($(ARCH), WINNT)
-LD_LINKLIB += $(NSCP_DISTDIR)/lib/nsldap32v10.lib $(NSCP_DISTDIR)/lib/nslch32v10.lib
-LDX_LINKLIB = $(LD_LINKLIB) $(LIBDEST)/$(SHARED_BASE_IMPLIB)
-
-I18NLIBS=$(addsuffix .$(LIB_SUFFIX),\
- $(addprefix $(OBJDIR)/lib/lib, \
- ldapu $(LIBADMIN) $(FRAME) $(CRYPT) $(LIBACCESS))) \
- $(LIBDBM) $(LIBXP) $(LIBNSPR) $(LIBARES) $(LIBSEC)
-else
-
-# The way I18LIBS was defined in server3_mail_branch, is quite misleading.
-# (see modules.mk for details). After this, LD_LINKLIB gets redefined
-# and that adds unwanted lines to the link of bunch of things. Please
-# add I18LIBS to the individual makefiles, where necessary. See
-# mailserv2/admin/src/Makefile -> DEPLIBS for an example.
-# I am changing this definition for the merge. Retain these changes in
-# future merges. I haved added posix4 to keep what was before merge.
-# - Nirmal 4/24/97.
-#I18NLIBS=$(addsuffix .$(LIB_SUFFIX),\
-# $(addprefix $(OBJDIR)/lib/lib, \
-# ldapu $(LIBADMIN) $(FRAME) $(CRYPT) $(LIBACCESS))) \
-# $(LIBDBM) $(LIBXP) $(LIBNSPR) $(LIBARES) \
-# -L$(MCOM_ROOT)/components/ldapsdk/$(NSOBJDIR_NAME)/lib \
-# -lssldap10 $(LIBSEC)
-I18NLIBS=$(addsuffix .$(LIB_SUFFIX),\
- $(addprefix $(OBJDIR)/lib/lib, \
- ldapu $(LIBADMIN) $(FRAME) $(CRYPT) $(LIBACCESS))) \
- $(LIBDBM) $(LIBXP) $(LIBNSPR) $(LIBARES) \
- -L$(NSCP_DISTDIR)/lib \
- -lssldap10 $(LIBSEC)
-
-endif
-
-ifeq ($(ARCH), SOLARIS) # IRIX and HPUX have no posix4 lib
- I18NLIBS += -lposix4
-endif
-
-LD_LINKLIB += $(I18NLIBS)
-
-ifeq ($(ARCH), IRIX)
-LD_LINKLIB += $(NSCP_DISTDIR)/lib/libldap10.so
-endif
-
-##########################################################################
-## AIX override to make dynamic linking work correctly
-## instead of linking directly with the shared object, we use an
-## import list. Note this syntax only works with g++ or gcc as the compiler
-##########################################################################
-
-ifeq ($(ARCH), AIX)
-LD_MATCHLIB = -Wl,-bI:$(MSRV_ROOT)/code/plugins/NSMatch.exp
-endif
-
-
-
-DB_DEFINES = -DMEMMOVE -D__DBINTERFACE_PRIVATE -DPOSIX_MISTAKE
-
-INCLUDES = -I$(MSRV_ROOT)/code/include \
- -I$(MCOM_ROOT)/lib/libdbm \
- -I$(MSRV_ROOT)/contrib/regex \
- $(MSRV_INCLUDES)
-
-CCOPTS = $(MSRV_DBG_DEFINES) $(CFLAGS) $(INCLUDES) \
- $(MCC_INCLUDE) $(NSPR_DEFINES)
-CXXOPTS = $(MSRV_DBG_DEFINES) $(CFLAGS) $(INCLUDES) \
- $(MCC_INCLUDE) $(NSPR_DEFINES)
-
-
-MSRVDESTS = $(BLDDEST) $(LIBDEST) $(NETDEST) $(LOCDEST) $(EXTDEST) \
- $(BINDEST) $(OBJDEST)
-
-$(MSRVDESTS):
- $(MD) $@
-
-default: all
-
-all: $(MSRVDESTS)
-
-depend: localdepend
-
-clean: localclean
-
-spotless: clean
- $(RM) -r $(BLDDEST)
-
diff --git a/ldap/servers/snmp/ntagt/nslagtcom_nt.h b/ldap/servers/snmp/ntagt/nslagtcom_nt.h
deleted file mode 100644
index 28dd59f..0000000
--- a/ldap/servers/snmp/ntagt/nslagtcom_nt.h
+++ /dev/null
@@ -1,69 +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 **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-
-/*-------------------------------------------------------------------------
- *
- * nslagtcom_nt.h - Common definitions for NS Directory Server's SNMP
- * subagent on NT.
- * The definitions in here should be kept so that modules
- * other than the subagent can share this file.
- *
- * Revision History:
- * 07/27/1997 Steve Ross Created
- *
- *
- *
- *-----------------------------------------------------------------------*/
-
-#ifndef __NSLAGTCOM_NT_H_
-#define __NSLMAGTCOM_NT_H_
-
-/*-------------------------------------------------------------------------
- *
- * Defines
- *
- *-----------------------------------------------------------------------*/
-
-#define MAGT_NSEV_SNMPTRAP "NSEV_SNMPTRAP_LDAP"
-
-#endif /* __NSLAGTCOM_NT_H_ */
diff --git a/ldap/servers/snmp/ntagt/nsldapagt_nt.c b/ldap/servers/snmp/ntagt/nsldapagt_nt.c
deleted file mode 100644
index 0934680..0000000
--- a/ldap/servers/snmp/ntagt/nsldapagt_nt.c
+++ /dev/null
@@ -1,1778 +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 **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-
-/*-------------------------------------------------------------------------
- *
- * nsldapagt_nt.c - SNMP Extension Agent for Directory Server on NT.
- * Provides SNMP data to NT SNMP Service on behalf of the
- * Directory Server installed on the current system. SNMP
- * data is collected from the following sources:
- * 1. config file (static data)
- * 2. daemonstats file (dynamic data)
- *
- * Revision History:
- * 07/25/1997 Steve Ross Created
- *
- *
- *-----------------------------------------------------------------------*/
-
-
-#include <ctype.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <io.h>
-#include <windows.h>
-#include <winsock.h>
-#include <time.h>
-#include <snmp.h>
-#include "nt/regparms.h"
-#include "agtmmap.h"
-#include "nslagtcom_nt.h"
-#include "nsldapmib_nt.h"
-#include "nsldapagt_nt.h"
-#include "ldap.h"
-
-/*-------------------------------------------------------------------------
- *
- * Defines
- *
- *-----------------------------------------------------------------------*/
-
-#define REPLACE(x, y) do {if ((x)) SNMP_free((x));\
- (x) = SNMP_malloc(strlen((y)) + 1);\
- if ((x)) strcpy((x), (y));} while(0)
-
-#define export extern "C"
-
-/*-------------------------------------------------------------------------
- *
- * Globals
- *
- *-----------------------------------------------------------------------*/
-
-instance_list_t *pInstanceList = NULL;
-
-/*
- * Extension Agent DLLs need access to elapsed time agent has been active.
- * This is implemented by initializing the Extension Agent with a time zero
- * reference, and allowing the agent to compute elapsed time by subtracting
- * the time zero reference from the current system time. This Extension
- * Agent implements this reference with dwTimeZero.
- */
-DWORD dwTimeZero = 0;
-
-/*-------------------------------------------------------------------------
- *
- * Externs
- *
- *-----------------------------------------------------------------------*/
-
-extern AsnObjectIdentifier MIB_OidPrefix;
-extern UINT MIB_num_vars;
-
-/*------------------------ prototypes -----------------------------------*/
-// char *getRootDirFromConfFile(char *filename, char *szLogPath);
-char *getRootDirFromConfFile(char *filename);
-
-/*-------------------------------------------------------------------------
- *
- * MagtInitInstance: initializes entry in instance list
- *
- *
- *
- *
- *
- *-----------------------------------------------------------------------*/
-
- int MagtInitInstance(instance_list_t *pInstance)
- {
-
-
- pInstance->ghTrapEvent = NULL;
- pInstance->pOpsStatInfo = NULL;
- pInstance->pEntriesStatInfo = NULL;
- pInstance->ppIntStatInfo = NULL;
- pInstance->pMibInfo = NULL;
- pInstance->oldUpdateTime = 0;
- pInstance->oldStartTime = 0;
- pInstance->graceCycles = MAGT_TIME_QUANTUM;
- pInstance->mmapStale = MAGT_FALSE;
- pInstance->mmapOk = MAGT_FALSE;
- pInstance->serverUp = MAGT_FALSE;
- pInstance->downTrapSent = MAGT_FALSE;
- pInstance->trapType = MAGT_TRAP_NONE;
-
- return 0;
- }
-
- int MagtInitStats(MagtOpsTblInfo_t *OpsTblInfo,
- MagtEntriesTblInfo_t *EntriesTblInfo,
- MagtIntTblInfo_t **IntTblInfo )
- {
- int i;
-
- if (OpsTblInfo != NULL)
- {
- OpsTblInfo->AnonymousBinds = 0;
- OpsTblInfo->UnAuthBinds = 0;
- OpsTblInfo->SimpleAuthBinds = 0;
- OpsTblInfo->StrongAuthBinds = 0;
- OpsTblInfo->BindSecurityErrors = 0;
- OpsTblInfo->InOps = 0;
- OpsTblInfo->ReadOps = 0;
- OpsTblInfo->CompareOps = 0;
- OpsTblInfo->AddEntryOps = 0;
- OpsTblInfo->RemoveEntryOps = 0;
- OpsTblInfo->ModifyEntryOps = 0;
- OpsTblInfo->ModifyRDNOps = 0;
- OpsTblInfo->ListOps = 0;
- OpsTblInfo->SearchOps = 0;
- OpsTblInfo->OneLevelSearchOps = 0;
- OpsTblInfo->WholeSubtreeSearchOps = 0;
- OpsTblInfo->Referrals = 0;
- OpsTblInfo->Chainings = 0;
- OpsTblInfo->SecurityErrors = 0;
- OpsTblInfo->Errors = 0;
- }
-
- if(EntriesTblInfo != NULL)
- {
- EntriesTblInfo->MasterEntries = 0;
- EntriesTblInfo->CopyEntries = 0;
- EntriesTblInfo->CacheEntries = 0;
- EntriesTblInfo->CacheHits = 0;
- EntriesTblInfo->SlaveHits = 0;
- }
-
- if(IntTblInfo != NULL)
- {
- for(i=0; i < NUM_SNMP_INT_TBL_ROWS; i++)
- {
- strcpy(IntTblInfo[i]->DsName.val, "Not Available");
- IntTblInfo[i]->DsName.len = strlen("Not Available");
-
- IntTblInfo[i]->TimeOfCreation = 0;
- IntTblInfo[i]->TimeOfLastAttempt = 0;
- IntTblInfo[i]->TimeOfLastSuccess = 0;
- IntTblInfo[i]->FailuresSinceLastSuccess = 0;
- IntTblInfo[i]->Failures = 0;
- IntTblInfo[i]->Successes = 0;
-
- strcpy(IntTblInfo[i]->URL.val, "Not Available");
- IntTblInfo[i]->URL.len = strlen("Not Available");
- }
- }
-
- return 0;
- }
-
-/*-------------------------------------------------------------------------
- *
- * MagtCheckServer: Checks the Server's status and indicates
- * which trap is to be generated if necessary.
- *
- * Returns: MAGT_TRAP_NONE - No trap to be generated
- * Trap # - Id of trap to be generated
- *
- *-----------------------------------------------------------------------*/
-
-int MagtCheckServer(instance_list_t *pInstance)
-{
- int err;
-
- if (pInstance->mmapStale == MAGT_TRUE)
- pInstance->mmapOk = MAGT_FALSE; /* Ensure open of mmap */
-
- err = MagtReadStats(&(pInstance->hdrInfo),
- NULL,
- NULL,
- NULL,
- pInstance->szStatsPath,
- pInstance->szLogPath); /* Find times info in hdr */
-
- if (pInstance->mmapOk == MAGT_FALSE)
- {
- if (err != 0) /* Cannot open mmap file */
- {
- if ((pInstance->serverUp == MAGT_TRUE) || /* Server status changes */
- (pInstance->downTrapSent == MAGT_FALSE)) /* Down trap was not sent */
- {
- pInstance->serverUp = MAGT_FALSE;
- pInstance->downTrapSent = MAGT_TRUE;
- pInstance->trapType = MAGT_TRAP_SERVER_DOWN;
- }
- }
- else
- {
- pInstance->mmapOk = MAGT_TRUE;
-
- /*
- * Since mmapOk was false, it means the mmap file couldn't be
- * opened before. Now it is opened ok, so it will be assumed
- * that the server has gone down and up and a start trap may need
- * to be sent.
- */
- if (pInstance->mmapStale == MAGT_FALSE)
- pInstance->serverUp = MAGT_FALSE;
- else
- pInstance->mmapStale = MAGT_FALSE; /* Not stale anymore */
- }
- }
-
- if (pInstance->trapType == MAGT_TRAP_NONE)
- {
- if (err != 0)
- {
- pInstance->mmapOk = MAGT_FALSE;
-
- /*
- * If the mmap file does not exist, assume server has gone down.
- */
- if (err == ENOENT)
- {
- if((pInstance->serverUp == MAGT_TRUE) || /* Server status changes */
- (pInstance->downTrapSent == MAGT_FALSE)) /* Down trap was not sent */
- {
- pInstance->serverUp = MAGT_FALSE;
- pInstance->downTrapSent = MAGT_TRUE;
- pInstance->trapType = MAGT_TRAP_SERVER_DOWN;
- }
- }
- }
- else /* Got hdr info ok */
- {
-
- /*
- * The fact that header info can be read will be taken as the
- * server is up. If it was not up before, a server start trap
- * will need to be sent.
- */
- if (((pInstance->hdrInfo.restarted) || (pInstance->hdrInfo.startTime > pInstance->oldStartTime))
- && (pInstance->hdrInfo.updateTime > pInstance->oldUpdateTime))
- {
- pInstance->oldUpdateTime = pInstance->hdrInfo.updateTime;
- pInstance->oldStartTime = pInstance->hdrInfo.startTime;
- pInstance->graceCycles = MAGT_TIME_QUANTUM;
- pInstance->serverUp = MAGT_TRUE;
- pInstance->downTrapSent = MAGT_FALSE;
- pInstance->trapType = MAGT_TRAP_SERVER_START;
- }
- else
- {
- if (pInstance->hdrInfo.updateTime > pInstance->oldUpdateTime)
- {
- pInstance->oldUpdateTime = pInstance->hdrInfo.updateTime;
- if (pInstance->graceCycles == 0)
- {
-
- /*
- * The server has probably been stuck and has been restarted.
- */
- pInstance->serverUp = MAGT_TRUE;
- pInstance->downTrapSent = MAGT_FALSE;
- pInstance->trapType = MAGT_TRAP_SERVER_START;
- }
-
- /*
- * Reset grace cycles in either case because server is healthy.
- */
- pInstance->graceCycles = MAGT_TIME_QUANTUM;
- }
- else /* Mmap file not updated */
- {
- pInstance->mmapStale = MAGT_TRUE;
-
- /*
- * The server is not responding, send trap if one has not
- * been sent yet.
- */
- if (pInstance->graceCycles > 0)
- {
- pInstance->graceCycles--;
- if (pInstance->graceCycles == 0)
- {
- pInstance->trapType = MAGT_TRAP_SERVER_DOWN;
- }
- }
- }
- }
- }
- }
-
- return pInstance->trapType;
-}
-
-
-/*-------------------------------------------------------------------------
- *
- * MagtCleanUp: Cleans up any allocated global resources.
- *
- * Returns: None
- *
- *-----------------------------------------------------------------------*/
-
-void MagtCleanUp()
-{
- instance_list_t *pInstance;
-
- for (pInstance = pInstanceList; pInstance; pInstance = pInstance->pNext)
- {
- if (pInstance->pCfgInfo != NULL)
- GlobalFree(pInstance->pCfgInfo);
-
- if (pInstance->pMibInfo != NULL)
- GlobalFree(pInstance->pMibInfo);
-
- if (pInstance->szRootDir != NULL)
- GlobalFree(pInstance->szRootDir);
-
- if (pInstance->ghTrapEvent != NULL)
- CloseHandle(pInstance->ghTrapEvent);
- }
-
-}
-
-/*-------------------------------------------------------------------------
- *
- * MagtConfProcess: Processes a configuration entry and updates the
- * corresponding static info field.
- *
- * Returns: None
- *
- *-----------------------------------------------------------------------*/
-
-void MagtConfProcess(char *line, int lineLen,
- MagtLDAPInfo_t *info)
-
-{
- char keyWord[MAGT_MAX_LINELEN + 1];
- char *val, *p;
-
- if (line == NULL) /* Shouldn't happen */
- return;
-
- if ((*line) == '#') /* Comment - Ignore */
- return;
-
- keyWord[0] = '\0';
-
- if (sscanf(line, "%s", keyWord) != 1) /* Partial entry */
- return;
-
- val = line;
-
- /*
- * Go past any spaces preceding the keyword.
- */
- while ((*val) && (isspace(*val)))
- ++val;
-
- if (!(*val))
- return;
-
- /*
- * Go past the keyword.
- */
- for (; (*val) && !(isspace(*val)); ++val);
-
- if (!(*val))
- return;
-
- /*
- * Go past the spaces that follow the key word.
- */
- while ((*val) && (isspace(*val)))
- ++val;
-
- if (!(*val))
- return;
-
- /*
- * Strip CRLF characters.
- */
- if ((p = strchr(val, '\r')) != NULL)
- *p = '\0';
- if ((p = strchr(val, '\n')) != NULL)
- *p = '\0';
-
- /*
- * Now val points to the value and keyWord points to the key word.
- */
-
- if (!stricmp(keyWord, "nsslapd-port:"))
- {
- info->port = atoi(val);
- return;
- }
-
- if (!stricmp(keyWord, "nsslapd-localhost:"))
- {
- REPLACE(info->host, val);
- info->host[strlen(info->host)] = '\0';
- return;
- }
-
- if (!stricmp(keyWord, "nsslapd-rootdn:"))
- {
- REPLACE(info->rootdn, val);
- info->rootdn[strlen(info->rootdn)] = '\0';
- return;
- }
-
- if (!stricmp(keyWord, "nsslapd-rootpw:"))
- {
- REPLACE(info->rootpw, val);
- info->rootpw[strlen(info->rootpw)] = '\0';
- return;
- }
-
- /*
- * None of the above? Invalid keyword. Just return.
- */
- return;
-}
-
-
-char *getRootDirFromConfFile(char *confpath)
-{
- char *rootDir = NULL;
- const char *config = "\\config\0" ;
- char instanceDir[MAGT_MAX_LINELEN + 1] = "";
- size_t len ;
-
- if (confpath) {
- len = strlen(confpath) - strlen(config) ;
- strncpy(instanceDir, confpath, len);
- rootDir = _strdup(instanceDir) ; // allocate memory for rootDir and set up to value pointed by instanceDir
- return rootDir ;
- }
- else return NULL ;
-}
-
-
-/*-------------------------------------------------------------------------
- *
- * MagtInitMibStorage: Initializes the storage pointers of MIB variables.
- *
- * Returns: None
- *
- *-----------------------------------------------------------------------*/
-
-void MagtInitMibStorage(MagtMibEntry_t * MibInfo,
- MagtOpsTblInfo_t * pOpsStatInfo,
- MagtEntriesTblInfo_t * pEntriesStatInfo,
- MagtIntTblInfo_t ** ppIntStatInfo,
- MagtStaticInfo_t * pCfgInfo)
-{
- switch(MibInfo->uId)
- {
- case MAGT_ID_DESC:
- MibInfo->Storage = pCfgInfo->entityDescr.val;
- break;
- case MAGT_ID_VERS:
- MibInfo->Storage = pCfgInfo->entityVers.val;
- break;
- case MAGT_ID_ORG:
- MibInfo->Storage = pCfgInfo->entityOrg.val;
- break;
- case MAGT_ID_LOC:
- MibInfo->Storage = pCfgInfo->entityLocation.val;
- break;
- case MAGT_ID_CONTACT:
- MibInfo->Storage = pCfgInfo->entityContact.val;
- break;
- case MAGT_ID_NAME:
- MibInfo->Storage = pCfgInfo->entityName.val;
- break;
- case MAGT_ID_APPLINDEX:
- MibInfo->Storage = &pCfgInfo->ApplIndex;
- break;
-
- /* operations table attrs */
- case MAGT_ID_ANONYMOUS_BINDS:
- MibInfo->Storage = &pOpsStatInfo->AnonymousBinds;
- break;
- case MAGT_ID_UNAUTH_BINDS:
- MibInfo->Storage = &pOpsStatInfo->UnAuthBinds;
- break;
- case MAGT_ID_SIMPLE_AUTH_BINDS:
- MibInfo->Storage = &pOpsStatInfo->SimpleAuthBinds;
- break;
- case MAGT_ID_STRONG_AUTH_BINDS:
- MibInfo->Storage = &pOpsStatInfo->StrongAuthBinds;
- break;
- case MAGT_ID_BIND_SECURITY_ERRORS:
- MibInfo->Storage = &pOpsStatInfo->BindSecurityErrors;
- break;
- case MAGT_ID_IN_OPS:
- MibInfo->Storage = &pOpsStatInfo->InOps;
- break;
- case MAGT_ID_READ_OPS:
- MibInfo->Storage = &pOpsStatInfo->ReadOps;
- break;
- case MAGT_ID_COMPARE_OPS:
- MibInfo->Storage = &pOpsStatInfo->CompareOps;
- break;
- case MAGT_ID_ADD_ENTRY_OPS:
- MibInfo->Storage = &pOpsStatInfo->AddEntryOps;
- break;
- case MAGT_ID_REMOVE_ENTRY_OPS:
- MibInfo->Storage = &pOpsStatInfo->RemoveEntryOps;
- break;
- case MAGT_ID_MODIFY_ENTRY_OPS:
- MibInfo->Storage = &pOpsStatInfo->ModifyEntryOps;
- break;
- case MAGT_ID_MODIFY_RDN_OPS:
- MibInfo->Storage = &pOpsStatInfo->ModifyRDNOps;
- break;
- case MAGT_ID_LIST_OPS:
- MibInfo->Storage = &pOpsStatInfo->ListOps;
- break;
- case MAGT_ID_SEARCH_OPS:
- MibInfo->Storage = &pOpsStatInfo->SearchOps;
- break;
- case MAGT_ID_ONE_LEVEL_SEARCH_OPS:
- MibInfo->Storage = &pOpsStatInfo->OneLevelSearchOps;
- break;
- case MAGT_ID_WHOLE_SUBTREE_SEARCH_OPS:
- MibInfo->Storage = &pOpsStatInfo->WholeSubtreeSearchOps;
- break;
- case MAGT_ID_REFERRALS:
- MibInfo->Storage = &pOpsStatInfo->Referrals;
- break;
- case MAGT_ID_CHAININGS:
- MibInfo->Storage = &pOpsStatInfo->Chainings;
- break;
- case MAGT_ID_SECURITY_ERRORS:
- MibInfo->Storage = &pOpsStatInfo->SecurityErrors;
- break;
- case MAGT_ID_ERRORS:
- MibInfo->Storage = &pOpsStatInfo->Errors;
- break;
- /* entries table attrs */
- case MAGT_ID_MASTER_ENTRIES:
- MibInfo->Storage = &pEntriesStatInfo->MasterEntries;
- break;
- case MAGT_ID_COPY_ENTRIES:
- MibInfo->Storage = &pEntriesStatInfo->CopyEntries;
- break;
- case MAGT_ID_CACHE_ENTRIES:
- MibInfo->Storage = &pEntriesStatInfo->CacheEntries;
- break;
- case MAGT_ID_CACHE_HITS:
- MibInfo->Storage = &pEntriesStatInfo->CacheHits;
- break;
- case MAGT_ID_SLAVE_HITS:
- MibInfo->Storage = &pEntriesStatInfo->SlaveHits;
- break;
- /* interaction table entries
- *---------------------------------
- * a little different because table of N entries, we can get current value of n
- * from MibInfo->Oid.ids[MibInfo->Oid.idLength] because dsIntIndex is last,
- * subtract 1 from it because oids go from 1 to NUM_SNMP_INT_TBL_ROWS array goes
- * from 0 to NUM_SNMP_INT_TBL_ROWS - 1
- * if this ever changes this logic will have to change to get it from
- * appropriate spot
- */
- case MAGT_ID_DS_NAME:
- MibInfo->Storage = ppIntStatInfo[MibInfo->Oid.ids[MibInfo->Oid.idLength - 1] - 1]->DsName.val;
- break;
- case MAGT_ID_TIME_OF_CREATION:
- MibInfo->Storage = &(ppIntStatInfo[MibInfo->Oid.ids[MibInfo->Oid.idLength - 1] - 1]->TimeOfCreation);
- break;
- case MAGT_ID_TIME_OF_LAST_ATTEMPT:
- MibInfo->Storage = &(ppIntStatInfo[MibInfo->Oid.ids[MibInfo->Oid.idLength - 1] - 1]->TimeOfLastAttempt);
- break;
- case MAGT_ID_TIME_OF_LAST_SUCCESS:
- MibInfo->Storage = &(ppIntStatInfo[MibInfo->Oid.ids[MibInfo->Oid.idLength - 1] - 1]->TimeOfLastSuccess);
- break;
- case MAGT_ID_FAILURES_SINCE_LAST_SUCCESS:
- MibInfo->Storage = &(ppIntStatInfo[MibInfo->Oid.ids[MibInfo->Oid.idLength - 1] - 1]->FailuresSinceLastSuccess);
- break;
- case MAGT_ID_FAILURES:
- MibInfo->Storage = &(ppIntStatInfo[MibInfo->Oid.ids[MibInfo->Oid.idLength - 1] - 1]->Failures);
- break;
- case MAGT_ID_SUCCESSES:
- MibInfo->Storage = &(ppIntStatInfo[MibInfo->Oid.ids[MibInfo->Oid.idLength - 1] - 1]->Successes);
- break;
- case MAGT_ID_URL:
- MibInfo->Storage = ppIntStatInfo[MibInfo->Oid.ids[MibInfo->Oid.idLength - 1] - 1]->URL.val;
- break;
-
-
- default:
- break;
- }
-}
-
-/*-------------------------------------------------------------------------
- *
- * ReadStaticSettingsOverLdap: Reads static information from the directory server
- *
- *
- * Returns: 0 - No error
- * -1 - Errors
- *
- *-----------------------------------------------------------------------*/
-
-int ReadStaticSettingsOverLdap(MagtLDAPInfo_t ldapInfo, MagtStaticInfo_t *staticInfo, int *SNMPoff)
-{
- LDAP *ld;
- LDAPMessage *result, *e;
- BerElement *ber;
- char *a;
- char **vals;
- char *attrs[]={LDAP_ATTR_SNMP_ENABLED,
- LDAP_ATTR_SNMP_DESCRIPTION,
- LDAP_ATTR_SNMP_ORGANIZATION,
- LDAP_ATTR_SNMP_LOCATION,
- LDAP_ATTR_SNMP_CONTACT,
- NULL};
- /* set the applIndex to the ldap port */
- staticInfo->ApplIndex = ldapInfo.port;
-
- /* get rest of static settings from the Directory Server */
- if ( ( ld = ldap_init( ldapInfo.host, ldapInfo.port ) ) == NULL )
- {
- return -1;
- }
-
- if ( ldap_simple_bind_s( ld, NULL, NULL) != LDAP_SUCCESS )
- {
- return -1;
- }
-
-
- if ( ldap_search_s( ld, LDAP_CONFIG_DN, LDAP_SCOPE_BASE, BASE_OBJECTCLASS_SEARCH,
- attrs, 0, &result ) != LDAP_SUCCESS )
- {
- return -1;
-
- }else{
-
- e = ldap_first_entry( ld, result );
-
- if(e != NULL)
- {
- for ( a = ldap_first_attribute( ld, e, &ber );
- a != NULL; a = ldap_next_attribute( ld, e, ber ) )
- {
- if ((vals = ldap_get_values( ld, e, a)) != NULL )
- {
- MagtDispStr_t *pStaticAttr=NULL;
- /* we only want the first value, ignore any others */
- if( 0 == strcmp(LDAP_ATTR_SNMP_ENABLED, a) )
- {
- if(0 == stricmp(SNMP_ON, vals[0]) )
- {
- *SNMPoff = 0;
- }else{
- *SNMPoff = 1;
- }
- }else if( 0 == strcmp(LDAP_ATTR_SNMP_DESCRIPTION, a) ){
- pStaticAttr = &(staticInfo->entityDescr);
- }else if( 0 == strcmp(LDAP_ATTR_SNMP_ORGANIZATION, a) ){
- pStaticAttr = &(staticInfo->entityOrg);
- }else if( 0 == strcmp(LDAP_ATTR_SNMP_LOCATION, a) ){
- pStaticAttr = &(staticInfo->entityLocation);
- }else if( 0 == strcmp(LDAP_ATTR_SNMP_CONTACT, a) ){
- pStaticAttr = &(staticInfo->entityContact);
- }
- /* stevross: missing the following for NT
- version
- DSName
- */
-
- /* for Unix also missing
- MasterHost, MasterPort
- */
- if(pStaticAttr != NULL && vals[0] != NULL)
- {
- REPLACE(pStaticAttr->val, vals[0]);
- pStaticAttr->len = strlen(pStaticAttr->val);
- }
-
- ldap_value_free( vals );
-
- }
-
- ldap_memfree( a );
-
- }
-
- if ( ber != NULL )
- {
- ldap_ber_free( ber, 0 );
- }
- }
- }
-
- ldap_msgfree( result );
- ldap_unbind( ld );
-
- return 0;
-}
-
-/*-------------------------------------------------------------------------
- *
- * MagtLoadStaticInfo: Loads static information from the configuration
- * file.
- *
- * Returns: 0 - No error
- * -1 - Errors
- *
- *-----------------------------------------------------------------------*/
-
-int MagtLoadStaticInfo(MagtStaticInfo_t *staticInfo, char *pszRootDir, int *SNMPOff, char *pszLogPath)
-{
- char confpath[MAX_PATH];
- FILE *fp;
- char linebuf[MAGT_MAX_LINELEN + 1];
- int lineLen;
- char logMsg[1024];
- MagtLDAPInfo_t ldapInfo;
-
- /*
- * Set-up default values first.
- */
-
- staticInfo->entityDescr.val = NULL;
- staticInfo->entityVers.val = NULL;
- staticInfo->entityOrg.val = NULL;
- staticInfo->entityLocation.val = NULL;
- staticInfo->entityContact.val = NULL;
- staticInfo->entityName.val = NULL;
-
- staticInfo->ApplIndex = 0;
-
- REPLACE(staticInfo->entityDescr.val, CAPBRAND " Directory Server");
- staticInfo->entityDescr.len = strlen(staticInfo->entityDescr.val);
-
- REPLACE(staticInfo->entityVers.val, "1");
- staticInfo->entityVers.len = strlen(staticInfo->entityVers.val);
-
- REPLACE(staticInfo->entityOrg.val, "Not Available");
- staticInfo->entityOrg.len = strlen(staticInfo->entityOrg.val);
-
- REPLACE(staticInfo->entityLocation.val, "Not Available");
- staticInfo->entityLocation.len = strlen(staticInfo->entityLocation.val);
-
- REPLACE(staticInfo->entityContact.val, "Not Available");
- staticInfo->entityContact.len = strlen(staticInfo->entityContact.val);
-
- REPLACE(staticInfo->entityName.val, "Not Available");
- staticInfo->entityName.len = strlen(staticInfo->entityName.val);
-
- /*
- * Read any config info from dse.ldif (for now its just port used as
- * applIndex
- */
-
- wsprintf(confpath, "%s/%s/%s", pszRootDir, MAGT_CONFDIR, DSE_LDIF);
-
- if ((fp = fopen(confpath, "r")) == (FILE *) NULL)
- {
- wsprintf(logMsg,
- "Failed to open dse.ldif (error = %d)\n",
- errno);
- MagtLog(logMsg, pszLogPath);
- return (-1);
- }
-
-
- while ((lineLen = MagtReadLine(linebuf, MAGT_MAX_LINELEN, fp)) > 0)
- {
- /*
- * Update the configured entries.
- */
- MagtConfProcess(linebuf, lineLen, &ldapInfo);
- }
- fclose (fp);
-
- if( 0 != ReadStaticSettingsOverLdap(ldapInfo, staticInfo, SNMPOff) < 0 )
- {
- wsprintf(logMsg,
- "Failed to read SNMP configuration over ldap\n");
- MagtLog(logMsg, pszLogPath);
- return (-1);
- }
-
- return (0);
-}
-
-/*-------------------------------------------------------------------------
- *
- * MagtLog: Logs the specified message into the log file.
- * Notes: Log file is opened and closed each time.
- *
- * Returns: None
- *
- *-----------------------------------------------------------------------*/
-
-void MagtLog(char *logMsg, char *pszLogPath)
-{
- FILE *f;
- char *szTime;
-
- f = fopen(pszLogPath, "a");
- if (!f)
- return;
- szTime = MagtLogTime();
- if (szTime != NULL)
- {
- fprintf(f, "%s %s", szTime, logMsg);
- SNMP_free(szTime);
- }
- else /* No time string returned */
- {
- fprintf(f, "%s %s", "00000000000000", logMsg);
- }
- fclose(f);
-}
-
-/*-------------------------------------------------------------------------
- *
- * MagtLogTime: Returns time for logging purpose.
- *
- * Returns: Formatted time string - No error
- * "00000000000000" - Errors
- *
- *-----------------------------------------------------------------------*/
-
-char *MagtLogTime()
-{
- time_t timeNow;
- struct tm tmLocal;
- char dateBuf[64];
- char *timeStr = NULL;
- static timeZoneSet = MAGT_FALSE;
-
- timeNow = time(0);
- memcpy(&tmLocal, localtime(&timeNow), sizeof(tmLocal));
-
- /*
- * Set up the timezone information.
- */
- if (!timeZoneSet)
- {
- tzset();
- timeZoneSet = MAGT_TRUE;
- }
-
- /*
- * Create the date string.
- */
- if (!strftime(dateBuf, 64, "%Y%m%d%H%M%S", &tmLocal))
- {
- strcpy(dateBuf, "00000000000000");
- }
- REPLACE(timeStr, dateBuf);
-
- return timeStr;
-}
-
-/*-------------------------------------------------------------------------
- *
- * MagtOpenLog: Creates and opens the log file.
- * Backs up any old log file.
- *
- * Returns: None
- *
- *-----------------------------------------------------------------------*/
-
-void MagtOpenLog(char *pszRootDir, char *pszLogPath)
-{
- char logDir[MAX_PATH];
- char oldPath[MAX_PATH];
- int fd;
-
- wsprintf(logDir, "%s\\%s", pszRootDir, "logs");
- if (mkdir(logDir) != 0)
- {
- if (errno != EEXIST)
- return;
- }
-
- wsprintf(pszLogPath, "%s\\%s", logDir, MAGT_LOGFILE);
- wsprintf(oldPath, "%s\\%s%s", logDir, MAGT_LOGFILE, ".old");
-
- /*
- * Rename old log file to keep a back up.
- */
- unlink(oldPath);
- rename(pszLogPath, oldPath);
-
- /*
- * Create and open new log file.
- */
- fd = open(pszLogPath,
- _O_WRONLY | _O_CREAT | _O_TRUNC,
- _S_IWRITE);
- if (fd != -1)
- close(fd);
-}
-
-/*-------------------------------------------------------------------------
- *
- * MagtReadLine: Reads one line of text (up to n chars) from specified
- * file.
- *
- * Returns: Len read - No error
- * -1 - Errors
- *
- *-----------------------------------------------------------------------*/
-
-int MagtReadLine(char *buf, int n, FILE *fp)
-{
- if (fgets(buf, n, fp) != NULL)
- {
- return(strlen(buf));
- }
- else
- {
- return(-1);
- }
-}
-
-
-/*-------------------------------------------------------------------------
- *
- * MagtReadStats: Reads statistics from stats file. The hdr and tbl data
- * buffers will be filled in if they are not NULL.
- *
- * Returns: 0 - No errors
- * errno - Errors
- *
- *-----------------------------------------------------------------------*/
-
-int MagtReadStats(MagtHdrInfo_t *hdrInfo,
- MagtOpsTblInfo_t *OpsTblInfo,
- MagtEntriesTblInfo_t *EntriesTblInfo,
- MagtIntTblInfo_t **IntTblInfo,
- char * pszStatsPath,
- char * pszLogPath)
-{
- int hdl;
- int err;
- int i;
- struct agt_stats_t *pfile_stats;
-
- if ((err = agt_mopen_stats(pszStatsPath, O_RDONLY, &hdl)) != 0)
- {
-
- /*
- now with multiple instances this function gets called
- on every snmprequest. Hence
- logging here became too expensive, now let caller interpret
- results and figure out if it should log something or not
- */
-
-
- return err;
- }
-
-
-
- if ( (hdl > 1) || (hdl < 0) )
- {
- return (EINVAL); /* Inavlid handle */
- }
-
- if ((mmap_tbl [hdl].maptype != AGT_MAP_READ) && (mmap_tbl [hdl].maptype != AGT_MAP_RDWR))
- {
- return (EINVAL); /* Inavlid handle */
- }
-
- if (mmap_tbl [hdl].fp <= (caddr_t) 0)
- {
- return (EFAULT); /* Something got corrupted */
- }
-
-#if (0)
- fprintf (stderr, "%s@%d> fp = %d\n", __FILE__, __LINE__, mmap_tbl [hdl].fp);
-#endif
-
- pfile_stats = (struct agt_stats_t *) (mmap_tbl [hdl].fp);
-
- /*
- * Only fill in buffers if they are not NULL. This way, one can choose
- * to get only the hdr info or only the tbl info.
- */
- if (hdrInfo != NULL)
- {
-/* versMajor and versMinor are no longer used. <03/04/05> */
-// hdrInfo->versMajor = pfile_stats->hdr_stats.hdrVersionMjr;
-// hdrInfo->versMinor = pfile_stats->hdr_stats.hdrVersionMnr;
- hdrInfo->restarted = pfile_stats->hdr_stats.restarted;
- hdrInfo->startTime = pfile_stats->hdr_stats.startTime;
- hdrInfo->updateTime = pfile_stats->hdr_stats.updateTime;
- }
- if (OpsTblInfo != NULL){
- OpsTblInfo->AnonymousBinds = pfile_stats->ops_stats.dsAnonymousBinds;
- OpsTblInfo->UnAuthBinds = pfile_stats->ops_stats.dsUnAuthBinds;
- OpsTblInfo->SimpleAuthBinds = pfile_stats->ops_stats.dsSimpleAuthBinds;
- OpsTblInfo->StrongAuthBinds = pfile_stats->ops_stats.dsStrongAuthBinds;
- OpsTblInfo->BindSecurityErrors = pfile_stats->ops_stats.dsBindSecurityErrors;
- OpsTblInfo->InOps = pfile_stats->ops_stats.dsInOps;
- OpsTblInfo->ReadOps = pfile_stats->ops_stats.dsReadOps;
- OpsTblInfo->CompareOps = pfile_stats->ops_stats.dsCompareOps;
- OpsTblInfo->AddEntryOps = pfile_stats->ops_stats.dsAddEntryOps;
- OpsTblInfo->RemoveEntryOps = pfile_stats->ops_stats.dsRemoveEntryOps;
- OpsTblInfo->ModifyEntryOps = pfile_stats->ops_stats.dsModifyEntryOps;
- OpsTblInfo->ModifyRDNOps = pfile_stats->ops_stats.dsModifyRDNOps;
- OpsTblInfo->ListOps = pfile_stats->ops_stats.dsListOps;
- OpsTblInfo->SearchOps = pfile_stats->ops_stats.dsSearchOps;
- OpsTblInfo->OneLevelSearchOps = pfile_stats->ops_stats.dsOneLevelSearchOps;
- OpsTblInfo->WholeSubtreeSearchOps = pfile_stats->ops_stats.dsWholeSubtreeSearchOps;
- OpsTblInfo->Referrals = pfile_stats->ops_stats.dsReferrals;
- OpsTblInfo->Chainings = pfile_stats->ops_stats.dsChainings;
- OpsTblInfo->SecurityErrors = pfile_stats->ops_stats.dsSecurityErrors;
- OpsTblInfo->Errors = pfile_stats->ops_stats.dsErrors;
- OpsTblInfo->ConnectionsInMaxThreads = pfile_stats->ops_stats.dsConnectionsInMaxThreads;
- OpsTblInfo->ConnectionsMaxThreadsHit = pfile_stats->ops_stats.dsMaxThreadsHit;
- }
- if(EntriesTblInfo != NULL){
- EntriesTblInfo->MasterEntries = pfile_stats->entries_stats.dsMasterEntries;
- EntriesTblInfo->CopyEntries = pfile_stats->entries_stats.dsCopyEntries;
- EntriesTblInfo->CacheEntries = pfile_stats->entries_stats.dsCacheEntries;
- EntriesTblInfo->CacheHits = pfile_stats->entries_stats.dsCacheHits;
- EntriesTblInfo->SlaveHits = pfile_stats->entries_stats.dsSlaveHits;
- }
-
- if(IntTblInfo != NULL){
- for(i=0; i < NUM_SNMP_INT_TBL_ROWS; i++)
- {
-
- strcpy(IntTblInfo[i]->DsName.val, pfile_stats->int_stats[i].dsName);
- IntTblInfo[i]->DsName.len = strlen(pfile_stats->int_stats[i].dsName);
-
- IntTblInfo[i]->TimeOfCreation = pfile_stats->int_stats[i].dsTimeOfCreation;
- IntTblInfo[i]->TimeOfLastAttempt = pfile_stats->int_stats[i].dsTimeOfLastAttempt;
- IntTblInfo[i]->TimeOfLastSuccess = pfile_stats->int_stats[i].dsTimeOfLastSuccess;
- IntTblInfo[i]->FailuresSinceLastSuccess = pfile_stats->int_stats[i].dsFailuresSinceLastSuccess;
- IntTblInfo[i]->Failures = pfile_stats->int_stats[i].dsFailures;
- IntTblInfo[i]->Successes = pfile_stats->int_stats[i].dsSuccesses;
- strcpy(IntTblInfo[i]->URL.val, pfile_stats->int_stats[i].dsURL);
- IntTblInfo[i]->URL.len = strlen(pfile_stats->int_stats[i].dsURL);
-
- }
- }
-
- agt_mclose_stats(hdl);
- return 0;
-}
-
-/*-------------------------------------------------------------------------
- *
- * DllMain: Standard WIN32 DLL entry point.
- *
- * Returns: TRUE
- *
- *-----------------------------------------------------------------------*/
-
-BOOL WINAPI DllMain(HANDLE hDll, DWORD dwReason, LPVOID lpReserved)
-{
-
- switch(dwReason)
- {
- case DLL_PROCESS_ATTACH:
- case DLL_THREAD_ATTACH:
- case DLL_THREAD_DETACH:
- break;
- case DLL_PROCESS_DETACH:
- MagtCleanUp();
- break;
- default:
- break;
- }
-
- return TRUE;
-}
-
-/*-------------------------------------------------------------------------
- *
- * SnmpExtensionInit: Entry point to coordinate the initializations of the
- * Extension Agent and the Extendible Agent. The
- * Extendible Agent provides the Extension Agent with a
- * time zero reference; and the Extension Agent
- * provides the Extendible Agent with an Event handle
- * for communicating occurence of traps, and an object
- * identifier representing the root of the MIB subtree
- * that the Extension Agent supports.
- *
- * Returns: TRUE - No error
- * FALSE - Errors
- *
- *-----------------------------------------------------------------------*/
-
-BOOL WINAPI SnmpExtensionInit(IN DWORD dwTimeZeroReference,
- OUT HANDLE *hPollForTrapEvent,
- OUT AsnObjectIdentifier *supportedView)
-{
- int nMibIndex = 0;
- SECURITY_ATTRIBUTES sa;
- PSECURITY_ATTRIBUTES psa = NULL;
- SECURITY_DESCRIPTOR sd;
- char logMsg[1024];
- int i;
-
- instance_list_t *pInstance;
-
- /*
- * Record the time reference provided by the Extendible Agent.
- */
-
- dwTimeZero = dwTimeZeroReference;
-
- /*
- * Create a security descriptor that gives everyone access to the
- * trap event. This is so that the SNMP process can set the event
- * when it detects that the server is up or down. Without this
- * relaxed ACL, the SNMP process which usually runs as the Netscape
- * DS user can not set the trap event created by this DLL which is
- * loaded by the Extendible Agent, which usually runs as LocalSystem.
- */
- if (InitializeSecurityDescriptor(&sd,
- SECURITY_DESCRIPTOR_REVISION) == TRUE)
- {
- if (SetSecurityDescriptorDacl(&sd, TRUE, NULL, FALSE) == TRUE)
- {
- sa.nLength = sizeof(SECURITY_ATTRIBUTES);
- sa.bInheritHandle = TRUE;
- sa.lpSecurityDescriptor = &sd;
- psa = &sa;
- }
- }
-
- /*
- * Create an event that will be used to communicate the occurence of
- * traps to the Extendible Agent.
- * The event will have a signaled initial state so that the status of
- * the server can be checked as soon as the subagent is loaded and
- * the necessary trap will be generated.
- */
- if ((*hPollForTrapEvent = CreateEvent(psa,
- FALSE,
- FALSE,
- MAGT_NSEV_SNMPTRAP)) == NULL)
- {
- return FALSE;
- }
-
- /*
- * Indicate the MIB view supported by this Extension Agent, an object
- * identifier representing the sub root of the MIB that is supported.
- */
- *supportedView = MIB_OidPrefix;
-
-
- /*
- * Initialize globals.
- */
-
- if ( !_FindNetscapeServers() )
- {
- return FALSE;
- }
-
- for (pInstance = pInstanceList; pInstance; pInstance = pInstance->pNext)
- {
- MagtInitInstance(pInstance);
- }
-
- for (pInstance = pInstanceList; pInstance; pInstance = pInstance->pNext)
- {
- /* build the mib */
-
- if ((pInstance->pOpsStatInfo = (MagtOpsTblInfo_t *) GlobalAlloc(GPTR,
- sizeof(MagtOpsTblInfo_t))) == NULL)
- {
- wsprintf(logMsg, "Failed to allocate ops stats structure (error = %d)\n",
- GetLastError());
- MagtLog(logMsg, pInstance->szLogPath);
- return FALSE;
- }
-
- if ((pInstance->pEntriesStatInfo = (MagtEntriesTblInfo_t *) GlobalAlloc(GPTR,
- sizeof(MagtEntriesTblInfo_t))) == NULL)
- {
- wsprintf(logMsg, "Failed to allocate entries stat structure (error = %d)\n",
- GetLastError());
- MagtLog(logMsg, pInstance->szLogPath);
- return FALSE;
- }
-
- if ((pInstance->ppIntStatInfo = (MagtIntTblInfo_t **) GlobalAlloc(GPTR,
- NUM_SNMP_INT_TBL_ROWS * sizeof(MagtIntTblInfo_t *))) == NULL)
- {
- wsprintf(logMsg, "Failed to allocate interaction stat structure (error = %d)\n",
- GetLastError());
- MagtLog(logMsg, pInstance->szLogPath);
- return FALSE;
- }
-
- for(i =0; i < NUM_SNMP_INT_TBL_ROWS; i++)
- {
- pInstance->ppIntStatInfo[i] = (MagtIntTblInfo_t *) GlobalAlloc(GPTR,
- sizeof(MagtIntTblInfo_t));
-
- /* make the static char for name and url so they have one address for later use */
- pInstance->ppIntStatInfo[i]->DsName.val = (char *) GlobalAlloc(GPTR,
- 100 * sizeof(char));
- pInstance->ppIntStatInfo[i]->URL.val = (char *) GlobalAlloc(GPTR,
- 100 * sizeof(char));
- }
-
- /* initialize the stats we just allocated */
- MagtInitStats(pInstance->pOpsStatInfo,
- pInstance->pEntriesStatInfo,
- pInstance->ppIntStatInfo);
-
-
- if( Mib_init(&(pInstance->pMibInfo), pInstance->pCfgInfo->ApplIndex) == -1)
- {
- wsprintf(logMsg, "Failed to create Mib structure (error = %d)\n",
- GetLastError());
- MagtLog(logMsg, pInstance->szLogPath);
- return FALSE;
- }
-
- for (nMibIndex = 0; nMibIndex < (int) MIB_num_vars; nMibIndex++)
- {
- MagtInitMibStorage(&(pInstance->pMibInfo[nMibIndex]),
- pInstance->pOpsStatInfo,
- pInstance->pEntriesStatInfo,
- pInstance->ppIntStatInfo,
- pInstance->pCfgInfo);
- }
-
-
- /*
- * Construct the path to stats file.
- */
- wsprintfA(pInstance->szStatsPath, "%s/logs/%s", pInstance->szRootDir,
- AGT_STATS_FILE);
-
- if (MagtReadStats(NULL, pInstance->pOpsStatInfo,
- pInstance->pEntriesStatInfo,
- pInstance->ppIntStatInfo,
- pInstance->szStatsPath,
- pInstance->szLogPath) != 0)
- {
- wsprintf(logMsg,
- "Failed to open Memory Mapped Stats File. Make sure ns-slapd is running\n",
- GetLastError());
- MagtLog(logMsg, pInstance->szLogPath);
- }
-
-
- }
-
- /* now that all mib's set up set next pointer from last entry to first
- entry of next instance */
-
- for (nMibIndex = 0; nMibIndex < (int) MIB_num_vars; nMibIndex++)
- {
-
- for (pInstance = pInstanceList; pInstance; pInstance = pInstance->pNext)
- {
- if(pInstance->pNext != NULL)
- {
- pInstance->pMibInfo[nMibIndex].MibNext = &(pInstance->pNext->pMibInfo[nMibIndex]);
- }else{
- if (nMibIndex + 1 != (int) MIB_num_vars)
- {
- pInstance->pMibInfo[nMibIndex].MibNext = &(pInstanceList->pMibInfo[nMibIndex + 1]);
- }
- }
- }
-
-
- }
-
- /*
- * Set event to have SnmpExtensionTrap invoked for initial check of
- * Server status.
- */
- if (SetEvent(*hPollForTrapEvent) == FALSE)
- {
- /* don't have a specific instance to log it to, find something better to do later */
- }
-
- return TRUE;
-}
-
-/*-------------------------------------------------------------------------
- *
- * SnmpExtensionTrap: Entry point to communicate traps to the Extendible
- * Agent. The Extendible Agent will query this entry
- * point when the trap event (supplied at initialization
- * time) is asserted, which indicates that zero or more
- * traps may have occured. The Extendible Agent will
- * repeatedly call this entry point until FALSE is
- * returned, indicating that all outstanding traps have
- * been processed.
- *
- * Returns: TRUE - Valid trap data
- * FALSE - No trap data
- *
- *-----------------------------------------------------------------------*/
-
-BOOL WINAPI SnmpExtensionTrap(OUT AsnObjectIdentifier *enterprise,
- OUT AsnInteger *genericTrap,
- OUT AsnInteger *specificTrap,
- OUT AsnTimeticks *timeStamp,
- OUT RFC1157VarBindList *variableBindings)
-{
- static UINT oidList[] = {1, 3, 6, 1, 4, 1, 1450};
- static UINT oidListLen = MAGT_OID_SIZEOF(oidList);
- static RFC1157VarBind *trapVars = NULL;
- static MagtTrapTask_t trapTask = MAGT_TRAP_GENERATION;
- int nVarLen;
- char logMsg[1024];
- instance_list_t *pInstance;
-
-
- if (trapTask == MAGT_TRAP_CLEANUP)
- {
- if (variableBindings->list != NULL)
- SNMP_FreeVarBind(variableBindings->list);
-
- trapTask = MAGT_TRAP_GENERATION;
- }
-
-
- if (trapTask == MAGT_TRAP_GENERATION)
- {
-
- for (pInstance = pInstanceList; pInstance; pInstance = pInstance->pNext)
- {
- MagtCheckServer(pInstance);
-
- /*
- * If there is no trap to be generated for this instance keep looking at other
- * instances.
- */
- if (pInstance->trapType == MAGT_TRAP_NONE)
- {
- continue;
- }
-
- enterprise->ids = (UINT *) SNMP_malloc(sizeof(UINT) * oidListLen);
- if (enterprise->ids == NULL)
- {
- wsprintf(logMsg,
- "Failed to allocate enterprise id\n");
- MagtLog(logMsg, pInstance->szLogPath);
- return FALSE;
- }
- enterprise->idLength = oidListLen;
- memcpy(enterprise->ids, oidList, sizeof(UINT) * oidListLen);
-
- *genericTrap = SNMP_GENERICTRAP_ENTERSPECIFIC;
- *specificTrap = pInstance->trapType;
- *timeStamp = GetCurrentTime() - dwTimeZero;
-
- /*
- * Set up the variable binding list with variables specified in the MIB
- * for each trap.
- */
- if ((trapVars = SNMP_malloc(sizeof(RFC1157VarBind) * 4)) == NULL)
- {
- wsprintf(logMsg,
- "Failed to allocate trap variables\n");
- MagtLog(logMsg, pInstance->szLogPath);
- SNMP_oidfree(enterprise);
- return FALSE;
- }
-
- if ((nVarLen = MagtFillTrapVars(pInstance->trapType, trapVars, pInstance->pCfgInfo)) == 0)
- {
- wsprintf(logMsg,
- "Failed to fill trap variables\n");
- MagtLog(logMsg, pInstance->szLogPath);
- SNMP_free(trapVars);
- SNMP_oidfree(enterprise);
- return FALSE;
- }
-
- variableBindings->list = trapVars;
- variableBindings->len = nVarLen;
-
- trapTask = MAGT_TRAP_CLEANUP;
-
- wsprintf(logMsg,
- "Sending trap %d\n",
- pInstance->trapType);
- MagtLog(logMsg, pInstance->szLogPath);
-
- /* reset the trap type for this instance */
- pInstance->trapType = MAGT_TRAP_NONE;
-
- /*
- * Indicate that a trap should be sent and parameters contain valid
- * data.
- */
- return TRUE;
- }
-
-
- }
-
- /*
- * Indicate that no more traps are available and parameters do not
- * refer to any valid data.
- */
-
- return FALSE;
-}
-
-/*-------------------------------------------------------------------------
- *
- * SnmpExtensionQuery: Entry point to resolve queries for MIB variables in
- * their supported MIB view (supplied at
- * initialization time). The supported requestType is
- * Get/GetNext.
- *
- * Returns: TRUE - No error
- * FALSE - Errors
- *
- *-----------------------------------------------------------------------*/
-
-BOOL WINAPI SnmpExtensionQuery(IN BYTE requestType,
- IN OUT RFC1157VarBindList *variableBindings,
- OUT AsnInteger *errorStatus,
- OUT AsnInteger *errorIndex)
-{
- static time_t lastChkTime = 0;
- UINT i;
- HANDLE hTrapEvent;
- time_t currTime;
-
- /*
- * Check for valid input.
- */
-
- if (variableBindings == NULL ||
- errorStatus == NULL ||
- errorIndex == NULL)
- {
- return FALSE;
- }
-
- /*
- * Iterate through the variable bindings list to resolve individual
- * variable bindings.
- */
-
- for (i = 0; i < variableBindings->len; i++)
- {
- *errorStatus = MagtResolveVarBind(&variableBindings->list[i],
- requestType);
-
- /*
- * Test and handle case where GetNext past end of MIB view supported by
- * this Extension Agent occurs. Special processing is required to
- * communicate this situation to the Extendible Agent so it can take
- * appropriate action.
- */
- if (*errorStatus == SNMP_ERRORSTATUS_NOSUCHNAME &&
- requestType == MAGT_MIB_ACTION_GETNEXT)
- {
- *errorStatus = SNMP_ERRORSTATUS_NOERROR;
-
- /*
- * Modify variable binding of such variables so the OID points just
- * outside the MIB view supported by this Extension Agent. The
- * Extendible Agent tests for this, and takes appropriate action.
- */
- SNMP_oidfree(&variableBindings->list[i].name);
- SNMP_oidcpy(&variableBindings->list[i].name, &MIB_OidPrefix);
- variableBindings->list[i].name.ids[MAGT_MIB_PREFIX_LEN - 1]++;
- }
-
- /*
- * If an error was indicated, communicate error status and error index
- * to the Extendible Agent. The Extendible Agent will ensure that the
- * original variable bindings are returned in the response packet.
- */
- if (*errorStatus != SNMP_ERRORSTATUS_NOERROR)
- {
- *errorIndex = i + 1;
- return FALSE;
- }
- }
-
- /*
- * Before going back, set the trap event so server status can be checked
- * to see if a trap needs to be generated. This is to cover the case the
- * SNMP process is unable to set the trap event because it is stuck.
- */
- currTime = time(0);
-
- /*
- * If just check status, do not generate event again.
- */
- if ((currTime - lastChkTime) >= MAGT_TIME_QUANTUM * 3)
- {
- if ((hTrapEvent = OpenEvent(EVENT_MODIFY_STATE, FALSE,
- (LPCTSTR)MAGT_NSEV_SNMPTRAP)) != NULL)
- SetEvent(hTrapEvent);
-
- lastChkTime = currTime;
- }
-
- return TRUE;
-}
-
-
-/* --- Open Function --------------------------------------------------------------------- */
-
-
-/* _FindNetscapeServers()
- * Function to loop through registry looking for netscape servers
- * Stores them into pInstanceList as it finds them.
- */
-
-#define MAX_KEY_SIZE 128
-DWORD
-_FindNetscapeServers()
-{
- LONG regStatus,
- status;
- HKEY hKeyNetscape = NULL,
- hKeyNetscapeConf;
- DWORD dwKey,
- type,
- dwServerKeySize,
- size,
- dwServerCount = 0;
- WCHAR szServerKeyName[MAX_KEY_SIZE],
- szPath[MAX_KEY_SIZE];
- FILETIME fileTime;
- instance_list_t *pNew;
- instance_list_t *pCurrent;
- DWORD iUniqueID = 0;
- char logMsg[1024];
- regStatus = RegOpenKeyEx(
- HKEY_LOCAL_MACHINE,
- TEXT(KEY_SOFTWARE_NETSCAPE) TEXT("\\") TEXT(DS_KEY_ROOT),
- 0L,
- KEY_ALL_ACCESS,
- &hKeyNetscape);
-
- if (regStatus != ERROR_SUCCESS) {
- goto ExitPoint;
- }
-
- dwKey = 0;
- do {
- dwServerKeySize = MAX_KEY_SIZE;
- regStatus = RegEnumKeyEx(
- hKeyNetscape,
- dwKey,
- (char *) szServerKeyName,
- &dwServerKeySize,
- NULL,
- 0,
- 0,
- &fileTime);
- dwKey++;
-
- if (regStatus == ERROR_SUCCESS) {
-
- regStatus = RegOpenKeyEx(
- hKeyNetscape,
- (char *) szServerKeyName,
- 0L,
- KEY_ALL_ACCESS,
- &hKeyNetscapeConf);
-
- if (regStatus != ERROR_SUCCESS) {
- continue;
- }
-
- /* Now look for "ConfigurationPath" to find 3.0 netscape servers */
- size = MAX_KEY_SIZE;
- status = RegQueryValueEx(
- hKeyNetscapeConf,
- TEXT(VALUE_CONFIG_PATH),
- 0L,
- &type,
- (LPBYTE)szPath,
- &size);
- if ( status == ERROR_SUCCESS ) {
- /* this is a netscape server */
- if ( (pNew = (instance_list_t *)malloc(sizeof(instance_list_t))) == NULL) {
- status = (unsigned long)-1;
- RegCloseKey(hKeyNetscapeConf);
- goto ExitPoint;
- }
- if ( (pNew->pInstanceName = (PWCH)malloc(sizeof(WCHAR) *(dwServerKeySize+1))) == NULL) {
- status = (unsigned long)-1;
- RegCloseKey(hKeyNetscapeConf);
- goto ExitPoint;
- }
- if ( (pNew->pConfPath = (PWCH)malloc(sizeof(WCHAR) *(size+1))) == NULL) {
- status = (unsigned long)-1;
- RegCloseKey(hKeyNetscapeConf);
- goto ExitPoint;
- }
-
-
- pNew->Handle = 0;
- pNew->pData = NULL;
-
- pNew->instance.ParentObjectTitleIndex = 0;
- pNew->instance.ParentObjectInstance = 0;
- pNew->instance.UniqueID = -1;
- pNew->instance.NameOffset = sizeof(PERF_INSTANCE_DEFINITION);
- lstrcpy((char *) pNew->pInstanceName, (char *) szServerKeyName);
-
- lstrcpy((char *) pNew->pConfPath, (char *) szPath);
-
- pNew->instance.NameLength = (dwServerKeySize+1) * sizeof(WCHAR);
- pNew->instance.ByteLength = sizeof(PERF_INSTANCE_DEFINITION) +
- (((pNew->instance.NameLength + sizeof(DWORD)-1)/sizeof(DWORD))*sizeof(DWORD));
- pNew->instance.UniqueID = iUniqueID++;
-
- wsprintf(pNew->szLogPath, "\\%s", MAGT_LOGFILE);
- if( ((char *) pNew->szRootDir = getRootDirFromConfFile(pNew->pConfPath) ) != NULL)
- {
- /* can only check if getRootDir */
-
- /* open the log */
-
- MagtOpenLog(pNew->szRootDir, pNew->szLogPath);
-
- if ((pNew->pCfgInfo = (MagtStaticInfo_t *) GlobalAlloc(GPTR,
- sizeof(MagtStaticInfo_t))) == NULL)
- {
- /* something fatal happened but try to free this
- node that won't be used anyway
- */
- if(pNew != NULL)
- {
- free(pNew);
- }
- status = (unsigned long)-1;
- goto ExitPoint;
- }
-
- MagtLoadStaticInfo(pNew->pCfgInfo, pNew->szRootDir, &pNew->SNMPOff, pNew->szLogPath);
-
-
- if ( pNew->SNMPOff )
- {
- wsprintf(logMsg,
- "SNMP subagent is not configured to be on\n");
- MagtLog(logMsg, pNew->szLogPath);
-
- /* since not adding this to list free it */
- if(pNew != NULL)
- {
- free(pNew);
- }
- }else{
- /* new instance that is on to add to list */
-
- /* if first element null or less than first element add to beginning */
- if( (pInstanceList == NULL)
- || (pNew->pCfgInfo->ApplIndex < pInstanceList->pCfgInfo->ApplIndex) )
- {
- pNew->pNext = pInstanceList;
- pInstanceList = pNew;
- }else{
- /* must be after first element */
- for(pCurrent= pInstanceList; pCurrent; pCurrent=pCurrent->pNext)
- {
- if(pNew->pCfgInfo->ApplIndex == pCurrent->pCfgInfo->ApplIndex)
- {
- /* ApplIndex must be unique, another instance on this host
- is already configured to be on using this applIndex,
- so I can't monitor this one. Log the error and
- don't add this instance to the list */
-
- wsprintf(logMsg,
- "Another server instance with this ApplIndex: %d is already being"
- " monitored. ApplIndex must be unique. Turn off"
- " SNMP monitoring of the other server instance or change"
- " the ApplIndex of one of the server instances.\n",
- pNew->pCfgInfo->ApplIndex);
- MagtLog(logMsg, pNew->szLogPath);
-
- /* since not adding this to list free it */
- if(pNew != NULL)
- {
- free(pNew);
- }
- }else if( (pCurrent->pNext == NULL)
- || ( (pNew->pCfgInfo->ApplIndex > pCurrent->pCfgInfo->ApplIndex)
- && (pNew->pCfgInfo->ApplIndex < pCurrent->pNext->pCfgInfo->ApplIndex)) )
- {
- /* if next is null or if greater this element and less then next one
- add it inbetween */
- pNew->pNext=pCurrent->pNext;
- pCurrent->pNext=pNew;
- break;
- }
- }
- }
- }
- }
- dwServerCount++;
- }
-
- RegCloseKey(hKeyNetscapeConf);
- }
-
- } while ( regStatus != ERROR_NO_MORE_ITEMS );
-
-ExitPoint:
- if (hKeyNetscape)
- RegCloseKey (hKeyNetscape);
-
- return dwServerCount;
-}
-
diff --git a/ldap/servers/snmp/ntagt/nsldapagt_nt.def b/ldap/servers/snmp/ntagt/nsldapagt_nt.def
deleted file mode 100644
index 31e8d5a..0000000
--- a/ldap/servers/snmp/ntagt/nsldapagt_nt.def
+++ /dev/null
@@ -1,56 +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 ns-ldapagt
-
-DESCRIPTION 'Dirsrv SNMP Agent'
-
-CODE LOADONCALL MOVEABLE DISCARDABLE
-DATA PRELOAD MOVEABLE SINGLE
-
-SEGMENTS
- _TEXT PRELOAD
- INIT_TEXT PRELOAD
-
-HEAPSIZE 1024
-
-EXPORTS
- SnmpExtensionInit
- SnmpExtensionTrap
- SnmpExtensionQuery
-
diff --git a/ldap/servers/snmp/ntagt/nsldapagt_nt.h b/ldap/servers/snmp/ntagt/nsldapagt_nt.h
deleted file mode 100644
index 51d4cd3..0000000
--- a/ldap/servers/snmp/ntagt/nsldapagt_nt.h
+++ /dev/null
@@ -1,268 +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 **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-
-/*-------------------------------------------------------------------------
- *
- * nsldapagt_nt.h - Definitions for NS Directory Server's SNMP subagent on
- * NT.
- *
- * Revision History:
- * 07/25/1997 Steve Ross Created
- *
- *
- *-----------------------------------------------------------------------*/
-
-#ifndef __NSLDAPAGT_NT_H_
-#define __NSLDAPAGT_NT_H_
-
-/*-------------------------------------------------------------------------
- *
- * Defines
- *
- *-----------------------------------------------------------------------*/
-
-#define MAGT_MAX_LINELEN 255
-#define MAGT_CONFFILE "snmp.conf"
-#define MAGT_CONFDIR "config"
-#define DSE_LDIF "dse.ldif"
-#define MAGT_LOGFILE "nsldapagt.log"
-#define MAGT_TIME_QUANTUM 10
-
-#define MAGT_TRAP_NONE 0
-#define MAGT_TRAP_SERVER_DOWN 7001
-#define MAGT_TRAP_SERVER_START 7002
-
-#define LDAP_CONFIG_DN "cn=SNMP,cn=config"
-#define BASE_OBJECTCLASS_SEARCH "objectclass=*"
-
-#define LDAP_ATTR_SNMP_ENABLED "nssnmpenabled"
-#define LDAP_ATTR_SNMP_DESCRIPTION "nssnmpdescription"
-#define LDAP_ATTR_SNMP_ORGANIZATION "nssnmporganization"
-#define LDAP_ATTR_SNMP_LOCATION "nssnmplocation"
-#define LDAP_ATTR_SNMP_CONTACT "nssnmpcontact"
-
-#define SNMP_ON "ON"
-
-/*-------------------------------------------------------------------------
- *
- * Types
- *
- *-----------------------------------------------------------------------*/
-
-typedef enum
-{
- MAGT_FALSE = 0,
- MAGT_TRUE
-} MagtBool_t;
-
-typedef enum
-{
- MAGT_TRAP_GENERATION,
- MAGT_TRAP_CLEANUP
-} MagtTrapTask_t;
-
-typedef struct MagtDispStr
-{
- int len;
- unsigned char *val;
-} MagtDispStr_t;
-
-typedef struct MagtStaticInfo
-{
- MagtDispStr_t entityDescr;
- MagtDispStr_t entityVers;
- MagtDispStr_t entityOrg;
- MagtDispStr_t entityLocation;
- MagtDispStr_t entityContact;
- MagtDispStr_t entityName;
- int ApplIndex;
-
-} MagtStaticInfo_t;
-
-typedef struct MagtLDAPInfo
-{
- char *host;
- int port;
- char *rootdn;
- char *rootpw;
-
-
-} MagtLDAPInfo_t;
-
-typedef struct MagtHdrInfo
-{
-/* versMajor and versMinor are no longer used. <03/04/05> */
-// int versMajor;
-// int versMinor;
- int restarted;
- time_t startTime;
- time_t updateTime;
-} MagtHdrInfo_t;
-
-typedef struct MagtOpsTblInfo
-{
- int AnonymousBinds;
- int UnAuthBinds;
- int SimpleAuthBinds;
- int StrongAuthBinds;
- int BindSecurityErrors;
- int InOps;
- int ReadOps;
- int CompareOps;
- int AddEntryOps;
- int RemoveEntryOps;
- int ModifyEntryOps;
- int ModifyRDNOps;
- int ListOps;
- int SearchOps;
- int OneLevelSearchOps;
- int WholeSubtreeSearchOps;
- int Referrals;
- int Chainings;
- int SecurityErrors;
- int Errors;
- int ConnectionsInMaxThreads;
- int ConnectionsMaxThreadsHit;
-} MagtOpsTblInfo_t;
-
-typedef struct MagtEntriesTblInfo
-{
- int MasterEntries;
- int CopyEntries;
- int CacheEntries;
- int CacheHits;
- int SlaveHits;
-} MagtEntriesTblInfo_t;
-
-typedef struct MagtIntTblInfo
-{
- MagtDispStr_t DsName;
- time_t TimeOfCreation;
- time_t TimeOfLastAttempt;
- time_t TimeOfLastSuccess;
- int FailuresSinceLastSuccess;
- int Failures;
- int Successes;
- MagtDispStr_t URL;
-}MagtIntTblInfo_t;
-
-typedef struct instance_list_t {
- PERF_INSTANCE_DEFINITION instance;
- PWSTR pInstanceName;
- PWSTR pConfPath;
- int Handle;
- struct agt_stats_t * pData;
- HANDLE ghTrapEvent;
- MagtOpsTblInfo_t * pOpsStatInfo;
- MagtEntriesTblInfo_t * pEntriesStatInfo;
- MagtIntTblInfo_t ** ppIntStatInfo;
- MagtStaticInfo_t * pCfgInfo;
- MagtMibEntry_t * pMibInfo;
- char * szRootDir;
- char szLogPath[MAX_PATH];
- char szStatsPath[MAX_PATH];
- int SNMPOff;
-
-
- /* trap stuff */
- time_t oldUpdateTime;
- time_t oldStartTime;
- int graceCycles;
- MagtBool_t mmapStale;
- MagtBool_t mmapOk;
- MagtBool_t serverUp;
- MagtBool_t downTrapSent;
- int trapType;
- MagtHdrInfo_t hdrInfo;
-
- struct instance_list_t * pNext;
-} instance_list_t;
-
-/*-------------------------------------------------------------------------
- *
- * Prototypes
- *
- *-----------------------------------------------------------------------*/
-
-int MagtCheckServer(instance_list_t *pInstance);
-
-void MagtCleanUp();
-
-void MagtConfProcess(char *line, int lineLen,
- MagtLDAPInfo_t *info);
-
-char *MagtGetRootDir(void);
-
-
-void MagtInitMibStorage(MagtMibEntry_t * MibInfo,
- MagtOpsTblInfo_t * pOpsStatInfo,
- MagtEntriesTblInfo_t * pEntriesStatInfo,
- MagtIntTblInfo_t ** ppIntStatInfo,
- MagtStaticInfo_t * pCfgInfo);
-
-
-int MagtLoadStaticInfo(MagtStaticInfo_t *staticInfo, char *pszRootDir, int *SNMPOff, char *pszLogPath);
-
-void MagtLog(char *logMsg, char *pszLogPath);
-
-char *MagtLogTime();
-
-void MagtOpenLog(char *pszRootDir, char *pszLogPath);
-
-int MagtReadLine(char *buf,
- int n,
- FILE *fp);
-
-int MagtReadStats(MagtHdrInfo_t *hdrInfo,
- MagtOpsTblInfo_t *OpsTblInfo,
- MagtEntriesTblInfo_t *EntriesTblInfo,
- MagtIntTblInfo_t **IntTblInfo,
- char * pszStatsPath,
- char * pszLogPath);
-
-DWORD _FindNetscapeServers();
-
-extern instance_list_t *pInstanceList;
-
-
-#endif /* __NSLDAPAGT_NT_H_ */
diff --git a/ldap/servers/snmp/ntagt/nsldapmib_nt.c b/ldap/servers/snmp/ntagt/nsldapmib_nt.c
deleted file mode 100644
index b319457..0000000
--- a/ldap/servers/snmp/ntagt/nsldapmib_nt.c
+++ /dev/null
@@ -1,1078 +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 **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-
-/*-------------------------------------------------------------------------
- *
- * nsldapmib_nt.c - NS Directory Server's MIB for extended SNMP agent
- * on NT.
- *
- * Revision History:
- * 07/25/1997 Steve Ross Created
- *
- *
- *-----------------------------------------------------------------------*/
-
-#include <stdio.h>
-#include <malloc.h>
-#include <time.h>
-#include <windows.h>
-#include <malloc.h>
-#include <snmp.h>
-#include <mgmtapi.h>
-#include "nsldapmib_nt.h"
-#include "nsldapagt_nt.h"
-#include "agtmmap.h"
-
-/*-------------------------------------------------------------------------
- *
- * Globals
- *
- *-----------------------------------------------------------------------*/
-
-/*
- * For ldap, the prefix to all MIB variables is 1.3.6.1.4.1.1450.7
- */
-UINT OID_Prefix[] = {1, 3, 6, 1, 4, 1, 1450, 7};
-AsnObjectIdentifier MIB_OidPrefix = {MAGT_OID_SIZEOF(OID_Prefix),
- OID_Prefix};
-
-/*
- * OID of each MIB variable.
- * For example, the OID for mtaReceivedMessages is:
- * 1.3.6.1.4.1.1450.7
- *
- * - nsldap = netscape 7
- * -dsOpsTable = nsldap 1
- * -dsEntriesTable = nsldap 2
- * -dsIntTable = nsldap 3
- * -dsEntityINfo = nsldap 5
- *
- */
-
-
-UINT OID_ApplIndex[] = {389};
-/* setup the parts of the OID we know in advance */
-
-/* ops table */
-UINT OID_AnonymousBinds[] = {1, 1, 1};
-UINT OID_UnAuthBinds[] = {1, 1, 2};
-UINT OID_SimpleAuthBinds[] = {1, 1, 3};
-UINT OID_StrongAuthBinds[] = {1, 1, 4};
-UINT OID_BindSecurityErrors[] = {1, 1, 5};
-UINT OID_InOps[] = {1, 1, 6};
-UINT OID_ReadOps[] = {1, 1, 7};
-UINT OID_CompareOps[] = {1, 1, 8};
-UINT OID_AddEntryOps[] = {1, 1, 9};
-UINT OID_RemoveEntryOps[] = {1, 1, 10};
-UINT OID_ModifyEntryOps[] = {1, 1, 11};
-UINT OID_ModifyRDNOps[] = {1, 1, 12};
-UINT OID_ListOps[] = {1, 1, 13};
-UINT OID_SearchOps[] = {1, 1, 14};
-UINT OID_OneLevelSearchOps[] = {1, 1, 15};
-UINT OID_WholeSubtreeSearchOps[] = {1, 1, 16};
-UINT OID_Referrals[] = {1, 1, 17};
-UINT OID_Chainings[] = {1, 1, 18};
-UINT OID_SecurityErrors[] = {1, 1, 19};
-UINT OID_Errors[] = {1, 1, 20};
-
-/* entries table */
-UINT OID_MasterEntries[] = {2, 1, 1};
-UINT OID_CopyEntries[] = {2, 1, 2};
-UINT OID_CacheEntries[] = {2, 1, 3};
-UINT OID_CacheHits[] = {2, 1, 4};
-UINT OID_SlaveHits[] = {2, 1, 5};
-
-/* interaction table */
-UINT OID_DsIntIndex[] = {3, 1, 1};
-UINT OID_DsName[] = {3, 1, 2};
-UINT OID_TimeOfCreation[] = {3, 1, 3};
-UINT OID_TimeOfLastAttempt[] = {3, 1, 4};
-UINT OID_TimeOfLastSuccess[] = {3, 1, 5};
-UINT OID_FailuresSinceLastSuccess[] = {3, 1, 6};
-UINT OID_Failures[] = {3, 1, 7};
-UINT OID_Successes[] = {3, 1, 8};
-UINT OID_URL[] = {3, 1, 9};
-
-/* entity table */
-UINT OID_EntityDescr[] = {5, 1, 1};
-UINT OID_EntityVers[] = {5, 1, 2};
-UINT OID_EntityOrg[] = {5, 1, 3};
-UINT OID_EntityLocation[] = {5, 1, 4};
-UINT OID_EntityContact[] = {5, 1, 5};
-UINT OID_EntityName[] = {5, 1, 6};
-
-
-/* make AsnObjectIdentifiers so can use snmputilOidcpy for each server instance, and append to put on indexes later */
-/* ops table */
-AsnObjectIdentifier ASN_AnonymousBinds = {MAGT_OID_SIZEOF(OID_AnonymousBinds) ,OID_AnonymousBinds};
-AsnObjectIdentifier ASN_UnAuthBinds = {MAGT_OID_SIZEOF(OID_UnAuthBinds) ,OID_UnAuthBinds};
-AsnObjectIdentifier ASN_SimpleAuthBinds = {MAGT_OID_SIZEOF(OID_SimpleAuthBinds) ,OID_SimpleAuthBinds};
-AsnObjectIdentifier ASN_StrongAuthBinds = {MAGT_OID_SIZEOF(OID_StrongAuthBinds) ,OID_StrongAuthBinds};
-AsnObjectIdentifier ASN_BindSecurityErrors = {MAGT_OID_SIZEOF(OID_BindSecurityErrors) ,OID_BindSecurityErrors};
-AsnObjectIdentifier ASN_InOps = {MAGT_OID_SIZEOF(OID_InOps) ,OID_InOps};
-AsnObjectIdentifier ASN_ReadOps = {MAGT_OID_SIZEOF(OID_ReadOps) ,OID_ReadOps};
-AsnObjectIdentifier ASN_CompareOps = {MAGT_OID_SIZEOF(OID_CompareOps) ,OID_CompareOps};
-AsnObjectIdentifier ASN_AddEntryOps = {MAGT_OID_SIZEOF(OID_AddEntryOps) ,OID_AddEntryOps};
-AsnObjectIdentifier ASN_RemoveEntryOps = {MAGT_OID_SIZEOF(OID_RemoveEntryOps) ,OID_RemoveEntryOps};
-AsnObjectIdentifier ASN_ModifyEntryOps = {MAGT_OID_SIZEOF(OID_ModifyEntryOps) ,OID_ModifyEntryOps};
-AsnObjectIdentifier ASN_ModifyRDNOps = {MAGT_OID_SIZEOF(OID_ModifyRDNOps) ,OID_ModifyRDNOps};
-AsnObjectIdentifier ASN_ListOps = {MAGT_OID_SIZEOF(OID_ListOps) ,OID_ListOps};
-AsnObjectIdentifier ASN_SearchOps = {MAGT_OID_SIZEOF(OID_SearchOps) ,OID_SearchOps};
-AsnObjectIdentifier ASN_OneLevelSearchOps = {MAGT_OID_SIZEOF(OID_OneLevelSearchOps) ,OID_OneLevelSearchOps};
-AsnObjectIdentifier ASN_WholeSubtreeSearchOps = {MAGT_OID_SIZEOF(OID_WholeSubtreeSearchOps),OID_WholeSubtreeSearchOps};
-AsnObjectIdentifier ASN_Referrals = {MAGT_OID_SIZEOF(OID_Referrals) ,OID_Referrals};
-AsnObjectIdentifier ASN_Chainings = {MAGT_OID_SIZEOF(OID_Chainings) ,OID_Chainings};
-AsnObjectIdentifier ASN_SecurityErrors = {MAGT_OID_SIZEOF(OID_SecurityErrors) ,OID_SecurityErrors};
-AsnObjectIdentifier ASN_Errors = {MAGT_OID_SIZEOF(OID_Errors) ,OID_Errors};
-
-/* entries table */
-AsnObjectIdentifier ASN_MasterEntries = {MAGT_OID_SIZEOF(OID_MasterEntries) ,OID_MasterEntries};
-AsnObjectIdentifier ASN_CopyEntries = {MAGT_OID_SIZEOF(OID_CopyEntries) ,OID_CopyEntries};
-AsnObjectIdentifier ASN_CacheEntries = {MAGT_OID_SIZEOF(OID_CacheEntries) ,OID_CacheEntries};
-AsnObjectIdentifier ASN_CacheHits = {MAGT_OID_SIZEOF(OID_CacheHits) ,OID_CacheHits};
-AsnObjectIdentifier ASN_SlaveHits = {MAGT_OID_SIZEOF(OID_SlaveHits) ,OID_SlaveHits};
-
-/* interaction table */
-AsnObjectIdentifier ASN_DsName = {MAGT_OID_SIZEOF(OID_DsName) ,OID_DsName};
-AsnObjectIdentifier ASN_TimeOfCreation = {MAGT_OID_SIZEOF(OID_TimeOfCreation) ,OID_TimeOfCreation};
-AsnObjectIdentifier ASN_TimeOfLastAttempt = {MAGT_OID_SIZEOF(OID_TimeOfLastAttempt) ,OID_TimeOfLastAttempt};
-AsnObjectIdentifier ASN_TimeOfLastSuccess = {MAGT_OID_SIZEOF(OID_TimeOfLastSuccess) ,OID_TimeOfLastSuccess};
-AsnObjectIdentifier ASN_FailuresSinceLastSuccess = {MAGT_OID_SIZEOF(OID_FailuresSinceLastSuccess) ,OID_FailuresSinceLastSuccess};
-AsnObjectIdentifier ASN_Failures = {MAGT_OID_SIZEOF(OID_Failures) ,OID_Failures};
-AsnObjectIdentifier ASN_Successes = {MAGT_OID_SIZEOF(OID_Successes) ,OID_Successes};
-AsnObjectIdentifier ASN_URL = {MAGT_OID_SIZEOF(OID_URL) ,OID_URL};
-
-/* entity table */
-AsnObjectIdentifier ASN_EntityDescr = {MAGT_OID_SIZEOF(OID_EntityDescr) ,OID_EntityDescr};
-AsnObjectIdentifier ASN_EntityVers = {MAGT_OID_SIZEOF(OID_EntityVers) ,OID_EntityVers};
-AsnObjectIdentifier ASN_EntityOrg = {MAGT_OID_SIZEOF(OID_EntityOrg) ,OID_EntityOrg};
-AsnObjectIdentifier ASN_EntityLocation = {MAGT_OID_SIZEOF(OID_EntityLocation) ,OID_EntityLocation};
-AsnObjectIdentifier ASN_EntityContact = {MAGT_OID_SIZEOF(OID_EntityContact) ,OID_EntityContact};
-AsnObjectIdentifier ASN_EntityName = {MAGT_OID_SIZEOF(OID_EntityName) ,OID_EntityName};
-
-/*
- * Storage definitions for MIB.
- */
-char szPlaceHolder[] = "Not Available";
-int nPlaceHolder = 0;
-
-#define NUM_ENTITY_COLUMNS 6
-#define NUM_OPS_COLUMNS 20
-#define NUM_ENTRIES_COLUMNS 5
-#define NUM_INT_COLUMNS 8
-#define NUM_INT_ROWS 5
-
-
-UINT MIB_num_vars;
-
-void OidAppendIndex(AsnObjectIdentifier *Oid, int Index);
-
-int Mib_init(MagtMibEntry_t **Mib, int ApplIndex)
-{
- int i;
- int j;
-
- MIB_num_vars = (UINT) 71;
-
- /* allocate the memory for this Mib Instance */
- if( (*Mib = (MagtMibEntry_t *) GlobalAlloc(GPTR, MIB_num_vars *
- sizeof(MagtMibEntry_t ) )) == NULL)
- {
- return -1;
- }
-
- /**************************
- * Ops Table Stuff
- * --------------
- * AnonymousBinds
- * UnAuthBinds
- * SimpleAuthBinds
- * StrongAuthBinds
- * BindSecurityErrors
- * InOps
- * ReadOps
- * CompareOps
- * AddEntryOps
- * RemoveEntryOps
- * ModifyEntryOps
- * ModifyRDNOps
- * ListOps
- * SearchOps
- * OneLevelSearchOps
- * WholeSubtreeSearchOps
- * Referrals
- * Chainings
- * SecurityErrors
- * Errors
- **************************/
-
-
- i=0;
- SnmpUtilOidCpy(&((*Mib)[i].Oid), &ASN_AnonymousBinds);
- OidAppendIndex(&((*Mib)[i].Oid), ApplIndex);
- (*Mib)[i].Storage = &nPlaceHolder;
- (*Mib)[i].Type = ASN_RFC1155_COUNTER;
- (*Mib)[i].Access = MAGT_MIB_ACCESS_READ;
- (*Mib)[i].MibFunc = MagtMIBLeafFunc;
- (*Mib)[i].MibNext = NULL;
- (*Mib)[i].uId = MAGT_ID_ANONYMOUS_BINDS;
-
- i++;
- SnmpUtilOidCpy(&((*Mib)[i].Oid), &ASN_UnAuthBinds);
- OidAppendIndex(&((*Mib)[i].Oid), ApplIndex);
- (*Mib)[i].Storage = &nPlaceHolder;
- (*Mib)[i].Type = ASN_RFC1155_COUNTER;
- (*Mib)[i].Access = MAGT_MIB_ACCESS_READ;
- (*Mib)[i].MibFunc = MagtMIBLeafFunc;
- (*Mib)[i].MibNext = NULL;
- (*Mib)[i].uId = MAGT_ID_UNAUTH_BINDS;
-
- i++;
- SnmpUtilOidCpy(&((*Mib)[i].Oid), &ASN_SimpleAuthBinds);
- OidAppendIndex(&((*Mib)[i].Oid), ApplIndex);
- (*Mib)[i].Storage = &nPlaceHolder;
- (*Mib)[i].Type = ASN_RFC1155_COUNTER;
- (*Mib)[i].Access = MAGT_MIB_ACCESS_READ;
- (*Mib)[i].MibFunc = MagtMIBLeafFunc;
- (*Mib)[i].MibNext = NULL;
- (*Mib)[i].uId = MAGT_ID_SIMPLE_AUTH_BINDS;
-
- i++;
- SnmpUtilOidCpy(&((*Mib)[i].Oid), &ASN_StrongAuthBinds);
- OidAppendIndex(&((*Mib)[i].Oid), ApplIndex);
- (*Mib)[i].Storage = &nPlaceHolder;
- (*Mib)[i].Type = ASN_RFC1155_COUNTER;
- (*Mib)[i].Access = MAGT_MIB_ACCESS_READ;
- (*Mib)[i].MibFunc = MagtMIBLeafFunc;
- (*Mib)[i].MibNext = NULL;
- (*Mib)[i].uId = MAGT_ID_STRONG_AUTH_BINDS;
-
- i++;
- SnmpUtilOidCpy(&((*Mib)[i].Oid), &ASN_BindSecurityErrors);
- OidAppendIndex(&((*Mib)[i].Oid), ApplIndex);
- (*Mib)[i].Storage = &nPlaceHolder;
- (*Mib)[i].Type = ASN_RFC1155_COUNTER;
- (*Mib)[i].Access = MAGT_MIB_ACCESS_READ;
- (*Mib)[i].MibFunc = MagtMIBLeafFunc;
- (*Mib)[i].MibNext = NULL;
- (*Mib)[i].uId = MAGT_ID_BIND_SECURITY_ERRORS;
-
- i++;
- SnmpUtilOidCpy(&((*Mib)[i].Oid), &ASN_InOps);
- OidAppendIndex(&((*Mib)[i].Oid), ApplIndex);
- (*Mib)[i].Storage = &nPlaceHolder;
- (*Mib)[i].Type = ASN_RFC1155_COUNTER;
- (*Mib)[i].Access = MAGT_MIB_ACCESS_READ;
- (*Mib)[i].MibFunc = MagtMIBLeafFunc;
- (*Mib)[i].MibNext = NULL;
- (*Mib)[i].uId = MAGT_ID_IN_OPS;
-
- i++;
- SnmpUtilOidCpy(&((*Mib)[i].Oid), &ASN_ReadOps);
- OidAppendIndex(&((*Mib)[i].Oid), ApplIndex);
- (*Mib)[i].Storage = &nPlaceHolder;
- (*Mib)[i].Type = ASN_RFC1155_COUNTER;
- (*Mib)[i].Access = MAGT_MIB_ACCESS_READ;
- (*Mib)[i].MibFunc = MagtMIBLeafFunc;
- (*Mib)[i].MibNext = NULL;
- (*Mib)[i].uId = MAGT_ID_READ_OPS;
-
- i++;
- SnmpUtilOidCpy(&((*Mib)[i].Oid), &ASN_CompareOps);
- OidAppendIndex(&((*Mib)[i].Oid), ApplIndex);
- (*Mib)[i].Storage = &nPlaceHolder;
- (*Mib)[i].Type = ASN_RFC1155_COUNTER;
- (*Mib)[i].Access = MAGT_MIB_ACCESS_READ;
- (*Mib)[i].MibFunc = MagtMIBLeafFunc;
- (*Mib)[i].MibNext = NULL;
- (*Mib)[i].uId = MAGT_ID_COMPARE_OPS;
-
- i++;
- SnmpUtilOidCpy(&((*Mib)[i].Oid), &ASN_AddEntryOps);
- OidAppendIndex(&((*Mib)[i].Oid), ApplIndex);
- (*Mib)[i].Storage = &nPlaceHolder;
- (*Mib)[i].Type = ASN_RFC1155_COUNTER;
- (*Mib)[i].Access = MAGT_MIB_ACCESS_READ;
- (*Mib)[i].MibFunc = MagtMIBLeafFunc;
- (*Mib)[i].MibNext = NULL;
- (*Mib)[i].uId = MAGT_ID_ADD_ENTRY_OPS;
-
- i++;
- SnmpUtilOidCpy(&((*Mib)[i].Oid), &ASN_RemoveEntryOps);
- OidAppendIndex(&((*Mib)[i].Oid), ApplIndex);
- (*Mib)[i].Storage = &nPlaceHolder;
- (*Mib)[i].Type = ASN_RFC1155_COUNTER;
- (*Mib)[i].Access = MAGT_MIB_ACCESS_READ;
- (*Mib)[i].MibFunc = MagtMIBLeafFunc;
- (*Mib)[i].MibNext = NULL;
- (*Mib)[i].uId = MAGT_ID_REMOVE_ENTRY_OPS;
-
- i++;
- SnmpUtilOidCpy(&((*Mib)[i].Oid), &ASN_ModifyEntryOps);
- OidAppendIndex(&((*Mib)[i].Oid), ApplIndex);
- (*Mib)[i].Storage = &nPlaceHolder;
- (*Mib)[i].Type = ASN_RFC1155_COUNTER;
- (*Mib)[i].Access = MAGT_MIB_ACCESS_READ;
- (*Mib)[i].MibFunc = MagtMIBLeafFunc;
- (*Mib)[i].MibNext = NULL;
- (*Mib)[i].uId = MAGT_ID_MODIFY_ENTRY_OPS;
-
- i++;
- SnmpUtilOidCpy(&((*Mib)[i].Oid), &ASN_ModifyRDNOps);
- OidAppendIndex(&((*Mib)[i].Oid), ApplIndex);
- (*Mib)[i].Storage = &nPlaceHolder;
- (*Mib)[i].Type = ASN_RFC1155_COUNTER;
- (*Mib)[i].Access = MAGT_MIB_ACCESS_READ;
- (*Mib)[i].MibFunc = MagtMIBLeafFunc;
- (*Mib)[i].MibNext = NULL;
- (*Mib)[i].uId = MAGT_ID_MODIFY_RDN_OPS;
-
- i++;
- SnmpUtilOidCpy(&((*Mib)[i].Oid), &ASN_ListOps);
- OidAppendIndex(&((*Mib)[i].Oid), ApplIndex);
- (*Mib)[i].Storage = &nPlaceHolder;
- (*Mib)[i].Type = ASN_RFC1155_COUNTER;
- (*Mib)[i].Access = MAGT_MIB_ACCESS_READ;
- (*Mib)[i].MibFunc = MagtMIBLeafFunc;
- (*Mib)[i].MibNext = NULL;
- (*Mib)[i].uId = MAGT_ID_LIST_OPS;
-
- i++;
- SnmpUtilOidCpy(&((*Mib)[i].Oid), &ASN_SearchOps);
- OidAppendIndex(&((*Mib)[i].Oid), ApplIndex);
- (*Mib)[i].Storage = &nPlaceHolder;
- (*Mib)[i].Type = ASN_RFC1155_COUNTER;
- (*Mib)[i].Access = MAGT_MIB_ACCESS_READ;
- (*Mib)[i].MibFunc = MagtMIBLeafFunc;
- (*Mib)[i].MibNext = NULL;
- (*Mib)[i].uId = MAGT_ID_SEARCH_OPS;
-
- i++;
- SnmpUtilOidCpy(&((*Mib)[i].Oid), &ASN_OneLevelSearchOps);
- OidAppendIndex(&((*Mib)[i].Oid), ApplIndex);
- (*Mib)[i].Storage = &nPlaceHolder;
- (*Mib)[i].Type = ASN_RFC1155_COUNTER;
- (*Mib)[i].Access = MAGT_MIB_ACCESS_READ;
- (*Mib)[i].MibFunc = MagtMIBLeafFunc;
- (*Mib)[i].MibNext = NULL;
- (*Mib)[i].uId = MAGT_ID_ONE_LEVEL_SEARCH_OPS;
-
- i++;
- SnmpUtilOidCpy(&((*Mib)[i].Oid), &ASN_WholeSubtreeSearchOps);
- OidAppendIndex(&((*Mib)[i].Oid), ApplIndex);
- (*Mib)[i].Storage = &nPlaceHolder;
- (*Mib)[i].Type = ASN_RFC1155_COUNTER;
- (*Mib)[i].Access = MAGT_MIB_ACCESS_READ;
- (*Mib)[i].MibFunc = MagtMIBLeafFunc;
- (*Mib)[i].MibNext = NULL;
- (*Mib)[i].uId = MAGT_ID_WHOLE_SUBTREE_SEARCH_OPS;
-
- i++;
- SnmpUtilOidCpy(&((*Mib)[i].Oid), &ASN_Referrals);
- OidAppendIndex(&((*Mib)[i].Oid), ApplIndex);
- (*Mib)[i].Storage = &nPlaceHolder;
- (*Mib)[i].Type = ASN_RFC1155_COUNTER;
- (*Mib)[i].Access = MAGT_MIB_ACCESS_READ;
- (*Mib)[i].MibFunc = MagtMIBLeafFunc;
- (*Mib)[i].MibNext = NULL;
- (*Mib)[i].uId = MAGT_ID_REFERRALS;
-
- i++;
- SnmpUtilOidCpy(&((*Mib)[i].Oid), &ASN_Chainings);
- OidAppendIndex(&((*Mib)[i].Oid), ApplIndex);
- (*Mib)[i].Storage = &nPlaceHolder;
- (*Mib)[i].Type = ASN_RFC1155_COUNTER;
- (*Mib)[i].Access = MAGT_MIB_ACCESS_READ;
- (*Mib)[i].MibFunc = MagtMIBLeafFunc;
- (*Mib)[i].MibNext = NULL;
- (*Mib)[i].uId = MAGT_ID_CHAININGS;
-
- i++;
- SnmpUtilOidCpy(&((*Mib)[i].Oid), &ASN_SecurityErrors);
- OidAppendIndex(&((*Mib)[i].Oid), ApplIndex);
- (*Mib)[i].Storage = &nPlaceHolder;
- (*Mib)[i].Type = ASN_RFC1155_COUNTER;
- (*Mib)[i].Access = MAGT_MIB_ACCESS_READ;
- (*Mib)[i].MibFunc = MagtMIBLeafFunc;
- (*Mib)[i].MibNext = NULL;
- (*Mib)[i].uId = MAGT_ID_SECURITY_ERRORS;
-
- i++;
- SnmpUtilOidCpy(&((*Mib)[i].Oid), &ASN_Errors);
- OidAppendIndex(&((*Mib)[i].Oid), ApplIndex);
- (*Mib)[i].Storage = &nPlaceHolder;
- (*Mib)[i].Type = ASN_RFC1155_COUNTER;
- (*Mib)[i].Access = MAGT_MIB_ACCESS_READ;
- (*Mib)[i].MibFunc = MagtMIBLeafFunc;
- (*Mib)[i].MibNext = NULL;
- (*Mib)[i].uId = MAGT_ID_ERRORS;
-
- /**************************
- * Entries Table Stuff
- * --------------
- * MasterEntries
- * CopyEntries
- * CacheEntries
- * CacheHits
- * SlaveHits
- **************************/
-
- i++;
- SnmpUtilOidCpy(&((*Mib)[i].Oid), &ASN_MasterEntries);
- OidAppendIndex(&((*Mib)[i].Oid), ApplIndex);
- (*Mib)[i].Storage = &nPlaceHolder;
- (*Mib)[i].Type = ASN_RFC1155_COUNTER;
- (*Mib)[i].Access = MAGT_MIB_ACCESS_READ;
- (*Mib)[i].MibFunc = MagtMIBLeafFunc;
- (*Mib)[i].MibNext = NULL;
- (*Mib)[i].uId = MAGT_ID_MASTER_ENTRIES;
-
- i++;
- SnmpUtilOidCpy(&((*Mib)[i].Oid), &ASN_CopyEntries);
- OidAppendIndex(&((*Mib)[i].Oid), ApplIndex);
- (*Mib)[i].Storage = &nPlaceHolder;
- (*Mib)[i].Type = ASN_RFC1155_COUNTER;
- (*Mib)[i].Access = MAGT_MIB_ACCESS_READ;
- (*Mib)[i].MibFunc = MagtMIBLeafFunc;
- (*Mib)[i].MibNext = NULL;
- (*Mib)[i].uId = MAGT_ID_COPY_ENTRIES;
-
- i++;
- SnmpUtilOidCpy(&((*Mib)[i].Oid), &ASN_CacheEntries);
- OidAppendIndex(&((*Mib)[i].Oid), ApplIndex);
- (*Mib)[i].Storage = &nPlaceHolder;
- (*Mib)[i].Type = ASN_RFC1155_COUNTER;
- (*Mib)[i].Access = MAGT_MIB_ACCESS_READ;
- (*Mib)[i].MibFunc = MagtMIBLeafFunc;
- (*Mib)[i].MibNext = NULL;
- (*Mib)[i].uId = MAGT_ID_CACHE_ENTRIES;
-
- i++;
- SnmpUtilOidCpy(&((*Mib)[i].Oid), &ASN_CacheHits);
- OidAppendIndex(&((*Mib)[i].Oid), ApplIndex);
- (*Mib)[i].Storage = &nPlaceHolder;
- (*Mib)[i].Type = ASN_RFC1155_COUNTER;
- (*Mib)[i].Access = MAGT_MIB_ACCESS_READ;
- (*Mib)[i].MibFunc = MagtMIBLeafFunc;
- (*Mib)[i].MibNext = NULL;
- (*Mib)[i].uId = MAGT_ID_CACHE_HITS;
-
- i++;
- SnmpUtilOidCpy(&((*Mib)[i].Oid), &ASN_SlaveHits);
- OidAppendIndex(&((*Mib)[i].Oid), ApplIndex);
- (*Mib)[i].Storage = &nPlaceHolder;
- (*Mib)[i].Type = ASN_RFC1155_COUNTER;
- (*Mib)[i].Access = MAGT_MIB_ACCESS_READ;
- (*Mib)[i].MibFunc = MagtMIBLeafFunc;
- (*Mib)[i].MibNext = NULL;
- (*Mib)[i].uId = MAGT_ID_SLAVE_HITS;
-
-
- /**************************
- * Interaction Table Stuff
- * --------------
- * DsName
- * TimeOfCreation
- * TimeOfLastAttempt
- * TimeOfLastSuccess
- * FailuresSinceLastSuccess
- * Failures
- * Successes
- * URL
- **************************/
-
- for(j=1; j <= NUM_SNMP_INT_TBL_ROWS; j++)
- {
-
- i++;
- SnmpUtilOidCpy(&((*Mib)[i].Oid), &ASN_DsName);
- OidAppendIndex(&((*Mib)[i].Oid), ApplIndex);
- OidAppendIndex(&((*Mib)[i].Oid), j);
- (*Mib)[i].Storage = szPlaceHolder;
- (*Mib)[i].Type = ASN_RFC1213_DISPSTRING;
- (*Mib)[i].Access = MAGT_MIB_ACCESS_READ;
- (*Mib)[i].MibFunc = MagtMIBLeafFunc;
- (*Mib)[i].MibNext = NULL;
- (*Mib)[i].uId = MAGT_ID_DS_NAME;
-
- }
-
- for(j=1; j <= NUM_SNMP_INT_TBL_ROWS; j++)
- {
-
- i++;
- SnmpUtilOidCpy(&((*Mib)[i].Oid), &ASN_TimeOfCreation);
- OidAppendIndex(&((*Mib)[i].Oid), ApplIndex);
- OidAppendIndex(&((*Mib)[i].Oid), j);
- (*Mib)[i].Storage = &nPlaceHolder;
- (*Mib)[i].Type = ASN_RFC1155_TIMETICKS;
- (*Mib)[i].Access = MAGT_MIB_ACCESS_READ;
- (*Mib)[i].MibFunc = MagtMIBLeafFunc;
- (*Mib)[i].MibNext = NULL;
- (*Mib)[i].uId = MAGT_ID_TIME_OF_CREATION;
- }
-
- for(j=1; j <= NUM_SNMP_INT_TBL_ROWS; j++)
- {
-
- i++;
- SnmpUtilOidCpy(&((*Mib)[i].Oid), &ASN_TimeOfLastAttempt);
- OidAppendIndex(&((*Mib)[i].Oid), ApplIndex);
- OidAppendIndex(&((*Mib)[i].Oid), j);
- (*Mib)[i].Storage = &nPlaceHolder;
- (*Mib)[i].Type = ASN_RFC1155_TIMETICKS;
- (*Mib)[i].Access = MAGT_MIB_ACCESS_READ;
- (*Mib)[i].MibFunc = MagtMIBLeafFunc;
- (*Mib)[i].MibNext = NULL;
- (*Mib)[i].uId = MAGT_ID_TIME_OF_LAST_ATTEMPT;
- }
-
- for(j=1; j <= NUM_SNMP_INT_TBL_ROWS; j++)
- {
-
- i++;
- SnmpUtilOidCpy(&((*Mib)[i].Oid), &ASN_TimeOfLastSuccess);
- OidAppendIndex(&((*Mib)[i].Oid), ApplIndex);
- OidAppendIndex(&((*Mib)[i].Oid), j);
- (*Mib)[i].Storage = &nPlaceHolder;
- (*Mib)[i].Type = ASN_RFC1155_TIMETICKS;
- (*Mib)[i].Access = MAGT_MIB_ACCESS_READ;
- (*Mib)[i].MibFunc = MagtMIBLeafFunc;
- (*Mib)[i].MibNext = NULL;
- (*Mib)[i].uId = MAGT_ID_TIME_OF_LAST_SUCCESS;
- }
-
- for(j=1; j <= NUM_SNMP_INT_TBL_ROWS; j++)
- {
-
- i++;
- SnmpUtilOidCpy(&((*Mib)[i].Oid), &ASN_FailuresSinceLastSuccess);
- OidAppendIndex(&((*Mib)[i].Oid), ApplIndex);
- OidAppendIndex(&((*Mib)[i].Oid), j);
- (*Mib)[i].Storage = &nPlaceHolder;
- (*Mib)[i].Type = ASN_RFC1155_COUNTER;
- (*Mib)[i].Access = MAGT_MIB_ACCESS_READ;
- (*Mib)[i].MibFunc = MagtMIBLeafFunc;
- (*Mib)[i].MibNext = NULL;
- (*Mib)[i].uId = MAGT_ID_FAILURES_SINCE_LAST_SUCCESS;
- }
-
- for(j=1; j <= NUM_SNMP_INT_TBL_ROWS; j++)
- {
- i++;
- SnmpUtilOidCpy(&((*Mib)[i].Oid), &ASN_Failures);
- OidAppendIndex(&((*Mib)[i].Oid), ApplIndex);
- OidAppendIndex(&((*Mib)[i].Oid), j);
- (*Mib)[i].Storage = &nPlaceHolder;
- (*Mib)[i].Type = ASN_RFC1155_COUNTER;
- (*Mib)[i].Access = MAGT_MIB_ACCESS_READ;
- (*Mib)[i].MibFunc = MagtMIBLeafFunc;
- (*Mib)[i].MibNext = NULL;
- (*Mib)[i].uId = MAGT_ID_FAILURES;
- }
-
- for(j=1; j <= NUM_SNMP_INT_TBL_ROWS; j++)
- {
- i++;
- SnmpUtilOidCpy(&((*Mib)[i].Oid), &ASN_Successes);
- OidAppendIndex(&((*Mib)[i].Oid), ApplIndex);
- OidAppendIndex(&((*Mib)[i].Oid), j);
- (*Mib)[i].Storage = &nPlaceHolder;
- (*Mib)[i].Type = ASN_RFC1155_COUNTER;
- (*Mib)[i].Access = MAGT_MIB_ACCESS_READ;
- (*Mib)[i].MibFunc = MagtMIBLeafFunc;
- (*Mib)[i].MibNext = NULL;
- (*Mib)[i].uId = MAGT_ID_SUCCESSES;
- }
-
- for(j=1; j <= NUM_SNMP_INT_TBL_ROWS; j++)
- {
- i++;
- SnmpUtilOidCpy(&((*Mib)[i].Oid), &ASN_URL);
- OidAppendIndex(&((*Mib)[i].Oid), ApplIndex);
- OidAppendIndex(&((*Mib)[i].Oid), j);
- (*Mib)[i].Storage = szPlaceHolder;
- (*Mib)[i].Type = ASN_RFC1213_DISPSTRING;
- (*Mib)[i].Access = MAGT_MIB_ACCESS_READ;
- (*Mib)[i].MibFunc = MagtMIBLeafFunc;
- (*Mib)[i].MibNext = NULL;
- (*Mib)[i].uId = MAGT_ID_URL;
- }
-
- /**************************
- * Entity Stuff
- * --------------
- * EntityDescr
- * EntityVers
- * EntityOrg
- * EntityLocation
- * EntityContact
- * EntityName
- **************************/
-
- i++;
- SnmpUtilOidCpy(&((*Mib)[i].Oid), &ASN_EntityDescr);
- OidAppendIndex(&((*Mib)[i].Oid), ApplIndex);
- (*Mib)[i].Storage = szPlaceHolder;
- (*Mib)[i].Type = ASN_RFC1213_DISPSTRING;
- (*Mib)[i].Access = MAGT_MIB_ACCESS_READ;
- (*Mib)[i].MibFunc = MagtMIBLeafFunc;
- (*Mib)[i].MibNext = NULL;
- (*Mib)[i].uId = MAGT_ID_DESC;
-
- i++;
- SnmpUtilOidCpy(&((*Mib)[i].Oid), &ASN_EntityVers);
- OidAppendIndex(&((*Mib)[i].Oid), ApplIndex);
- (*Mib)[i].Storage = szPlaceHolder;
- (*Mib)[i].Type = ASN_RFC1213_DISPSTRING;
- (*Mib)[i].Access = MAGT_MIB_ACCESS_READ;
- (*Mib)[i].MibFunc = MagtMIBLeafFunc;
- (*Mib)[i].MibNext = NULL;
- (*Mib)[i].uId = MAGT_ID_VERS;
-
- i++;
- SnmpUtilOidCpy(&((*Mib)[i].Oid), &ASN_EntityOrg);
- OidAppendIndex(&((*Mib)[i].Oid), ApplIndex);
- (*Mib)[i].Storage = szPlaceHolder;
- (*Mib)[i].Type = ASN_RFC1213_DISPSTRING;
- (*Mib)[i].Access = MAGT_MIB_ACCESS_READ;
- (*Mib)[i].MibFunc = MagtMIBLeafFunc;
- (*Mib)[i].MibNext = NULL;
- (*Mib)[i].uId = MAGT_ID_ORG;
-
- i++;
- SnmpUtilOidCpy(&((*Mib)[i].Oid), &ASN_EntityLocation);
- OidAppendIndex(&((*Mib)[i].Oid), ApplIndex);
- (*Mib)[i].Storage = szPlaceHolder;
- (*Mib)[i].Type = ASN_RFC1213_DISPSTRING;
- (*Mib)[i].Access = MAGT_MIB_ACCESS_READ;
- (*Mib)[i].MibFunc = MagtMIBLeafFunc;
- (*Mib)[i].MibNext = NULL;
- (*Mib)[i].uId = MAGT_ID_LOC;
-
- i++;
- SnmpUtilOidCpy(&((*Mib)[i].Oid), &ASN_EntityContact);
- OidAppendIndex(&((*Mib)[i].Oid), ApplIndex);
- (*Mib)[i].Storage = szPlaceHolder;
- (*Mib)[i].Type = ASN_RFC1213_DISPSTRING;
- (*Mib)[i].Access = MAGT_MIB_ACCESS_READ;
- (*Mib)[i].MibFunc = MagtMIBLeafFunc;
- (*Mib)[i].MibNext = NULL;
- (*Mib)[i].uId = MAGT_ID_CONTACT;
-
- i++;
- SnmpUtilOidCpy(&((*Mib)[i].Oid), &ASN_EntityName);
- OidAppendIndex(&((*Mib)[i].Oid), ApplIndex);
- (*Mib)[i].Storage = szPlaceHolder;
- (*Mib)[i].Type = ASN_RFC1213_DISPSTRING;
- (*Mib)[i].Access = MAGT_MIB_ACCESS_READ;
- (*Mib)[i].MibFunc = MagtMIBLeafFunc;
- (*Mib)[i].MibNext = NULL;
- (*Mib)[i].uId = MAGT_ID_NAME;
-
- return 0;
-}
-
-void OidAppendIndex(AsnObjectIdentifier *Oid, int Index)
-{
- UINT OID_Index[1];
- AsnObjectIdentifier ASN_Index;
-
- OID_Index[0] = Index;
- ASN_Index.ids = OID_Index;
- ASN_Index.idLength = 1;
-
- SnmpUtilOidAppend(Oid, &ASN_Index);
-
-}
-
-/*-------------------------------------------------------------------------
- *
- * MagtFillTrapVars: Fills in the variable list for the specified trap.
- *
- * Returns: 0 - No variable filled
- * n - Number of variables filled
- *
- *-----------------------------------------------------------------------*/
-
-int MagtFillTrapVars(int trapType, RFC1157VarBind *trapVars, MagtStaticInfo_t *pCfgInfo)
-{
- MagtDispStr_t varVals[4];
- int nVarLen = 0;
- int i, j;
- static AsnObjectIdentifier varOid[4] = {{MAGT_OID_SIZEOF(OID_EntityDescr),
- OID_EntityDescr},
- {MAGT_OID_SIZEOF(OID_EntityVers),
- OID_EntityVers},
- {MAGT_OID_SIZEOF(OID_EntityLocation),
- OID_EntityLocation},
- {MAGT_OID_SIZEOF(OID_EntityContact),
- OID_EntityContact}};
-
- /*
- * Get the variable values from the static info which has been obtained
- * from the snmp config file at initialization time.
- */
- varVals[0].len = pCfgInfo->entityDescr.len;
- varVals[0].val = pCfgInfo->entityDescr.val;
- varVals[1].len = pCfgInfo->entityVers.len;
- varVals[1].val = pCfgInfo->entityVers.val;
- varVals[2].len = pCfgInfo->entityLocation.len;
- varVals[2].val = pCfgInfo->entityLocation.val;
- varVals[3].len = pCfgInfo->entityContact.len;
- varVals[3].val = pCfgInfo->entityContact.val;
-
- for (i = 0; i < 4; i++)
- {
- SNMP_oidcpy(&trapVars[i].name, &MIB_OidPrefix);
- SNMP_oidappend(&trapVars[i].name, &varOid[i]);
- trapVars[i].value.asnType = ASN_OCTETSTRING;
- trapVars[i].value.asnValue.string.length = varVals[i].len;
- trapVars[i].value.asnValue.string.stream =
- SNMP_malloc((trapVars[i].value.asnValue.string.length) *
- sizeof(char));
- if (trapVars[i].value.asnValue.string.stream == NULL)
- {
-
- /*
- * Clean up any allocated variable binding allocated up until now.
- */
- for (j = 0; j < i; j++)
- {
- SNMP_FreeVarBind(&trapVars[j]);
- return nVarLen;
- }
- }
- memcpy(trapVars[i].value.asnValue.string.stream, varVals[i].val,
- trapVars[i].value.asnValue.string.length);
- trapVars[i].value.asnValue.string.dynamic = TRUE;
- }
-
- switch (trapType)
- {
- case MAGT_TRAP_SERVER_DOWN:
- nVarLen = 4;
- break;
- case MAGT_TRAP_SERVER_START:
- nVarLen = 3;
- break;
- default:
- break;
- }
-
- return nVarLen;
-}
-
-/*-------------------------------------------------------------------------
- *
- * MagtMIBLeafFunc: Performs generic actions on leaf variables in the MIB.
- * Note that SET action is not supported.
- *
- * Returns: SNMP_ERRORSTATUS_NOERROR - No error
- * PDU error codes - Errors
- *
- *-----------------------------------------------------------------------*/
-
-UINT MagtMIBLeafFunc(IN UINT Action, IN MagtMibEntry_t *mibPtr,
- IN RFC1157VarBind *VarBind)
-{
- UINT ErrStat = SNMP_ERRORSTATUS_NOERROR;
- static AsnObjectIdentifier ApplIndexOid = {MAGT_OID_SIZEOF(OID_ApplIndex),
- OID_ApplIndex};
- instance_list_t *pInstance;
- char logMsg[1024];
-
- switch(Action)
- {
- case MAGT_MIB_ACTION_GETNEXT:
- /*
- * If there is no next pointer, this is the end of the MIB tree.
- */
- if (mibPtr->MibNext == NULL)
- {
- ErrStat = SNMP_ERRORSTATUS_NOSUCHNAME;
- return ErrStat;
- }
-
- /*
- * Set up VarBind to contain the OID of the next variable.
- */
- SNMP_oidfree(&VarBind->name);
- SNMP_oidcpy(&VarBind->name, &MIB_OidPrefix);
- SNMP_oidappend(&VarBind->name, &mibPtr->MibNext->Oid);
-
- /*
- * Call function to process the GET request.
- */
- ErrStat = (*mibPtr->MibNext->MibFunc)(MAGT_MIB_ACTION_GET, mibPtr->MibNext,
- VarBind);
- break;
- case MAGT_MIB_ACTION_GET:
-
- /*
- * Make sure that the variable's access right allows GET.
- */
- if (mibPtr->Access != MAGT_MIB_ACCESS_READ &&
- mibPtr->Access != MAGT_MIB_ACCESS_READWRITE)
- {
- ErrStat = SNMP_ERRORSTATUS_NOSUCHNAME;
- return ErrStat;
- }
-
- if (mibPtr->Storage == NULL) /* Counter not supported */
- {
- ErrStat = SNMP_ERRORSTATUS_GENERR;
- return ErrStat;
- }
-
- if ((VarBind->name.ids[MAGT_MIB_PREFIX_LEN] > 1) &&
- (SNMP_oidcmp(&mibPtr->Oid, &ApplIndexOid) != 0))
- {
-
- /*
- * Read stats file to update counter statistics.
- */
-
- /* need to update all of them because don't know which instance resulted
- into call into this function */
- for (pInstance = pInstanceList; pInstance; pInstance = pInstance->pNext)
- {
- if (MagtReadStats(NULL, pInstance->pOpsStatInfo,
- pInstance->pEntriesStatInfo,
- pInstance->ppIntStatInfo,
- pInstance->szStatsPath,
- pInstance->szLogPath) != 0)
- {
-
- /* this server is off/or went down since we
- started up snmp. The snmp agent will
- return last values it was set to until
- server starts back up. If server was not
- started will return null for strings and
- 0 for values */
-
- /* to log for each snmp request is to expensive
- for now, just silently acknowledge the fact
- and think about something better for the future
- */
-
-
- }
- }
- }
-
- /*
- * Set up VarBind's return value.
- */
- VarBind->value.asnType = mibPtr->Type;
- switch (VarBind->value.asnType)
- {
- case ASN_RFC1155_TIMETICKS:
- case ASN_RFC1155_COUNTER:
- case ASN_RFC1155_GAUGE:
- case ASN_INTEGER:
- VarBind->value.asnValue.number = *(AsnInteger *)(mibPtr->Storage);
- break;
- case ASN_RFC1155_IPADDRESS:
- case ASN_OCTETSTRING: /* = ASN_RFC1213_DISPSTRING */
- VarBind->value.asnValue.string.length =
- strlen((LPSTR)mibPtr->Storage);
- VarBind->value.asnValue.string.stream =
- SNMP_malloc((VarBind->value.asnValue.string.length + 2) *
- sizeof(char));
- if (VarBind->value.asnValue.string.stream == NULL)
- {
- ErrStat = SNMP_ERRORSTATUS_GENERR;
- return ErrStat;
- }
- memcpy(VarBind->value.asnValue.string.stream,
- (LPSTR)mibPtr->Storage,
- VarBind->value.asnValue.string.length);
- VarBind->value.asnValue.string.dynamic = TRUE;
- break;
- case ASN_OBJECTIDENTIFIER:
- VarBind->value.asnValue.object =
- *(AsnObjectIdentifier *)(mibPtr->Storage);
- break;
- default:
- ErrStat = SNMP_ERRORSTATUS_GENERR;
- break;
- } /* Switch */
-
- break;
- default:
- ErrStat = SNMP_ERRORSTATUS_GENERR;
- break;
- } /* Switch */
-
- return ErrStat;
-}
-
-/*-------------------------------------------------------------------------
- *
- * MagtResolveVarBind: Resolves a single variable binding. Modifies the
- * variable on a GET or a GETNEXT.
- *
- * Returns: SNMP_ERRORSTATUS_NOERROR - No error
- * PDU error codes - Errors
- *
- *-----------------------------------------------------------------------*/
-
-UINT MagtResolveVarBind(IN OUT RFC1157VarBind *VarBind, IN UINT PduAction)
-{
- MagtMibEntry_t *mibPtr = NULL;
- AsnObjectIdentifier TempOid;
- int CompResult;
- UINT i = 0;
- UINT nResult;
- instance_list_t *pInstance;
-
- pInstance = pInstanceList;
-
- while (mibPtr == NULL && pInstance !=NULL)
- {
- /*
- * Construct OID with complete prefix for comparison purpose
- */
- SNMP_oidcpy(&TempOid, &MIB_OidPrefix);
- SNMP_oidappend(&TempOid, &(pInstance->pMibInfo[i].Oid));
-
- /*
- * Check for OID in MIB. On a GET-NEXT, the OID does not have to match
- * exactly a variable in the MIB, it must only fall under the MIB root.
- */
- CompResult = SNMP_oidcmp(&VarBind->name, &TempOid);
-
- if (CompResult < 0) /* Not an exact match */
- {
- if (PduAction != MAGT_MIB_ACTION_GETNEXT) /* Only GET-NEXT is valid */
- {
-
- pInstance=pInstance->pNext;
- i=0;
- if(pInstance == NULL)
- {
- nResult = SNMP_ERRORSTATUS_NOSUCHNAME;
- return nResult;
- }else{
- continue;
- }
-
- }
-
- /*
- * Since the match was not exact, but var bind name is within MIB,
- * we are at the next MIB variable down from the one specified.
- */
- PduAction = MAGT_MIB_ACTION_GET;
- mibPtr = &(pInstance->pMibInfo[i]);
-
- /*
- * Replace var bind name with new name.
- */
- SNMP_oidfree(&VarBind->name);
- SNMP_oidcpy(&VarBind->name, &MIB_OidPrefix);
- SNMP_oidappend(&VarBind->name, &mibPtr->Oid);
- }
- else
- {
- if (CompResult == 0) /* Found an exact match */
- {
- mibPtr = &(pInstance->pMibInfo[i]);
- }else{
- /* see if it is one of the other ApplIndex */
- instance_list_t *pApplIndex;
- for(pApplIndex = pInstance; pApplIndex; pApplIndex=pApplIndex->pNext)
- {
- SNMP_oidfree(&TempOid);
-
- SNMP_oidcpy(&TempOid, &MIB_OidPrefix);
- SNMP_oidappend(&TempOid, &(pApplIndex->pMibInfo[i].Oid));
-
- CompResult = SNMP_oidcmp(&VarBind->name, &TempOid);
- if(CompResult == 0)
- {
- mibPtr = &(pApplIndex->pMibInfo[i]);
- }
- }
- }
-
-
- }
-
- /*
- * Free OID memory before checking another variable.
- */
- SNMP_oidfree(&TempOid);
- i++;
-
- if(i == MIB_num_vars)
- {
- pInstance=pInstance->pNext;
- i=0;
- }
- } /* While */
-
- if (mibPtr == NULL) /* OID not within MIB's scope */
- {
- nResult = SNMP_ERRORSTATUS_NOSUCHNAME;
- return nResult;
- }
-
- if (*mibPtr->MibFunc == NULL)
- {
- nResult = SNMP_ERRORSTATUS_NOSUCHNAME;
- return nResult;
- }
-
- /*
- * Call function to process request. Each MIB entry has a function pointer
- * that knows how to process its MIB variable.
- */
- nResult = (*mibPtr->MibFunc)(PduAction, mibPtr, VarBind);
-
- SNMP_oidfree(&TempOid); /* Free temp memory */
-
- return nResult;
-
-}
diff --git a/ldap/servers/snmp/ntagt/nsldapmib_nt.h b/ldap/servers/snmp/ntagt/nsldapmib_nt.h
deleted file mode 100644
index f303e76..0000000
--- a/ldap/servers/snmp/ntagt/nsldapmib_nt.h
+++ /dev/null
@@ -1,167 +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 **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-
-/*-------------------------------------------------------------------------
- *
- * nsldapmib_nt.h - Definitions for NS Directory Server's MIB on NT.
- *
- * Revision History:
- * 07/25/1997 Steve Ross Created
- *
- *
- *
- *-----------------------------------------------------------------------*/
-
-#ifndef __NSLDAPMIB_NT_H_
-#define __NSLDAPMIB_NT_H_
-
-/*-------------------------------------------------------------------------
- *
- * Defines
- *
- *-----------------------------------------------------------------------*/
-
-#define MAGT_MIB_PREFIX_LEN MIB_OidPrefix.idLength
-#define MAGT_MAX_STRING_LEN 255
-
-#define MAGT_MIB_ACCESS_READ 0
-#define MAGT_MIB_ACCESS_WRITE 1
-#define MAGT_MIB_ACCESS_READWRITE 2
-
-#define MAGT_MIB_ACTION_GET ASN_RFC1157_GETREQUEST
-#define MAGT_MIB_ACTION_SET ASN_RFC1157_SETREQUEST
-#define MAGT_MIB_ACTION_GETNEXT ASN_RFC1157_GETNEXTREQUEST
-
-/*
- * Macro to determine number of sub-oids in array.
- */
-#define MAGT_OID_SIZEOF(Oid) (sizeof Oid / sizeof(UINT))
-
-/*
- * Unique ID for each entry in the MIB.
- */
-enum
-{
- MAGT_ID_DESC = 0,
- MAGT_ID_VERS,
- MAGT_ID_ORG,
- MAGT_ID_LOC,
- MAGT_ID_CONTACT,
- MAGT_ID_NAME,
- /* operations table attrs */
- MAGT_ID_ANONYMOUS_BINDS,
- MAGT_ID_UNAUTH_BINDS,
- MAGT_ID_SIMPLE_AUTH_BINDS,
- MAGT_ID_STRONG_AUTH_BINDS ,
- MAGT_ID_BIND_SECURITY_ERRORS,
- MAGT_ID_IN_OPS,
- MAGT_ID_READ_OPS,
- MAGT_ID_COMPARE_OPS,
- MAGT_ID_ADD_ENTRY_OPS,
- MAGT_ID_REMOVE_ENTRY_OPS,
- MAGT_ID_MODIFY_ENTRY_OPS,
- MAGT_ID_MODIFY_RDN_OPS,
- MAGT_ID_LIST_OPS,
- MAGT_ID_SEARCH_OPS,
- MAGT_ID_ONE_LEVEL_SEARCH_OPS,
- MAGT_ID_WHOLE_SUBTREE_SEARCH_OPS,
- MAGT_ID_REFERRALS,
- MAGT_ID_CHAININGS,
- MAGT_ID_SECURITY_ERRORS,
- MAGT_ID_ERRORS,
- /* entries table attrs */
- MAGT_ID_MASTER_ENTRIES,
- MAGT_ID_COPY_ENTRIES,
- MAGT_ID_CACHE_ENTRIES,
- MAGT_ID_CACHE_HITS,
- MAGT_ID_SLAVE_HITS,
- /* interaction table entries */
- MAGT_ID_DS_NAME,
- MAGT_ID_TIME_OF_CREATION,
- MAGT_ID_TIME_OF_LAST_ATTEMPT,
- MAGT_ID_TIME_OF_LAST_SUCCESS,
- MAGT_ID_FAILURES_SINCE_LAST_SUCCESS,
- MAGT_ID_FAILURES,
- MAGT_ID_SUCCESSES,
- MAGT_ID_URL,
- /* applIndex */
- MAGT_ID_APPLINDEX
-};
-
-/*-------------------------------------------------------------------------
- *
- * Types
- *
- *-----------------------------------------------------------------------*/
-
-typedef struct MagtMibEntry
-{
- AsnObjectIdentifier Oid;
- void *Storage;
- BYTE Type;
- UINT Access;
- UINT (*MibFunc)(UINT, struct MagtMibEntry *, RFC1157VarBind *);
- struct MagtMibEntry *MibNext;
- UINT uId;
-} MagtMibEntry_t;
-
-#include "nsldapagt_nt.h"
-/*-------------------------------------------------------------------------
- *
- * Prototypes
- *
- *-----------------------------------------------------------------------*/
-
-int MagtFillTrapVars(int trapType,
- RFC1157VarBind * trapVars,
- MagtStaticInfo_t * pCfgInfo);
-
-UINT MagtMIBLeafFunc(IN UINT Action,
- IN MagtMibEntry_t *MibPtr,
- IN RFC1157VarBind *VarBind);
-
-UINT MagtResolveVarBind(IN OUT RFC1157VarBind *VarBind,
- IN UINT PduAction);
-
-int Mib_init(MagtMibEntry_t **Mib, int ApplIndex);
-#endif /* __NSLDAPMIB_NT_H_ */
diff --git a/lib/base/eventlog.cpp b/lib/base/eventlog.cpp
deleted file mode 100644
index 7144edd..0000000
--- a/lib/base/eventlog.cpp
+++ /dev/null
@@ -1,106 +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 **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-// //
-// Name: EVENTLOG //
-// Platforms: WIN32 //
-// ...................................................................... //
-// Revision History: //
-// 01-12-95 Initial Version, Aruna Victor (aruna(a)netscape.com) //
-// 12-02-96 Code cleanup, Andy Hakim (ahakim(a)netscape.com) //
-// - consolidated admin and http functions into one //
-// - moved registry modification code to installer //
-// - removed several unecessary functions //
-// - changed function parameters to existing functions //
-// //
-//--------------------------------------------------------------------------//
-
-#include <windows.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include "netsite.h"
-#include "base/eventlog.h"
-#include <nt/regparms.h>
-#include <nt/messages.h>
-
-HANDLE ghEventSource;
-
-NSPR_BEGIN_EXTERN_C
-
-NSAPI_PUBLIC HANDLE InitializeLogging(char *szEventLogName)
-{
- ghEventSource = RegisterEventSource(NULL, szEventLogName);
- return ghEventSource;
-}
-
-
-
-NSAPI_PUBLIC BOOL TerminateLogging(HANDLE hEventSource)
-{
- BOOL bReturn = FALSE;
- if(hEventSource == NULL)
- hEventSource = ghEventSource;
- if(hEventSource)
- bReturn = DeregisterEventSource(hEventSource);
- return(bReturn);
-}
-
-
-
-NSAPI_PUBLIC BOOL LogErrorEvent(HANDLE hEventSource, WORD fwEventType, WORD fwCategory, DWORD IDEvent, LPTSTR chMsg, LPTSTR lpszMsg)
-{
- BOOL bReturn = FALSE;
- LPTSTR lpszStrings[2];
-
- lpszStrings[0] = chMsg;
- lpszStrings[1] = lpszMsg;
-
- if(hEventSource == NULL)
- hEventSource = ghEventSource;
-
- if(hEventSource)
- bReturn = ReportEvent(hEventSource, fwEventType, fwCategory,
- IDEvent, NULL, 2, 0, (LPCTSTR *)lpszStrings, NULL);
- return(bReturn);
-}
-
-NSPR_END_EXTERN_C
diff --git a/lib/base/nterrors.cpp b/lib/base/nterrors.cpp
deleted file mode 100644
index 68c31fe..0000000
--- a/lib/base/nterrors.cpp
+++ /dev/null
@@ -1,120 +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 **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/*
- * nterrors.c: Conversion of error numbers to explanation strings
- *
- * Aruna Victor 12/6/95
- */
-
-
-#include <windows.h>
-#include <stdio.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <netsite.h>
-#include <base/nterrors.h>
-#include <base/nterr.h>
-
-struct _NtHashedError {
- int ErrorNumber;
- char *ErrorString;
- struct _NtHashedError *next;
-} ;
-
-typedef struct _NtHashedError NtHashedError;
-
-NtHashedError *hashedNtErrors[200];
-
-#define HASH_ERROR_MODULUS 199
-#define DEFAULT_ERROR_STRING "Error Number is unknown"
-
-char *
-FindError(int error)
-{
- NtHashedError *tmp;
-
- int hashValue = error % HASH_ERROR_MODULUS;
- tmp = hashedNtErrors[hashValue];
-
- while(tmp) {
- if (tmp->ErrorNumber == error) {
- return tmp->ErrorString;
- }
- tmp = tmp->next;
- }
- return(DEFAULT_ERROR_STRING);
-}
-
-void
-EnterError(NtHashedError *error)
-{
- NtHashedError *tmp;
- int hashValue;
- int number = 199;
-
- hashValue = error->ErrorNumber % HASH_ERROR_MODULUS;
-
- if(!(tmp = hashedNtErrors[hashValue])){
- hashedNtErrors[hashValue] = error;
- } else {
- while(tmp->next) {
- tmp = tmp->next;
- }
- tmp->next = error;
- }
-}
-
-void
-HashNtErrors()
-{
- NtHashedError *error;
- int i = 0;
-
- while(NtErrorStrings[i].ErrorString) {
- error = (NtHashedError *)MALLOC(sizeof(NtHashedError));
- error->ErrorNumber = NtErrorStrings[i].ErrorNumber;
- error->ErrorString = NtErrorStrings[i++].ErrorString;
- error->next = NULL;
- EnterError(error);
- }
-}
\ No newline at end of file
8 years, 10 months
ldap/servers
by Richard Allen Megginson
ldap/servers/slapd/libglobs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 538ff19416eaeb54e04c89202fda30f709127678
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Mon Jun 15 12:17:11 2015 -0600
fix MEMPOOL_EXPERIMENTAL build
diff --git a/ldap/servers/slapd/libglobs.c b/ldap/servers/slapd/libglobs.c
index ddc6552..2499c57 100644
--- a/ldap/servers/slapd/libglobs.c
+++ b/ldap/servers/slapd/libglobs.c
@@ -1129,7 +1129,7 @@ static struct config_get_and_set {
CONFIG_ON_OFF, (ConfigGetFunc)config_get_enable_nunc_stans, &init_enable_nunc_stans},
#endif
#ifdef MEMPOOL_EXPERIMENTAL
- ,{CONFIG_MEMPOOL_SWITCH_ATTRIBUTE, config_set_mempool_switch,
+ {CONFIG_MEMPOOL_SWITCH_ATTRIBUTE, config_set_mempool_switch,
NULL, 0,
(void**)&global_slapdFrontendConfig.mempool_switch,
CONFIG_ON_OFF, (ConfigGetFunc)config_get_mempool_switch,
8 years, 10 months
ldap/servers
by Richard Allen Megginson
ldap/servers/slapd/libglobs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
New commits:
commit a9263e3fa9d50d469e204fbc4581860c46e7d3b5
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Mon Jun 15 10:47:22 2015 -0600
fix build with nunc-stans
diff --git a/ldap/servers/slapd/libglobs.c b/ldap/servers/slapd/libglobs.c
index 968f0f5..ddc6552 100644
--- a/ldap/servers/slapd/libglobs.c
+++ b/ldap/servers/slapd/libglobs.c
@@ -1123,10 +1123,10 @@ static struct config_get_and_set {
(void**)&global_slapdFrontendConfig.maxsimplepaged_per_conn,
CONFIG_INT, (ConfigGetFunc)config_get_maxsimplepaged_per_conn, DEFAULT_MAXSIMPLEPAGED_PER_CONN_STR},
#ifdef ENABLE_NUNC_STANS
- ,{CONFIG_ENABLE_NUNC_STANS, config_set_enable_nunc_stans,
+ {CONFIG_ENABLE_NUNC_STANS, config_set_enable_nunc_stans,
NULL, 0,
(void**)&global_slapdFrontendConfig.enable_nunc_stans,
- CONFIG_ON_OFF, (ConfigGetFunc)config_get_enable_nunc_stans, &init_enable_nunc_stans}
+ CONFIG_ON_OFF, (ConfigGetFunc)config_get_enable_nunc_stans, &init_enable_nunc_stans},
#endif
#ifdef MEMPOOL_EXPERIMENTAL
,{CONFIG_MEMPOOL_SWITCH_ATTRIBUTE, config_set_mempool_switch,
8 years, 10 months
config.h.in configure configure.ac include/base include/ldaputil include/libadmin include/netsite.h include/public ldap/include ldap/libraries ldap/servers ldap/systools lib/base lib/ldaputil lib/libaccess lib/libadmin
by Mark Reynolds
config.h.in | 3
configure | 12
configure.ac | 4
include/base/eventlog.h | 14
include/base/file.h | 27
include/base/fsmutex.h | 4
include/base/systems.h | 41
include/ldaputil/cert.h | 4
include/ldaputil/dbconf.h | 4
include/ldaputil/encode.h | 4
include/ldaputil/errors.h | 4
include/ldaputil/extcmap.h | 17
include/ldaputil/ldapauth.h | 4
include/libadmin/libadmin.h | 7
include/netsite.h | 28
include/public/base/systems.h | 32
include/public/nsacl/aclapi.h | 11
include/public/nsapi.h | 57 -
ldap/include/disptmpl.h | 12
ldap/include/ldaplog.h | 31
ldap/include/lthread.h | 58 -
ldap/include/ntslapdregparms.h | 78 -
ldap/include/ntwatchdog.h | 105 --
ldap/include/regex.h | 4
ldap/include/srchpref.h | 12
ldap/libraries/libavl/avl.c | 6
ldap/libraries/libavl/testavl.c | 3
ldap/servers/plugins/acl/acl.h | 5
ldap/servers/plugins/acl/acldllmain.c | 88 -
ldap/servers/plugins/acl/aclplugin.c | 9
ldap/servers/plugins/chainingdb/cb_debug.c | 9
ldap/servers/plugins/chainingdb/cb_init.c | 4
ldap/servers/plugins/chainingdb/cbdllmain.c | 91 -
ldap/servers/plugins/collation/config.c | 2
ldap/servers/plugins/collation/debug.c | 9
ldap/servers/plugins/collation/dllmain.c | 87 -
ldap/servers/plugins/cos/cos.c | 14
ldap/servers/plugins/cos/dllmain.c | 79 -
ldap/servers/plugins/distrib/dllmain.c | 73 -
ldap/servers/plugins/dna/dna.c | 15
ldap/servers/plugins/http/dllmain.c | 79 -
ldap/servers/plugins/http/http_client.c | 31
ldap/servers/plugins/http/http_impl.c | 3
ldap/servers/plugins/pam_passthru/pam_ptdebug.c | 8
ldap/servers/plugins/pam_passthru/pam_ptdllmain.c | 91 -
ldap/servers/plugins/passthru/ptdebug.c | 8
ldap/servers/plugins/passthru/ptdllmain.c | 88 -
ldap/servers/plugins/presence/dllmain.c | 78 -
ldap/servers/plugins/presence/presence.c | 27
ldap/servers/plugins/pwdstorage/crypt_pwd.c | 4
ldap/servers/plugins/pwdstorage/dllmain.c | 73 -
ldap/servers/plugins/pwdstorage/pwd_init.c | 2
ldap/servers/plugins/pwdstorage/pwdstorage.h | 2
ldap/servers/plugins/referint/dllmain.c | 77 -
ldap/servers/plugins/referint/referint.c | 19
ldap/servers/plugins/replication/cl5_api.c | 5
ldap/servers/plugins/replication/cl5_config.c | 9
ldap/servers/plugins/replication/repl.h | 2
ldap/servers/plugins/replication/repl5.h | 5
ldap/servers/plugins/replication/repl_init.c | 8
ldap/servers/plugins/replication/replutil.c | 4
ldap/servers/plugins/retrocl/dllmain.c | 74 -
ldap/servers/plugins/retrocl/retrocl.c | 8
ldap/servers/plugins/rever/dllmain.c | 73 -
ldap/servers/plugins/roles/dllmain.c | 79 -
ldap/servers/plugins/roles/roles_plugin.c | 8
ldap/servers/plugins/statechange/dllmain.c | 79 -
ldap/servers/plugins/statechange/statechange.c | 15
ldap/servers/plugins/syntaxes/debug.c | 8
ldap/servers/plugins/syntaxes/dllmain.c | 89 -
ldap/servers/plugins/uiduniq/7bit.c | 6
ldap/servers/plugins/vattrsp_template/dllmain.c | 78 -
ldap/servers/plugins/vattrsp_template/vattrsp.c | 3
ldap/servers/plugins/views/dllmain.c | 78 -
ldap/servers/plugins/views/views.c | 17
ldap/servers/slapd/abandon.c | 2
ldap/servers/slapd/add.c | 10
ldap/servers/slapd/agtmmap.c | 145 --
ldap/servers/slapd/agtmmap.h | 16
ldap/servers/slapd/attr.c | 2
ldap/servers/slapd/auth.c | 2
ldap/servers/slapd/ava.c | 2
ldap/servers/slapd/back-ldbm/back-ldbm.h | 14
ldap/servers/slapd/back-ldbm/dblayer.c | 42
ldap/servers/slapd/back-ldbm/dllmain.c | 82 -
ldap/servers/slapd/back-ldbm/import-threads.c | 20
ldap/servers/slapd/back-ldbm/init.c | 10
ldap/servers/slapd/back-ldbm/ldbm_bind.c | 166 ---
ldap/servers/slapd/back-ldbm/monitor.c | 22
ldap/servers/slapd/back-ldbm/perfctrs.c | 149 --
ldap/servers/slapd/back-ldif/back-ldif.h | 10
ldap/servers/slapd/back-ldif/dllmain.c | 107 --
ldap/servers/slapd/back-ldif/init.c | 8
ldap/servers/slapd/bind.c | 3
ldap/servers/slapd/ch_malloc.c | 364 -------
ldap/servers/slapd/charray.c | 2
ldap/servers/slapd/compare.c | 2
ldap/servers/slapd/config.c | 10
ldap/servers/slapd/configdse.c | 2
ldap/servers/slapd/connection.c | 1120 ++--------------------
ldap/servers/slapd/conntable.c | 36
ldap/servers/slapd/csngen.c | 7
ldap/servers/slapd/daemon.c | 966 +-----------------
ldap/servers/slapd/delete.c | 2
ldap/servers/slapd/detach.c | 2
ldap/servers/slapd/dn.c | 2
ldap/servers/slapd/dse.c | 3
ldap/servers/slapd/entry.c | 2
ldap/servers/slapd/fe.h | 7
ldap/servers/slapd/fedse.c | 3
ldap/servers/slapd/fileio.c | 268 -----
ldap/servers/slapd/filter.c | 2
ldap/servers/slapd/filterentry.c | 2
ldap/servers/slapd/generation.c | 7
ldap/servers/slapd/getopt_ext.h | 11
ldap/servers/slapd/globals.c | 12
ldap/servers/slapd/init.c | 14
ldap/servers/slapd/intrinsics.h | 37
ldap/servers/slapd/ldaputil.c | 4
ldap/servers/slapd/libglobs.c | 54 -
ldap/servers/slapd/libslapd.def | 2
ldap/servers/slapd/localhost.c | 136 +-
ldap/servers/slapd/lock.c | 16
ldap/servers/slapd/log.c | 180 ---
ldap/servers/slapd/log.h | 6
ldap/servers/slapd/main.c | 179 ---
ldap/servers/slapd/mempool.c | 35
ldap/servers/slapd/modify.c | 4
ldap/servers/slapd/modrdn.c | 2
ldap/servers/slapd/modutil.c | 2
ldap/servers/slapd/monitor.c | 18
ldap/servers/slapd/operation.c | 2
ldap/servers/slapd/opshared.c | 8
ldap/servers/slapd/plugin.c | 12
ldap/servers/slapd/protect_db.c | 252 ----
ldap/servers/slapd/proto-slap.h | 17
ldap/servers/slapd/pw.c | 6
ldap/servers/slapd/result.c | 2
ldap/servers/slapd/saslbind.c | 2
ldap/servers/slapd/slap.h | 52 -
ldap/servers/slapd/snmp_collator.c | 157 +--
ldap/servers/slapd/ssl.c | 144 --
ldap/servers/slapd/start_tls_extop.c | 48
ldap/servers/slapd/str2filter.c | 2
ldap/servers/slapd/stubs.c | 9
ldap/servers/slapd/task.c | 7
ldap/servers/slapd/test-plugins/dllmain.c | 84 -
ldap/servers/slapd/test-plugins/testbind.c | 3
ldap/servers/slapd/test-plugins/testdatainterop.c | 3
ldap/servers/slapd/test-plugins/testentry.c | 6
ldap/servers/slapd/test-plugins/testextendedop.c | 3
ldap/servers/slapd/test-plugins/testgetip.c | 5
ldap/servers/slapd/test-plugins/testpostop.c | 20
ldap/servers/slapd/test-plugins/testpreop.c | 3
ldap/servers/slapd/test-plugins/testsaslbind.c | 3
ldap/servers/slapd/time.c | 38
ldap/servers/slapd/tools/dbscan.c | 10
ldap/servers/slapd/tools/ldaptool-sasl.c | 33
ldap/servers/slapd/tools/ldclt/data.c | 95 -
ldap/servers/slapd/tools/ldclt/ldapfct.c | 191 ---
ldap/servers/slapd/tools/ldclt/ldclt.c | 146 --
ldap/servers/slapd/tools/ldclt/parser.c | 59 -
ldap/servers/slapd/tools/ldclt/port.c | 212 ----
ldap/servers/slapd/tools/ldclt/port.h | 28
ldap/servers/slapd/tools/ldclt/scalab01.c | 72 -
ldap/servers/slapd/tools/ldclt/threadMain.c | 93 -
ldap/servers/slapd/tools/ldclt/workarounds.c | 4
ldap/servers/slapd/tools/ldif.c | 9
ldap/servers/slapd/tools/migratecred.c | 35
ldap/servers/slapd/tools/mmldif.c | 17
ldap/servers/slapd/tools/pwenc.c | 16
ldap/servers/slapd/tools/rsearch/addthread.c | 2
ldap/servers/slapd/tools/rsearch/main.c | 3
ldap/servers/slapd/tools/rsearch/nametable.c | 14
ldap/servers/slapd/tools/rsearch/rsearch.c | 2
ldap/servers/slapd/tools/rsearch/searchthread.c | 2
ldap/servers/slapd/unbind.c | 2
ldap/servers/slapd/uniqueidgen.c | 4
ldap/servers/slapd/util.c | 64 -
ldap/servers/slapd/uuid.c | 7
ldap/servers/slapd/uuid.h | 5
ldap/servers/snmp/ntagt/msrvdefs.mak | 11
ldap/systools/idsktune.c | 86 -
lib/base/dns.cpp | 6
lib/base/dnsdmain.cpp | 9
lib/base/file.cpp | 287 -----
lib/base/fsmutex.cpp | 44
lib/base/net.cpp | 6
lib/base/shexp.cpp | 8
lib/base/system.cpp | 4
lib/base/systhr.cpp | 92 -
lib/base/util.cpp | 8
lib/ldaputil/dbconf.c | 46
lib/ldaputil/init.c | 9
lib/libaccess/acl.yy.cpp | 4
lib/libaccess/aclscan.l | 4
lib/libaccess/lasdns.cpp | 7
lib/libaccess/permhash.h | 4
lib/libadmin/error.c | 22
lib/libadmin/util.c | 13
200 files changed, 497 insertions(+), 8828 deletions(-)
New commits:
commit 003651c23272437aae5177de22138dec3695fd09
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Mon Jun 15 12:03:25 2015 -0400
Ticket 47998 - cleanup WINDOWS ifdef's
Description: Remove all the windows specific code (#ifdef's, etc)
https://fedorahosted.org/389/ticket/47998
Reviewed by: rmeggins & nhosoi(Thanks!!)
diff --git a/config.h.in b/config.h.in
index 762cbf7..041a18f 100644
--- a/config.h.in
+++ b/config.h.in
@@ -423,9 +423,6 @@
/* package version */
#undef VERSION
-/* UNIX */
-#undef XP_UNIX
-
/* GNU Source */
#undef _GNU_SOURCE
diff --git a/configure b/configure
index 8d8ca08..7d14f33 100755
--- a/configure
+++ b/configure
@@ -18454,9 +18454,6 @@ sttyexec=/bin/stty
case $host in
*-*-linux*)
-$as_echo "#define XP_UNIX 1" >>confdefs.h
-
-
$as_echo "#define Linux 1" >>confdefs.h
@@ -18566,9 +18563,6 @@ $as_echo "#define USE_POSIX_RWLOCKS 1" >>confdefs.h
;;
ia64-hp-hpux*)
-$as_echo "#define XP_UNIX 1" >>confdefs.h
-
-
$as_echo "#define hpux 1" >>confdefs.h
@@ -18604,9 +18598,6 @@ $as_echo "#define _INCLUDE_STDC__SOURCE_199901 1" >>confdefs.h
;;
hppa*-hp-hpux*)
-$as_echo "#define XP_UNIX 1" >>confdefs.h
-
-
$as_echo "#define hpux 1" >>confdefs.h
@@ -18645,9 +18636,6 @@ $as_echo "#define ATOMIC_64BIT_OPERATIONS 1" >>confdefs.h
;;
*-*-solaris*)
-$as_echo "#define XP_UNIX 1" >>confdefs.h
-
-
$as_echo "#define SVR4 1" >>confdefs.h
diff --git a/configure.ac b/configure.ac
index c151870..b65b217 100644
--- a/configure.ac
+++ b/configure.ac
@@ -527,7 +527,6 @@ fi
sttyexec=/bin/stty
case $host in
*-*-linux*)
- AC_DEFINE([XP_UNIX], [1], [UNIX])
AC_DEFINE([Linux], [1], [Linux])
AC_DEFINE([LINUX], [1], [Linux])
AC_DEFINE([LINUX2_0], [1], [Linux 2.0])
@@ -571,7 +570,6 @@ case $host in
AC_DEFINE([USE_POSIX_RWLOCKS], [1], [POSIX rwlocks])
;;
ia64-hp-hpux*)
- AC_DEFINE([XP_UNIX], [1], [UNIX])
AC_DEFINE([hpux], [1], [HP-UX])
AC_DEFINE([HPUX], [1], [HP-UX])
AC_DEFINE([HPUX11], [1], [HP-UX 11])
@@ -589,7 +587,6 @@ case $host in
initdir=/init.d
;;
hppa*-hp-hpux*)
- AC_DEFINE([XP_UNIX], [1], [UNIX])
AC_DEFINE([hpux], [1], [HP-UX])
AC_DEFINE([HPUX], [1], [HP-UX])
AC_DEFINE([HPUX11], [1], [HP-UX 11])
@@ -608,7 +605,6 @@ case $host in
initdir=/init.d
;;
*-*-solaris*)
- AC_DEFINE([XP_UNIX], [1], [UNIX])
AC_DEFINE([SVR4], [1], [SVR4])
AC_DEFINE([__svr4], [1], [SVR4])
AC_DEFINE([__svr4__], [1], [SVR4])
diff --git a/include/base/eventlog.h b/include/base/eventlog.h
index 5e6c6ac..bd75eb8 100644
--- a/include/base/eventlog.h
+++ b/include/base/eventlog.h
@@ -54,18 +54,4 @@
#include "netsite.h"
-
-#if defined(XP_WIN32)
-
-NSPR_BEGIN_EXTERN_C
-
-NSAPI_PUBLIC HANDLE InitializeLogging(char *szEventLogName);
-NSAPI_PUBLIC BOOL TerminateLogging(HANDLE hEventSource);
-NSAPI_PUBLIC BOOL LogErrorEvent(HANDLE hEventSource, WORD fwEventType, WORD fwCategory, DWORD IDEvent, LPTSTR chMsg, LPTSTR lpszMsg);
-
-NSPR_END_EXTERN_C
-
-#endif /* XP_WIN32 */
-
-
#endif
diff --git a/include/base/file.h b/include/base/file.h
index 6ad9fc7..9bb7e1b 100644
--- a/include/base/file.h
+++ b/include/base/file.h
@@ -80,11 +80,6 @@ NSAPI_PUBLIC int INTsystem_tlock(SYS_FILE fd);
NSAPI_PUBLIC int INTsystem_flock(SYS_FILE fd);
NSAPI_PUBLIC int INTsystem_ulock(SYS_FILE fd);
-#ifdef XP_WIN32
-NSAPI_PUBLIC SYS_DIR INTdir_open(char *path);
-NSAPI_PUBLIC SYS_DIRENT *INTdir_read(SYS_DIR ds);
-NSAPI_PUBLIC void INTdir_close(SYS_DIR ds);
-#endif /* XP_WIN32 */
/* --- OBSOLETE ----------------------------------------------------------
* The following macros/functions are obsolete and are only maintained for
@@ -92,14 +87,6 @@ NSAPI_PUBLIC void INTdir_close(SYS_DIR ds);
* -----------------------------------------------------------------------
*/
-#ifdef XP_WIN32
-NSAPI_PUBLIC char *INTsystem_winsockerr(void);
-NSAPI_PUBLIC char *INTsystem_winerr(void);
-NSAPI_PUBLIC int INTsystem_pread(SYS_FILE fd, char *buf, int sz);
-NSAPI_PUBLIC int INTsystem_pwrite(SYS_FILE fd, char *buf, int sz);
-NSAPI_PUBLIC void INTfile_unix2local(char *path, char *p2);
-#endif /* XP_WIN32 */
-
NSAPI_PUBLIC int INTsystem_nocoredumps(void);
NSAPI_PUBLIC int INTfile_setinherit(SYS_FILE fd, int value);
NSAPI_PUBLIC int INTfile_notfound(void);
@@ -124,20 +111,6 @@ NSPR_END_EXTERN_C
#define system_tlock INTsystem_tlock
#define system_flock INTsystem_flock
#define system_ulock INTsystem_ulock
-#ifdef XP_WIN32
-#define dir_open INTdir_open
-#define dir_read INTdir_read
-#define dir_close INTdir_close
-#endif /* XP_WIN32 */
-
-/* Obsolete */
-#ifdef XP_WIN32
-#define system_winsockerr INTsystem_winsockerr
-#define system_winerr INTsystem_winerr
-#define system_pread INTsystem_pread
-#define system_pwrite INTsystem_pwrite
-#define file_unix2local INTfile_unix2local
-#endif /* XP_WIN32 */
#define system_nocoredumps INTsystem_nocoredumps
#define file_setinherit INTfile_setinherit
diff --git a/include/base/fsmutex.h b/include/base/fsmutex.h
index 5eca55c..f321c73 100644
--- a/include/base/fsmutex.h
+++ b/include/base/fsmutex.h
@@ -94,15 +94,11 @@ NSAPI_PUBLIC FSMUTEX fsmutex_init(char *name, int number, int flags);
Sets the ownership of the underlying filesystem object to the given
uid and gid. Only effective if the server is running as root.
*/
-#ifdef XP_UNIX
#include <unistd.h>
#ifdef __sony
#include <sys/types.h>
#endif
NSAPI_PUBLIC void fsmutex_setowner(FSMUTEX fsm, uid_t uid, gid_t gid);
-#endif
-
-
/*
fsmutex_terminate deletes a filesystem-based mutex. A mutex will only
diff --git a/include/base/systems.h b/include/base/systems.h
index 5703547..044cb83 100644
--- a/include/base/systems.h
+++ b/include/base/systems.h
@@ -438,46 +438,9 @@
#define SA_HANDLER_T(x) (void (*)(int))x
#endif
-#elif defined (XP_WIN32) /* Windows NT */
-
-#include <wtypes.h>
-#include <winbase.h>
-
-typedef void* PASSWD;
-
-#define ACCELERATOR_CACHE
-#define AUTH_DBM
-/* size has been raised to 200 with NT 4.0 server; NT 4.0 workstation is still
- * limited
- */
-#define DAEMON_LISTEN_SIZE 200
-#define DAEMON_WIN32
-#define DLL_CAPABLE
-#define DLL_WIN32
-#define DNS_CACHE
-#define LOG_BUFFERING
-#define HAVE_STRFTIME /* no cftime */
-#define NEED_CRYPT_PROTO
-#define NEEDS_WRITEV
-#define NET_SOCKETS
-#ifndef NO_DOMAINNAME
-#define NO_DOMAINNAME
-#endif
-#ifdef BUILD_DLL
-#define NSAPI_PUBLIC __declspec(dllexport)
#else
-#define NSAPI_PUBLIC
-#endif /* BUILD_DLL */
-#define THREAD_ANY
-#define THREAD_NSPR_KERNEL
-#define USE_NSPR
-#define USE_STRFTIME /* no cftime */
-
-#else
-
#error "Missing defines in ns/netsite/include/base/systems.h"
-
-#endif /* Windows NT */
+#endif
/* Pick up the configuration symbols in the public interface */
#ifndef PUBLIC_BASE_SYSTEMS_H
@@ -513,7 +476,6 @@ typedef void* PASSWD;
/* NS_MAIL builds sec-key.c which calls systhread_init, which requires */
/* that USE_NSPR is defined when systhr.c is compiled. --lachman */
/* MCC_PROXY does the same thing now --nbreslow -- LIKE HELL --ari */
-#if defined(XP_UNIX)
#define USE_NSPR
/* XXXrobm This is UNIX-only for the moment */
#define LOG_BUFFERING
@@ -527,7 +489,6 @@ typedef void* PASSWD;
#endif /* IRIX */
#endif /* SW_THREADS */
#define THREAD_ANY
-#endif /* XP_UNIX */
/* --- End the great debate --- */
diff --git a/include/ldaputil/cert.h b/include/ldaputil/cert.h
index 051940c..403866f 100644
--- a/include/ldaputil/cert.h
+++ b/include/ldaputil/cert.h
@@ -44,12 +44,8 @@
#define _LDAPU_CERT_H
#ifndef NSAPI_PUBLIC
-#ifdef XP_WIN32
-#define NSAPI_PUBLIC __declspec(dllexport)
-#else
#define NSAPI_PUBLIC
#endif
-#endif
#ifdef __cplusplus
extern "C" {
diff --git a/include/ldaputil/dbconf.h b/include/ldaputil/dbconf.h
index b6dd1ed..2655f36 100644
--- a/include/ldaputil/dbconf.h
+++ b/include/ldaputil/dbconf.h
@@ -46,12 +46,8 @@
#include <stdio.h>
#ifndef NSAPI_PUBLIC
-#ifdef XP_WIN32
-#define NSAPI_PUBLIC __declspec(dllexport)
-#else
#define NSAPI_PUBLIC
#endif
-#endif
typedef struct dbconf_propval {
char *prop; /* Property name */
diff --git a/include/ldaputil/encode.h b/include/ldaputil/encode.h
index 5aa63b7..a2e7082 100644
--- a/include/ldaputil/encode.h
+++ b/include/ldaputil/encode.h
@@ -44,12 +44,8 @@
#define _LDAPU_ENCODE_H
#ifndef NSAPI_PUBLIC
-#ifdef XP_WIN32
-#define NSAPI_PUBLIC __declspec(dllexport)
-#else
#define NSAPI_PUBLIC
#endif
-#endif
#ifdef __cplusplus
extern "C" {
diff --git a/include/ldaputil/errors.h b/include/ldaputil/errors.h
index 7b36a47..0b7f9b8 100644
--- a/include/ldaputil/errors.h
+++ b/include/ldaputil/errors.h
@@ -44,12 +44,8 @@
#define _LDAPU_ERRORS_H
#ifndef NSAPI_PUBLIC
-#ifdef XP_WIN32
-#define NSAPI_PUBLIC __declspec(dllexport)
-#else
#define NSAPI_PUBLIC
#endif
-#endif
#ifdef DBG_PRINT
#include <stdio.h>
diff --git a/include/ldaputil/extcmap.h b/include/ldaputil/extcmap.h
index 0327135..320376e 100644
--- a/include/ldaputil/extcmap.h
+++ b/include/ldaputil/extcmap.h
@@ -46,12 +46,8 @@
#include <ldap.h>
#ifndef NSAPI_PUBLIC
-#if defined( _WINDOWS ) || defined( _WIN32 ) || defined( XP_WIN32 )
-#define NSAPI_PUBLIC __declspec(dllexport)
-#else
#define NSAPI_PUBLIC
#endif
-#endif
#define LDAPU_ATTR_INITFN "InitFn"
@@ -311,20 +307,9 @@ NSAPI_PUBLIC extern int CertMapDLLInitFn(LDAPUDispatchVector_t **table);
extern LDAPUDispatchVector_t *__ldapu_table;
-#if defined( _WINDOWS ) || defined( _WIN32 ) || defined( XP_WIN32 )
-#define CertmapDLLInitFnTbl LDAPUDispatchVector_t *__ldapu_table;
-#define CertmapDLLInit(rv, libname) \
-{\
- HANDLE h = LoadLibrary((libname)); \
- CertMapDLLInitFn_t init_fn; \
- if (!h) return LDAPU_CERT_MAP_INITFN_FAILED; \
- init_fn = (CertMapDLLInitFn_t)GetProcAddress(h, "CertMapDLLInitFn"); \
- rv = init_fn(&__ldapu_table); \
-}
-#else
#define CertmapDLLInit(rv, libname)
#define CertmapDLLInitFnTbl
-#endif
+
#endif /* INTLDAPU */
diff --git a/include/ldaputil/ldapauth.h b/include/ldaputil/ldapauth.h
index fc1ab93..b3fa511 100644
--- a/include/ldaputil/ldapauth.h
+++ b/include/ldaputil/ldapauth.h
@@ -47,12 +47,8 @@
#include <ldap.h>
#ifndef NSAPI_PUBLIC
-#ifdef XP_WIN32
-#define NSAPI_PUBLIC __declspec(dllexport)
-#else
#define NSAPI_PUBLIC
#endif
-#endif
#ifdef __cplusplus
extern "C" {
diff --git a/include/libadmin/libadmin.h b/include/libadmin/libadmin.h
index 05d0b09..a0fad68 100644
--- a/include/libadmin/libadmin.h
+++ b/include/libadmin/libadmin.h
@@ -51,17 +51,10 @@
#include <stdio.h>
#include <limits.h>
-
#include "base/systems.h"
#include "base/systhr.h"
#include "base/util.h"
-
-#ifdef XP_UNIX
#include <unistd.h>
-#else /* XP_WIN32 */
-#include <winsock.h>
-#endif /* XP_WIN32 */
-
#include "prinit.h"
#include "prthread.h"
#include "prlong.h"
diff --git a/include/netsite.h b/include/netsite.h
index 2bdfc8d..9147430 100644
--- a/include/netsite.h
+++ b/include/netsite.h
@@ -78,38 +78,10 @@
#define VOID void
#endif
-#ifdef XP_UNIX
-/*
- * Provide some typedefs that are commonly used on windows
- *
- * DO NOT USE THESE! They will be deleted later!
- *
- */
-#define CONST const
-typedef unsigned long DWORD;
-typedef int BOOL;
-typedef unsigned char BYTE;
-typedef unsigned short WORD;
-typedef float FLOAT;
-typedef FLOAT *PFLOAT;
-typedef BOOL *PBOOL;
-typedef BOOL *LPBOOL;
-typedef BYTE *PBYTE;
-typedef BYTE *LPBYTE;
-typedef int *PINT;
-typedef int *LPINT;
-typedef WORD *PWORD;
-typedef WORD *LPWORD;
-typedef long *LPLONG;
-typedef DWORD *PDWORD;
-typedef DWORD *LPDWORD;
-typedef void *LPVOID;
-
#ifndef SNI
#if !defined (boolean) && !defined (__GNUC__)
typedef int boolean;
#endif
-#endif
#endif
#define NS_TRUE 1
diff --git a/include/public/base/systems.h b/include/public/base/systems.h
index fc9b045..cfd1388 100644
--- a/include/public/base/systems.h
+++ b/include/public/base/systems.h
@@ -212,41 +212,11 @@
#define SHMEM_UNIX_MMAP
#define ZERO(ptr,len) memset(ptr,0,len)
-#elif defined (XP_WIN32) /* Windows NT */
-
-#include <wtypes.h>
-#include <winbase.h>
-
-typedef void* PASSWD;
-
-#define caddr_t PCHAR
-#define CASECMPARG_T const
-#define FILE_WIN32
-#define FILE_WIN32_MMAP
-#define MALLOC_POOLS
-#define NEED_STRCASECMP
-#define NEED_STRNCASECMP
-#define NET_WINSOCK
-#define NSAPI_PUBLIC __declspec(dllexport)
-/* The stat call under NT doesn't define these macros */
-#ifndef S_ISDIR
-#define S_ISDIR(mode) ((mode&S_IFMT) == S_IFDIR)
-#endif
-#ifndef S_ISREG
-#define S_ISREG(mode) ((mode&S_IFMT) == S_IFREG)
-#endif
-#ifndef S_ISLNK
-#define S_ISLNK(x) (0)
-#endif
-#define SEM_WIN32
-#define SHMEM_WIN32_MMAP
-#define ZERO(ptr, len) ZeroMemory(ptr, len)
-
#else
#error "Missing defines in ns/netsite/include/public/base/systems.h"
-#endif /* Windows NT */
+#endif
#ifndef NSPR_BEGIN_EXTERN_C
#ifdef __cplusplus
diff --git a/include/public/nsacl/aclapi.h b/include/public/nsacl/aclapi.h
index e3abb25..e312d99 100644
--- a/include/public/nsacl/aclapi.h
+++ b/include/public/nsacl/aclapi.h
@@ -274,19 +274,8 @@ struct ACLDispatchVector {
int (*f_ACL_GetDefaultResult)(ACLEvalHandle_t *acleval);
};
-#ifdef XP_WIN32
-
-#ifdef INTNSACL
-NSAPI_PUBLIC extern ACLDispatchVector_t *__nsacl_table;
-#else
-__declspec(dllimport) ACLDispatchVector_t *__nsacl_table;
-#endif /* INTNSACL */
-
-#else /* !XP_WIN32 */
-
NSAPI_PUBLIC extern ACLDispatchVector_t *__nsacl_table;
-#endif /* XP_WIN32 */
#ifndef INTNSACL
diff --git a/include/public/nsapi.h b/include/public/nsapi.h
index c3f1748..5dde361 100644
--- a/include/public/nsapi.h
+++ b/include/public/nsapi.h
@@ -63,11 +63,7 @@
/* Used in some places as a length limit on error messages */
#define MAGNUS_ERROR_LEN 1024
-#ifdef XP_WIN32
-#define ENDLINE "\r\n"
-#else
#define ENDLINE "\n"
-#endif
/*
* The maximum length of an error message. NOT RUN-TIME CHECKED
@@ -134,17 +130,9 @@
/* The disk page size on this machine. */
#define FILE_BUFFERSIZE 4096
-#ifdef XP_UNIX
-
#define FILE_PATHSEP '/'
#define FILE_PARENT "../"
-#elif defined(XP_WIN32)
-
-#define FILE_PATHSEP '/'
-#define FILE_PARENT "..\\"
-
-#endif /* XP_WIN32 */
/* WILDPAT uses shell expressions */
#define WILDPAT_VALID(exp) shexp_valid(exp)
@@ -174,17 +162,6 @@
#include <unistd.h>
#endif
-#ifdef FILE_WIN32
-#include <direct.h>
-#endif /* FILE_WIN32 */
-
-#ifdef NET_WINSOCK
-#include <winsock.h>
-struct iovec {
- char *iov_base;
- unsigned iov_len;
-};
-#else
#if !defined(SUNOS4) && !defined(HPUX) && !defined(LINUX)
#include <sys/select.h>
#endif
@@ -192,10 +169,7 @@ struct iovec {
#include <sys/socket.h>
#include <netinet/in.h> /* sockaddr and in_addr */
#include <sys/uio.h>
-#endif /* NET_WINSOCK */
-
#include <sys/stat.h>
-
#include <ctype.h> /* isspace */
#include <stdio.h>
#include <stdarg.h>
@@ -203,11 +177,8 @@ struct iovec {
#include <string.h>
#include <errno.h>
#include <time.h>
-
-#ifdef XP_UNIX
#include <dirent.h>
#include <pwd.h> /* struct passwd */
-#endif /* XP_UNIX */
#ifndef BIG_LINE
#define BIG_LINE 1024
@@ -228,28 +199,8 @@ typedef void *SYS_FILE;
typedef void* CONDVAR;
typedef void *COUNTING_SEMAPHORE;
typedef void* CRITICAL;
-
-#ifdef XP_UNIX
typedef DIR* SYS_DIR;
typedef struct dirent SYS_DIRENT;
-#endif /* XP_UNIX */
-
-#ifdef XP_WIN32
-
-typedef struct {
- char *d_name;
-} dirent_s;
-
-typedef struct {
- HANDLE dp;
- WIN32_FIND_DATA fdata;
- dirent_s de;
-} dir_s;
-
-typedef dir_s* SYS_DIR;
-typedef dirent_s SYS_DIRENT;
-
-#endif /* XP_WIN32 */
typedef struct {
char *name,*value;
@@ -318,7 +269,6 @@ typedef struct {
#define strncasecmp(s1, s2, n) util_strncasecmp(s1, s2, n)
#endif /* NEED_STRNCASECMP */
-#ifdef XP_UNIX
#define dir_open opendir
#define dir_read readdir
#define dir_close closedir
@@ -326,13 +276,6 @@ typedef struct {
#define dir_remove rmdir
#define system_chdir chdir
#define file_unix2local(path,p2) strcpy(p2,path)
-#endif /* XP_UNIX */
-
-#ifdef XP_WIN32
-#define dir_create _mkdir
-#define dir_remove _rmdir
-#define system_chdir SetCurrentDirectory
-#endif /* XP_WIN32 */
/*
* Thread-safe variant of localtime
diff --git a/ldap/include/disptmpl.h b/ldap/include/disptmpl.h
index 226470c..d326637 100644
--- a/ldap/include/disptmpl.h
+++ b/ldap/include/disptmpl.h
@@ -64,22 +64,10 @@ extern "C" {
/* calling conventions used by library */
#ifndef LDAP_CALL
-#if defined( _WINDOWS ) || defined( _WIN32 )
-#define LDAP_C __cdecl
-#ifndef _WIN32
-#define __stdcall _far _pascal
-#define LDAP_CALLBACK _loadds
-#else
-#define LDAP_CALLBACK
-#endif /* _WIN32 */
-#define LDAP_PASCAL __stdcall
-#define LDAP_CALL LDAP_PASCAL
-#else /* _WINDOWS */
#define LDAP_C
#define LDAP_CALLBACK
#define LDAP_PASCAL
#define LDAP_CALL
-#endif /* _WINDOWS */
#endif /* LDAP_CALL */
#define LDAP_TEMPLATE_VERSION 1
diff --git a/ldap/include/ldaplog.h b/ldap/include/ldaplog.h
index 6ced113..20f0101 100644
--- a/ldap/include/ldaplog.h
+++ b/ldap/include/ldaplog.h
@@ -86,36 +86,6 @@ extern "C" {
# undef LDAPDebug2Args
# undef LDAPDebugLevelIsSet
-# ifdef _WIN32
-# ifndef DONT_DECLARE_SLAPD_LDAP_DEBUG /* see libglobs.c for info */
- extern __declspec(dllimport) int slapd_ldap_debug;
-# endif /* DONT_DECLARE_SLAPD_LDAP_DEBUG */
-# define LDAPDebug( level, fmt, arg1, arg2, arg3 ) \
- { \
- if ( *module_ldap_debug & level ) { \
- slapd_log_error_proc( NULL, fmt, arg1, arg2, arg3 ); \
- } \
- }
-# define LDAPDebug0Args( level, fmt ) \
- { \
- if ( *module_ldap_debug & level ) { \
- slapd_log_error_proc( NULL, fmt ); \
- } \
- }
-# define LDAPDebug1Arg( level, fmt, arg ) \
- { \
- if ( *module_ldap_debug & level ) { \
- slapd_log_error_proc( NULL, fmt, arg ); \
- } \
- }
-# define LDAPDebug2Args( level, fmt, arg1, arg2 ) \
- { \
- if ( *module_ldap_debug & level ) { \
- slapd_log_error_proc( NULL, fmt, arg1, arg2 ); \
- } \
- }
-# define LDAPDebugLevelIsSet( level ) (0 != (*module_ldap_debug & level))
-# else /* Not _WIN32 */
extern int slapd_ldap_debug;
# define LDAPDebug( level, fmt, arg1, arg2, arg3 ) \
{ \
@@ -142,7 +112,6 @@ extern "C" {
} \
}
# define LDAPDebugLevelIsSet( level ) (0 != (slapd_ldap_debug & level))
-# endif /* Win32 */
#endif /* LDAP_DEBUG */
#ifdef __cplusplus
diff --git a/ldap/include/lthread.h b/ldap/include/lthread.h
index bfdd4f3..910adb3 100644
--- a/ldap/include/lthread.h
+++ b/ldap/include/lthread.h
@@ -317,64 +317,6 @@ typedef struct irix_cv {
#else
-#if defined( WIN32_KERNEL_THREADS )
-
-/***********************************
- * *
- * thread definitions for Win32 *
- * *
- ***********************************/
-
-#define _THREAD
-
-#include <windows.h>
-#include <process.h>
-#include "ldap.h"
-#include "ldaplog.h"
-
-typedef void (*VFP)(void *);
-
-/* Win32 threads are preemptive */
-#define PTHREAD_PREEMPTIVE 1
-
-/* thread attributes and thread type */
-typedef int pthread_attr_t;
-typedef HANDLE pthread_t;
-
-/* default attr states */
-#define pthread_mutexattr_default 0
-#define pthread_condattr_default 0
-
-/* thread state - joinable or not */
-#define PTHREAD_CREATE_JOINABLE 0
-#define PTHREAD_CREATE_DETACHED 1
-/* thread scope - who is in scheduling pool */
-#define PTHREAD_SCOPE_PROCESS 0
-#define PTHREAD_SCOPE_SYSTEM 1
-
-/* mutex attributes and mutex type */
-typedef int pthread_mutexattr_t;
-typedef HANDLE pthread_mutex_t;
-
-/* mutex and condition variable scope - process or system */
-#define PTHREAD_SHARE_PRIVATE 0
-#define PTHREAD_SHARE_PROCESS 1
-
-/* condition variable attributes and condition variable type */
-typedef int pthread_condattr_t;
-
-/* simulated condition variable */
-struct win32_cv_waiter {
- pthread_t icvw_pthread;
- struct win32_cv_waiter *icvw_next;
-};
-typedef struct win32_cv {
- pthread_mutex_t icv_mutex;
- pthread_mutex_t *icv_waitermutex;
- struct win32_cv_waiter *icv_waiterq;
-} pthread_cond_t;
-
-#endif /* NATIVE_WIN32_THREADS */
#endif /* sgi sproc */
#endif /* dce pthreads */
#endif /* hp dce pthreads */
diff --git a/ldap/include/ntslapdregparms.h b/ldap/include/ntslapdregparms.h
deleted file mode 100644
index 78eed47..0000000
--- a/ldap/include/ntslapdregparms.h
+++ /dev/null
@@ -1,78 +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 **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/******************************************************
- *
- *
- * ntslapdregparms.h - NT Registry keys for Slapd.
- *
- ******************************************************/
-
-#if defined( _WIN32 )
-
-#if !defined( _NTSLAPDREGPARMS_H_ )
-#define _NTSLAPDREGPARMS_H_
-
-#define COMPANY_KEY "SOFTWARE\\Netscape"
-#define COMPANY_NAME VENDOR
-#define PROGRAM_GROUP_NAME VENDOR
-#define PRODUCT_NAME "slapd"
-#define PRODUCT_BIN "ns-slapd"
-#define SLAPD_EXE "slapd.exe"
-#define SERVICE_EXE SLAPD_EXE
-#define SLAPD_CONF "slapd.conf"
-#define MAGNUS_CONF SLAPD_CONF
-#define SLAPD_DONGLE_FILE "password.dng"
-#define DONGLE_FILE_NAME SLAPD_DONGLE_FILE
-#define PRODUCT_VERSION "1.0"
-#define EVENTLOG_APPNAME VENDOR "Slapd"
-#define DIRECTORY_SERVICE_PREFIX CAPBRAND " Directory Server "
-#define SERVICE_PREFIX DIRECTORY_SERVICE_PREFIX
-#define CONFIG_PATH_KEY "ConfigurationPath"
-#define EVENTLOG_MESSAGES_KEY "EventMessageFile"
-#define EVENT_LOG_KEY "SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application"
-#define ADMIN_REGISTRY_ROOT_KEY "Admin Server"
-#define SLAPD_REGISTRY_ROOT_KEY "Slapd Server"
-#define PRODUCT_KEY SLAPD_REGISTRY_ROOT_KEY
-#endif /* _NTSLAPDREGPARMS_H_ */
-
-#endif /* _WIN32 */
diff --git a/ldap/include/ntwatchdog.h b/ldap/include/ntwatchdog.h
deleted file mode 100644
index 0c8be74..0000000
--- a/ldap/include/ntwatchdog.h
+++ /dev/null
@@ -1,105 +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 **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/******************************************************
- *
- *
- * ntwatchdog.h - Defs for NT Watchdog Service.
- *
- ******************************************************/
-
-#if defined( _WIN32 )
-
-#if !defined( _NTWATCHDOG_H_ )
-#define _NTWATCHDOG_H_
-
-#define FILE_PATHSEP '/'
-
-#define SLAPD_ROOT "SLAPD_ROOT" // environment variable holding server root path
-#define MORTALITY_KEY "MortalityTimeSecs"
-#define MINRAMFREE_KEY "MinRamFree"
-#define MINRAMTOTAL_KEY "MinRamTotal"
-#define MINRAMPERSERVER_KEY "MinRamPerServer"
-#define DEFAULT_MORTALITY_TIME 60 // seconds after startup up until server will NOT be restarted
-#define DEFAULT_KILL_TIME 600 // seconds to wait for httpd.exe to shutdown
-#define DEFAULT_CRON_TIME 60 // seconds to wait before rechecking cron.conf
-#define DEFAULT_RESTART_TIME 10 // seconds to wait before restarting server
-#define DEFAULT_MINRAMFREE 0 // KB free physical memory remaining
-#define DEFAULT_MINRAMTOTAL (30 * 1024) // KB free physical memory installed
-#define DEFAULT_MINRAMPERSERVER (15 * 1024) // KB free physical memory per server
-
-#define MSG_RESOURCES "Not enough physical memory to start server."
-
-// offsets for extra window bytes, used in Set/GetWindowLong()
-#define GWL_PROCESS_HANDLE (sizeof(LONG) * 0)
-#define GWL_PASSWORD_ADDR (sizeof(LONG) * 1)
-#define GWL_PASSWORD_LENGTH (sizeof(LONG) * 2)
-
-#define MAX_LINE 512
-#define MAX_PASSWORD 256
-#define MAX_TOKENNAME 50
-
-typedef struct PK11_PIN
-{
- char TokenName[MAX_TOKENNAME];
- int TokenLength;
- char Password[MAX_PASSWORD];
- int PasswordLength;
-}PK11_PIN;
-
-#define CLOSEHANDLE(X) \
-{ \
- if(X) \
- { \
- CloseHandle(X); \
- X = 0; \
- } \
-}
-
-// in ntcron.c
-LPTHREAD_START_ROUTINE CRON_ThreadProc(HANDLE hevWatchDogExit);
-
-// in watchdog.c
-BOOL WD_SysLog(WORD fwEventType, DWORD IDEvent, char *szData);
-
-#endif /* _NTWATCHDOG_H_ */
-#endif /* _WIN32 */
diff --git a/ldap/include/regex.h b/ldap/include/regex.h
index 7748dcf..8caa96f 100644
--- a/ldap/include/regex.h
+++ b/ldap/include/regex.h
@@ -40,7 +40,7 @@
# include <config.h>
#endif
-#if defined( macintosh ) || defined( DOS ) || defined( _WINDOWS ) || defined( NEED_BSDREGEX )
+#if defined( macintosh ) || defined( NEED_BSDREGEX )
/*
* Copyright (c) 1993 Regents of the University of Michigan.
* All rights reserved.
@@ -97,4 +97,4 @@ int re_subs();
#ifdef __cplusplus
}
#endif
-#endif /* macintosh or DOS or or _WIN32 or NEED_BSDREGEX */
+#endif /* macintosh or NEED_BSDREGEX */
diff --git a/ldap/include/srchpref.h b/ldap/include/srchpref.h
index d5918f8..687fe25 100644
--- a/ldap/include/srchpref.h
+++ b/ldap/include/srchpref.h
@@ -65,22 +65,10 @@ extern "C" {
/* calling conventions used by library */
#ifndef LDAP_CALL
-#if defined( _WINDOWS ) || defined( _WIN32 )
-#define LDAP_C __cdecl
-#ifndef _WIN32
-#define __stdcall _far _pascal
-#define LDAP_CALLBACK _loadds
-#else
-#define LDAP_CALLBACK
-#endif /* _WIN32 */
-#define LDAP_PASCAL __stdcall
-#define LDAP_CALL LDAP_PASCAL
-#else /* _WINDOWS */
#define LDAP_C
#define LDAP_CALLBACK
#define LDAP_PASCAL
#define LDAP_CALL
-#endif /* _WINDOWS */
#endif /* LDAP_CALL */
struct ldap_searchattr {
diff --git a/ldap/libraries/libavl/avl.c b/ldap/libraries/libavl/avl.c
index 18c43e0..92c3847 100644
--- a/ldap/libraries/libavl/avl.c
+++ b/ldap/libraries/libavl/avl.c
@@ -58,12 +58,6 @@ static char copyright[] = "@(#) Copyright (c) 1993 Regents of the University of
static char avl_version[] = "AVL library version 1.0\n";
#endif
-#ifdef _WIN32
-typedef char *caddr_t;
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#endif
-
#include <sys/types.h>
#include <stdlib.h>
#include <stdio.h>
diff --git a/ldap/libraries/libavl/testavl.c b/ldap/libraries/libavl/testavl.c
index eae9b7a..aa95d9f 100644
--- a/ldap/libraries/libavl/testavl.c
+++ b/ldap/libraries/libavl/testavl.c
@@ -41,9 +41,6 @@
#endif
/* testavl.c - Test Tim Howes AVL code */
-#ifdef _WIN32
-#include <windows.h>
-#endif
#include <sys/types.h>
#include <stdio.h>
#include "avl.h"
diff --git a/ldap/servers/plugins/acl/acl.h b/ldap/servers/plugins/acl/acl.h
index 86ac12f..420b2e6 100644
--- a/ldap/servers/plugins/acl/acl.h
+++ b/ldap/servers/plugins/acl/acl.h
@@ -69,13 +69,10 @@
#include <string.h>
#include <sys/types.h>
#include <limits.h>
-#ifndef _WIN32
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
-#endif
-
#include <ldap.h>
#include <las.h>
#include <aclproto.h>
@@ -86,9 +83,7 @@
#include "slapi-private.h"
#include "portable.h"
#include "avl.h"
-
#include "cert.h"
-
#include <plhash.h>
#ifdef SOLARIS
diff --git a/ldap/servers/plugins/acl/acldllmain.c b/ldap/servers/plugins/acl/acldllmain.c
index 627ecc8..ac219ad 100644
--- a/ldap/servers/plugins/acl/acldllmain.c
+++ b/ldap/servers/plugins/acl/acldllmain.c
@@ -41,96 +41,17 @@
#endif
#include "acl.h"
+#include <stdio.h>
-#ifdef _WIN32
-/* Lifted from Q125688
- * How to Port a 16-bit DLL to a Win32 DLL
- * on the MSVC 4.0 CD
- */
-BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
-{
- WSADATA wsadata;
-
- switch (fdwReason)
- {
- case DLL_PROCESS_ATTACH:
- /* Code from LibMain inserted here. Return TRUE to keep the
- DLL loaded or return FALSE to fail loading the DLL.
-
- You may have to modify the code in your original LibMain to
- account for the fact that it may be called more than once.
- You will get one DLL_PROCESS_ATTACH for each process that
- loads the DLL. This is different from LibMain which gets
- called only once when the DLL is loaded. The only time this
- is critical is when you are using shared data sections.
- If you are using shared data sections for statically
- allocated data, you will need to be careful to initialize it
- only once. Check your code carefully.
-
- Certain one-time initializations may now need to be done for
- each process that attaches. You may also not need code from
- your original LibMain because the operating system may now
- be doing it for you.
- */
- /*
- * 16 bit code calls UnlockData()
- * which is mapped to UnlockSegment in windows.h
- * in 32 bit world UnlockData is not defined anywhere
- * UnlockSegment is mapped to GlobalUnfix in winbase.h
- * and the docs for both UnlockSegment and GlobalUnfix say
- * ".. function is oboslete. Segments have no meaning
- * in the 32-bit environment". So we do nothing here.
- */
-
- if( errno = WSAStartup(0x0101, &wsadata ) != 0 )
- return FALSE;
-
- break;
-
- case DLL_THREAD_ATTACH:
- /* Called each time a thread is created in a process that has
- already loaded (attached to) this DLL. Does not get called
- for each thread that exists in the process before it loaded
- the DLL.
-
- Do thread-specific initialization here.
- */
- break;
-
- case DLL_THREAD_DETACH:
- /* Same as above, but called when a thread in the process
- exits.
-
- Do thread-specific cleanup here.
- */
- break;
-
- case DLL_PROCESS_DETACH:
- /* Code from _WEP inserted here. This code may (like the
- LibMain) not be necessary. Check to make certain that the
- operating system is not doing it for you.
- */
- WSACleanup();
-
- break;
- }
- /* The return value is only used for DLL_PROCESS_ATTACH; all other
- conditions are ignored. */
- return TRUE; // successful DLL_PROCESS_ATTACH
-}
-#else
int CALLBACK
LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
{
/*UnlockData( 0 );*/
return( 1 );
}
-#endif
#ifdef LDAP_DEBUG
-#ifndef _WIN32
#include <stdarg.h>
-#include <stdio.h>
void LDAPDebug( int level, char* fmt, ... )
{
@@ -148,13 +69,7 @@ void LDAPDebug( int level, char* fmt, ... )
}
}
#endif
-#endif
-
-#ifndef _WIN32
-/* The 16-bit version of the RTL does not implement perror() */
-
-#include <stdio.h>
void perror( const char *msg )
{
@@ -163,4 +78,3 @@ void perror( const char *msg )
OutputDebugString( buf );
}
-#endif
diff --git a/ldap/servers/plugins/acl/aclplugin.c b/ldap/servers/plugins/acl/aclplugin.c
index c6ad719..7784210 100644
--- a/ldap/servers/plugins/acl/aclplugin.c
+++ b/ldap/servers/plugins/acl/aclplugin.c
@@ -405,12 +405,3 @@ acl_access_allowed_main ( Slapi_PBlock *pb, Slapi_Entry *e, char **attrs,
return rc;
}
-#ifdef _WIN32
-
-int *module_ldap_debug = 0;
-void plugin_init_debug_level ( int *level_ptr )
-{
- module_ldap_debug = level_ptr;
-}
-#endif
-
diff --git a/ldap/servers/plugins/chainingdb/cb_debug.c b/ldap/servers/plugins/chainingdb/cb_debug.c
index 07fbc88..e93104e 100644
--- a/ldap/servers/plugins/chainingdb/cb_debug.c
+++ b/ldap/servers/plugins/chainingdb/cb_debug.c
@@ -49,12 +49,3 @@
#include <sys/types.h>
#include "cb.h"
-#ifdef _WIN32
-int *module_ldap_debug = 0;
-
-void plugin_init_debug_level(int *level_ptr)
-{
- module_ldap_debug = level_ptr;
-}
-#endif
-
diff --git a/ldap/servers/plugins/chainingdb/cb_init.c b/ldap/servers/plugins/chainingdb/cb_init.c
index b9a4cb0..9f3e286 100644
--- a/ldap/servers/plugins/chainingdb/cb_init.c
+++ b/ldap/servers/plugins/chainingdb/cb_init.c
@@ -59,10 +59,6 @@ static void cb_set_backend_type(cb_backend * cb) {
}
/* Initialization function */
-#ifdef _WIN32
-__declspec(dllexport)
-#endif
-
int
chaining_back_init( Slapi_PBlock *pb )
{
diff --git a/ldap/servers/plugins/chainingdb/cbdllmain.c b/ldap/servers/plugins/chainingdb/cbdllmain.c
index 77c840b..16ccc5c 100644
--- a/ldap/servers/plugins/chainingdb/cbdllmain.c
+++ b/ldap/servers/plugins/chainingdb/cbdllmain.c
@@ -41,96 +41,18 @@
#endif
#include "cb.h"
+#include <stdio.h>
-#ifdef _WIN32
-/* Lifted from Q125688
- * How to Port a 16-bit DLL to a Win32 DLL
- * on the MSVC 4.0 CD
- */
-BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
-{
- WSADATA wsadata;
-
- switch (fdwReason)
- {
- case DLL_PROCESS_ATTACH:
- /* Code from LibMain inserted here. Return TRUE to keep the
- DLL loaded or return FALSE to fail loading the DLL.
-
- You may have to modify the code in your original LibMain to
- account for the fact that it may be called more than once.
- You will get one DLL_PROCESS_ATTACH for each process that
- loads the DLL. This is different from LibMain which gets
- called only once when the DLL is loaded. The only time this
- is critical is when you are using shared data sections.
- If you are using shared data sections for statically
- allocated data, you will need to be careful to initialize it
- only once. Check your code carefully.
-
- Certain one-time initializations may now need to be done for
- each process that attaches. You may also not need code from
- your original LibMain because the operating system may now
- be doing it for you.
- */
- /*
- * 16 bit code calls UnlockData()
- * which is mapped to UnlockSegment in windows.h
- * in 32 bit world UnlockData is not defined anywhere
- * UnlockSegment is mapped to GlobalUnfix in winbase.h
- * and the docs for both UnlockSegment and GlobalUnfix say
- * ".. function is oboslete. Segments have no meaning
- * in the 32-bit environment". So we do nothing here.
- */
-
- if( errno = WSAStartup(0x0101, &wsadata ) != 0 )
- return FALSE;
-
- break;
-
- case DLL_THREAD_ATTACH:
- /* Called each time a thread is created in a process that has
- already loaded (attached to) this DLL. Does not get called
- for each thread that exists in the process before it loaded
- the DLL.
-
- Do thread-specific initialization here.
- */
- break;
-
- case DLL_THREAD_DETACH:
- /* Same as above, but called when a thread in the process
- exits.
-
- Do thread-specific cleanup here.
- */
- break;
-
- case DLL_PROCESS_DETACH:
- /* Code from _WEP inserted here. This code may (like the
- LibMain) not be necessary. Check to make certain that the
- operating system is not doing it for you.
- */
- WSACleanup();
-
- break;
- }
- /* The return value is only used for DLL_PROCESS_ATTACH; all other
- conditions are ignored. */
- return TRUE; // successful DLL_PROCESS_ATTACH
-}
-#else
int CALLBACK
LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
{
/*UnlockData( 0 );*/
return( 1 );
}
-#endif
+
#ifdef LDAP_DEBUG
-#ifndef _WIN32
#include <stdarg.h>
-#include <stdio.h>
void LDAPDebug( int level, char* fmt, ... )
{
@@ -147,13 +69,6 @@ void LDAPDebug( int level, char* fmt, ... )
}
}
#endif
-#endif
-
-#ifndef _WIN32
-
-/* The 16-bit version of the RTL does not implement perror() */
-
-#include <stdio.h>
void perror( const char *msg )
{
@@ -161,5 +76,3 @@ void perror( const char *msg )
wsprintf( buf, "%s: error %d\n", msg, WSAGetLastError()) ;
OutputDebugString( buf );
}
-
-#endif
diff --git a/ldap/servers/plugins/collation/config.c b/ldap/servers/plugins/collation/config.c
index 3a155dc..413d13d 100644
--- a/ldap/servers/plugins/collation/config.c
+++ b/ldap/servers/plugins/collation/config.c
@@ -78,11 +78,9 @@ strtok_quote( char *line, char *sep )
}
break;
-#ifndef _WIN32
case '\\':
*d++ = *++next;
break;
-#endif
default:
if ( ! inquote ) {
diff --git a/ldap/servers/plugins/collation/debug.c b/ldap/servers/plugins/collation/debug.c
index fb64855..46ebddf 100644
--- a/ldap/servers/plugins/collation/debug.c
+++ b/ldap/servers/plugins/collation/debug.c
@@ -40,12 +40,3 @@
# include <config.h>
#endif
-#ifdef _WIN32
-int *module_ldap_debug = 0;
-
-void
-plugin_init_debug_level (int *level_ptr)
-{
- module_ldap_debug = level_ptr;
-}
-#endif
diff --git a/ldap/servers/plugins/collation/dllmain.c b/ldap/servers/plugins/collation/dllmain.c
index cc3d016..f8cca09 100644
--- a/ldap/servers/plugins/collation/dllmain.c
+++ b/ldap/servers/plugins/collation/dllmain.c
@@ -44,96 +44,18 @@
* Microsoft Windows specifics for collation DLL
*/
#include "ldap.h"
+#include <stdio.h>
-#ifdef _WIN32
-/* Lifted from Q125688
- * How to Port a 16-bit DLL to a Win32 DLL
- * on the MSVC 4.0 CD
- */
-BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
-{
- WSADATA wsadata;
-
- switch (fdwReason)
- {
- case DLL_PROCESS_ATTACH:
- /* Code from LibMain inserted here. Return TRUE to keep the
- DLL loaded or return FALSE to fail loading the DLL.
-
- You may have to modify the code in your original LibMain to
- account for the fact that it may be called more than once.
- You will get one DLL_PROCESS_ATTACH for each process that
- loads the DLL. This is different from LibMain which gets
- called only once when the DLL is loaded. The only time this
- is critical is when you are using shared data sections.
- If you are using shared data sections for statically
- allocated data, you will need to be careful to initialize it
- only once. Check your code carefully.
-
- Certain one-time initializations may now need to be done for
- each process that attaches. You may also not need code from
- your original LibMain because the operating system may now
- be doing it for you.
- */
- /*
- * 16 bit code calls UnlockData()
- * which is mapped to UnlockSegment in windows.h
- * in 32 bit world UnlockData is not defined anywhere
- * UnlockSegment is mapped to GlobalUnfix in winbase.h
- * and the docs for both UnlockSegment and GlobalUnfix say
- * ".. function is oboslete. Segments have no meaning
- * in the 32-bit environment". So we do nothing here.
- */
-
- if( errno = WSAStartup(0x0101, &wsadata ) != 0 )
- return FALSE;
-
- break;
-
- case DLL_THREAD_ATTACH:
- /* Called each time a thread is created in a process that has
- already loaded (attached to) this DLL. Does not get called
- for each thread that exists in the process before it loaded
- the DLL.
-
- Do thread-specific initialization here.
- */
- break;
-
- case DLL_THREAD_DETACH:
- /* Same as above, but called when a thread in the process
- exits.
-
- Do thread-specific cleanup here.
- */
- break;
-
- case DLL_PROCESS_DETACH:
- /* Code from _WEP inserted here. This code may (like the
- LibMain) not be necessary. Check to make certain that the
- operating system is not doing it for you.
- */
- WSACleanup();
-
- break;
- }
- /* The return value is only used for DLL_PROCESS_ATTACH; all other
- conditions are ignored. */
- return TRUE; // successful DLL_PROCESS_ATTACH
-}
-#else
int CALLBACK
LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
{
/*UnlockData( 0 );*/
return( 1 );
}
-#endif
#ifdef LDAP_DEBUG
-#ifndef _WIN32
+
#include <stdarg.h>
-#include <stdio.h>
void LDAPDebug( int level, char* fmt, ... )
{
@@ -151,11 +73,7 @@ void LDAPDebug( int level, char* fmt, ... )
}
}
#endif
-#endif
-#ifndef _WIN32
-/* The 16-bit version of the RTL does not implement perror() */
-#include <stdio.h>
void perror( const char *msg )
{
@@ -164,4 +82,3 @@ void perror( const char *msg )
OutputDebugString( buf );
}
-#endif
diff --git a/ldap/servers/plugins/cos/cos.c b/ldap/servers/plugins/cos/cos.c
index 1e963e5..7ec18e8 100644
--- a/ldap/servers/plugins/cos/cos.c
+++ b/ldap/servers/plugins/cos/cos.c
@@ -48,11 +48,8 @@
#include "slapi-private.h"
#include "cos_cache.h"
#include "vattr_spi.h"
-
-/* get file mode flags for unix */
-#ifndef _WIN32
#include <sys/stat.h>
-#endif
+
/*** secret slapd stuff ***/
@@ -98,15 +95,6 @@ static Slapi_PluginDesc pdesc = { "cos", VENDOR, DS_PACKAGE_VERSION,
static void * cos_plugin_identity = NULL;
-#ifdef _WIN32
-int *module_ldap_debug = 0;
-
-void plugin_init_debug_level(int *level_ptr)
-{
- module_ldap_debug = level_ptr;
-}
-#endif
-
/*
** Plugin identity mgmt
*/
diff --git a/ldap/servers/plugins/cos/dllmain.c b/ldap/servers/plugins/cos/dllmain.c
index 1fb17e4..d23057a 100644
--- a/ldap/servers/plugins/cos/dllmain.c
+++ b/ldap/servers/plugins/cos/dllmain.c
@@ -47,87 +47,10 @@
#include "lber.h"
-#ifdef _WIN32
-/* Lifted from Q125688
- * How to Port a 16-bit DLL to a Win32 DLL
- * on the MSVC 4.0 CD
- */
-BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
-{
- WSADATA wsadata;
-
- switch (fdwReason)
- {
- case DLL_PROCESS_ATTACH:
- /* Code from LibMain inserted here. Return TRUE to keep the
- DLL loaded or return FALSE to fail loading the DLL.
-
- You may have to modify the code in your original LibMain to
- account for the fact that it may be called more than once.
- You will get one DLL_PROCESS_ATTACH for each process that
- loads the DLL. This is different from LibMain which gets
- called only once when the DLL is loaded. The only time this
- is critical is when you are using shared data sections.
- If you are using shared data sections for statically
- allocated data, you will need to be careful to initialize it
- only once. Check your code carefully.
-
- Certain one-time initializations may now need to be done for
- each process that attaches. You may also not need code from
- your original LibMain because the operating system may now
- be doing it for you.
- */
- /*
- * 16 bit code calls UnlockData()
- * which is mapped to UnlockSegment in windows.h
- * in 32 bit world UnlockData is not defined anywhere
- * UnlockSegment is mapped to GlobalUnfix in winbase.h
- * and the docs for both UnlockSegment and GlobalUnfix say
- * ".. function is oboslete. Segments have no meaning
- * in the 32-bit environment". So we do nothing here.
- */
-
- if( errno = WSAStartup(0x0101, &wsadata ) != 0 )
- return FALSE;
-
- break;
-
- case DLL_THREAD_ATTACH:
- /* Called each time a thread is created in a process that has
- already loaded (attached to) this DLL. Does not get called
- for each thread that exists in the process before it loaded
- the DLL.
-
- Do thread-specific initialization here.
- */
- break;
-
- case DLL_THREAD_DETACH:
- /* Same as above, but called when a thread in the process
- exits.
-
- Do thread-specific cleanup here.
- */
- break;
-
- case DLL_PROCESS_DETACH:
- /* Code from _WEP inserted here. This code may (like the
- LibMain) not be necessary. Check to make certain that the
- operating system is not doing it for you.
- */
- WSACleanup();
-
- break;
- }
- /* The return value is only used for DLL_PROCESS_ATTACH; all other
- conditions are ignored. */
- return TRUE; // successful DLL_PROCESS_ATTACH
-}
-#else
int CALLBACK
LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
{
/*UnlockData( 0 );*/
return( 1 );
}
-#endif
+
diff --git a/ldap/servers/plugins/distrib/dllmain.c b/ldap/servers/plugins/distrib/dllmain.c
index 32715ff..3e072ff 100644
--- a/ldap/servers/plugins/distrib/dllmain.c
+++ b/ldap/servers/plugins/distrib/dllmain.c
@@ -46,82 +46,9 @@
#include "ldap.h"
-#ifdef _WIN32
-/* Lifted from Q125688
- * How to Port a 16-bit DLL to a Win32 DLL
- * on the MSVC 4.0 CD
- */
-BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
-{
-
- switch (fdwReason)
- {
- case DLL_PROCESS_ATTACH:
- /* Code from LibMain inserted here. Return TRUE to keep the
- DLL loaded or return FALSE to fail loading the DLL.
-
- You may have to modify the code in your original LibMain to
- account for the fact that it may be called more than once.
- You will get one DLL_PROCESS_ATTACH for each process that
- loads the DLL. This is different from LibMain which gets
- called only once when the DLL is loaded. The only time this
- is critical is when you are using shared data sections.
- If you are using shared data sections for statically
- allocated data, you will need to be careful to initialize it
- only once. Check your code carefully.
-
- Certain one-time initializations may now need to be done for
- each process that attaches. You may also not need code from
- your original LibMain because the operating system may now
- be doing it for you.
- */
- /*
- * 16 bit code calls UnlockData()
- * which is mapped to UnlockSegment in windows.h
- * in 32 bit world UnlockData is not defined anywhere
- * UnlockSegment is mapped to GlobalUnfix in winbase.h
- * and the docs for both UnlockSegment and GlobalUnfix say
- * ".. function is oboslete. Segments have no meaning
- * in the 32-bit environment". So we do nothing here.
- */
-
- break;
-
- case DLL_THREAD_ATTACH:
- /* Called each time a thread is created in a process that has
- already loaded (attached to) this DLL. Does not get called
- for each thread that exists in the process before it loaded
- the DLL.
-
- Do thread-specific initialization here.
- */
- break;
-
- case DLL_THREAD_DETACH:
- /* Same as above, but called when a thread in the process
- exits.
-
- Do thread-specific cleanup here.
- */
- break;
-
- case DLL_PROCESS_DETACH:
- /* Code from _WEP inserted here. This code may (like the
- LibMain) not be necessary. Check to make certain that the
- operating system is not doing it for you.
- */
-
- break;
- }
- /* The return value is only used for DLL_PROCESS_ATTACH; all other
- conditions are ignored. */
- return TRUE; /* successful DLL_PROCESS_ATTACH */
-}
-#else
int CALLBACK
LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
{
/*UnlockData( 0 );*/
return( 1 );
}
-#endif
diff --git a/ldap/servers/plugins/dna/dna.c b/ldap/servers/plugins/dna/dna.c
index 7da853b..4613fd2 100644
--- a/ldap/servers/plugins/dna/dna.c
+++ b/ldap/servers/plugins/dna/dna.c
@@ -60,10 +60,7 @@
#error Need to define portable format macros such as PRIu64
#endif /* HAVE_INTTYPES_H */
-/* get file mode flags for unix */
-#ifndef _WIN32
#include <sys/stat.h>
-#endif
#define DNA_PLUGIN_SUBSYSTEM "dna-plugin"
#define DNA_PLUGIN_VERSION 0x00020000
@@ -318,18 +315,6 @@ static int dna_be_txn_mod_pre_op(Slapi_PBlock *pb);
void dna_dump_config();
void dna_dump_config_entry(struct configEntry *);
-/**
- * set the debug level
- */
-#ifdef _WIN32
-int *module_ldap_debug = 0;
-
-void plugin_init_debug_level(int *level_ptr)
-{
- module_ldap_debug = level_ptr;
-}
-#endif
-
/*
* During the plugin startup we delay the creation of the shared config entries
* so all the other betxn plugins have time to start. During the "delayed"
diff --git a/ldap/servers/plugins/http/dllmain.c b/ldap/servers/plugins/http/dllmain.c
index 9bf3c1b..86418cb 100644
--- a/ldap/servers/plugins/http/dllmain.c
+++ b/ldap/servers/plugins/http/dllmain.c
@@ -47,89 +47,10 @@
#include "ldap.h"
#include "lber.h"
-#ifdef _WIN32
-/* Lifted from Q125688
- * How to Port a 16-bit DLL to a Win32 DLL
- * on the MSVC 4.0 CD
- */
-
-BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
-{
- WSADATA wsadata;
-
- switch (fdwReason)
- {
- case DLL_PROCESS_ATTACH:
- /* Code from LibMain inserted here. Return TRUE to keep the
- DLL loaded or return FALSE to fail loading the DLL.
-
- You may have to modify the code in your original LibMain to
- account for the fact that it may be called more than once.
- You will get one DLL_PROCESS_ATTACH for each process that
- loads the DLL. This is different from LibMain which gets
- called only once when the DLL is loaded. The only time this
- is critical is when you are using shared data sections.
- If you are using shared data sections for statically
- allocated data, you will need to be careful to initialize it
- only once. Check your code carefully.
-
- Certain one-time initializations may now need to be done for
- each process that attaches. You may also not need code from
- your original LibMain because the operating system may now
- be doing it for you.
- */
- /*
- * 16 bit code calls UnlockData()
- * which is mapped to UnlockSegment in windows.h
- * in 32 bit world UnlockData is not defined anywhere
- * UnlockSegment is mapped to GlobalUnfix in winbase.h
- * and the docs for both UnlockSegment and GlobalUnfix say
- * ".. function is oboslete. Segments have no meaning
- * in the 32-bit environment". So we do nothing here.
- */
-
- if( errno = WSAStartup(0x0101, &wsadata ) != 0 )
- return FALSE;
-
- break;
-
- case DLL_THREAD_ATTACH:
- /* Called each time a thread is created in a process that has
- already loaded (attached to) this DLL. Does not get called
- for each thread that exists in the process before it loaded
- the DLL.
-
- Do thread-specific initialization here.
- */
- break;
-
- case DLL_THREAD_DETACH:
- /* Same as above, but called when a thread in the process
- exits.
-
- Do thread-specific cleanup here.
- */
- break;
-
- case DLL_PROCESS_DETACH:
- /* Code from _WEP inserted here. This code may (like the
- LibMain) not be necessary. Check to make certain that the
- operating system is not doing it for you.
- */
- WSACleanup();
-
- break;
- }
- /* The return value is only used for DLL_PROCESS_ATTACH; all other
- conditions are ignored. */
- return TRUE; /* successful DLL_PROCESS_ATTACH */
-}
-#else
int CALLBACK
LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
{
/*UnlockData( 0 );*/
return( 1 );
}
-#endif
diff --git a/ldap/servers/plugins/http/http_client.c b/ldap/servers/plugins/http/http_client.c
index 821f895..acba665 100644
--- a/ldap/servers/plugins/http/http_client.c
+++ b/ldap/servers/plugins/http/http_client.c
@@ -47,20 +47,14 @@
#include <stdio.h>
#include <string.h>
-
#include "portable.h"
#include "nspr.h"
-
#include "slapi-plugin.h"
#include "slapi-private.h"
-
#include "http_client.h"
#include "http_impl.h"
-
-/* get file mode flags for unix */
-#ifndef _WIN32
#include <sys/stat.h>
-#endif
+
/*** from proto-slap.h ***/
@@ -81,23 +75,13 @@ extern "C" {
#define LDAP_DEBUG_PLUGIN 0x10000 /* 65536 */
/* debugging stuff */
-# ifdef _WIN32
- extern int *module_ldap_debug;
-# define LDAPDebug( level, fmt, arg1, arg2, arg3 ) \
- { \
- if ( *module_ldap_debug & level ) { \
- slapd_log_error_proc( NULL, fmt, arg1, arg2, arg3 ); \
- } \
- }
-# else /* _WIN32 */
- extern int slapd_ldap_debug;
-# define LDAPDebug( level, fmt, arg1, arg2, arg3 ) \
+extern int slapd_ldap_debug;
+#define LDAPDebug( level, fmt, arg1, arg2, arg3 ) \
{ \
if ( slapd_ldap_debug & level ) { \
slapd_log_error_proc( NULL, fmt, arg1, arg2, arg3 ); \
} \
}
-# endif /* Win32 */
#ifdef __cplusplus
}
@@ -145,15 +129,6 @@ static int _http_get_redirected_uri(char *url, char **data, int *bytesRead);
static int _http_post(char *url, httpheader **httpheaderArray, char *body, char **data, int *bytesRead);
static void _http_shutdown( void );
-#ifdef _WIN32
-int *module_ldap_debug = 0;
-
-void plugin_init_debug_level(int *level_ptr)
-{
- module_ldap_debug = level_ptr;
-}
-#endif
-
/**
*
* Get the presence plug-in version
diff --git a/ldap/servers/plugins/http/http_impl.c b/ldap/servers/plugins/http/http_impl.c
index db02b67..98d0506 100644
--- a/ldap/servers/plugins/http/http_impl.c
+++ b/ldap/servers/plugins/http/http_impl.c
@@ -60,10 +60,7 @@
#include "slap.h"
#include "slapi-private.h"
#include "slapi-plugin-compat4.h"
-/* get file mode flags for unix */
-#ifndef _WIN32
#include <sys/stat.h>
-#endif
/*** from proto-slap.h ***/
diff --git a/ldap/servers/plugins/pam_passthru/pam_ptdebug.c b/ldap/servers/plugins/pam_passthru/pam_ptdebug.c
index d72967a..d2abf2a 100644
--- a/ldap/servers/plugins/pam_passthru/pam_ptdebug.c
+++ b/ldap/servers/plugins/pam_passthru/pam_ptdebug.c
@@ -49,11 +49,3 @@
#include <sys/types.h>
#include "pam_passthru.h"
-#ifdef _WIN32
-int *module_ldap_debug = 0;
-
-void plugin_init_debug_level(int *level_ptr)
-{
- module_ldap_debug = level_ptr;
-}
-#endif
diff --git a/ldap/servers/plugins/pam_passthru/pam_ptdllmain.c b/ldap/servers/plugins/pam_passthru/pam_ptdllmain.c
index 6948a1f..a17bc1b 100644
--- a/ldap/servers/plugins/pam_passthru/pam_ptdllmain.c
+++ b/ldap/servers/plugins/pam_passthru/pam_ptdllmain.c
@@ -42,97 +42,19 @@
#include "ldap.h"
#include "lber.h"
#include "passthru.h"
+#include <stdio.h>
-#ifdef _WIN32
-/* Lifted from Q125688
- * How to Port a 16-bit DLL to a Win32 DLL
- * on the MSVC 4.0 CD
- */
-BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
-{
- WSADATA wsadata;
-
- switch (fdwReason)
- {
- case DLL_PROCESS_ATTACH:
- /* Code from LibMain inserted here. Return TRUE to keep the
- DLL loaded or return FALSE to fail loading the DLL.
-
- You may have to modify the code in your original LibMain to
- account for the fact that it may be called more than once.
- You will get one DLL_PROCESS_ATTACH for each process that
- loads the DLL. This is different from LibMain which gets
- called only once when the DLL is loaded. The only time this
- is critical is when you are using shared data sections.
- If you are using shared data sections for statically
- allocated data, you will need to be careful to initialize it
- only once. Check your code carefully.
-
- Certain one-time initializations may now need to be done for
- each process that attaches. You may also not need code from
- your original LibMain because the operating system may now
- be doing it for you.
- */
- /*
- * 16 bit code calls UnlockData()
- * which is mapped to UnlockSegment in windows.h
- * in 32 bit world UnlockData is not defined anywhere
- * UnlockSegment is mapped to GlobalUnfix in winbase.h
- * and the docs for both UnlockSegment and GlobalUnfix say
- * ".. function is oboslete. Segments have no meaning
- * in the 32-bit environment". So we do nothing here.
- */
-
- if( errno = WSAStartup(0x0101, &wsadata ) != 0 )
- return FALSE;
-
- break;
-
- case DLL_THREAD_ATTACH:
- /* Called each time a thread is created in a process that has
- already loaded (attached to) this DLL. Does not get called
- for each thread that exists in the process before it loaded
- the DLL.
-
- Do thread-specific initialization here.
- */
- break;
-
- case DLL_THREAD_DETACH:
- /* Same as above, but called when a thread in the process
- exits.
-
- Do thread-specific cleanup here.
- */
- break;
-
- case DLL_PROCESS_DETACH:
- /* Code from _WEP inserted here. This code may (like the
- LibMain) not be necessary. Check to make certain that the
- operating system is not doing it for you.
- */
- WSACleanup();
-
- break;
- }
- /* The return value is only used for DLL_PROCESS_ATTACH; all other
- conditions are ignored. */
- return TRUE; // successful DLL_PROCESS_ATTACH
-}
-#else
int CALLBACK
LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
{
/*UnlockData( 0 );*/
return( 1 );
}
-#endif
+
#ifdef LDAP_DEBUG
-#ifndef _WIN32
#include <stdarg.h>
-#include <stdio.h>
void LDAPDebug( int level, char* fmt, ... )
{
@@ -150,13 +72,6 @@ void LDAPDebug( int level, char* fmt, ... )
}
}
#endif
-#endif
-
-#ifndef _WIN32
-
-/* The 16-bit version of the RTL does not implement perror() */
-
-#include <stdio.h>
void perror( const char *msg )
{
@@ -164,5 +79,3 @@ void perror( const char *msg )
wsprintf( buf, "%s: error %d\n", msg, WSAGetLastError()) ;
OutputDebugString( buf );
}
-
-#endif
diff --git a/ldap/servers/plugins/passthru/ptdebug.c b/ldap/servers/plugins/passthru/ptdebug.c
index f504aed..607161c 100644
--- a/ldap/servers/plugins/passthru/ptdebug.c
+++ b/ldap/servers/plugins/passthru/ptdebug.c
@@ -50,11 +50,3 @@
#include <sys/types.h>
#include "passthru.h"
-#ifdef _WIN32
-int *module_ldap_debug = 0;
-
-void plugin_init_debug_level(int *level_ptr)
-{
- module_ldap_debug = level_ptr;
-}
-#endif
diff --git a/ldap/servers/plugins/passthru/ptdllmain.c b/ldap/servers/plugins/passthru/ptdllmain.c
index f3a7e88..ef471bc 100644
--- a/ldap/servers/plugins/passthru/ptdllmain.c
+++ b/ldap/servers/plugins/passthru/ptdllmain.c
@@ -43,97 +43,17 @@
#include "ldap.h"
#include "lber.h"
#include "passthru.h"
+#include <stdio.h>
-
-#ifdef _WIN32
-/* Lifted from Q125688
- * How to Port a 16-bit DLL to a Win32 DLL
- * on the MSVC 4.0 CD
- */
-BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
-{
- WSADATA wsadata;
-
- switch (fdwReason)
- {
- case DLL_PROCESS_ATTACH:
- /* Code from LibMain inserted here. Return TRUE to keep the
- DLL loaded or return FALSE to fail loading the DLL.
-
- You may have to modify the code in your original LibMain to
- account for the fact that it may be called more than once.
- You will get one DLL_PROCESS_ATTACH for each process that
- loads the DLL. This is different from LibMain which gets
- called only once when the DLL is loaded. The only time this
- is critical is when you are using shared data sections.
- If you are using shared data sections for statically
- allocated data, you will need to be careful to initialize it
- only once. Check your code carefully.
-
- Certain one-time initializations may now need to be done for
- each process that attaches. You may also not need code from
- your original LibMain because the operating system may now
- be doing it for you.
- */
- /*
- * 16 bit code calls UnlockData()
- * which is mapped to UnlockSegment in windows.h
- * in 32 bit world UnlockData is not defined anywhere
- * UnlockSegment is mapped to GlobalUnfix in winbase.h
- * and the docs for both UnlockSegment and GlobalUnfix say
- * ".. function is oboslete. Segments have no meaning
- * in the 32-bit environment". So we do nothing here.
- */
-
- if( errno = WSAStartup(0x0101, &wsadata ) != 0 )
- return FALSE;
-
- break;
-
- case DLL_THREAD_ATTACH:
- /* Called each time a thread is created in a process that has
- already loaded (attached to) this DLL. Does not get called
- for each thread that exists in the process before it loaded
- the DLL.
-
- Do thread-specific initialization here.
- */
- break;
-
- case DLL_THREAD_DETACH:
- /* Same as above, but called when a thread in the process
- exits.
-
- Do thread-specific cleanup here.
- */
- break;
-
- case DLL_PROCESS_DETACH:
- /* Code from _WEP inserted here. This code may (like the
- LibMain) not be necessary. Check to make certain that the
- operating system is not doing it for you.
- */
- WSACleanup();
-
- break;
- }
- /* The return value is only used for DLL_PROCESS_ATTACH; all other
- conditions are ignored. */
- return TRUE; // successful DLL_PROCESS_ATTACH
-}
-#else
int CALLBACK
LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
{
/*UnlockData( 0 );*/
return( 1 );
}
-#endif
#ifdef LDAP_DEBUG
-#ifndef _WIN32
#include <stdarg.h>
-#include <stdio.h>
void LDAPDebug( int level, char* fmt, ... )
{
@@ -151,14 +71,9 @@ void LDAPDebug( int level, char* fmt, ... )
}
}
#endif
-#endif
-#ifndef _WIN32
/* The 16-bit version of the RTL does not implement perror() */
-
-#include <stdio.h>
-
void perror( const char *msg )
{
char buf[128];
@@ -166,4 +81,3 @@ void perror( const char *msg )
OutputDebugString( buf );
}
-#endif
diff --git a/ldap/servers/plugins/presence/dllmain.c b/ldap/servers/plugins/presence/dllmain.c
index 1fb17e4..21b45cc 100644
--- a/ldap/servers/plugins/presence/dllmain.c
+++ b/ldap/servers/plugins/presence/dllmain.c
@@ -47,87 +47,9 @@
#include "lber.h"
-#ifdef _WIN32
-/* Lifted from Q125688
- * How to Port a 16-bit DLL to a Win32 DLL
- * on the MSVC 4.0 CD
- */
-BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
-{
- WSADATA wsadata;
-
- switch (fdwReason)
- {
- case DLL_PROCESS_ATTACH:
- /* Code from LibMain inserted here. Return TRUE to keep the
- DLL loaded or return FALSE to fail loading the DLL.
-
- You may have to modify the code in your original LibMain to
- account for the fact that it may be called more than once.
- You will get one DLL_PROCESS_ATTACH for each process that
- loads the DLL. This is different from LibMain which gets
- called only once when the DLL is loaded. The only time this
- is critical is when you are using shared data sections.
- If you are using shared data sections for statically
- allocated data, you will need to be careful to initialize it
- only once. Check your code carefully.
-
- Certain one-time initializations may now need to be done for
- each process that attaches. You may also not need code from
- your original LibMain because the operating system may now
- be doing it for you.
- */
- /*
- * 16 bit code calls UnlockData()
- * which is mapped to UnlockSegment in windows.h
- * in 32 bit world UnlockData is not defined anywhere
- * UnlockSegment is mapped to GlobalUnfix in winbase.h
- * and the docs for both UnlockSegment and GlobalUnfix say
- * ".. function is oboslete. Segments have no meaning
- * in the 32-bit environment". So we do nothing here.
- */
-
- if( errno = WSAStartup(0x0101, &wsadata ) != 0 )
- return FALSE;
-
- break;
-
- case DLL_THREAD_ATTACH:
- /* Called each time a thread is created in a process that has
- already loaded (attached to) this DLL. Does not get called
- for each thread that exists in the process before it loaded
- the DLL.
-
- Do thread-specific initialization here.
- */
- break;
-
- case DLL_THREAD_DETACH:
- /* Same as above, but called when a thread in the process
- exits.
-
- Do thread-specific cleanup here.
- */
- break;
-
- case DLL_PROCESS_DETACH:
- /* Code from _WEP inserted here. This code may (like the
- LibMain) not be necessary. Check to make certain that the
- operating system is not doing it for you.
- */
- WSACleanup();
-
- break;
- }
- /* The return value is only used for DLL_PROCESS_ATTACH; all other
- conditions are ignored. */
- return TRUE; // successful DLL_PROCESS_ATTACH
-}
-#else
int CALLBACK
LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
{
/*UnlockData( 0 );*/
return( 1 );
}
-#endif
diff --git a/ldap/servers/plugins/presence/presence.c b/ldap/servers/plugins/presence/presence.c
index 5e47841..b105afe 100644
--- a/ldap/servers/plugins/presence/presence.c
+++ b/ldap/servers/plugins/presence/presence.c
@@ -54,13 +54,9 @@
#include "vattr_spi.h"
#include "plhash.h"
#include "ldif.h"
-
#include "http_client.h"
-
-/* get file mode flags for unix */
-#ifndef _WIN32
#include <sys/stat.h>
-#endif
+
/*** from proto-slap.h ***/
@@ -81,13 +77,8 @@ extern "C" {
#define LDAP_DEBUG_PLUGIN 0x10000 /* 65536 */
/* debugging stuff */
-# ifdef _WIN32
- extern int *module_ldap_debug;
-# define LDAPDebugLevelIsSet( level ) ( *module_ldap_debug & level )
-# else /* _WIN32 */
- extern int slapd_ldap_debug;
-# define LDAPDebugLevelIsSet( level ) ( slapd_ldap_debug & level )
-# endif /* Win32 */
+extern int slapd_ldap_debug;
+#define LDAPDebugLevelIsSet( level ) ( slapd_ldap_debug & level )
#define LDAPDebug( level, fmt, arg1, arg2, arg3 ) \
{ \
@@ -245,18 +236,6 @@ PRIntn printIdVattrMapTable(PLHashEntry *he, PRIntn i, void *arg);
PRIntn printIdConfigMapTable(PLHashEntry *he, PRIntn i, void *arg);
/**
- * set the debug level
- */
-#ifdef _WIN32
-int *module_ldap_debug = 0;
-
-void plugin_init_debug_level(int *level_ptr)
-{
- module_ldap_debug = level_ptr;
-}
-#endif
-
-/**
*
* Get the presence plug-in version
*
diff --git a/ldap/servers/plugins/pwdstorage/crypt_pwd.c b/ldap/servers/plugins/pwdstorage/crypt_pwd.c
index 666fd4b..cdf3831 100644
--- a/ldap/servers/plugins/pwdstorage/crypt_pwd.c
+++ b/ldap/servers/plugins/pwdstorage/crypt_pwd.c
@@ -48,9 +48,6 @@
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
-#ifdef _WIN32
-char *crypt(char *key, char *salt);
-#else
#include <sys/socket.h>
#if defined( hpux ) || defined ( AIX ) || defined (LINUX) || defined (OSF1)
#ifndef __USE_XOPEN
@@ -60,7 +57,6 @@ char *crypt(char *key, char *salt);
#else /* hpux */
#include <crypt.h>
#endif /* hpux */
-#endif /* _WIN32 */
#include "pwdstorage.h"
diff --git a/ldap/servers/plugins/pwdstorage/dllmain.c b/ldap/servers/plugins/pwdstorage/dllmain.c
index 7c9faa1..892c41f 100644
--- a/ldap/servers/plugins/pwdstorage/dllmain.c
+++ b/ldap/servers/plugins/pwdstorage/dllmain.c
@@ -47,82 +47,9 @@
#include "ldap.h"
-#ifdef _WIN32
-/* Lifted from Q125688
- * How to Port a 16-bit DLL to a Win32 DLL
- * on the MSVC 4.0 CD
- */
-BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
-{
-
- switch (fdwReason)
- {
- case DLL_PROCESS_ATTACH:
- /* Code from LibMain inserted here. Return TRUE to keep the
- DLL loaded or return FALSE to fail loading the DLL.
-
- You may have to modify the code in your original LibMain to
- account for the fact that it may be called more than once.
- You will get one DLL_PROCESS_ATTACH for each process that
- loads the DLL. This is different from LibMain which gets
- called only once when the DLL is loaded. The only time this
- is critical is when you are using shared data sections.
- If you are using shared data sections for statically
- allocated data, you will need to be careful to initialize it
- only once. Check your code carefully.
-
- Certain one-time initializations may now need to be done for
- each process that attaches. You may also not need code from
- your original LibMain because the operating system may now
- be doing it for you.
- */
- /*
- * 16 bit code calls UnlockData()
- * which is mapped to UnlockSegment in windows.h
- * in 32 bit world UnlockData is not defined anywhere
- * UnlockSegment is mapped to GlobalUnfix in winbase.h
- * and the docs for both UnlockSegment and GlobalUnfix say
- * ".. function is oboslete. Segments have no meaning
- * in the 32-bit environment". So we do nothing here.
- */
-
- break;
-
- case DLL_THREAD_ATTACH:
- /* Called each time a thread is created in a process that has
- already loaded (attached to) this DLL. Does not get called
- for each thread that exists in the process before it loaded
- the DLL.
-
- Do thread-specific initialization here.
- */
- break;
-
- case DLL_THREAD_DETACH:
- /* Same as above, but called when a thread in the process
- exits.
-
- Do thread-specific cleanup here.
- */
- break;
-
- case DLL_PROCESS_DETACH:
- /* Code from _WEP inserted here. This code may (like the
- LibMain) not be necessary. Check to make certain that the
- operating system is not doing it for you.
- */
-
- break;
- }
- /* The return value is only used for DLL_PROCESS_ATTACH; all other
- conditions are ignored. */
- return TRUE; /* successful DLL_PROCESS_ATTACH */
-}
-#else
int CALLBACK
LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
{
/*UnlockData( 0 );*/
return( 1 );
}
-#endif
diff --git a/ldap/servers/plugins/pwdstorage/pwd_init.c b/ldap/servers/plugins/pwdstorage/pwd_init.c
index 23b7417..4678f31 100644
--- a/ldap/servers/plugins/pwdstorage/pwd_init.c
+++ b/ldap/servers/plugins/pwdstorage/pwd_init.c
@@ -63,9 +63,7 @@ static Slapi_PluginDesc sha512_pdesc = { "sha512-password-storage-scheme", VENDO
static Slapi_PluginDesc ssha512_pdesc = { "ssha512-password-storage-scheme", VENDOR, DS_PACKAGE_VERSION, "Salted Secure Hashing Algorithm (SSHA512)" };
-#ifndef _WIN32
static Slapi_PluginDesc crypt_pdesc = { "crypt-password-storage-scheme", VENDOR, DS_PACKAGE_VERSION, "Unix crypt algorithm (CRYPT)" };
-#endif
static Slapi_PluginDesc clear_pdesc = { "clear-password-storage-scheme", VENDOR, DS_PACKAGE_VERSION, "No encryption (CLEAR)" };
diff --git a/ldap/servers/plugins/pwdstorage/pwdstorage.h b/ldap/servers/plugins/pwdstorage/pwdstorage.h
index f215ba2..b8548df 100644
--- a/ldap/servers/plugins/pwdstorage/pwdstorage.h
+++ b/ldap/servers/plugins/pwdstorage/pwdstorage.h
@@ -101,11 +101,9 @@ char * sha512_pw_enc( const char *pwd );
char * salted_sha512_pw_enc( const char *pwd );
int clear_pw_cmp( const char *userpwd, const char *dbpwd );
char *clear_pw_enc( const char *pwd );
-#ifndef _WIN32
void crypt_init();
int crypt_pw_cmp( const char *userpwd, const char *dbpwd );
char *crypt_pw_enc( const char *pwd );
-#endif
int ns_mta_md5_pw_cmp( const char *userpwd, const char *dbpwd );
int md5_pw_cmp( const char *userpwd, const char *dbpwd );
char *md5_pw_enc( const char *pwd );
diff --git a/ldap/servers/plugins/referint/dllmain.c b/ldap/servers/plugins/referint/dllmain.c
index ca2ab1c..4474511 100644
--- a/ldap/servers/plugins/referint/dllmain.c
+++ b/ldap/servers/plugins/referint/dllmain.c
@@ -46,83 +46,6 @@
#include "ldap.h"
-#ifdef _WIN32
-/* Lifted from Q125688
- * How to Port a 16-bit DLL to a Win32 DLL
- * on the MSVC 4.0 CD
- */
-BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
-{
- WSADATA wsadata;
-
- switch (fdwReason)
- {
- case DLL_PROCESS_ATTACH:
- /* Code from LibMain inserted here. Return TRUE to keep the
- DLL loaded or return FALSE to fail loading the DLL.
-
- You may have to modify the code in your original LibMain to
- account for the fact that it may be called more than once.
- You will get one DLL_PROCESS_ATTACH for each process that
- loads the DLL. This is different from LibMain which gets
- called only once when the DLL is loaded. The only time this
- is critical is when you are using shared data sections.
- If you are using shared data sections for statically
- allocated data, you will need to be careful to initialize it
- only once. Check your code carefully.
-
- Certain one-time initializations may now need to be done for
- each process that attaches. You may also not need code from
- your original LibMain because the operating system may now
- be doing it for you.
- */
- /*
- * 16 bit code calls UnlockData()
- * which is mapped to UnlockSegment in windows.h
- * in 32 bit world UnlockData is not defined anywhere
- * UnlockSegment is mapped to GlobalUnfix in winbase.h
- * and the docs for both UnlockSegment and GlobalUnfix say
- * ".. function is oboslete. Segments have no meaning
- * in the 32-bit environment". So we do nothing here.
- */
-
- if( errno = WSAStartup(0x0101, &wsadata ) != 0 )
- return FALSE;
-
- break;
-
- case DLL_THREAD_ATTACH:
- /* Called each time a thread is created in a process that has
- already loaded (attached to) this DLL. Does not get called
- for each thread that exists in the process before it loaded
- the DLL.
-
- Do thread-specific initialization here.
- */
- break;
-
- case DLL_THREAD_DETACH:
- /* Same as above, but called when a thread in the process
- exits.
-
- Do thread-specific cleanup here.
- */
- break;
-
- case DLL_PROCESS_DETACH:
- /* Code from _WEP inserted here. This code may (like the
- LibMain) not be necessary. Check to make certain that the
- operating system is not doing it for you.
- */
- WSACleanup();
-
- break;
- }
- /* The return value is only used for DLL_PROCESS_ATTACH; all other
- conditions are ignored. */
- return TRUE; // successful DLL_PROCESS_ATTACH
-}
-#else
int CALLBACK
LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
{
diff --git a/ldap/servers/plugins/referint/referint.c b/ldap/servers/plugins/referint/referint.c
index 66bb95e..c3b6e9c 100644
--- a/ldap/servers/plugins/referint/referint.c
+++ b/ldap/servers/plugins/referint/referint.c
@@ -45,25 +45,14 @@
#include "portable.h"
#include "slapi-plugin.h"
#include "slap.h"
-
-/* include NSPR header files */
#include "prthread.h"
#include "prlock.h"
#include "prerror.h"
#include "prcvar.h"
#include "prio.h"
-
-/* get file mode flags for unix */
-#ifndef _WIN32
#include <sys/stat.h>
-#endif
-#ifdef _WIN32
-#define REFERINT_DEFAULT_FILE_MODE 0
-#else
#define REFERINT_DEFAULT_FILE_MODE S_IRUSR | S_IWUSR
-#endif
-
#define REFERINT_PLUGIN_SUBSYSTEM "referint-plugin" /* used for logging */
#define REFERINT_PREOP_DESC "referint preop plugin"
#define REFERINT_ATTR_DELAY "referint-update-delay"
@@ -129,14 +118,6 @@ static void* referint_plugin_identity = NULL;
static int use_txn = 0;
static int premodfn = SLAPI_PLUGIN_PRE_MODIFY_FN;
-#ifdef _WIN32
-int *module_ldap_debug = 0;
-
-void plugin_init_debug_level(int *level_ptr)
-{
- module_ldap_debug = level_ptr;
-}
-#endif
static void
referint_lock()
diff --git a/ldap/servers/plugins/replication/cl5_api.c b/ldap/servers/plugins/replication/cl5_api.c
index 2d9a0bd..81c0408 100644
--- a/ldap/servers/plugins/replication/cl5_api.c
+++ b/ldap/servers/plugins/replication/cl5_api.c
@@ -174,13 +174,8 @@
#define DEFAULT_THREAD_STACKSIZE 0
#endif
-#ifdef _WIN32
-#define FILE_CREATE_MODE S_IREAD | S_IWRITE
-#define DIR_CREATE_MODE 0755
-#else /* _WIN32 */
#define FILE_CREATE_MODE S_IRUSR | S_IWUSR
#define DIR_CREATE_MODE 0755
-#endif
#define NO_DISK_SPACE 1024
#define MIN_DISK_SPACE 10485760 /* 10 MB */
diff --git a/ldap/servers/plugins/replication/cl5_config.c b/ldap/servers/plugins/replication/cl5_config.c
index f4da738..b81fe24 100644
--- a/ldap/servers/plugins/replication/cl5_config.c
+++ b/ldap/servers/plugins/replication/cl5_config.c
@@ -507,11 +507,7 @@ changelog5_config_modify (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entr
goto done;
}
-#ifdef _WIN32
- if (strcasecmp (currentDir, config.dir) != 0)
-#else /* On Unix, path are case sensitive */
if (strcmp (currentDir, config.dir) != 0)
-#endif
{
if (!cl5DbDirIsEmpty(config.dir))
{
@@ -918,9 +914,6 @@ static int _is_absolutepath (char * dir)
{
if (dir[0] == '/')
return 1;
-#if defined(_WIN32)
- if (dir[2] == '/' && dir[1] == ':')
- return 1;
-#endif
+
return 0;
}
diff --git a/ldap/servers/plugins/replication/repl.h b/ldap/servers/plugins/replication/repl.h
index 802e69c..3342d17 100644
--- a/ldap/servers/plugins/replication/repl.h
+++ b/ldap/servers/plugins/replication/repl.h
@@ -64,9 +64,7 @@
#include <time.h>
#include <stdio.h>
#include <string.h>
-#ifndef _WIN32
#include <sys/param.h>
-#endif /* _WIN32 */
#include "portable.h" /* GGOODREPL - is this cheating? */
#include "ldaplog.h"
diff --git a/ldap/servers/plugins/replication/repl5.h b/ldap/servers/plugins/replication/repl5.h
index 8381c97..60cb9a7 100644
--- a/ldap/servers/plugins/replication/repl5.h
+++ b/ldap/servers/plugins/replication/repl5.h
@@ -51,10 +51,7 @@
#include <time.h>
#include <stdio.h>
#include <string.h>
-#ifndef _WIN32
#include <sys/param.h>
-#endif /* _WIN32 */
-
#include "portable.h" /* GGOODREPL - is this cheating? */
#include "repl_shared.h"
#include "llist.h"
@@ -191,7 +188,7 @@ extern const char *type_winSyncWindowsFilter;
extern const char *type_winSyncDirectoryFilter;
extern const char *type_winSyncSubtreePair;
-/* To Allow Consumer Initialisation when adding an agreement - */
+/* To Allow Consumer Initialization when adding an agreement - */
extern const char *type_nsds5BeginReplicaRefresh;
/* For tuning replica release */
diff --git a/ldap/servers/plugins/replication/repl_init.c b/ldap/servers/plugins/replication/repl_init.c
index 7a7c32c..7e3d4ca 100644
--- a/ldap/servers/plugins/replication/repl_init.c
+++ b/ldap/servers/plugins/replication/repl_init.c
@@ -71,14 +71,6 @@ NOTE: This plugin depends on the Multi-Master Replication Plugin
#include "repl_shared.h"
#include "cl4.h" /* changelog interface */
-#ifdef _WIN32
-int *module_ldap_debug = 0;
-
-void plugin_init_debug_level(int *level_ptr)
-{
- module_ldap_debug = level_ptr;
-}
-#endif
/* ----------------------------- Legacy Replication Plugin */
diff --git a/ldap/servers/plugins/replication/replutil.c b/ldap/servers/plugins/replication/replutil.c
index 9b94308..e861f33 100644
--- a/ldap/servers/plugins/replication/replutil.c
+++ b/ldap/servers/plugins/replication/replutil.c
@@ -184,9 +184,6 @@ entry_print( Slapi_Entry *e )
int copyfile(char* source, char * destination, int overwrite, int mode)
{
-#if defined _WIN32
- return (0 == CopyFile(source,destination,overwrite ? FALSE : TRUE));
-#else
#ifdef DB_USE_64LFS
#define OPEN_FUNCTION dblayer_open_large
#else
@@ -252,7 +249,6 @@ error:
}
slapi_ch_free_string(&buffer);
return return_value;
-#endif
}
/* convert time from string like 1h (1 hour) to corresponding time in seconds */
diff --git a/ldap/servers/plugins/retrocl/dllmain.c b/ldap/servers/plugins/retrocl/dllmain.c
index 1a089b2..c460cd5 100644
--- a/ldap/servers/plugins/retrocl/dllmain.c
+++ b/ldap/servers/plugins/retrocl/dllmain.c
@@ -46,82 +46,10 @@
#include "ldap.h"
-#ifdef _WIN32
-/* Lifted from Q125688
- * How to Port a 16-bit DLL to a Win32 DLL
- * on the MSVC 4.0 CD
- */
-BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
-{
-
- switch (fdwReason)
- {
- case DLL_PROCESS_ATTACH:
- /* Code from LibMain inserted here. Return TRUE to keep the
- DLL loaded or return FALSE to fail loading the DLL.
-
- You may have to modify the code in your original LibMain to
- account for the fact that it may be called more than once.
- You will get one DLL_PROCESS_ATTACH for each process that
- loads the DLL. This is different from LibMain which gets
- called only once when the DLL is loaded. The only time this
- is critical is when you are using shared data sections.
- If you are using shared data sections for statically
- allocated data, you will need to be careful to initialize it
- only once. Check your code carefully.
-
- Certain one-time initializations may now need to be done for
- each process that attaches. You may also not need code from
- your original LibMain because the operating system may now
- be doing it for you.
- */
- /*
- * 16 bit code calls UnlockData()
- * which is mapped to UnlockSegment in windows.h
- * in 32 bit world UnlockData is not defined anywhere
- * UnlockSegment is mapped to GlobalUnfix in winbase.h
- * and the docs for both UnlockSegment and GlobalUnfix say
- * ".. function is oboslete. Segments have no meaning
- * in the 32-bit environment". So we do nothing here.
- */
-
- break;
-
- case DLL_THREAD_ATTACH:
- /* Called each time a thread is created in a process that has
- already loaded (attached to) this DLL. Does not get called
- for each thread that exists in the process before it loaded
- the DLL.
-
- Do thread-specific initialization here.
- */
- break;
-
- case DLL_THREAD_DETACH:
- /* Same as above, but called when a thread in the process
- exits.
-
- Do thread-specific cleanup here.
- */
- break;
-
- case DLL_PROCESS_DETACH:
- /* Code from _WEP inserted here. This code may (like the
- LibMain) not be necessary. Check to make certain that the
- operating system is not doing it for you.
- */
-
- break;
- }
- /* The return value is only used for DLL_PROCESS_ATTACH; all other
- conditions are ignored. */
- return TRUE; /* successful DLL_PROCESS_ATTACH */
-}
-#else
int CALLBACK
LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
{
/*UnlockData( 0 );*/
return( 1 );
}
-#endif
+
diff --git a/ldap/servers/plugins/retrocl/retrocl.c b/ldap/servers/plugins/retrocl/retrocl.c
index 8a0f350..1d9866e 100644
--- a/ldap/servers/plugins/retrocl/retrocl.c
+++ b/ldap/servers/plugins/retrocl/retrocl.c
@@ -64,14 +64,6 @@ nsslapd-plugindescription: Retrocl Plugin
#include "retrocl.h"
-#ifdef _WIN32
-int *module_ldap_debug = 0;
-
-void plugin_init_debug_level(int *level_ptr)
-{
- module_ldap_debug = level_ptr;
-}
-#endif
void* g_plg_identity [PLUGIN_MAX];
Slapi_Backend *retrocl_be_changelog = NULL;
diff --git a/ldap/servers/plugins/rever/dllmain.c b/ldap/servers/plugins/rever/dllmain.c
index 50afe62..f107648 100644
--- a/ldap/servers/plugins/rever/dllmain.c
+++ b/ldap/servers/plugins/rever/dllmain.c
@@ -47,82 +47,9 @@
#include "rever.h"
-#ifdef _WIN32
-/* Lifted from Q125688
- * How to Port a 16-bit DLL to a Win32 DLL
- * on the MSVC 4.0 CD
- */
-BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
-{
-
- switch (fdwReason)
- {
- case DLL_PROCESS_ATTACH:
- /* Code from LibMain inserted here. Return TRUE to keep the
- DLL loaded or return FALSE to fail loading the DLL.
-
- You may have to modify the code in your original LibMain to
- account for the fact that it may be called more than once.
- You will get one DLL_PROCESS_ATTACH for each process that
- loads the DLL. This is different from LibMain which gets
- called only once when the DLL is loaded. The only time this
- is critical is when you are using shared data sections.
- If you are using shared data sections for statically
- allocated data, you will need to be careful to initialize it
- only once. Check your code carefully.
-
- Certain one-time initializations may now need to be done for
- each process that attaches. You may also not need code from
- your original LibMain because the operating system may now
- be doing it for you.
- */
- /*
- * 16 bit code calls UnlockData()
- * which is mapped to UnlockSegment in windows.h
- * in 32 bit world UnlockData is not defined anywhere
- * UnlockSegment is mapped to GlobalUnfix in winbase.h
- * and the docs for both UnlockSegment and GlobalUnfix say
- * ".. function is oboslete. Segments have no meaning
- * in the 32-bit environment". So we do nothing here.
- */
-
- break;
-
- case DLL_THREAD_ATTACH:
- /* Called each time a thread is created in a process that has
- already loaded (attached to) this DLL. Does not get called
- for each thread that exists in the process before it loaded
- the DLL.
-
- Do thread-specific initialization here.
- */
- break;
-
- case DLL_THREAD_DETACH:
- /* Same as above, but called when a thread in the process
- exits.
-
- Do thread-specific cleanup here.
- */
- break;
-
- case DLL_PROCESS_DETACH:
- /* Code from _WEP inserted here. This code may (like the
- LibMain) not be necessary. Check to make certain that the
- operating system is not doing it for you.
- */
-
- break;
- }
- /* The return value is only used for DLL_PROCESS_ATTACH; all other
- conditions are ignored. */
- return TRUE; /* successful DLL_PROCESS_ATTACH */
-}
-#else
int CALLBACK
LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
{
/*UnlockData( 0 );*/
return( 1 );
}
-#endif
diff --git a/ldap/servers/plugins/roles/dllmain.c b/ldap/servers/plugins/roles/dllmain.c
index 1fb17e4..de55d26 100644
--- a/ldap/servers/plugins/roles/dllmain.c
+++ b/ldap/servers/plugins/roles/dllmain.c
@@ -46,88 +46,9 @@
#include "ldap.h"
#include "lber.h"
-
-#ifdef _WIN32
-/* Lifted from Q125688
- * How to Port a 16-bit DLL to a Win32 DLL
- * on the MSVC 4.0 CD
- */
-BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
-{
- WSADATA wsadata;
-
- switch (fdwReason)
- {
- case DLL_PROCESS_ATTACH:
- /* Code from LibMain inserted here. Return TRUE to keep the
- DLL loaded or return FALSE to fail loading the DLL.
-
- You may have to modify the code in your original LibMain to
- account for the fact that it may be called more than once.
- You will get one DLL_PROCESS_ATTACH for each process that
- loads the DLL. This is different from LibMain which gets
- called only once when the DLL is loaded. The only time this
- is critical is when you are using shared data sections.
- If you are using shared data sections for statically
- allocated data, you will need to be careful to initialize it
- only once. Check your code carefully.
-
- Certain one-time initializations may now need to be done for
- each process that attaches. You may also not need code from
- your original LibMain because the operating system may now
- be doing it for you.
- */
- /*
- * 16 bit code calls UnlockData()
- * which is mapped to UnlockSegment in windows.h
- * in 32 bit world UnlockData is not defined anywhere
- * UnlockSegment is mapped to GlobalUnfix in winbase.h
- * and the docs for both UnlockSegment and GlobalUnfix say
- * ".. function is oboslete. Segments have no meaning
- * in the 32-bit environment". So we do nothing here.
- */
-
- if( errno = WSAStartup(0x0101, &wsadata ) != 0 )
- return FALSE;
-
- break;
-
- case DLL_THREAD_ATTACH:
- /* Called each time a thread is created in a process that has
- already loaded (attached to) this DLL. Does not get called
- for each thread that exists in the process before it loaded
- the DLL.
-
- Do thread-specific initialization here.
- */
- break;
-
- case DLL_THREAD_DETACH:
- /* Same as above, but called when a thread in the process
- exits.
-
- Do thread-specific cleanup here.
- */
- break;
-
- case DLL_PROCESS_DETACH:
- /* Code from _WEP inserted here. This code may (like the
- LibMain) not be necessary. Check to make certain that the
- operating system is not doing it for you.
- */
- WSACleanup();
-
- break;
- }
- /* The return value is only used for DLL_PROCESS_ATTACH; all other
- conditions are ignored. */
- return TRUE; // successful DLL_PROCESS_ATTACH
-}
-#else
int CALLBACK
LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
{
/*UnlockData( 0 );*/
return( 1 );
}
-#endif
diff --git a/ldap/servers/plugins/roles/roles_plugin.c b/ldap/servers/plugins/roles/roles_plugin.c
index 80794df..5e3f1a5 100644
--- a/ldap/servers/plugins/roles/roles_plugin.c
+++ b/ldap/servers/plugins/roles/roles_plugin.c
@@ -63,14 +63,6 @@ static void * roles_plugin_identity = NULL;
static Slapi_PluginDesc pdesc = { "roles",
VENDOR, DS_PACKAGE_VERSION, "roles plugin" };
-#ifdef _WIN32
-int *module_ldap_debug = 0;
-
-void plugin_init_debug_level(int *level_ptr)
-{
- module_ldap_debug = level_ptr;
-}
-#endif
static int roles_start( Slapi_PBlock *pb );
static int roles_post_op( Slapi_PBlock *pb );
diff --git a/ldap/servers/plugins/statechange/dllmain.c b/ldap/servers/plugins/statechange/dllmain.c
index 1fb17e4..d23057a 100644
--- a/ldap/servers/plugins/statechange/dllmain.c
+++ b/ldap/servers/plugins/statechange/dllmain.c
@@ -47,87 +47,10 @@
#include "lber.h"
-#ifdef _WIN32
-/* Lifted from Q125688
- * How to Port a 16-bit DLL to a Win32 DLL
- * on the MSVC 4.0 CD
- */
-BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
-{
- WSADATA wsadata;
-
- switch (fdwReason)
- {
- case DLL_PROCESS_ATTACH:
- /* Code from LibMain inserted here. Return TRUE to keep the
- DLL loaded or return FALSE to fail loading the DLL.
-
- You may have to modify the code in your original LibMain to
- account for the fact that it may be called more than once.
- You will get one DLL_PROCESS_ATTACH for each process that
- loads the DLL. This is different from LibMain which gets
- called only once when the DLL is loaded. The only time this
- is critical is when you are using shared data sections.
- If you are using shared data sections for statically
- allocated data, you will need to be careful to initialize it
- only once. Check your code carefully.
-
- Certain one-time initializations may now need to be done for
- each process that attaches. You may also not need code from
- your original LibMain because the operating system may now
- be doing it for you.
- */
- /*
- * 16 bit code calls UnlockData()
- * which is mapped to UnlockSegment in windows.h
- * in 32 bit world UnlockData is not defined anywhere
- * UnlockSegment is mapped to GlobalUnfix in winbase.h
- * and the docs for both UnlockSegment and GlobalUnfix say
- * ".. function is oboslete. Segments have no meaning
- * in the 32-bit environment". So we do nothing here.
- */
-
- if( errno = WSAStartup(0x0101, &wsadata ) != 0 )
- return FALSE;
-
- break;
-
- case DLL_THREAD_ATTACH:
- /* Called each time a thread is created in a process that has
- already loaded (attached to) this DLL. Does not get called
- for each thread that exists in the process before it loaded
- the DLL.
-
- Do thread-specific initialization here.
- */
- break;
-
- case DLL_THREAD_DETACH:
- /* Same as above, but called when a thread in the process
- exits.
-
- Do thread-specific cleanup here.
- */
- break;
-
- case DLL_PROCESS_DETACH:
- /* Code from _WEP inserted here. This code may (like the
- LibMain) not be necessary. Check to make certain that the
- operating system is not doing it for you.
- */
- WSACleanup();
-
- break;
- }
- /* The return value is only used for DLL_PROCESS_ATTACH; all other
- conditions are ignored. */
- return TRUE; // successful DLL_PROCESS_ATTACH
-}
-#else
int CALLBACK
LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
{
/*UnlockData( 0 );*/
return( 1 );
}
-#endif
+
diff --git a/ldap/servers/plugins/statechange/statechange.c b/ldap/servers/plugins/statechange/statechange.c
index ad2cc0a..ec30f40 100644
--- a/ldap/servers/plugins/statechange/statechange.c
+++ b/ldap/servers/plugins/statechange/statechange.c
@@ -47,11 +47,8 @@
#include "portable.h"
#include "slapi-plugin.h"
#include "statechange.h"
-
-/* get file mode flags for unix */
-#ifndef _WIN32
#include <sys/stat.h>
-#endif
+
/* the circular list of systems to notify */
typedef struct _statechange_notify
@@ -100,16 +97,6 @@ static Slapi_PluginDesc pdesc = { "statechange", VENDOR, DS_PACKAGE_VERSION,
"state change notification service plugin" };
-#ifdef _WIN32
-int *module_ldap_debug = 0;
-
-void plugin_init_debug_level(int *level_ptr)
-{
- module_ldap_debug = level_ptr;
-}
-#endif
-
-
/*
statechange_init
--------
diff --git a/ldap/servers/plugins/syntaxes/debug.c b/ldap/servers/plugins/syntaxes/debug.c
index c887875..51f02c6 100644
--- a/ldap/servers/plugins/syntaxes/debug.c
+++ b/ldap/servers/plugins/syntaxes/debug.c
@@ -47,11 +47,3 @@
#include <sys/types.h>
#include "syntax.h"
-#ifdef _WIN32
-int *module_ldap_debug = 0;
-
-void plugin_init_debug_level(int *level_ptr)
-{
- module_ldap_debug = level_ptr;
-}
-#endif
diff --git a/ldap/servers/plugins/syntaxes/dllmain.c b/ldap/servers/plugins/syntaxes/dllmain.c
index d1555c3..0dd3ff0 100644
--- a/ldap/servers/plugins/syntaxes/dllmain.c
+++ b/ldap/servers/plugins/syntaxes/dllmain.c
@@ -45,97 +45,18 @@
*/
#include "ldap.h"
#include "syntax.h"
+#include <stdio.h>
-#ifdef _WIN32
-/* Lifted from Q125688
- * How to Port a 16-bit DLL to a Win32 DLL
- * on the MSVC 4.0 CD
- */
-BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
-{
- WSADATA wsadata;
-
- switch (fdwReason)
- {
- case DLL_PROCESS_ATTACH:
- /* Code from LibMain inserted here. Return TRUE to keep the
- DLL loaded or return FALSE to fail loading the DLL.
-
- You may have to modify the code in your original LibMain to
- account for the fact that it may be called more than once.
- You will get one DLL_PROCESS_ATTACH for each process that
- loads the DLL. This is different from LibMain which gets
- called only once when the DLL is loaded. The only time this
- is critical is when you are using shared data sections.
- If you are using shared data sections for statically
- allocated data, you will need to be careful to initialize it
- only once. Check your code carefully.
-
- Certain one-time initializations may now need to be done for
- each process that attaches. You may also not need code from
- your original LibMain because the operating system may now
- be doing it for you.
- */
- /*
- * 16 bit code calls UnlockData()
- * which is mapped to UnlockSegment in windows.h
- * in 32 bit world UnlockData is not defined anywhere
- * UnlockSegment is mapped to GlobalUnfix in winbase.h
- * and the docs for both UnlockSegment and GlobalUnfix say
- * ".. function is oboslete. Segments have no meaning
- * in the 32-bit environment". So we do nothing here.
- */
-
- if( errno = WSAStartup(0x0101, &wsadata ) != 0 )
- return FALSE;
-
- break;
-
- case DLL_THREAD_ATTACH:
- /* Called each time a thread is created in a process that has
- already loaded (attached to) this DLL. Does not get called
- for each thread that exists in the process before it loaded
- the DLL.
-
- Do thread-specific initialization here.
- */
- break;
-
- case DLL_THREAD_DETACH:
- /* Same as above, but called when a thread in the process
- exits.
-
- Do thread-specific cleanup here.
- */
- break;
-
- case DLL_PROCESS_DETACH:
- /* Code from _WEP inserted here. This code may (like the
- LibMain) not be necessary. Check to make certain that the
- operating system is not doing it for you.
- */
- WSACleanup();
-
- break;
- }
- /* The return value is only used for DLL_PROCESS_ATTACH; all other
- conditions are ignored. */
- return TRUE; // successful DLL_PROCESS_ATTACH
-}
-#else
int CALLBACK
LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
{
/*UnlockData( 0 );*/
return( 1 );
}
-#endif
#ifdef LDAP_DEBUG
-#ifndef _WIN32
#include <stdarg.h>
-#include <stdio.h>
void LDAPDebug( int level, char* fmt, ... )
{
@@ -153,13 +74,7 @@ void LDAPDebug( int level, char* fmt, ... )
}
}
#endif
-#endif
-
-#ifndef _WIN32
-
-/* The 16-bit version of the RTL does not implement perror() */
-#include <stdio.h>
void perror( const char *msg )
{
@@ -167,5 +82,3 @@ void perror( const char *msg )
wsprintf( buf, "%s: error %d\n", msg, WSAGetLastError()) ;
OutputDebugString( buf );
}
-
-#endif
diff --git a/ldap/servers/plugins/uiduniq/7bit.c b/ldap/servers/plugins/uiduniq/7bit.c
index a96951e..c326b9a 100644
--- a/ldap/servers/plugins/uiduniq/7bit.c
+++ b/ldap/servers/plugins/uiduniq/7bit.c
@@ -53,12 +53,6 @@
#include <string.h>
/* DBDB this should be pulled from a common header file */
-#ifdef _WIN32
-#ifndef strcasecmp
-#define strcasecmp(x,y) strcmpi(x,y)
-#endif
-#endif
-
#if defined( LDAP_DEBUG ) && !defined( DEBUG )
#define DEBUG
#endif
diff --git a/ldap/servers/plugins/vattrsp_template/dllmain.c b/ldap/servers/plugins/vattrsp_template/dllmain.c
index 1fb17e4..21b45cc 100644
--- a/ldap/servers/plugins/vattrsp_template/dllmain.c
+++ b/ldap/servers/plugins/vattrsp_template/dllmain.c
@@ -47,87 +47,9 @@
#include "lber.h"
-#ifdef _WIN32
-/* Lifted from Q125688
- * How to Port a 16-bit DLL to a Win32 DLL
- * on the MSVC 4.0 CD
- */
-BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
-{
- WSADATA wsadata;
-
- switch (fdwReason)
- {
- case DLL_PROCESS_ATTACH:
- /* Code from LibMain inserted here. Return TRUE to keep the
- DLL loaded or return FALSE to fail loading the DLL.
-
- You may have to modify the code in your original LibMain to
- account for the fact that it may be called more than once.
- You will get one DLL_PROCESS_ATTACH for each process that
- loads the DLL. This is different from LibMain which gets
- called only once when the DLL is loaded. The only time this
- is critical is when you are using shared data sections.
- If you are using shared data sections for statically
- allocated data, you will need to be careful to initialize it
- only once. Check your code carefully.
-
- Certain one-time initializations may now need to be done for
- each process that attaches. You may also not need code from
- your original LibMain because the operating system may now
- be doing it for you.
- */
- /*
- * 16 bit code calls UnlockData()
- * which is mapped to UnlockSegment in windows.h
- * in 32 bit world UnlockData is not defined anywhere
- * UnlockSegment is mapped to GlobalUnfix in winbase.h
- * and the docs for both UnlockSegment and GlobalUnfix say
- * ".. function is oboslete. Segments have no meaning
- * in the 32-bit environment". So we do nothing here.
- */
-
- if( errno = WSAStartup(0x0101, &wsadata ) != 0 )
- return FALSE;
-
- break;
-
- case DLL_THREAD_ATTACH:
- /* Called each time a thread is created in a process that has
- already loaded (attached to) this DLL. Does not get called
- for each thread that exists in the process before it loaded
- the DLL.
-
- Do thread-specific initialization here.
- */
- break;
-
- case DLL_THREAD_DETACH:
- /* Same as above, but called when a thread in the process
- exits.
-
- Do thread-specific cleanup here.
- */
- break;
-
- case DLL_PROCESS_DETACH:
- /* Code from _WEP inserted here. This code may (like the
- LibMain) not be necessary. Check to make certain that the
- operating system is not doing it for you.
- */
- WSACleanup();
-
- break;
- }
- /* The return value is only used for DLL_PROCESS_ATTACH; all other
- conditions are ignored. */
- return TRUE; // successful DLL_PROCESS_ATTACH
-}
-#else
int CALLBACK
LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
{
/*UnlockData( 0 );*/
return( 1 );
}
-#endif
diff --git a/ldap/servers/plugins/vattrsp_template/vattrsp.c b/ldap/servers/plugins/vattrsp_template/vattrsp.c
index c815761..6e14269 100644
--- a/ldap/servers/plugins/vattrsp_template/vattrsp.c
+++ b/ldap/servers/plugins/vattrsp_template/vattrsp.c
@@ -51,10 +51,7 @@
/* the global plugin handle */
static volatile vattr_sp_handle *vattr_handle = NULL;
-/* get file mode flags for unix */
-#ifndef _WIN32
#include <sys/stat.h>
-#endif
#define VATTRSP_PLUGIN_SUBSYSTEM "vattrsp-template-plugin" /* used for logging */
diff --git a/ldap/servers/plugins/views/dllmain.c b/ldap/servers/plugins/views/dllmain.c
index 1fb17e4..21b45cc 100644
--- a/ldap/servers/plugins/views/dllmain.c
+++ b/ldap/servers/plugins/views/dllmain.c
@@ -47,87 +47,9 @@
#include "lber.h"
-#ifdef _WIN32
-/* Lifted from Q125688
- * How to Port a 16-bit DLL to a Win32 DLL
- * on the MSVC 4.0 CD
- */
-BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
-{
- WSADATA wsadata;
-
- switch (fdwReason)
- {
- case DLL_PROCESS_ATTACH:
- /* Code from LibMain inserted here. Return TRUE to keep the
- DLL loaded or return FALSE to fail loading the DLL.
-
- You may have to modify the code in your original LibMain to
- account for the fact that it may be called more than once.
- You will get one DLL_PROCESS_ATTACH for each process that
- loads the DLL. This is different from LibMain which gets
- called only once when the DLL is loaded. The only time this
- is critical is when you are using shared data sections.
- If you are using shared data sections for statically
- allocated data, you will need to be careful to initialize it
- only once. Check your code carefully.
-
- Certain one-time initializations may now need to be done for
- each process that attaches. You may also not need code from
- your original LibMain because the operating system may now
- be doing it for you.
- */
- /*
- * 16 bit code calls UnlockData()
- * which is mapped to UnlockSegment in windows.h
- * in 32 bit world UnlockData is not defined anywhere
- * UnlockSegment is mapped to GlobalUnfix in winbase.h
- * and the docs for both UnlockSegment and GlobalUnfix say
- * ".. function is oboslete. Segments have no meaning
- * in the 32-bit environment". So we do nothing here.
- */
-
- if( errno = WSAStartup(0x0101, &wsadata ) != 0 )
- return FALSE;
-
- break;
-
- case DLL_THREAD_ATTACH:
- /* Called each time a thread is created in a process that has
- already loaded (attached to) this DLL. Does not get called
- for each thread that exists in the process before it loaded
- the DLL.
-
- Do thread-specific initialization here.
- */
- break;
-
- case DLL_THREAD_DETACH:
- /* Same as above, but called when a thread in the process
- exits.
-
- Do thread-specific cleanup here.
- */
- break;
-
- case DLL_PROCESS_DETACH:
- /* Code from _WEP inserted here. This code may (like the
- LibMain) not be necessary. Check to make certain that the
- operating system is not doing it for you.
- */
- WSACleanup();
-
- break;
- }
- /* The return value is only used for DLL_PROCESS_ATTACH; all other
- conditions are ignored. */
- return TRUE; // successful DLL_PROCESS_ATTACH
-}
-#else
int CALLBACK
LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
{
/*UnlockData( 0 );*/
return( 1 );
}
-#endif
diff --git a/ldap/servers/plugins/views/views.c b/ldap/servers/plugins/views/views.c
index 282acfd..08d623a 100644
--- a/ldap/servers/plugins/views/views.c
+++ b/ldap/servers/plugins/views/views.c
@@ -48,21 +48,14 @@
#include "slapi-plugin.h"
#include "statechange.h"
#include "views.h"
-
+#include <sys/stat.h>
#include "slapi-plugin-compat4.h"
#include "slapi-private.h"
-
#define VIEW_OBJECTCLASS "nsView"
#define VIEW_FILTER_ATTR "nsViewFilter"
#define STATECHANGE_VIEWS_ID "Views"
#define STATECHANGE_VIEWS_CONFG_FILTER "objectclass=" VIEW_OBJECTCLASS
-
-/* get file mode flags for unix */
-#ifndef _WIN32
-#include <sys/stat.h>
-#endif
-
#define VIEWS_PLUGIN_SUBSYSTEM "views-plugin" /* used for logging */
/* cache data structs */
@@ -162,14 +155,6 @@ static void * view_plugin_identity = NULL;
static Slapi_RWLock *g_views_cache_lock;
-#ifdef _WIN32
-int *module_ldap_debug = 0;
-
-void plugin_init_debug_level(int *level_ptr)
-{
- module_ldap_debug = level_ptr;
-}
-#endif
/*
** Plugin identity mgmt
diff --git a/ldap/servers/slapd/abandon.c b/ldap/servers/slapd/abandon.c
index 9797f7c..0a88a3b 100644
--- a/ldap/servers/slapd/abandon.c
+++ b/ldap/servers/slapd/abandon.c
@@ -56,9 +56,7 @@
#include <stdio.h>
#include <sys/types.h>
-#ifndef _WIN32
#include <sys/socket.h>
-#endif
#include "slap.h"
void
diff --git a/ldap/servers/slapd/add.c b/ldap/servers/slapd/add.c
index 12b97e8..b38dbd5 100644
--- a/ldap/servers/slapd/add.c
+++ b/ldap/servers/slapd/add.c
@@ -63,9 +63,7 @@
#include <string.h>
#include <time.h>
#include <sys/types.h>
-#ifndef _WIN32
#include <sys/socket.h>
-#endif
#include "slap.h"
#include "pratom.h"
#include "csngen.h"
@@ -879,15 +877,7 @@ add_created_attrs(Slapi_PBlock *pb, Slapi_Entry *e)
slapi_entry_attr_replace(e, "modifiersname", bvals);
curtime = current_time();
-#ifdef _WIN32
-{
- struct tm *pt;
- pt = gmtime(&curtime);
- memcpy(<m, pt, sizeof(struct tm));
-}
-#else
gmtime_r(&curtime, <m);
-#endif
strftime(buf, sizeof(buf), "%Y%m%d%H%M%SZ", <m);
bv.bv_val = buf;
diff --git a/ldap/servers/slapd/agtmmap.c b/ldap/servers/slapd/agtmmap.c
index 7f65b35..7d38a5e 100644
--- a/ldap/servers/slapd/agtmmap.c
+++ b/ldap/servers/slapd/agtmmap.c
@@ -53,29 +53,15 @@
#include "agtmmap.h"
-#ifndef _WIN32
#include <sys/mman.h>
#include <unistd.h>
-#else
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <time.h>
-#include "nt/regparms.h"
-#endif
-
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
-#ifndef _WIN32
agt_mmap_context_t mmap_tbl [2] = { {AGT_MAP_UNINIT, -1, (caddr_t) -1},
{AGT_MAP_UNINIT, -1, (caddr_t) -1} };
-#else
-agt_mmap_context_t mmap_tbl[2] = { {AGT_MAP_UNINIT, NULL, (caddr_t) -1, NULL},
- {AGT_MAP_UNINIT, NULL, (caddr_t) -1, NULL} };
-#endif /* ! _WIN32 */
-
/****************************************************************************
*
@@ -99,16 +85,14 @@ agt_mmap_context_t mmap_tbl[2] = { {AGT_MAP_UNINIT, NULL, (caddr_t) -1, NULL},
int
agt_mopen_stats (char * statsfile, int mode, int *hdl)
{
- caddr_t fp;
- char *path;
- int rc = 0;
-#ifndef _WIN32
- int fd;
- char *buf;
- int err;
- size_t sz;
- struct stat fileinfo;
-#endif /* _WIN32 */
+ caddr_t fp;
+ char *path;
+ char *buf;
+ int rc = 0;
+ int fd;
+ int err;
+ size_t sz;
+ struct stat fileinfo;
switch (mode)
{
@@ -142,8 +126,6 @@ agt_mopen_stats (char * statsfile, int mode, int *hdl)
else
path = AGT_STATS_FILE;
-
-#ifndef _WIN32
switch (mode)
{
case O_RDONLY:
@@ -232,105 +214,6 @@ agt_mopen_stats (char * statsfile, int mode, int *hdl)
rc = 0;
break;
} /* end switch */
-#else
- /* _WIN32 */
- switch (mode) {
- case O_RDONLY:
- {
- HANDLE hFile = NULL;
- HANDLE hMapFile = NULL;
-
- /* Open existing disk file for read */
- hFile = CreateFile(path,
- GENERIC_READ | GENERIC_WRITE,
- FILE_SHARE_READ | FILE_SHARE_WRITE,
- NULL,
- OPEN_EXISTING,
- FILE_ATTRIBUTE_NORMAL,
- NULL);
- if ( hFile == INVALID_HANDLE_VALUE || hFile == NULL ) return GetLastError();
-
- /* Create mapped file handle for reading */
- hMapFile = CreateFileMapping( hFile, NULL, PAGE_READONLY, 0,
- sizeof(struct agt_stats_t),
- NULL);
- if ( hMapFile == NULL ) {
- CloseHandle( hFile );
- rc = GetLastError();
- goto bail;
- }
-
- /* Create addr ptr to the start of the file */
- fp = (caddr_t) MapViewOfFileEx( hMapFile, FILE_MAP_READ, 0, 0,
- sizeof(struct agt_stats_t), NULL );
- if ( fp == NULL ) {
- CloseHandle( hMapFile );
- CloseHandle( hFile );
- rc = GetLastError();
- goto bail;
- }
-
- /* Fill in info on this opaque handle */
- mmap_tbl[0].maptype = AGT_MAP_READ;
- mmap_tbl[0].fd = hFile;
- mmap_tbl[0].fp = fp;
- mmap_tbl[0].mfh = hMapFile;
- *hdl = 0;
-
- rc = 0;
- break;
- }
-
- case O_RDWR:
- {
-
- HANDLE hFile = NULL;
- HANDLE hMapFile = NULL;
-
- hFile = CreateFile( path,
- GENERIC_WRITE | GENERIC_READ,
- FILE_SHARE_READ | FILE_SHARE_WRITE,
- NULL,
- OPEN_ALWAYS,
- FILE_ATTRIBUTE_NORMAL,
- NULL );
- if ( hFile == INVALID_HANDLE_VALUE || hFile == NULL ) return GetLastError();
-
- /* Create mapped file handle for reading */
- hMapFile = CreateFileMapping( hFile, NULL, PAGE_READWRITE, 0,
- sizeof(struct agt_stats_t),
- NULL );
- if ( hMapFile == NULL ) {
- CloseHandle( hFile );
- rc = GetLastError();
- goto bail;
- }
-
- /* Create addr ptr to the start of the file */
- fp = (caddr_t) MapViewOfFileEx( hMapFile, FILE_MAP_ALL_ACCESS, 0, 0,
- sizeof(struct agt_stats_t), NULL );
- if ( fp == NULL ) {
- CloseHandle( hMapFile );
- CloseHandle( hFile );
- rc = GetLastError();
- goto bail;
- }
-
- mmap_tbl[1].maptype = AGT_MAP_RDWR;
- mmap_tbl[1].fd = hFile;
- mmap_tbl[1].fp = fp;
- mmap_tbl[1].mfh = hMapFile;
- *hdl = 1;
-
- rc = 0;
- break;
-
- }
-
-
- }
-
-#endif /* !__WINNT__ */
bail:
return rc;
@@ -366,22 +249,10 @@ agt_mclose_stats (int hdl)
if (mmap_tbl [hdl].fp > (caddr_t) 0)
{
-#ifndef _WIN32
munmap (mmap_tbl [hdl].fp, sizeof (struct agt_stats_t));
mmap_tbl [hdl].fp = (caddr_t) -1;
close (mmap_tbl [hdl].fd);
mmap_tbl [hdl].fd = -1;
-#else
- BOOL bUnmapped;
-
- bUnmapped = UnmapViewOfFile( mmap_tbl[hdl].fp );
- if ( mmap_tbl[hdl].mfh ) CloseHandle( mmap_tbl[hdl].mfh );
- if ( mmap_tbl[hdl].fd ) CloseHandle( mmap_tbl[hdl].fd );
-
- mmap_tbl[hdl].fp = (caddr_t) -1;
- mmap_tbl[hdl].mfh = NULL;
- mmap_tbl[hdl].fd = NULL;
-#endif /* ! _WIN32 */
mmap_tbl [hdl].maptype = AGT_MAP_UNINIT;
return (0);
}
diff --git a/ldap/servers/slapd/agtmmap.h b/ldap/servers/slapd/agtmmap.h
index b7a5d5e..0a9bff9 100644
--- a/ldap/servers/slapd/agtmmap.h
+++ b/ldap/servers/slapd/agtmmap.h
@@ -59,10 +59,6 @@
#include <fcntl.h>
#include <errno.h>
#include "nspr.h"
-#ifdef _WIN32
-#include <windows.h>
-#define caddr_t PCHAR
-#endif
#ifdef __cplusplus
extern "C" {
@@ -72,9 +68,7 @@ extern "C" {
#define NUM_SNMP_INT_TBL_ROWS 5
#define SNMP_FIELD_LENGTH 100
-#ifndef _WIN32
extern int errno;
-#endif
#if !defined(_MAX_PATH)
#define _MAX_PATH 256
@@ -87,22 +81,12 @@ extern int errno;
typedef enum { AGT_MAP_UNINIT = 0, AGT_MAP_READ, AGT_MAP_RDWR } agt_mmap_type;
-#ifndef _WIN32
typedef struct
{
agt_mmap_type maptype;
int fd;
caddr_t fp;
} agt_mmap_context_t;
-#else
-typedef struct
-{
- agt_mmap_type maptype;
- HANDLE fd;
- caddr_t fp;
- HANDLE mfh;
-} agt_mmap_context_t;
-#endif /* ! _WIN32 */
struct hdr_stats_t{
/*
diff --git a/ldap/servers/slapd/attr.c b/ldap/servers/slapd/attr.c
index f19e7e6..8a2d6b1 100644
--- a/ldap/servers/slapd/attr.c
+++ b/ldap/servers/slapd/attr.c
@@ -47,12 +47,10 @@
#include <ctype.h>
#include <sys/types.h>
#include <sys/stat.h>
-#ifndef _WIN32
#include <sys/time.h>
#include <sys/param.h>
#include <fcntl.h>
#include <sys/socket.h>
-#endif
#include "slap.h"
#undef DEBUG /* disable counters */
#include <prcountr.h>
diff --git a/ldap/servers/slapd/auth.c b/ldap/servers/slapd/auth.c
index ae4af50..965a1c5 100644
--- a/ldap/servers/slapd/auth.c
+++ b/ldap/servers/slapd/auth.c
@@ -45,9 +45,7 @@
#include <ldaputil/ldaputil.h> /* LDAPU_SUCCESS, ldapu_VTable_set */
#include <ldaputil/init.h> /* ldaputil_init */
#include <ldaputil/certmap.h> /* ldapu_cert_to_ldap_entry */
-#ifndef _WIN32
#include <sys/param.h> /* MAXPATHLEN */
-#endif
#include "slap.h" /* slapi_ch_malloc */
#include "fe.h"
diff --git a/ldap/servers/slapd/ava.c b/ldap/servers/slapd/ava.c
index e97e9e7..70d59d7 100644
--- a/ldap/servers/slapd/ava.c
+++ b/ldap/servers/slapd/ava.c
@@ -45,9 +45,7 @@
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
-#ifndef _WIN32
#include <sys/socket.h>
-#endif
#include "slap.h"
int
diff --git a/ldap/servers/slapd/back-ldbm/back-ldbm.h b/ldap/servers/slapd/back-ldbm/back-ldbm.h
index b3badbc..074aa4c 100644
--- a/ldap/servers/slapd/back-ldbm/back-ldbm.h
+++ b/ldap/servers/slapd/back-ldbm/back-ldbm.h
@@ -84,30 +84,16 @@
#include "prio.h" /* for PR_OpenDir etc */
#include "prlog.h" /* for PR_ASSERT */
/* The following cruft is for ldif2db only */
-#ifndef XP_WIN32
#include <unistd.h> /* write/close (ldbm2ldif_write) */
-#else
-#include <io.h> /* write/close (ldbm2ldif_write) */
-#endif
#include <fcntl.h>
#include <time.h>
/* And this cruft is from nextid.c */
-#ifndef _WIN32
#include <sys/param.h>
-#endif /* ! _WIN32 */
#include <limits.h> /* Used in search.c (why?) */
-
-
-#ifndef _WIN32
/* for MAXPATHLEN */
#include <sys/param.h>
#define MKDIR(path,mode) mkdir((path),(mode))
-#else
-/* for mkdir */
-#include <direct.h>
-#define MKDIR(path,mode) mkdir(path)
-#endif
#ifdef HPUX11
#define __BIT_TYPES_DEFINED__
diff --git a/ldap/servers/slapd/back-ldbm/dblayer.c b/ldap/servers/slapd/back-ldbm/dblayer.c
index ac315bb..41646b2 100644
--- a/ldap/servers/slapd/back-ldbm/dblayer.c
+++ b/ldap/servers/slapd/back-ldbm/dblayer.c
@@ -95,11 +95,9 @@
#include "dblayer.h"
#include <prthread.h>
#include <prclist.h>
-#ifndef XP_WIN32
#include <sys/types.h>
#include <sys/statvfs.h>
#include <sys/resource.h>
-#endif
#if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR >= 4100
#define DB_OPEN(oflags, db, txnid, file, database, type, flags, mode, rval) \
@@ -793,20 +791,6 @@ static void dblayer_select_ncache(size_t cachesize, int *ncachep)
*ncachep, 0, 0);
}
#endif
- /* On Windows, we know that it's hard to allocate more than some
- * maximum chunk. In that case
- * we set ncache to a sensible value.
- */
-#if defined(_WIN32)
- {
- size_t max_windows_chunk = (300 * MEGABYTE); /* This number was determined empirically on Win2k */
- if (cachesize > max_windows_chunk) {
- *ncachep = (cachesize / max_windows_chunk) + 1;
- LDAPDebug(LDAP_DEBUG_ANY,"Setting ncache to: %d for Windows memory address space fragmentation\n",
- *ncachep, 0, 0);
- }
- }
-#endif
}
/* This function is no longer called :
@@ -935,7 +919,6 @@ static void dblayer_init_dbenv(DB_ENV *pEnv, dblayer_private *priv)
#include <sys/pstat.h>
#endif
-#if !defined(_WIN32)
static size_t dblayer_getvirtualmemsize()
{
struct rlimit rl;
@@ -944,7 +927,6 @@ static size_t dblayer_getvirtualmemsize()
getrlimit(RLIMIT_AS, &rl);
return rl.rlim_cur;
}
-#endif
/* pages = number of pages of physical ram on the machine (corrected for 32-bit build on 64-bit machine).
* procpages = pages currently used by this process (or working set size, sometimes)
@@ -956,26 +938,6 @@ void dblayer_sys_pages(size_t *pagesize, size_t *pages, size_t *procpages, size_
if (procpages)
*procpages = 0;
-#ifdef _WIN32
- {
- SYSTEM_INFO si;
- MEMORYSTATUS ms;
-
- GetSystemInfo(&si);
- ms.dwLength = sizeof(ms);
- GlobalMemoryStatus(&ms);
- *pagesize = si.dwPageSize;
- *pages = ms.dwTotalPhys / si.dwPageSize;
- *availpages = ms.dwAvailVirtual / *pagesize;
- if (procpages) {
- DWORD minwss = 0, maxwss = 0;
-
- GetProcessWorkingSetSize(GetCurrentProcess(), &minwss, &maxwss);
- *procpages = (int)(maxwss / si.dwPageSize);
- }
- }
-#endif
-
#ifdef OS_solaris
*pagesize = (int)sysconf(_SC_PAGESIZE);
*pages = (int)sysconf(_SC_PHYS_PAGES);
@@ -5859,9 +5821,6 @@ static int count_dbfiles_in_dir(char *directory, int *count, int recurse)
int
dblayer_copyfile(char *source, char *destination, int overwrite, int mode)
{
-#if defined _WIN32
- return (0 == CopyFile(source,destination,overwrite ? FALSE : TRUE));
-#else
#ifdef DB_USE_64LFS
#define OPEN_FUNCTION dblayer_open_large
#else
@@ -5935,7 +5894,6 @@ error:
}
slapi_ch_free((void**)&buffer);
return return_value;
-#endif
}
/*
diff --git a/ldap/servers/slapd/back-ldbm/dllmain.c b/ldap/servers/slapd/back-ldbm/dllmain.c
index 056ccc3..b0e49dc 100644
--- a/ldap/servers/slapd/back-ldbm/dllmain.c
+++ b/ldap/servers/slapd/back-ldbm/dllmain.c
@@ -44,88 +44,14 @@
* Microsoft Windows specifics for BACK-LDBM DLL
*/
#include "back-ldbm.h"
+#include <stdio.h>
-
-#ifdef _WIN32
-/* Lifted from Q125688
- * How to Port a 16-bit DLL to a Win32 DLL
- * on the MSVC 4.0 CD
- */
-BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
-{
-
- switch (fdwReason)
- {
- case DLL_PROCESS_ATTACH:
- /* Code from LibMain inserted here. Return TRUE to keep the
- DLL loaded or return FALSE to fail loading the DLL.
-
- You may have to modify the code in your original LibMain to
- account for the fact that it may be called more than once.
- You will get one DLL_PROCESS_ATTACH for each process that
- loads the DLL. This is different from LibMain which gets
- called only once when the DLL is loaded. The only time this
- is critical is when you are using shared data sections.
- If you are using shared data sections for statically
- allocated data, you will need to be careful to initialize it
- only once. Check your code carefully.
-
- Certain one-time initializations may now need to be done for
- each process that attaches. You may also not need code from
- your original LibMain because the operating system may now
- be doing it for you.
- */
- /*
- * 16 bit code calls UnlockData()
- * which is mapped to UnlockSegment in windows.h
- * in 32 bit world UnlockData is not defined anywhere
- * UnlockSegment is mapped to GlobalUnfix in winbase.h
- * and the docs for both UnlockSegment and GlobalUnfix say
- * ".. function is oboslete. Segments have no meaning
- * in the 32-bit environment". So we do nothing here.
- */
-
-
- break;
-
- case DLL_THREAD_ATTACH:
- /* Called each time a thread is created in a process that has
- already loaded (attached to) this DLL. Does not get called
- for each thread that exists in the process before it loaded
- the DLL.
-
- Do thread-specific initialization here.
- */
- break;
-
- case DLL_THREAD_DETACH:
- /* Same as above, but called when a thread in the process
- exits.
-
- Do thread-specific cleanup here.
- */
- break;
-
- case DLL_PROCESS_DETACH:
- /* Code from _WEP inserted here. This code may (like the
- LibMain) not be necessary. Check to make certain that the
- operating system is not doing it for you.
- */
-
- break;
- }
- /* The return value is only used for DLL_PROCESS_ATTACH; all other
- conditions are ignored. */
- return TRUE; // successful DLL_PROCESS_ATTACH
-}
-#else
int CALLBACK
LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
{
/*UnlockData( 0 );*/
return( 1 );
}
-#endif
#ifdef LDAP_DEBUG
#ifndef _WIN32
@@ -150,12 +76,7 @@ void LDAPDebug( int level, char* fmt, ... )
#endif
#endif
-#ifndef _WIN32
-
/* The 16-bit version of the RTL does not implement perror() */
-
-#include <stdio.h>
-
void perror( const char *msg )
{
char buf[128];
@@ -163,4 +84,3 @@ void perror( const char *msg )
OutputDebugString( buf );
}
-#endif
diff --git a/ldap/servers/slapd/back-ldbm/import-threads.c b/ldap/servers/slapd/back-ldbm/import-threads.c
index 6ad1c48..2100abb 100644
--- a/ldap/servers/slapd/back-ldbm/import-threads.c
+++ b/ldap/servers/slapd/back-ldbm/import-threads.c
@@ -52,9 +52,6 @@
#include "back-ldbm.h"
#include "vlv_srch.h"
#include "import.h"
-#ifdef XP_WIN32
-#define STDIN_FILENO 0
-#endif
static void import_wait_for_space_in_fifo(ImportJob *job, size_t new_esize);
static int import_get_and_add_parent_rdns(ImportWorkerInfo *info, ldbm_instance *inst, DB *db, ID id, ID *total_id, Slapi_RDN *srdn, int *curr_entry);
@@ -347,15 +344,7 @@ import_add_created_attrs(Slapi_Entry *e)
}
curtime = current_time();
-#ifdef _WIN32
-{
- struct tm *pt;
- pt = gmtime(&curtime);
- memcpy(<m, pt, sizeof(struct tm));
-}
-#else
gmtime_r(&curtime, <m);
-#endif
strftime(buf, sizeof(buf), "%Y%m%d%H%M%SZ", <m);
bv.bv_val = buf;
@@ -476,15 +465,6 @@ import_producer(void *param)
fd = STDIN_FILENO;
} else {
int o_flag = O_RDONLY;
-#ifdef XP_WIN32
- /* 613041 Somehow the windows low level io lose "\n"
- at a very particular situation using O_TEXT mode read.
- I think it is a windows bug for O_TEXT mode read.
- Use O_BINARY instead, which honestly returns chars
- without any translation.
- */
- o_flag |= O_BINARY;
-#endif
fd = dblayer_open_huge_file(curr_filename, o_flag, 0);
}
if (fd < 0) {
diff --git a/ldap/servers/slapd/back-ldbm/init.c b/ldap/servers/slapd/back-ldbm/init.c
index 6859b29..8bfadb2 100644
--- a/ldap/servers/slapd/back-ldbm/init.c
+++ b/ldap/servers/slapd/back-ldbm/init.c
@@ -51,16 +51,6 @@ static void *IDL_api[3];
static Slapi_PluginDesc pdesc = { "ldbm-backend", VENDOR,
DS_PACKAGE_VERSION, "high-performance LDAP backend database plugin" };
-#ifdef _WIN32
-int *module_ldap_debug = 0;
-
-void
-plugin_init_debug_level(int *level_ptr)
-{
- module_ldap_debug = level_ptr;
-}
-#endif
-
/* pb: not used */
int
ldbm_back_add_schema( Slapi_PBlock *pb )
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_bind.c b/ldap/servers/slapd/back-ldbm/ldbm_bind.c
index aaa7b26..ec6c7b8 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_bind.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_bind.c
@@ -44,160 +44,6 @@
#include "back-ldbm.h"
-#if defined( XP_WIN32 )
-
-typedef enum LDAPWAEnum {
- LDAPWA_NoDomainAttr = -3,
- LDAPWA_InvalidCredentials = -2,
- LDAPWA_Failure = -1,
- LDAPWA_Success= 0
-} LDAPWAStatus;
-
-int
-GetDomainUsername(
- char *pszNTuserdomainid,
- char *pszNTDomain,
- char *pszNTUsername
-)
-{
- char *pszAttr, *pDomain, *pUsername;
-
- if( !pszNTuserdomainid )
- return( 1 );
-
- // Split the specially constructed attribute.
- pszAttr = slapi_ch_strdup( pszNTuserdomainid );
-
- pDomain = pszAttr;
-
- pUsername = strchr( pszAttr, ':' );
- if( pUsername == NULL )
- return( 1 );
-
- // Set the end of the NT Domain name,
- // and the start of the NT username.
- *pUsername = (char)NULL;
- pUsername++;
-
- strcpy( pszNTDomain, pDomain);
- strcpy( pszNTUsername, pUsername);
-
- slapi_ch_free( (void**)&pszAttr );
-
- return( 0 );
-}
-
-/* Attempt Windows NT Authentication, using the password from the client app,
- with the NT Domain and NT username, both stored in the entry.
- If successful, the ldap_bind() is completed successsfully. */
-
-LDAPWAStatus
-WindowsAuthentication(
- struct backentry *e,
- struct berval *cred
-)
-{
- Slapi_Attr *a;
- Slapi_Value *sval = NULL;
- int iStatus;
- char szNTDomain[MAX_PATH], szNTUsername[MAX_PATH];
- HANDLE hToken = NULL;
- BOOL bLogonStatus = FALSE;
- int i= -1;
-
- /* Get the NT Domain and username - if the entry has such an attribute */
- if( !e || !e->ep_entry ||
- slapi_entry_attr_find( e->ep_entry, "ntuserdomainid", &a ) != 0)
- {
- return( LDAPWA_NoDomainAttr );
- }
-
- i= slapi_attr_first_value( a, &sval );
- if(sval==NULL)
- {
- return( LDAPWA_NoDomainAttr );
- }
-
- while(i != -1)
- {
- const struct berval *val = slapi_value_get_berval(sval);
- char * colon = NULL;
-
- if (!val->bv_val || (strlen(val->bv_val) > (MAX_PATH<<1))) {
- LDAPDebug( LDAP_DEBUG_TRACE,
- "WindowsAuthentication => validation FAILED for \"%s\" on NT Domain : "
- "ntuserdomainid attr value too long\n",
- val->bv_val, 0, 0);
- i= slapi_attr_next_value(a, i, &sval);
- continue;
- }
- colon = strchr( val->bv_val, ':' );
- if (!colon || ((colon - val->bv_val)/sizeof(char) > MAX_PATH)) {
- if (!colon) {
- LDAPDebug( LDAP_DEBUG_TRACE,
- "WindowsAuthentication => validation FAILED for \"%s\" on NT Domain : "
- "a colon is missing in ntuserdomainid attr value\n",
- val->bv_val, 0, 0);
- }
- else {
- LDAPDebug( LDAP_DEBUG_TRACE,
- "WindowsAuthentication => validation FAILED for \"%s\" on NT Domain : "
- "domain in ntuserdomainid attr value too long\n",
- val->bv_val, 0, 0);
- }
- i= slapi_attr_next_value(a, i, &sval);
- continue;
- }
-
- if(( iStatus = GetDomainUsername( val->bv_val,
- szNTDomain,
- szNTUsername )) != 0)
- {
- i= slapi_attr_next_value(a, i, &sval);
- continue;
- }
-
-#if !defined( LOGON32_LOGON_NETWORK )
-/* This is specified in the WIn32 LogonUser() documentation, but not defined
- in the Visual C++ 4.2 include file winbase.h. A search of the lastest version
- of this file at www.microsoft.com finds that LOGON32_LOGON_NETWORK == 3.
- */
-#define LOGON32_LOGON_NETWORK 3
-#endif
- /* Now do the Logon attempt */
- bLogonStatus = LogonUser( szNTUsername, // string that specifies the user name
- szNTDomain, // string that specifies the domain or server
- cred->bv_val, // string that specifies the password
- LOGON32_LOGON_NETWORK, // the type of logon operation,
- LOGON32_PROVIDER_DEFAULT, // specifies the logon provider
- &hToken ); // pointer to variable to receive token handle
- if( bLogonStatus && hToken )
- CloseHandle( hToken );
-
- if( bLogonStatus )
- {
- // Successful validation
- LDAPDebug( LDAP_DEBUG_TRACE,
- "WindowsAuthentication => validated \"%s\" on NT Domain \"%s\"\n",
- szNTUsername, szNTDomain, 0 );
- return( LDAPWA_Success );
- }
- else
- {
- LDAPDebug( LDAP_DEBUG_TRACE,
- "WindowsAuthentication => validation FAILED for \"%s\" on NT Domain \"%s\", reason %d\n",
- szNTUsername, szNTDomain, GetLastError() );
- return( LDAPWA_InvalidCredentials );
- }
- i= slapi_attr_next_value(a, i, &sval);
- }
-
-
- return( LDAPWA_Failure );
-
-}
-#endif
-
int
ldbm_back_bind( Slapi_PBlock *pb )
{
@@ -256,11 +102,6 @@ ldbm_back_bind( Slapi_PBlock *pb )
{
Slapi_Value cv;
if ( slapi_entry_attr_find( e->ep_entry, "userpassword", &attr ) != 0 ) {
-#if defined( XP_WIN32 )
- if( WindowsAuthentication( e, cred ) == LDAPWA_Success ) {
- break;
- }
-#endif
slapi_send_ldap_result( pb, LDAP_INAPPROPRIATE_AUTH, NULL,
NULL, 0, NULL );
CACHE_RETURN( &inst->inst_cache, &e );
@@ -270,13 +111,6 @@ ldbm_back_bind( Slapi_PBlock *pb )
bvals= attr_get_present_values(attr);
slapi_value_init_berval(&cv,cred);
if ( slapi_pw_find_sv( bvals, &cv ) != 0 ) {
-#if defined( XP_WIN32 )
- /* One last try - attempt Windows authentication,
- if the user has a Windows account. */
- if( WindowsAuthentication( e, cred ) == LDAPWA_Success ) {
- break;
- }
-#endif
slapi_send_ldap_result( pb, LDAP_INVALID_CREDENTIALS, NULL,
NULL, 0, NULL );
CACHE_RETURN( &inst->inst_cache, &e );
diff --git a/ldap/servers/slapd/back-ldbm/monitor.c b/ldap/servers/slapd/back-ldbm/monitor.c
index 469778d..ac2ef4c 100644
--- a/ldap/servers/slapd/back-ldbm/monitor.c
+++ b/ldap/servers/slapd/back-ldbm/monitor.c
@@ -186,10 +186,6 @@ int ldbm_back_monitor_instance_search(Slapi_PBlock *pb, Slapi_Entry *e,
}
for (i = 0;(mpfstat[i] && (mpfstat[i]->file_name != NULL)); i++) {
-#ifdef _WIN32
- int fpos = 0;
-#endif
-
/* only print out stats on files used by this instance */
if (strlen(mpfstat[i]->file_name) < strlen(inst->inst_dir_name))
continue;
@@ -205,7 +201,6 @@ int ldbm_back_monitor_instance_search(Slapi_PBlock *pb, Slapi_Entry *e,
slapi_ch_free_string(&absolute_pathname);
absolute_pathname = slapi_ch_smprintf("%s%c%s" , inst->inst_parent_dir_name, get_sep(inst->inst_parent_dir_name), mpfstat[i]->file_name );
-/* NPCTE fix for bugid 544365, esc 0. <P.R> <04-Jul-2001> */
/* Hide statistic of deleted files (mainly indexes) */
if (stat(absolute_pathname,&astat))
continue;
@@ -219,25 +214,10 @@ int ldbm_back_monitor_instance_search(Slapi_PBlock *pb, Slapi_Entry *e,
break;
if (j<i)
continue;
-/* end of NPCTE fix for bugid 544365 */
/* Get each file's stats */
PR_snprintf(buf, sizeof(buf), "%s", mpfstat[i]->file_name);
-#ifdef _WIN32
- /*
- * For NT, switch the last
- * backslash to a foward
- * slash. - RJP
- */
- for (fpos = strlen(buf); fpos >= 0; fpos--) {
- if (buf[fpos] == '\\') {
- buf[fpos] = '/';
- break;
- }
- }
-#endif
MSETF("dbFilename-%d", i);
-
sprintf(buf, "%lu", (unsigned long)mpfstat[i]->st_cache_hit);
MSETF("dbFileCacheHit-%d", i);
sprintf(buf, "%lu", (unsigned long)mpfstat[i]->st_cache_miss);
@@ -247,7 +227,7 @@ int ldbm_back_monitor_instance_search(Slapi_PBlock *pb, Slapi_Entry *e,
sprintf(buf, "%lu", (unsigned long)mpfstat[i]->st_page_out);
MSETF("dbFilePageOut-%d", i);
- slapi_ch_free_string(&absolute_pathname);
+ slapi_ch_free_string(&absolute_pathname);
}
slapi_ch_free_string(&absolute_pathname);
diff --git a/ldap/servers/slapd/back-ldbm/perfctrs.c b/ldap/servers/slapd/back-ldbm/perfctrs.c
index a1957db..3b43f0e 100644
--- a/ldap/servers/slapd/back-ldbm/perfctrs.c
+++ b/ldap/servers/slapd/back-ldbm/perfctrs.c
@@ -80,142 +80,21 @@ static void perfctrs_update(perfctrs_private *priv, DB_ENV *db_env);
static void perfctr_add_to_entry( Slapi_Entry *e, char *type,
PRUint32 countervalue );
-/*
- * Win32 specific code (to support the Windows NT/2000 Performance Monitor).
- */
-#if defined(_WIN32)
-static
-char * string_concatenate(char *a, char* b)
-{
- size_t string_length = 0;
- char *string = NULL;
-
- string_length = strlen(a) + strlen(b) + 1;
- string = slapi_ch_malloc(string_length);
-
- sprintf(string,"%s%s",a,b);
- return string;
-}
-
-static void init_shared_memory(perfctrs_private *priv)
-{
- performance_counters *perf = (performance_counters*)priv->memory;
- if (NULL != perf) {
- memset(perf,0,sizeof(performance_counters));
- }
-}
-
-static int open_event(char *name, perfctrs_private *priv)
-{
- HANDLE hEvent = INVALID_HANDLE_VALUE;
-
- hEvent = OpenEvent(EVENT_ALL_ACCESS,FALSE,name);
- if (NULL == hEvent) {
- hEvent = CreateEvent(NULL,FALSE,FALSE,name);
- if (NULL == hEvent) {
- LDAPDebug(LDAP_DEBUG_ANY,"BAD EV 1, err=%d\n",GetLastError(),0,0);
- return -1;
- }
- }
- priv->hEvent = hEvent;
- return 0;
-}
-
-static int open_shared_memory(char *name, perfctrs_private *priv)
-{
- HANDLE hMapping = INVALID_HANDLE_VALUE;
- void *pMemory = NULL;
- /* We fear a bug in NT where it fails to attach to an existing region on calling CreateFileMapping, so let's call OpenFileMapping first */
- hMapping = OpenFileMapping(FILE_MAP_ALL_ACCESS,FALSE,name);
- if (NULL == hMapping) {
- hMapping = CreateFileMapping((HANDLE)0xFFFFFFFF,NULL,PAGE_READWRITE,0,sizeof(performance_counters),name);
- if (NULL == hMapping) {
- LDAPDebug(LDAP_DEBUG_ANY,"BAD MAP 1, err=%d\n",GetLastError(),0,0);
- return -1;
- }
- }
- /* If we got to here, we have the mapping object open */
- pMemory = MapViewOfFile(hMapping,FILE_MAP_ALL_ACCESS,0,0,0);
- if (NULL == pMemory) {
- LDAPDebug(LDAP_DEBUG_ANY,"BAD MAP 2, err=%d\n",GetLastError(),0,0);
- return -1;
- }
- priv->memory = pMemory;
- priv->hMemory = hMapping;
- return 0;
-}
-#endif
-
/* Init perf ctrs */
void perfctrs_init(struct ldbminfo *li, perfctrs_private **ret_priv)
{
perfctrs_private *priv = NULL;
-#if defined(_WIN32)
- /* XXX What's my instance name ? */
-
- /*
- * We have a single DB environment for all backend databases.
- * Therefore the instance name can be the server instance name.
- * To match the db perf ctr DLL the instance name should be the
- * name of a key defined in the registry under:
- * HKEY_LOCAL_MACHINE\SOFTWARE\Netscape\Directory\5
- * i.e. slapd-servername
- */
-
- char *string = NULL;
- char *instance_name = li->li_plugin->plg_name; /* XXX does not identify server instance */
-#endif
-
*ret_priv = NULL;
-#if defined(_WIN32)
- /*
- * On Windows, the performance counters reside in shared memory.
- */
- if (NULL == instance_name) {
- goto error;
- }
- /* Invent the name for the shared memory region */
- string = string_concatenate(instance_name,PERFCTRS_REGION_SUFFIX);
- if (NULL == string) {
- goto error;
- }
-#endif
-
/*
* We need the perfctrs_private area on all platforms.
*/
priv = (perfctrs_private *)slapi_ch_calloc(1,sizeof(perfctrs_private));
-
-#if defined(_WIN32)
- /* Try to open the shared memory region */
- open_shared_memory(string,priv);
- free(string);
- /* Invent the name for the update mutex */
- string = string_concatenate(instance_name,PERFCTRS_MUTEX_SUFFIX);
- if (NULL == string) {
- goto error;
- }
- open_event(string,priv);
- free(string);
- init_shared_memory(priv);
-
-#else
- /*
- * On other platforms, the performance counters reside in regular memory.
- */
priv->memory = slapi_ch_calloc( 1, sizeof( performance_counters ));
-#endif
*ret_priv = priv;
return;
-
-#if defined(_WIN32)
-error:
- slapi_ch_free((void**)&priv);
- return;
-#endif
}
/* Terminate perf ctrs */
@@ -234,21 +113,9 @@ void perfctrs_terminate(perfctrs_private **priv, DB_ENV *db_env)
slapi_ch_free((void**)&logstat);
LOCK_STAT(db_env, &lockstat, DB_STAT_CLEAR, (void *)slapi_ch_malloc);
slapi_ch_free((void**)&lockstat);
-#if defined(_WIN32)
- if (NULL != (*priv)->memory) {
- UnmapViewOfFile((*priv)->memory);
- }
- if (NULL != (*priv)->hMemory) {
- CloseHandle((*priv)->hMemory);
- }
- if (NULL != (*priv)->hEvent) {
- CloseHandle((*priv)->hEvent);
- }
-#else
if (NULL != (*priv)->memory) {
slapi_ch_free(&(*priv)->memory);
}
-#endif
slapi_ch_free( (void **)priv );
}
@@ -256,26 +123,10 @@ void perfctrs_terminate(perfctrs_private **priv, DB_ENV *db_env)
/* Wait while checking for perfctr update requests */
void perfctrs_wait(size_t milliseconds,perfctrs_private *priv,DB_ENV *db_env)
{
-#if defined(_WIN32)
- if (NULL != priv) {
- DWORD ret = 0;
- if (NULL != priv->hEvent) {
- /* Sleep waiting on the perfctrs update event */
- ret = WaitForSingleObject(priv->hEvent,milliseconds);
- /* If we didn't time out, update the perfctrs */
- if (ret == WAIT_OBJECT_0) {
- perfctrs_update(priv,db_env);
- }
- } else {
- Sleep(milliseconds);
- }
- }
-#else
/* Just sleep */
PRIntervalTime interval; /*NSPR timeout stuffy*/
interval = PR_MillisecondsToInterval(milliseconds);
DS_Sleep(interval);
-#endif
}
/* Update perfctrs */
diff --git a/ldap/servers/slapd/back-ldif/back-ldif.h b/ldap/servers/slapd/back-ldif/back-ldif.h
index a286898..61179ed 100644
--- a/ldap/servers/slapd/back-ldif/back-ldif.h
+++ b/ldap/servers/slapd/back-ldif/back-ldif.h
@@ -50,20 +50,12 @@
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
-
-/* include NSPR header files */
#include "prlock.h"
-
#include "ldaplog.h"
#include "portable.h"
#include "slap.h"
-
-#ifdef _WIN32
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#else
#include <sys/socket.h>
-#endif /* _WIN32 */
+
/*Defines*/
#define LDIF_DB_ADD 0
diff --git a/ldap/servers/slapd/back-ldif/dllmain.c b/ldap/servers/slapd/back-ldif/dllmain.c
index 6b3ef87..282dce9 100644
--- a/ldap/servers/slapd/back-ldif/dllmain.c
+++ b/ldap/servers/slapd/back-ldif/dllmain.c
@@ -44,122 +44,18 @@
* Microsoft Windows specifics for LIBLDAP DLL
*/
#include "ldap.h"
+#include <stdio.h>
-#ifdef _WIN32
-/* Lifted from Q125688
- * How to Port a 16-bit DLL to a Win32 DLL
- * on the MSVC 4.0 CD
- */
-BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
-{
- WSADATA wsadata;
-
- switch (fdwReason)
- {
- case DLL_PROCESS_ATTACH:
- /* Code from LibMain inserted here. Return TRUE to keep the
- DLL loaded or return FALSE to fail loading the DLL.
-
- You may have to modify the code in your original LibMain to
- account for the fact that it may be called more than once.
- You will get one DLL_PROCESS_ATTACH for each process that
- loads the DLL. This is different from LibMain which gets
- called only once when the DLL is loaded. The only time this
- is critical is when you are using shared data sections.
- If you are using shared data sections for statically
- allocated data, you will need to be careful to initialize it
- only once. Check your code carefully.
-
- Certain one-time initializations may now need to be done for
- each process that attaches. You may also not need code from
- your original LibMain because the operating system may now
- be doing it for you.
- */
- /*
- * 16 bit code calls UnlockData()
- * which is mapped to UnlockSegment in windows.h
- * in 32 bit world UnlockData is not defined anywhere
- * UnlockSegment is mapped to GlobalUnfix in winbase.h
- * and the docs for both UnlockSegment and GlobalUnfix say
- * ".. function is oboslete. Segments have no meaning
- * in the 32-bit environment". So we do nothing here.
- */
-
- if( errno = WSAStartup(0x0101, &wsadata ) != 0 )
- return FALSE;
-
- break;
-
- case DLL_THREAD_ATTACH:
- /* Called each time a thread is created in a process that has
- already loaded (attached to) this DLL. Does not get called
- for each thread that exists in the process before it loaded
- the DLL.
-
- Do thread-specific initialization here.
- */
- break;
-
- case DLL_THREAD_DETACH:
- /* Same as above, but called when a thread in the process
- exits.
-
- Do thread-specific cleanup here.
- */
- break;
-
- case DLL_PROCESS_DETACH:
- /* Code from _WEP inserted here. This code may (like the
- LibMain) not be necessary. Check to make certain that the
- operating system is not doing it for you.
- */
- WSACleanup();
-
- break;
- }
- /* The return value is only used for DLL_PROCESS_ATTACH; all other
- conditions are ignored. */
- return TRUE; // successful DLL_PROCESS_ATTACH
-}
-#else
int CALLBACK
LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
{
/*UnlockData( 0 );*/
return( 1 );
}
-#endif
-
-#ifdef LDAP_DEBUG
-#ifndef _WIN32
-#include <stdarg.h>
-#include <stdio.h>
-
-void LDAPDebug( int level, char* fmt, ... )
-{
- static char debugBuf[1024];
-
- if (slapd_ldap_debug & level)
- {
- va_list ap;
- va_start (ap, fmt);
- _snprintf (debugBuf, sizeof(debugBuf), fmt, ap);
- debugBuf[sizeof(debugBuf)-1] = 0;
- va_end (ap);
-
- OutputDebugString (debugBuf);
- }
-}
-#endif
-#endif
-
-#ifndef _WIN32
/* The 16-bit version of the RTL does not implement perror() */
-#include <stdio.h>
-
void perror( const char *msg )
{
char buf[128];
@@ -167,4 +63,3 @@ void perror( const char *msg )
OutputDebugString( buf );
}
-#endif
diff --git a/ldap/servers/slapd/back-ldif/init.c b/ldap/servers/slapd/back-ldif/init.c
index 584c82a..696fc73 100644
--- a/ldap/servers/slapd/back-ldif/init.c
+++ b/ldap/servers/slapd/back-ldif/init.c
@@ -54,14 +54,6 @@
static Slapi_PluginDesc pdesc = { "ldif-backend", "Netscape", DS_PACKAGE_VERSION,
"LDIF backend database plugin" };
-#ifdef _WIN32
-int *module_ldap_debug = 0;
-
-void plugin_init_debug_level(int *level_ptr)
-{
- module_ldap_debug = level_ptr;
-}
-#endif
/*
* Function: ldif_back_init
diff --git a/ldap/servers/slapd/bind.c b/ldap/servers/slapd/bind.c
index acc65ce..99df72d 100644
--- a/ldap/servers/slapd/bind.c
+++ b/ldap/servers/slapd/bind.c
@@ -64,12 +64,9 @@
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
-#ifndef _WIN32
#include <sys/socket.h>
-#endif
#include "slap.h"
#include "fe.h"
-
#include "pratom.h"
#include <sasl.h>
diff --git a/ldap/servers/slapd/ch_malloc.c b/ldap/servers/slapd/ch_malloc.c
index b2afbe0..3aca001 100644
--- a/ldap/servers/slapd/ch_malloc.c
+++ b/ldap/servers/slapd/ch_malloc.c
@@ -47,9 +47,7 @@
#include <stdlib.h>
#include <string.h> /* strdup */
#include <sys/types.h>
-#ifndef _WIN32
#include <sys/socket.h>
-#endif
#undef DEBUG /* disable counters */
#include <prcountr.h>
#include "slap.h"
@@ -67,10 +65,6 @@ PR_DEFINE_COUNTER(slapi_ch_counter_exist);
static void *oom_emergency_area = NULL;
static PRLock *oom_emergency_lock = NULL;
-#if defined(_WIN32)
-static int recording= 0;
-#endif
-
#define SLAPD_MODULE "memory allocator"
static const char* const oom_advice =
@@ -83,13 +77,6 @@ static const char* const oom_advice =
" nsslapd-import-cachesize (LDBM Plug-in Settings - Import cache size).\n"
"Can't recover; calling exit(1).\n";
-#if defined(_WIN32) && defined(DEBUG)
-static void add_memory_record(void *p,unsigned long size);
-static void remove_memory_record(void *p);
-static int memory_record_dump( caddr_t data, caddr_t arg );
-static int memory_record_delete( caddr_t data, caddr_t arg );
-#endif
-
static void
create_counters()
{
@@ -169,12 +156,6 @@ slapi_ch_malloc(
PR_INCREMENT_COUNTER(slapi_ch_counter_malloc);
PR_INCREMENT_COUNTER(slapi_ch_counter_created);
PR_INCREMENT_COUNTER(slapi_ch_counter_exist);
-#if defined(_WIN32) && defined(DEBUG)
- if(recording)
- {
- add_memory_record(newmem,size);
- }
-#endif
return( newmem );
}
@@ -211,13 +192,6 @@ slapi_ch_realloc(
counters_created= 1;
}
PR_INCREMENT_COUNTER(slapi_ch_counter_realloc);
-#if defined(_WIN32) && defined(DEBUG)
- if(recording)
- {
- remove_memory_record(block);
- add_memory_record(newmem,size);
- }
-#endif
return( newmem );
}
@@ -257,12 +231,7 @@ slapi_ch_calloc(
PR_INCREMENT_COUNTER(slapi_ch_counter_calloc);
PR_INCREMENT_COUNTER(slapi_ch_counter_created);
PR_INCREMENT_COUNTER(slapi_ch_counter_exist);
-#if defined(_WIN32) && defined(DEBUG)
- if(recording)
- {
- add_memory_record(newmem,size);
- }
-#endif
+
return( newmem );
}
@@ -293,12 +262,7 @@ slapi_ch_strdup ( const char* s1)
PR_INCREMENT_COUNTER(slapi_ch_counter_strdup);
PR_INCREMENT_COUNTER(slapi_ch_counter_created);
PR_INCREMENT_COUNTER(slapi_ch_counter_exist);
-#if defined(_WIN32) && defined(DEBUG)
- if(recording)
- {
- add_memory_record(newmem,strlen(s1)+1);
- }
-#endif
+
return newmem;
}
#endif /* !MEMPOOL_EXPERIMENTAL */
@@ -325,13 +289,13 @@ slapi_ch_bvecdup (struct berval** v)
{
struct berval** newberval = NULL;
if (v != NULL) {
- size_t i = 0;
- while (v[i] != NULL) ++i;
- newberval = (struct berval**) slapi_ch_malloc ((i + 1) * sizeof (struct berval*));
- newberval[i] = NULL;
- while (i-- > 0) {
- newberval[i] = slapi_ch_bvdup (v[i]);
- }
+ size_t i = 0;
+ while (v[i] != NULL) ++i;
+ newberval = (struct berval**) slapi_ch_malloc ((i + 1) * sizeof (struct berval*));
+ newberval[i] = NULL;
+ while (i-- > 0) {
+ newberval[i] = slapi_ch_bvdup (v[i]);
+ }
}
return newberval;
}
@@ -351,15 +315,9 @@ void
slapi_ch_free(void **ptr)
{
if (ptr==NULL || *ptr == NULL){
- return;
+ return;
}
-#if defined(_WIN32) && defined(DEBUG)
- if(recording)
- {
- remove_memory_record(*ptr);
- }
-#endif
free (*ptr);
*ptr = NULL;
if(!counters_created)
@@ -436,305 +394,3 @@ slapi_ch_smprintf(const char *fmt, ...)
return p;
}
#endif
-
-/* ========================= NT Specific Leak Checking Code ================================== */
-
-#if defined(_WIN32) && defined(DEBUG)
-#define STOP_TRAVERSAL -2
-#define MR_CALL_STACK 16
-#define MR_DUMP_AMOUNT 16
-static Avlnode *mr_tree= NULL;
-static PRLock *mr_tree_lock= NULL;
-#endif
-
-void
-slapi_ch_start_recording()
-{
-#if defined(_WIN32) && defined(DEBUG)
- if(mr_tree_lock==NULL)
- {
- mr_tree_lock = PR_NewLock();
- }
- PR_Lock( mr_tree_lock );
- recording= 1;
- PR_Unlock( mr_tree_lock );
-#endif
-}
-
-void
-slapi_ch_stop_recording()
-{
-#if defined(_WIN32) && defined(DEBUG)
- PR_Lock( mr_tree_lock );
- recording= 0;
- avl_apply( mr_tree, memory_record_dump, NULL, STOP_TRAVERSAL, AVL_INORDER );
- avl_free( mr_tree, memory_record_delete );
- mr_tree= NULL;
- PR_Unlock( mr_tree_lock );
-#endif
-}
-
-#if defined(_WIN32) && defined(DEBUG)
-
-struct memory_record
-{
- void *p;
- unsigned long size;
- DWORD ra[MR_CALL_STACK];
-};
-
-
-static void
-mr_to_hex_dump(char* dest, void *addr, int size, int MaxBytes)
-{
- int i;
- for (i=0; i<MaxBytes; i++)
- {
- if(i<size)
- {
- wsprintf(dest+i*2, "%02x", ((unsigned char*)addr)[i]);
- }
- else
- {
- strcpy(dest+i*2, " ");
- }
- }
-}
-
-static void
-mr_to_char_dump(char* dest, void *addr, int size, int MaxBytes)
-{
- int i;
- char *c= (char*)addr;
- for(i=0;i<MaxBytes;i++)
- {
- if(i<size)
- {
- *(dest+i)= (isprint(*c)?*c:'.');
- c++;
- }
- else
- {
- *(dest+i)= ' ';
- }
- }
- *(dest+i)= '\0';
-}
-
-
-/*
- * Check that the address is (probably) valid
- */
-static int ValidateBP(UINT bp)
-{
- return !(IsBadReadPtr((void*)bp, 4) || IsBadWritePtr((void*)bp, 4));
-}
-
-/*
- * Check that the address is (probably) valid
- */
-static int ValidateIP(UINT ip)
-{
- return !IsBadReadPtr((void*)ip, 4);
-}
-
-static int
-memory_record_delete( caddr_t data, caddr_t arg )
-{
- struct memory_record *mr = (struct memory_record *)data;
- free(mr);
- return 0;
-}
-
-static int
-memory_record_duplicate_disallow( caddr_t d1, caddr_t d2 )
-{
- return -1;
-}
-
-static int
-memory_record_compare( caddr_t d1, caddr_t d2 )
-{
- struct memory_record *mr1 = (struct memory_record *)d1;
- struct memory_record *mr2 = (struct memory_record *)d2;
- return (mr1->p==mr2->p);
-}
-
-static void
-grab_stack(DWORD *ra,int framestograb,int framestoskip)
-{
- int framelookingat = 0;
- int framestoring = 0;
- DWORD _bp = 0;
-
- /* for every function the frame layout is:
- * ---------
- * |ret add|
- * ---------
- * |old bp | <- new bp
- * ---------
- */
-
- __asm mov _bp, ebp;
-
- if(framestoskip==0)
- {
- ra[framestoring]= _bp;
- framestoring++;
- }
- while (framelookingat < framestograb+framestoskip-1)
- {
- DWORD returnAddress = *(((DWORD*)_bp)+1);
- _bp = *((DWORD*)_bp);
- if (!ValidateBP(_bp)) break;
- if (!ValidateIP(returnAddress)) break;
- if(framelookingat>=framestoskip)
- {
- ra[framestoring]= returnAddress;
- framestoring++;
- }
- framelookingat++;
- }
- ra[framestoring]= 0;
-}
-
-static void
-add_memory_record(void *p,unsigned long size)
-{
- struct memory_record *mr= (struct memory_record *)malloc(sizeof(struct memory_record));
- mr->p= p;
- mr->size= size;
- grab_stack(mr->ra,MR_CALL_STACK,1);
- PR_Lock( mr_tree_lock );
- avl_insert( &mr_tree, mr, memory_record_compare, memory_record_duplicate_disallow );
- PR_Unlock( mr_tree_lock );
-}
-
-static void
-remove_memory_record(void *p)
-{
- struct memory_record *mr = NULL;
- struct memory_record search;
- PR_Lock( mr_tree_lock );
- search.p= p;
- mr = (struct memory_record *)avl_find( mr_tree, &search, memory_record_compare );
- if(mr!=NULL)
- {
- avl_delete( &mr_tree, mr, memory_record_compare );
- }
- PR_Unlock( mr_tree_lock );
-}
-
-#include <imagehlp.h>
-#pragma comment(lib, "imagehlp")
-
-static BOOL SymInitialized= FALSE;
-static HANDLE s_hProcess= NULL;
-
-BOOL InitialiseImageHelp()
-{
- if (!SymInitialized)
- {
- /* OBSOLETE: we don't have this directory structure any longer */
- /*
- * searchpath= <instancedir>\bin\slapd\server;<instancedir>\lib
- */
- char *searchpath= NULL;
- /* char *id= config_get_instancedir(); eliminated */
- if(id!=NULL)
- {
- char *p= id;
- while(p!=NULL)
- {
- p= strchr(id,'/');
- if(p!=NULL) *p='\\';
- }
- p= strrchr(id,'\\');
- if(p!=NULL)
- {
- *p= '\0';
- searchpath= slapi_ch_malloc(100+strlen(p)*2);
- strcpy(searchpath,id);
- strcat(searchpath,"\\bin\\slapd\\server;");
- strcat(searchpath,id);
- strcat(searchpath,"\\lib");
- }
- }
- s_hProcess = GetCurrentProcess();
- SymInitialized = SymInitialize(s_hProcess, searchpath, TRUE);
- slapi_ch_free((void**)&id);
- slapi_ch_free((void**)&searchpath);
- if (SymInitialized)
- {
- SymSetOptions(SYMOPT_DEFERRED_LOADS);
- }
- }
- return SymInitialized;
-}
-
-BOOL AddressToName(DWORD Addr, LPTSTR Str, int Max)
-{
- DWORD base;
- if (!InitialiseImageHelp())
- return FALSE;
- base = SymGetModuleBase(s_hProcess, Addr);
- if (base)
- {
- struct
- {
- IMAGEHLP_SYMBOL ihs;
- char NameBuf[256];
- } SymInfo;
- DWORD Displacement = 0;
- SymInfo.ihs.SizeOfStruct = sizeof(SymInfo);
- SymInfo.ihs.MaxNameLength = sizeof(SymInfo.NameBuf);
- if (SymGetSymFromAddr(s_hProcess, Addr, &Displacement, &SymInfo.ihs))
- {
- if (Displacement)
- _snprintf(Str, Max-1, "%s+%x", SymInfo.ihs.Name, Displacement);
- else
- _snprintf(Str, Max-1, "%s", SymInfo.ihs.Name);
- return TRUE;
- }
- else
- {
- _snprintf(Str, Max, "SymGetSymFromAddr failed (%d)", GetLastError());
- }
- }
- else
- {
- _snprintf(Str, Max, "SymGetModuleBase failed (%d)", GetLastError());
- }
- return FALSE;
-}
-
-static int
-memory_record_dump( caddr_t data, caddr_t arg )
-{
- int frame= 0;
- char b1[MR_DUMP_AMOUNT*2+1];
- char b2[MR_DUMP_AMOUNT+1];
- char b3[128];
- int size= 0;
- struct memory_record *mr = (struct memory_record *)data;
- if(!IsBadReadPtr(mr->p, MR_DUMP_AMOUNT))
- {
- size= MR_DUMP_AMOUNT;
- }
- mr_to_hex_dump(b1, mr->p, size, MR_DUMP_AMOUNT);
- mr_to_char_dump(b2, mr->p, size, MR_DUMP_AMOUNT);
- PR_snprintf(b3,sizeof(b3),"%p %ld %s %s",mr->p,mr->size,b1,b2);
- LDAPDebug( LDAP_DEBUG_ANY, "%s\n",b3,0,0);
- while(mr->ra[frame]!=0)
- {
- char fn[100];
- AddressToName(mr->ra[frame], fn, 100);
- LDAPDebug( LDAP_DEBUG_ANY, "%d %p %s\n",frame,mr->ra[frame],fn);
- frame++;
- }
- return 0;
-}
-
-#endif
-
-
diff --git a/ldap/servers/slapd/charray.c b/ldap/servers/slapd/charray.c
index f86ddc2..ad53335 100644
--- a/ldap/servers/slapd/charray.c
+++ b/ldap/servers/slapd/charray.c
@@ -45,9 +45,7 @@
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
-#ifndef _WIN32
#include <sys/socket.h>
-#endif
#include "slap.h"
void
diff --git a/ldap/servers/slapd/compare.c b/ldap/servers/slapd/compare.c
index 5fb1d2f..62aeb7d 100644
--- a/ldap/servers/slapd/compare.c
+++ b/ldap/servers/slapd/compare.c
@@ -54,9 +54,7 @@
#include <stdio.h>
#include <sys/types.h>
-#ifndef _WIN32
#include <sys/socket.h>
-#endif
#include "slap.h"
#include "pratom.h"
diff --git a/ldap/servers/slapd/config.c b/ldap/servers/slapd/config.c
index 8dbb103..d003f70 100644
--- a/ldap/servers/slapd/config.c
+++ b/ldap/servers/slapd/config.c
@@ -47,14 +47,10 @@
#include <sys/types.h>
#include <errno.h>
#include <stdlib.h>
-#ifdef _WIN32
-#include <direct.h> /* for getcwd */
-#else
#include <sys/socket.h>
#include <sys/param.h>
#include <unistd.h>
#include <pwd.h>
-#endif
#include "slap.h"
#include "pw.h"
#include <sys/stat.h>
@@ -255,7 +251,7 @@ slapd_bootstrap_config(const char *configdir)
continue;
}
/* increase file descriptors */
-#if !defined(_WIN32) && !defined(AIX)
+#if !defined(AIX)
if (!maxdescriptors[0] &&
entry_has_attr_and_value(e, CONFIG_MAXDESCRIPTORS_ATTRIBUTE,
maxdescriptors, sizeof(maxdescriptors)))
@@ -269,7 +265,7 @@ slapd_bootstrap_config(const char *configdir)
CONFIG_MAXDESCRIPTORS_ATTRIBUTE, errorbuf);
}
}
-#endif /* !defined(_WIN32) && !defined(AIX) */
+#endif /* !defined(AIX) */
/* see if we need to enable error logging */
if (!logenabled[0] &&
@@ -287,7 +283,6 @@ slapd_bootstrap_config(const char *configdir)
}
}
-#ifndef _WIN32
/* set the local user name; needed to set up error log */
if (!_localuser[0] &&
entry_has_attr_and_value(e, CONFIG_LOCALUSER_ATTRIBUTE,
@@ -300,7 +295,6 @@ slapd_bootstrap_config(const char *configdir)
CONFIG_LOCALUSER_ATTRIBUTE, errorbuf);
}
}
-#endif
/* set the log file name */
workpath[0] = '\0';
diff --git a/ldap/servers/slapd/configdse.c b/ldap/servers/slapd/configdse.c
index 5f26e6b..954d446 100644
--- a/ldap/servers/slapd/configdse.c
+++ b/ldap/servers/slapd/configdse.c
@@ -46,10 +46,8 @@
#include <string.h>
#include <sys/types.h>
#include <errno.h>
-#ifndef _WIN32
#include <sys/socket.h>
#include <sys/param.h>
-#endif
#include "log.h"
#include "slap.h"
#include "pw.h"
diff --git a/ldap/servers/slapd/connection.c b/ldap/servers/slapd/connection.c
index 8227756..3ea0576 100644
--- a/ldap/servers/slapd/connection.c
+++ b/ldap/servers/slapd/connection.c
@@ -214,29 +214,11 @@ connection_cleanup(Connection *conn)
* PRLock *c_pdumutex;
* Conn_private *c_private;
*/
-
-#ifdef _WIN32
- if (conn->c_prfd && (conn->c_flags & CONN_FLAG_SSL))
- {
- LDAPDebug( LDAP_DEBUG_CONNS,
- "conn=%" PRIu64 " fd=%d closed now\n",
- conn->c_connid, conn->c_sd,0);
- PR_Close(conn->c_prfd);
- }
- else if (conn->c_sd)
- {
- LDAPDebug( LDAP_DEBUG_CONNS,
- "conn=%" PRIu64 " fd=%d closed now\n",
- conn->c_connid, conn->c_sd,0);
- closesocket(conn->c_sd);
- }
-#else
if (conn->c_prfd)
{
PR_Close(conn->c_prfd);
enable_listeners = 1; /* re-enable listeners disabled due to no fds */
}
-#endif
conn->c_sd= SLAPD_INVALID_SOCKET;
conn->c_ldapversion= 0;
@@ -293,11 +275,11 @@ connection_cleanup(Connection *conn)
void
connection_reset(Connection* conn, int ns, PRNetAddr * from, int fromLen, int is_SSL)
{
- char * pTmp = is_SSL ? "SSL " : "";
- char *str_ip = NULL, *str_destip;
- char buf_ip[ 256 ], buf_destip[ 256 ];
- char *str_unknown = "unknown";
- int in_referral_mode = config_check_referral_mode();
+ char *pTmp = is_SSL ? "SSL " : "";
+ char *str_ip = NULL, *str_destip;
+ char buf_ip[ 256 ], buf_destip[ 256 ];
+ char *str_unknown = "unknown";
+ int in_referral_mode = config_check_referral_mode();
LDAPDebug( LDAP_DEBUG_CONNS, "new %sconnection on %d\n", pTmp, conn->c_sd, 0 );
@@ -305,8 +287,8 @@ connection_reset(Connection* conn, int ns, PRNetAddr * from, int fromLen, int is
conn->c_connid = slapi_counter_increment(num_conns);
if (! in_referral_mode) {
- slapi_counter_increment(g_get_global_snmp_vars()->ops_tbl.dsConnectionSeq);
- slapi_counter_increment(g_get_global_snmp_vars()->ops_tbl.dsConnections);
+ slapi_counter_increment(g_get_global_snmp_vars()->ops_tbl.dsConnectionSeq);
+ slapi_counter_increment(g_get_global_snmp_vars()->ops_tbl.dsConnections);
}
/*
@@ -314,74 +296,74 @@ connection_reset(Connection* conn, int ns, PRNetAddr * from, int fromLen, int is
*/
slapi_ch_free( (void**)&conn->cin_addr ); /* just to be conservative */
if ( from->raw.family == PR_AF_LOCAL ) { /* ldapi */
- conn->cin_addr = (PRNetAddr *) slapi_ch_malloc( sizeof( PRNetAddr ) );
- PL_strncpyz(buf_ip, from->local.path, sizeof(from->local.path));
- memcpy( conn->cin_addr, from, sizeof( PRNetAddr ) );
- if (!buf_ip[0]) {
- PR_GetPeerName( conn->c_prfd, from );
- PL_strncpyz(buf_ip, from->local.path, sizeof(from->local.path));
- memcpy( conn->cin_addr, from, sizeof( PRNetAddr ) );
- }
- if (!buf_ip[0]) {
- /* cannot derive local address */
- /* need something for logging */
- PL_strncpyz(buf_ip, "local", sizeof(buf_ip));
- }
- str_ip = buf_ip;
+ conn->cin_addr = (PRNetAddr *) slapi_ch_malloc( sizeof( PRNetAddr ) );
+ PL_strncpyz(buf_ip, from->local.path, sizeof(from->local.path));
+ memcpy( conn->cin_addr, from, sizeof( PRNetAddr ) );
+ if (!buf_ip[0]) {
+ PR_GetPeerName( conn->c_prfd, from );
+ PL_strncpyz(buf_ip, from->local.path, sizeof(from->local.path));
+ memcpy( conn->cin_addr, from, sizeof( PRNetAddr ) );
+ if (!buf_ip[0]) {
+ /* Cannot derive local address, need something for logging */
+ PL_strncpyz(buf_ip, "local", sizeof(buf_ip));
+ }
+ }
+ str_ip = buf_ip;
} else if ( ((from->ipv6.ip.pr_s6_addr32[0] != 0) || /* from contains non zeros */
(from->ipv6.ip.pr_s6_addr32[1] != 0) ||
(from->ipv6.ip.pr_s6_addr32[2] != 0) ||
(from->ipv6.ip.pr_s6_addr32[3] != 0)) ||
- ((conn->c_prfd != NULL) && (PR_GetPeerName( conn->c_prfd, from ) == 0)) ) {
- conn->cin_addr = (PRNetAddr *) slapi_ch_malloc( sizeof( PRNetAddr ) );
- memcpy( conn->cin_addr, from, sizeof( PRNetAddr ) );
+ ((conn->c_prfd != NULL) && (PR_GetPeerName( conn->c_prfd, from ) == 0)) )
+ {
+ conn->cin_addr = (PRNetAddr *) slapi_ch_malloc( sizeof( PRNetAddr ) );
+ memcpy( conn->cin_addr, from, sizeof( PRNetAddr ) );
- if ( PR_IsNetAddrType( conn->cin_addr, PR_IpAddrV4Mapped ) ) {
- PRNetAddr v4addr;
- memset( &v4addr, 0, sizeof( v4addr ) );
- v4addr.inet.family = PR_AF_INET;
- v4addr.inet.ip = conn->cin_addr->ipv6.ip.pr_s6_addr32[3];
- PR_NetAddrToString( &v4addr, buf_ip, sizeof( buf_ip ) );
- } else {
- PR_NetAddrToString( conn->cin_addr, buf_ip, sizeof( buf_ip ) );
- }
- buf_ip[ sizeof( buf_ip ) - 1 ] = '\0';
- str_ip = buf_ip;
+ if ( PR_IsNetAddrType( conn->cin_addr, PR_IpAddrV4Mapped ) ) {
+ PRNetAddr v4addr;
+ memset( &v4addr, 0, sizeof( v4addr ) );
+ v4addr.inet.family = PR_AF_INET;
+ v4addr.inet.ip = conn->cin_addr->ipv6.ip.pr_s6_addr32[3];
+ PR_NetAddrToString( &v4addr, buf_ip, sizeof( buf_ip ) );
+ } else {
+ PR_NetAddrToString( conn->cin_addr, buf_ip, sizeof( buf_ip ) );
+ }
+ buf_ip[ sizeof( buf_ip ) - 1 ] = '\0';
+ str_ip = buf_ip;
} else {
- /* try syscall since "from" was not given and PR_GetPeerName failed */
- /* a corner case */
- struct sockaddr_in addr; /* assuming IPv4 */
+ /* try syscall since "from" was not given and PR_GetPeerName failed */
+ /* a corner case */
+ struct sockaddr_in addr; /* assuming IPv4 */
#if ( defined( hpux ) )
- int addrlen;
+ int addrlen;
#else
- socklen_t addrlen;
+ socklen_t addrlen;
#endif
- addrlen = sizeof( addr );
- memset( &addr, 0, addrlen );
-
- if ( (conn->c_prfd == NULL) &&
- (getpeername( conn->c_sd, (struct sockaddr *)&addr, &addrlen )
- == 0) ) {
- conn->cin_addr = (PRNetAddr *)slapi_ch_malloc( sizeof( PRNetAddr ));
- memset( conn->cin_addr, 0, sizeof( PRNetAddr ) );
- PR_NetAddrFamily( conn->cin_addr ) = AF_INET6;
- /* note: IPv4-mapped IPv6 addr does not work on Windows */
- PR_ConvertIPv4AddrToIPv6(addr.sin_addr.s_addr, &(conn->cin_addr->ipv6.ip));
- PRLDAP_SET_PORT(conn->cin_addr, addr.sin_port);
-
- /* copy string equivalent of address into a buffer to use for
- * logging since each call to inet_ntoa() returns a pointer to a
- * single thread-specific buffer (which prevents us from calling
- * inet_ntoa() twice in one call to slapi_log_access()).
- */
- str_ip = inet_ntoa( addr.sin_addr );
- strncpy( buf_ip, str_ip, sizeof( buf_ip ) - 1 );
- buf_ip[ sizeof( buf_ip ) - 1 ] = '\0';
- str_ip = buf_ip;
- } else {
- str_ip = str_unknown;
- }
+ addrlen = sizeof( addr );
+ memset( &addr, 0, addrlen );
+
+ if ( (conn->c_prfd == NULL) &&
+ (getpeername( conn->c_sd, (struct sockaddr *)&addr, &addrlen ) == 0) )
+ {
+ conn->cin_addr = (PRNetAddr *)slapi_ch_malloc( sizeof( PRNetAddr ));
+ memset( conn->cin_addr, 0, sizeof( PRNetAddr ) );
+ PR_NetAddrFamily( conn->cin_addr ) = AF_INET6;
+ /* note: IPv4-mapped IPv6 addr does not work on Windows */
+ PR_ConvertIPv4AddrToIPv6(addr.sin_addr.s_addr, &(conn->cin_addr->ipv6.ip));
+ PRLDAP_SET_PORT(conn->cin_addr, addr.sin_port);
+
+ /* copy string equivalent of address into a buffer to use for
+ * logging since each call to inet_ntoa() returns a pointer to a
+ * single thread-specific buffer (which prevents us from calling
+ * inet_ntoa() twice in one call to slapi_log_access()).
+ */
+ str_ip = inet_ntoa( addr.sin_addr );
+ strncpy( buf_ip, str_ip, sizeof( buf_ip ) - 1 );
+ buf_ip[ sizeof( buf_ip ) - 1 ] = '\0';
+ str_ip = buf_ip;
+ } else {
+ str_ip = str_unknown;
+ }
}
/*
@@ -389,76 +371,73 @@ connection_reset(Connection* conn, int ns, PRNetAddr * from, int fromLen, int is
*/
slapi_ch_free( (void**)&conn->cin_destaddr ); /* just to be conservative */
if ( conn->c_prfd != NULL ) {
- conn->cin_destaddr = (PRNetAddr *) slapi_ch_malloc( sizeof( PRNetAddr ) );
- memset( conn->cin_destaddr, 0, sizeof( PRNetAddr ));
- if (PR_GetSockName( conn->c_prfd, conn->cin_destaddr ) == 0) {
- if ( conn->cin_destaddr->raw.family == PR_AF_LOCAL ) { /* ldapi */
- PL_strncpyz(buf_destip, conn->cin_destaddr->local.path,
- sizeof(conn->cin_destaddr->local.path));
- if (!buf_destip[0]) {
- PL_strncpyz(buf_destip, "unknown local file", sizeof(buf_destip));
- }
- } else if ( PR_IsNetAddrType( conn->cin_destaddr, PR_IpAddrV4Mapped ) ) {
- PRNetAddr v4destaddr;
- memset( &v4destaddr, 0, sizeof( v4destaddr ) );
- v4destaddr.inet.family = PR_AF_INET;
- v4destaddr.inet.ip = conn->cin_destaddr->ipv6.ip.pr_s6_addr32[3];
- PR_NetAddrToString( &v4destaddr, buf_destip, sizeof( buf_destip ) );
- } else {
- PR_NetAddrToString( conn->cin_destaddr, buf_destip, sizeof( buf_destip ) );
- }
- buf_destip[ sizeof( buf_destip ) - 1 ] = '\0';
- str_destip = buf_destip;
- } else {
- str_destip = str_unknown;
- }
+ conn->cin_destaddr = (PRNetAddr *) slapi_ch_malloc( sizeof( PRNetAddr ) );
+ memset( conn->cin_destaddr, 0, sizeof( PRNetAddr ));
+ if (PR_GetSockName( conn->c_prfd, conn->cin_destaddr ) == 0) {
+ if ( conn->cin_destaddr->raw.family == PR_AF_LOCAL ) { /* ldapi */
+ PL_strncpyz(buf_destip, conn->cin_destaddr->local.path,
+ sizeof(conn->cin_destaddr->local.path));
+ if (!buf_destip[0]) {
+ PL_strncpyz(buf_destip, "unknown local file", sizeof(buf_destip));
+ }
+ } else if ( PR_IsNetAddrType( conn->cin_destaddr, PR_IpAddrV4Mapped ) ) {
+ PRNetAddr v4destaddr;
+ memset( &v4destaddr, 0, sizeof( v4destaddr ) );
+ v4destaddr.inet.family = PR_AF_INET;
+ v4destaddr.inet.ip = conn->cin_destaddr->ipv6.ip.pr_s6_addr32[3];
+ PR_NetAddrToString( &v4destaddr, buf_destip, sizeof( buf_destip ) );
+ } else {
+ PR_NetAddrToString( conn->cin_destaddr, buf_destip, sizeof( buf_destip ) );
+ }
+ buf_destip[ sizeof( buf_destip ) - 1 ] = '\0';
+ str_destip = buf_destip;
+ } else {
+ str_destip = str_unknown;
+ }
} else {
- /* try syscall since c_prfd == NULL */
- /* a corner case */
- struct sockaddr_in destaddr; /* assuming IPv4 */
+ /* try syscall since c_prfd == NULL */
+ /* a corner case */
+ struct sockaddr_in destaddr; /* assuming IPv4 */
#if ( defined( hpux ) )
- int destaddrlen;
+ int destaddrlen;
#else
- socklen_t destaddrlen;
+ socklen_t destaddrlen;
#endif
- destaddrlen = sizeof( destaddr );
- memset( &destaddr, 0, destaddrlen );
- if ( (getsockname( conn->c_sd, (struct sockaddr *)&destaddr,
- &destaddrlen ) == 0) ) {
- conn->cin_destaddr =
- (PRNetAddr *)slapi_ch_malloc( sizeof( PRNetAddr ));
- memset( conn->cin_destaddr, 0, sizeof( PRNetAddr ));
- PR_NetAddrFamily( conn->cin_destaddr ) = AF_INET6;
- PRLDAP_SET_PORT( conn->cin_destaddr, destaddr.sin_port );
- /* note: IPv4-mapped IPv6 addr does not work on Windows */
- PR_ConvertIPv4AddrToIPv6(destaddr.sin_addr.s_addr,
- &(conn->cin_destaddr->ipv6.ip));
-
- /* copy string equivalent of address into a buffer to use for
- * logging since each call to inet_ntoa() returns a pointer to a
- * single thread-specific buffer (which prevents us from calling
- * inet_ntoa() twice in one call to slapi_log_access()).
- */
- str_destip = inet_ntoa( destaddr.sin_addr );
- strncpy( buf_destip, str_destip, sizeof( buf_destip ) - 1 );
- buf_destip[ sizeof( buf_destip ) - 1 ] = '\0';
- str_destip = buf_destip;
- } else {
- str_destip = str_unknown;
- }
+ destaddrlen = sizeof( destaddr );
+ memset( &destaddr, 0, destaddrlen );
+ if ( (getsockname( conn->c_sd, (struct sockaddr *)&destaddr, &destaddrlen ) == 0) ) {
+ conn->cin_destaddr = (PRNetAddr *)slapi_ch_malloc( sizeof( PRNetAddr ));
+ memset( conn->cin_destaddr, 0, sizeof( PRNetAddr ));
+ PR_NetAddrFamily( conn->cin_destaddr ) = AF_INET6;
+ PRLDAP_SET_PORT( conn->cin_destaddr, destaddr.sin_port );
+ /* note: IPv4-mapped IPv6 addr does not work on Windows */
+ PR_ConvertIPv4AddrToIPv6(destaddr.sin_addr.s_addr, &(conn->cin_destaddr->ipv6.ip));
+
+ /* copy string equivalent of address into a buffer to use for
+ * logging since each call to inet_ntoa() returns a pointer to a
+ * single thread-specific buffer (which prevents us from calling
+ * inet_ntoa() twice in one call to slapi_log_access()).
+ */
+ str_destip = inet_ntoa( destaddr.sin_addr );
+ strncpy( buf_destip, str_destip, sizeof( buf_destip ) - 1 );
+ buf_destip[ sizeof( buf_destip ) - 1 ] = '\0';
+ str_destip = buf_destip;
+ } else {
+ str_destip = str_unknown;
+ }
}
if ( !in_referral_mode ) {
- /* create a sasl connection */
- ids_sasl_server_new(conn);
+ /* create a sasl connection */
+ ids_sasl_server_new(conn);
}
/* log useful stuff to our access log */
slapi_log_access( LDAP_DEBUG_STATS,
- "conn=%" NSPRIu64 " fd=%d slot=%d %sconnection from %s to %s\n",
- conn->c_connid, conn->c_sd, ns, pTmp, str_ip, str_destip );
+ "conn=%" NSPRIu64 " fd=%d slot=%d %sconnection from %s to %s\n",
+ conn->c_connid, conn->c_sd, ns, pTmp, str_ip, str_destip );
/* initialize the remaining connection fields */
conn->c_ldapversion = LDAP_VERSION3;
@@ -507,8 +486,8 @@ init_op_threads()
(VFP) (void *) connection_threadmain, NULL,
PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD,
PR_UNJOINABLE_THREAD,
- SLAPD_DEFAULT_THREAD_STACKSIZE
- ) == NULL ) {
+ SLAPD_DEFAULT_THREAD_STACKSIZE ) == NULL )
+ {
int prerr = PR_GetError();
LDAPDebug( LDAP_DEBUG_ANY, "PR_CreateThread failed, " SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n",
prerr, slapd_pr_strerror( prerr ), 0 );
@@ -619,14 +598,15 @@ connection_dispatch_operation(Connection *conn, Operation *op, Slapi_PBlock *pb)
* we let SEARCH operations through as well. The search code
* is responsible for checking if the operation is a root DSE
* search. */
- if ((slapi_sdn_get_dn(&(op->o_sdn)) == NULL ) &&
- /* anon access off and something other than BIND, EXTOP, UNBIND or ABANDON */
+ if ((slapi_sdn_get_dn(&(op->o_sdn)) == NULL ) &&
+ /* anon access off and something other than BIND, EXTOP, UNBIND or ABANDON */
(((config_get_anon_access_switch() == SLAPD_ANON_ACCESS_OFF) && (op->o_tag != LDAP_REQ_BIND) &&
- (op->o_tag != LDAP_REQ_EXTENDED) && (op->o_tag != LDAP_REQ_UNBIND) && (op->o_tag != LDAP_REQ_ABANDON)) ||
- /* root DSE access only and something other than BIND, EXTOP, UNBIND, ABANDON, or SEARCH */
+ (op->o_tag != LDAP_REQ_EXTENDED) && (op->o_tag != LDAP_REQ_UNBIND) && (op->o_tag != LDAP_REQ_ABANDON)) ||
+ /* root DSE access only and something other than BIND, EXTOP, UNBIND, ABANDON, or SEARCH */
((config_get_anon_access_switch() == SLAPD_ANON_ACCESS_ROOTDSE) && (op->o_tag != LDAP_REQ_BIND) &&
- (op->o_tag != LDAP_REQ_EXTENDED) && (op->o_tag != LDAP_REQ_UNBIND) &&
- (op->o_tag != LDAP_REQ_ABANDON) && (op->o_tag != LDAP_REQ_SEARCH)))) {
+ (op->o_tag != LDAP_REQ_EXTENDED) && (op->o_tag != LDAP_REQ_UNBIND) &&
+ (op->o_tag != LDAP_REQ_ABANDON) && (op->o_tag != LDAP_REQ_SEARCH))))
+ {
slapi_log_access( LDAP_DEBUG_STATS,
"conn=%" NSPRIu64 " op=%d UNPROCESSED OPERATION"
" - Anonymous access not allowed\n",
@@ -803,827 +783,6 @@ int connection_is_active_nolock (Connection *conn)
!(conn->c_flags & CONN_FLAG_CLOSING);
}
-/* returns non-0 if this is an active connection meaning it is in use
- and not in the closing mode */
-
-#if defined LDAP_IOCP
-/*
- * IO Completion ports are currently only available on NT.
- */
-
-typedef enum {read_data, write_data, new_connection} work_type;
-static int wait_on_new_work(Connection **ppConn, work_type *type);
-static int issue_new_read(Connection *conn);
-static int finished_chomping(Connection *conn);
-static int read_the_data(Connection *op, int *process_op, int *defer_io, int *defer_pushback);
-static int is_new_operation(Connection *conn);
-static int process_operation(Connection *conn, Operation *op);
-static int connection_operation_new(Connection *conn, Operation **ppOp);
-Operation *get_current_op(Connection *conn);
-static int handle_read_data(Connection *conn,Operation **op,
- int * connection_referenced);
-int queue_pushed_back_data(Connection *conn);
-static int add_to_select_set(Connection *conn);
-
-static void inc_op_count(Connection* conn)
-{
- PR_AtomicIncrement(&conn->c_opscompleted);
- slapi_counter_increment(ops_completed);
-}
-
-static int connection_increment_reference(Connection *conn)
-{
- int rc = 0;
- PR_Lock( conn->c_mutex );
- rc = connection_acquire_nolock (conn);
- PR_Unlock( conn->c_mutex );
- return rc;
-}
-
-static void connection_decrement_reference(Connection *conn)
-{
- PR_Lock( conn->c_mutex );
- connection_release_nolock (conn);
- PR_Unlock( conn->c_mutex );
-}
-
-static void
-connection_threadmain()
-{
- /*
- * OK, so this is the thread main routine for the thread pool.
- * This is the general idea : wait on the i/o completion port.
- * then get some data. There are three cases here:
- * 1) This is the first piece of data read for a new LDAP op.
- * 2) This is a subsequent, but not final, piece of data read in the current LDAP op on this connection
- * 3) This is the last piece of the current LDAP op on the current connection.
- * Note that these cases are NOT exclusive ! In particular, all three can occur for the same read.
- * based on detecting these cases, we end up doing one or more of the following things:
- * a) Create new structures for a new op.
- * b) Read data into the BER buffer for the op.
- * c) Press on to service the operation request (note that the results are currently written
- * synchronously.
- * We always queue a new read on the socket too.
- * (Note, we need to make sure we don't issue the new read operation until we've copied
- * the data from the existing one. Otherwise we'd open ourselves to getting OOO data.)
- *
- * The intention is that this code will be clean enough to be used for the UNIX build,
- * once we fake up I/O completion ports with select and another thread.
- */
-
- Connection *conn = NULL;
- Operation *op = NULL;
- int return_value = -1;
- int abandon_connection = 0;
- work_type command = 0;
- int connection_referenced = 0;
-
- /* Don't ask me, and I will tell you no lies */
-#if defined( OSF1 ) || defined( hpux ) || defined( LINUX )
- /* Arrange to ignore SIGPIPE signals. */
- SIGNAL( SIGPIPE, SIG_IGN );
-#endif
-
- while (1) {
-
- abandon_connection = 1; /* we start off assuming that we'll fail somewhere */
- conn = NULL; /* just make sure we don't step on an old connection by mistake */
- op = NULL; /* Same goes for the operation */
-
- return_value = wait_on_new_work(&conn,&command);
- if( op_shutdown )
- break;
- if (0 == return_value) {
- connection_referenced = 0; /* No outstanding ref count on connection if wait for work returned OK */
- switch (command) {
- case read_data:
- return_value = handle_read_data(conn,&op,&connection_referenced);
- if (0 == return_value)
- {
- abandon_connection = 0;
- }
- break;
- case write_data:
- /* NYI, but we need to go and find the state for the connection, find the operation
- * which queued the write, and then get whatever data we need to write, then write it ! */
- break;
- case new_connection:
- /* NYI, but this would consist of the same stuff which is currently in daemon.c.
- * On NT, we'd use AcceptEx() */
- break;
- default:
- break;
- }
- finished_chomping(conn);
- } else {
- PR_SetError(PR_IO_ERROR, return_value);
- connection_referenced = 1; /* There is an outstanding refcnt on the conn, so we get to close the right one ! */
- }
-
- /* If anything went wrong with the connection above, such that we need to
- * disconnect it, we'll know here and shoot it in the foot.
- */
- if ( (NULL != conn) && abandon_connection) {
- disconnect_server(conn, conn->c_connid, op ? op->o_opid : -1, SLAPD_DISCONNECT_ABORT, 0 );
- if (connection_referenced) {
- connection_decrement_reference(conn);
- }
- }
- }
- g_decr_active_threadcnt();
-}
-
-static int handle_read_data(Connection *conn,Operation **op,
- int * connection_referenced)
-{
- int return_value = 0;
- int return_value2 = 0;
- int process_op = 0; /* Do we or do we not process a complete operation now ? */
- int defer_io = 0;
- int defer_pushback = 0;
-
- if (is_new_operation(conn)) {
- return_value = connection_operation_new(conn,op);
- } else {
- *op = get_current_op(conn);
- }
-
- /* if connection is closing */
- if (return_value != 0) {
- LDAPDebug(LDAP_DEBUG_CONNS,
- "handle_read_data returns as conn %" NSPRIu64 " closing, fd=%d\n",
- conn->c_connid,conn->c_sd,0);
- return return_value;
- }
-
- return_value = read_the_data(conn,&process_op, &defer_io, &defer_pushback);
-
- if (0 == return_value) {
- int replication_session = conn->c_isreplication_session;
- if (0 != process_op)
- return_value = process_operation(conn,*op);
- /* Post any pending I/O operation _after_ processing any operation */
- if (replication_session) {
- /* Initiate any deferred I/O here */
- if (defer_io) {
- if (conn->c_flags & CONN_FLAG_SSL) {
- add_to_select_set(conn);
- return_value2 = 0;
- } else {
- return_value2 = issue_new_read(conn);
- }
- }
- if (defer_pushback) {
- return_value2 = queue_pushed_back_data(conn);
- }
- }
- }
- else
- *connection_referenced = 1;
-
- if (return_value) {
- return return_value;
- } else {
- return return_value2;
- }
-}
-
-/* Function which does the work involved in servicing an LDAP operation. */
-static int process_operation(Connection *conn, Operation *op)
-{
- Slapi_PBlock *pb = NULL;
- ber_len_t len;
- ber_tag_t tag;
- ber_int_t msgid;
- int return_value = 0;
- int destroy_content = 1;
-
-
- pb = (Slapi_PBlock *) slapi_ch_calloc( 1, sizeof(Slapi_PBlock) );
- pb->pb_conn = conn;
- pb->pb_op = op;
- /* destroy operation content when done */
- slapi_pblock_set (pb, SLAPI_DESTROY_CONTENT, &destroy_content);
-
- if (! config_check_referral_mode()) {
- slapi_counter_increment(ops_initiated);
- slapi_counter_increment(g_get_global_snmp_vars()->ops_tbl.dsInOps);
- }
-
- if ( (tag = ber_get_int( op->o_ber, &msgid ))
- != LDAP_TAG_MSGID ) {
- /* log, close and send error */
- LDAPDebug( LDAP_DEBUG_ANY,
- "conn=%" NSPRIu64 " unable to read tag for incoming request\n", conn->c_connid, 0, 0 );
- return_value = -1;
- goto done;
- }
- op->o_msgid = msgid;
-
- tag = ber_peek_tag( op->o_ber, &len );
- switch ( tag ) {
- case LBER_ERROR:
- case LDAP_TAG_LDAPDN: /* optional username, for CLDAP */
- /* log, close and send error */
- LDAPDebug( LDAP_DEBUG_ANY,
- "conn=%" NSPRIu64 " ber_peek_tag returns 0x%lx\n", conn->c_connid, tag, 0 );
- return_value = -1;
- goto done;
- default:
- break;
- }
- op->o_tag = tag;
-
- /* are we in referral-only mode? */
- if (config_check_referral_mode() && tag != LDAP_REQ_UNBIND)
- {
- referral_mode_reply(pb);
- goto done;
- }
-
- /* check if new password is required */
- if(connection_need_new_password(conn, op, pb))
- {
- goto done;
- }
-
- /* if this is a bulk import, only "add" and "import done (extop)" are
- * allowed */
- if (conn->c_flags & CONN_FLAG_IMPORT) {
- if ((tag != LDAP_REQ_ADD) && (tag != LDAP_REQ_EXTENDED)) {
- /* no cookie for you. */
- LDAPDebug(LDAP_DEBUG_ANY, "Attempted operation %d from "
- "within bulk import\n", tag, 0, 0);
- slapi_send_ldap_result(pb, LDAP_PROTOCOL_ERROR, NULL, NULL,
- 0, NULL);
- return_value = -1;
- goto done;
- }
- }
-
- /*
- * Call the do_<operation> function to process this request.
- */
- connection_dispatch_operation(conn, op, pb);
-
-done:
-
- /* If we're here, it means that we successfully completed an operation , so bump the counts */
- inc_op_count(conn);
-
- if ( !( pb->pb_op->o_flags & OP_FLAG_PS )) {
- /*
- * If not a persistent search, remove the operation
- * from this connection's list.
- */
- PR_Lock( conn->c_mutex );
- connection_remove_operation( conn, op );
- PR_Unlock( conn->c_mutex );
-
- /* destroying the pblock will cause destruction of the operation
- * so this must happen before releasing the connection
- */
- slapi_pblock_destroy( pb );
-
- PR_Lock( conn->c_mutex );
- if (connection_release_nolock (conn) != 0)
- {
- return_value = -1;
- }
- PR_Unlock( conn->c_mutex );
-
- } else { /* ps code acquires ref to conn - we need to release ours here */
- PR_Lock( conn->c_mutex );
- if (connection_release_nolock (conn) != 0)
- {
- return_value = -1;
- }
- PR_Unlock( conn->c_mutex );
- }
- return return_value;
-}
-
-/* Helper functions for the code above: */
-
-
-struct Conn_private {
- /* First the platform-dependent part */
-#ifdef _WIN32
- OVERLAPPED c_overlapped;
- DWORD c_buffer_size;
- char *c_buffer;
- DWORD c_number_of_async_bytes_read;
- DWORD c_buffer_offset;
- DWORD c_deferred_length;
-#else
-#endif
- /* Now the platform independent part */
- Operation *c_current_op;
- int c_flags;
-};
-
-static void connection_free_private_buffer(Connection *conn)
-{
-#ifdef _WIN32
- if (NULL != conn->c_private) {
- slapi_ch_free( (void**)&conn->c_private->c_buffer);
- }
-#else
-#endif
-}
-
-#define FLAG_CONN_HAD_SOME 1 /* Set when we've read the first piece of data already, means we don't need to allocate a new op */
-#define FLAG_CONN_COMPLETE 2 /* Set when we've read all of an LDAP operation request, means we can proceed to process it */
-
-
-/* Little helper functions */
-
-Operation *get_current_op(Connection *conn)
-{
- Operation *return_op = conn->c_private->c_current_op;
- PR_ASSERT(NULL != return_op);
- return return_op;
-}
-
-static int is_new_operation(Connection *conn)
-{
- if (0 == conn->c_private->c_flags) {
- return 1;
- } else {
- return 0;
- }
-}
-
-/* Called when a new operation comes in on a connection */
-static int connection_operation_new(Connection *conn, Operation **ppOp)
-{
- /* we need to make a new operation structure and chain it onto the connection */
- Operation *temp_op = NULL;
- int rc;
-
- PR_Lock( conn->c_mutex );
- if (connection_is_active_nolock(conn) == 0) {
- LDAPDebug(LDAP_DEBUG_CONNS,
- "not creating a new operation when conn %" NSPRIu64 " closing\n",
- conn->c_connid,0,0);
- PR_Unlock( conn->c_mutex );
- return -1;
- }
- temp_op = operation_new( plugin_build_operation_action_bitmap( 0,
- plugin_get_server_plg() ));
- connection_add_operation( conn, temp_op);
- rc = connection_acquire_nolock (conn);
- PR_Unlock( conn->c_mutex );
- /* Stash the op pointer in the connection structure for later use */
- PR_ASSERT(NULL == conn->c_private->c_current_op);
- conn->c_private->c_current_op = temp_op;
- *ppOp = temp_op;
- return rc;
-}
-
-/* Call this to tell the select thread to put us back into the read-ready signal set */
-static int add_to_select_set(Connection *conn)
-{
- conn->c_gettingber = 0;
- signal_listner();
- return 0;
-}
-
-static int remove_from_select_set(Connection *conn)
-{
- conn->c_gettingber = 1;
- return 0;
-}
-
-/* Helper functions from here on are platform-dependent */
-/* First the NT ones */
-
-#ifdef _WIN32
-
-static HANDLE completion_port = INVALID_HANDLE_VALUE;
-#define COMPKEY_DIE ((DWORD) -1L) /* used to kill off workers */
-
-static void push_back_data(Connection *conn, size_t offset, size_t length);
-static int queue_pushed_back_data(Connection *conn);
-
-/* Called when we've read from the completion queue, so there's data
- * waiting for us to pickup. We're told: the number of bytes read, the
- * address of the buffer, the state of this connection (new op, middle of op).
- */
-static int read_the_data(Connection *conn, int *process_op, int *defer_io, int *defer_pushback)
-{
- Conn_private *priv = conn->c_private;
- Operation *op = NULL;
- DWORD Bytes_Read = 0;
- char *Buffer = NULL;
- ber_tag_t tag = 0;
- int return_value = -1;
- ber_len_t ber_len = 0;
- ber_len_t Bytes_Scanned = 0;
-
- *defer_io = 0;
- *defer_pushback = 0;
-
- op = priv->c_current_op;
- Bytes_Read = priv->c_number_of_async_bytes_read;
- Buffer = priv->c_buffer + priv->c_buffer_offset;
-
- PR_ASSERT(NULL != op->o_ber);
-
- /* Is this an SSL connection ? */
- if (0 == (conn->c_flags & CONN_FLAG_SSL)) {
- /* Not SSL */
-
- if (! config_check_referral_mode()) {
- /* Update stats */
- PR_Lock( op_thread_lock );
- (*(g_get_global_snmp_vars()->ops_tbl.dsBytesRecv)) += Bytes_Read;
- PR_Unlock( op_thread_lock );
- }
-
- /* We need to read the data into the BER buffer */
- /* This can return a tag pr LBER_DEFAULT, indicating some error condition */
- tag = ber_get_next_buffer_ext( Buffer, Bytes_Read, &ber_len, op->o_ber, &Bytes_Scanned, conn->c_sb );
- if (LBER_DEFAULT == tag || LBER_OVERFLOW == tag)
- {
- if (0 == Bytes_Scanned)
- {
- /* Means we encountered an error---eg the client sent us pure crap---
- a bunch of bytes which we took to be a tag, length, then we ran off the
- end of the buffer. The next time we get here, we'll be returned LBER_DEFAULT
- This means that everything we've seen up till now is useless because it wasn't
- an LDAP message.
- So, we toss it away ! */
- if (LBER_OVERFLOW == tag) {
- slapi_log_error( SLAPI_LOG_FATAL, "connection",
- "conn=%" NSPRIu64 " fd=%d The length of BER Element was too long.\n",
- conn->c_connid, conn->c_sd );
- }
- PR_Lock( conn->c_mutex );
- connection_remove_operation( conn, op );
- operation_free(&op, conn);
- priv->c_current_op = NULL;
- PR_Unlock( conn->c_mutex );
- return -1; /* Abandon Connection */
- }
- }
- if (is_ber_too_big(conn,ber_len))
- {
- PR_Lock( conn->c_mutex );
- connection_remove_operation( conn, op );
- operation_free(&op, conn);
- priv->c_current_op = NULL;
- PR_Unlock( conn->c_mutex );
- return -1; /* Abandon Connection */
- }
-
- /* We set the flag to indicate that we'er in the middle of an op */
- priv->c_flags |= FLAG_CONN_HAD_SOME;
-
- /* Then we decide whether this is the last read for the current op */
- /* and set the flag accordingly */
- if (LBER_DEFAULT != tag) { /* we received a complete message */
- if (LDAP_TAG_MESSAGE == tag) { /* looks like an LDAP message */
- /* It's time to process this operation */
- *process_op = 1;
- priv->c_current_op = NULL;
- priv->c_flags = 0;
- } else {
- /*
- * We received a non-LDAP message. Log and close connection.
- */
- LDAPDebug( LDAP_DEBUG_ANY,
- "conn=%" NSPRIu64 " received a non-LDAP message"
- " (tag 0x%lx, expected 0x%lx)\n",
- conn->c_connid, tag, LDAP_TAG_MESSAGE );
- PR_Lock( conn->c_mutex );
- connection_remove_operation( conn, op );
- operation_free(&op, conn);
- priv->c_current_op = NULL;
- PR_Unlock( conn->c_mutex );
- return -1; /* Abandon Connection */
- }
- }
-
- /* Finally, mark whether there's the beginning of another operation remaining in the buffer */
- /* If there is, queue up another I/O completion request on the port to get it handled OK */
- /* If not, issue a new read on the socket. */
- if (Bytes_Scanned != Bytes_Read) {
- if (connection_increment_reference(conn) == -1) {
- LDAPDebug(LDAP_DEBUG_CONNS,
- "could not acquire lock in issue_new_read as conn %" NSPRIu64 " closing fd=%d\n",
- conn->c_connid,conn->c_sd,0);
- /* XXX how to handle this error? */
- /* MAB: 25 Jan 01: let's try like this and pray this won't leak... */
- /* GB : this should be OK because an error here
- * means some other thread decided to close the
- * connection, which mean a fatal error happened
- * in that case just forget about the remaining
- * data and return
- */
- return (0);
- }
- push_back_data(conn,priv->c_overlapped.Offset + Bytes_Scanned,Bytes_Read-Bytes_Scanned);
- if (!conn->c_isreplication_session) {
- if ((return_value = queue_pushed_back_data(conn)) == -1) {
- /* MAB: 25 jan 01 we need to decrement the conn refcnt before leaving... Otherwise,
- * this thread will unbalance the ref_cnt inc and dec for this connection
- * and the result is that the connection is never closed and instead is kept
- * forever an never released -> this was causing a fd starvation on NT
- */
- connection_decrement_reference(conn);
- LDAPDebug(LDAP_DEBUG_CONNS,
- "push_back_data failed: closing conn %" NSPRIu64 " fd=%d\n",
- conn->c_connid,conn->c_sd,0);
- }
- } else {
- /* Queue the I/O later to serialize */
- *defer_pushback = 1;
- return_value = 0;
- }
- } else {
- priv->c_overlapped.Offset = 0;
- if (!conn->c_isreplication_session) {
- return_value = issue_new_read(conn);
- } else {
- /* Queue the I/O later to serialize */
- *defer_io = 1;
- return_value = 0;
- }
- }
- } else {
- /* SSL */
- if ( (tag = ber_get_next( conn->c_sb, &ber_len, op->o_ber ))
- != LDAP_TAG_MESSAGE ) {
- return( -1 );
- }
- if(is_ber_too_big(conn,ber_len))
- {
- return( -1 );
- }
- /* Put this connection back into the read-ready signal state */
- /* priv->c_flags |= FLAG_CONN_COMPLETE; Redundant now */
- /* It's time to process this operation */
- *process_op = 1;
- priv->c_current_op = NULL;
- priv->c_flags = 0;
- return_value = 0;
- if (!conn->c_isreplication_session) {
- add_to_select_set(conn);
- } else {
- *defer_io = 1;
- }
- }
-
- return return_value;
-}
-
-void push_back_data(Connection *conn, size_t offset, size_t length)
-{
- conn->c_private->c_overlapped.Offset = offset;
- conn->c_private->c_deferred_length = length;
-}
-
-int queue_pushed_back_data(Connection *conn)
-{
- /* Use PostQueuedCompletionStatus() to push the data back up the pipe */
- BOOL return_bool = FALSE;
-
- return_bool = PostQueuedCompletionStatus(completion_port,conn->c_private->c_deferred_length,(DWORD)conn,&conn->c_private->c_overlapped);
-
- if (return_bool) {
- return 0;
- } else {
- return -1;
- }
-}
-
-/* This function issues a new read operation on the connection.
- * Called once we've finished reading everything from the buffer.
- * VMS crusties will notice the similarity to $QIO.
- */
-int issue_new_read(Connection *conn)
-{
- BOOL return_bool = FALSE;
- HANDLE socket = INVALID_HANDLE_VALUE;
- void **buffer = NULL;
- DWORD bytes_read = 0;
- DWORD buffer_size = 0;
- OVERLAPPED *overlapped = NULL;
-
- PR_ASSERT(NULL != conn);
- socket = (HANDLE)conn->c_sd;
- PR_ASSERT(NULL != socket);
-
- /* here we make sure that we have a buffer allocated */
- buffer = &conn->c_private->c_buffer;
- if (NULL == *buffer) {
- *buffer = (void*)slapi_ch_malloc(LDAP_SOCKET_IO_BUFFER_SIZE);
- if (NULL == *buffer) {
- /* memory allocation failure */
- return -1;
- }
- conn->c_private->c_buffer_size = LDAP_SOCKET_IO_BUFFER_SIZE;
- }
-
- buffer_size = conn->c_private->c_buffer_size;
- overlapped = &conn->c_private->c_overlapped;
-
- if (connection_increment_reference(conn) == -1) {
- LDAPDebug(LDAP_DEBUG_CONNS,
- "could not acquire lock in issue_new_read as conn %" NSPRIu64 " closing fd=%d\n",
- conn->c_connid,conn->c_sd,0);
- /* This means that the connection is closing */
- return -1;
- }
- return_bool = ReadFile(socket,*buffer,buffer_size,&bytes_read,overlapped);
- if ( !return_bool && ERROR_IO_PENDING != GetLastError( ) ) {
- /* This means that the connection is shot for some reason */
- connection_decrement_reference(conn);
- return -1;
- } else {
- /* Our work is done, i/o read now queued */
- return 0;
- }
-}
-
-static int wait_on_new_work(Connection **ppConn, work_type *type)
-{
- /* Here, we wait on the I/O completion port for new data */
- /* because we're not sure whether the completion port has been created yet,
- * we wait 'till it has been.
- */
- Connection *temp_conn = NULL;
- DWORD Bytes_Received = 0;
- OVERLAPPED *pOverlapped = NULL;
- BOOL return_bool = FALSE;
-
- *type = read_data;
-
- while ( (INVALID_HANDLE_VALUE == completion_port) && (!op_shutdown) ) {
- Sleep(100);
- }
- while (1) {
- if (op_shutdown) {
- return EINTR;
- }
- return_bool = GetQueuedCompletionStatus(completion_port,&Bytes_Received,(DWORD*)&temp_conn,&pOverlapped,INFINITE);
- if ((unsigned long)temp_conn == COMPKEY_DIE ) {
- continue; /* kill this worker */
- }
- if (TRUE == return_bool) {
- /* we successfully completed the I/O operation */
- /* set the connection pointer the caller gave us to the one from the port */
- PR_ASSERT(NULL != pOverlapped);
- PR_ASSERT(NULL != temp_conn);
- *ppConn = temp_conn;
- /* store the # bytes read in the connection structure */
- (*ppConn)->c_private->c_number_of_async_bytes_read = Bytes_Received;
- (*ppConn)->c_private->c_buffer_offset = (*ppConn)->c_private->c_overlapped.Offset;
- if( Bytes_Received == 0 )
- {
- /* 0 bytes received from a completed overlapped I/O
- operation means the socket's been closed. */
- break;
- }
- (*ppConn)->c_idlesince = current_time();
- /* If we exit here, everything is OK */
- connection_decrement_reference(temp_conn);
- return 0;
- }
- if ( (FALSE == return_bool) && (NULL == pOverlapped) ) {
- /* we timed out */
- /* slapi_log_error( SLAPI_LOG_FATAL, "connection",
- "GetQueuedCompletionStatus call timed out\n");*/
- continue;
- }
- if ( (FALSE == return_bool) && (NULL != pOverlapped)) {
- /* signifies some sort of i/o error, most likely an abortive close */
- /* slapi_log_error( SLAPI_LOG_FATAL, "connection",
- "GetQueuedCompletionStatus call failed; error - %ld\n", GetLastError());*/
- if (NULL != temp_conn) {
- /* If we were told the connection, return it--otherwise we can't tell which connection to close */
- *ppConn = temp_conn;
- }
- break;
- }
- }
- return EPIPE; /* we failed to read for some reason */
-}
-
-int connection_new_private(Connection *conn)
-{
- /* first add to the completion port */
- DWORD threads = 10; /* DBDB hackhack */
- HANDLE socket = INVALID_HANDLE_VALUE;
- HANDLE return_port = NULL;
- Conn_private *priv = NULL;
- int return_value = -1;
-
- PR_ASSERT(NULL != conn);
-
- socket = (HANDLE) conn->c_sd;
-
- /* make the private data if it isn't already there */
-
- if (NULL == conn->c_private) {
- Conn_private *new_private = (Conn_private *)slapi_ch_malloc(sizeof(Conn_private));
- if (NULL == new_private) {
- /* memory allocation failed */
- return -1;
- }
- conn->c_private = new_private;
- ZeroMemory(conn->c_private,sizeof(Conn_private));
- }
- priv = conn->c_private;
- /* Make sure the private structure is cleared */
- /* Note: you must modify this code if the contents
- * of the structure are changed---we can't simply
- * zero the structure because we want to preserve the
- * buffer. IMPORTANT---here we reuse the I/O buffer
- * from before. This is deliberate, to avoid mallocing again */
- ZeroMemory(&(priv->c_overlapped),sizeof(OVERLAPPED));
- priv->c_number_of_async_bytes_read = 0;
- priv->c_buffer_offset = 0;
- priv->c_flags = 0;
- priv->c_current_op = NULL;
-
-
- if (INVALID_HANDLE_VALUE == completion_port) {
- /* completion port not yet setup, we need to make it */
- completion_port = CreateIoCompletionPort(INVALID_HANDLE_VALUE,NULL,0,0);
- if (NULL == completion_port) {
- LDAPDebug(LDAP_DEBUG_ANY,"Failed to create master I/O completion port\n",0,0,0);
- return -1;
- }
- }
- /* If the connection is SSL, don't do the right thing */
- if (0 == (conn->c_flags & CONN_FLAG_SSL)) {
- return_port = CreateIoCompletionPort(socket,completion_port,(DWORD)conn,0);
- if (NULL == return_port) {
- LDAPDebug(LDAP_DEBUG_ANY,"Failed to associate socket with I/O completion port, fd=%d,GetLastError = %d\n",socket,GetLastError(),0);
- return -1;
- }
- /* Now queue the initial read on this connection */
- return_value = issue_new_read(conn);
- } else {
- return_value = 0;
- }
-
- return return_value;
-}
-
-/* If all is well, this only gets called for SSL connections */
-int connection_activity(Connection *conn)
-{
- /* First check that this really is an SSL connection */
- if (0 == (conn->c_flags & CONN_FLAG_SSL)) {
- return -1;
- }
- /* Now, the plan here is to push something up the IOCP pipe */
- /* We need to fake something up so that the code which pulls
- * it off the queue does the right thing. Here's what we do:
- * We just call PostQueuedCompletionStatus like normal.
- * The connection is marked as SSL, and it is this that the
- * reading code notices. Simple !
- */
- /* Also, we need to participate in the signaling protocol to the select thread */
- remove_from_select_set(conn);
- /* We hold the lock already, increment the reference count, which will
- be decremented in wait_for_new_work(). */
- if (connection_acquire_nolock (conn) == -1) {
- LDAPDebug(LDAP_DEBUG_CONNS,
- "could not acquire lock in connection_activity as conn %" NSPRIu64 " closing fd=%d\n",
- conn->c_connid,conn->c_sd,0);
- /* XXX how to handle this error? */
- /* MAB: 25 Jan 01: let's return on error and pray this won't leak */
- return (-1);
- }
- push_back_data(conn, 0, 1);
- return queue_pushed_back_data(conn);
-}
-
-static int finished_chomping(Connection *conn)
-{
- /* On NT we don't need to do anything here */
- return 0;
-}
-
-#else /* WIN32/UNIX */
-
-/*
- * This is where the UNIX Helper functions would be if IO
- * Completion Ports were supported on UNIX.
- */
-
-#endif /* WIN32/UNIX */
-
-#else /* LDAP_IOCP */
-
-/*
- * IO Completion Ports are not available on this platform.
- */
-
/* The connection private structure for UNIX turbo mode */
struct Conn_private
{
@@ -1681,7 +840,7 @@ openldap_read_function(Sockbuf_IO_Desc *sbiod, void *buf, ber_len_t len)
errno = EWOULDBLOCK;
#elif defined(EAGAIN)
errno = EAGAIN;
-#endif
+#endif
PR_SetError(PR_WOULD_BLOCK_ERROR, 0);
} else {
/* copy buffered data into output buf */
@@ -2789,8 +1948,6 @@ get_work_q(struct Slapi_op_stack **op_stack_obj)
return (wqitem);
}
-#endif /* LDAP_IOCP */
-
/* Helper functions common to both varieties of connection code: */
@@ -2801,12 +1958,6 @@ get_work_q(struct Slapi_op_stack **op_stack_obj)
void
op_thread_cleanup()
{
-#ifdef _WIN32
- int i;
- PRIntervalTime interval;
- int max_threads = config_get_threadnumber();
- interval = PR_SecondsToInterval(3);
-#endif
LDAPDebug( LDAP_DEBUG_ANY,
"slapd shutting down - signaling operation threads - op stack size %d max work q size %d max work q stack size %d\n",
op_stack_size, work_q_size_max, work_q_stack_size_max);
@@ -2815,17 +1966,6 @@ op_thread_cleanup()
PR_Lock( work_q_lock );
PR_NotifyAllCondVar ( work_q_cv ); /* tell any thread waiting in connection_wait_for_new_work to shutdown */
PR_Unlock( work_q_lock );
-#ifdef _WIN32
- LDAPDebug( LDAP_DEBUG_ANY,
- "slapd shutting down - waiting for %d threads to terminate\n",
- g_get_active_threadcnt(), 0, 0 );
- /* kill off each worker waiting on GetQueuedCompletionStatus */
- for ( i = 0; i < max_threads; ++ i )
- {
- PostQueuedCompletionStatus( completion_port, 0, COMPKEY_DIE ,0);
- }
- /* don't sleep: there's no reason to do so here DS_Sleep(interval); */ /* sleep 3 seconds */
-#endif
}
/* do this after all worker threads have terminated */
@@ -3181,7 +2321,7 @@ connection_abandon_operations( Connection *c )
* handle it here until a better solution is found
*/
if ( op->o_status != SLAPI_OP_STATUS_RESULT_SENT ||
- op->o_flags & OP_FLAG_PS ) {
+ (op->o_flags & OP_FLAG_PS) ) {
op->o_status = SLAPI_OP_STATUS_ABANDONED;
}
}
diff --git a/ldap/servers/slapd/conntable.c b/ldap/servers/slapd/conntable.c
index cd05313..7845a5d 100644
--- a/ldap/servers/slapd/conntable.c
+++ b/ldap/servers/slapd/conntable.c
@@ -77,10 +77,9 @@ connection_table_new(int table_size)
ber_sockbuf_set_option( ct->c[i].c_sb, LBER_SOCKBUF_OPT_NO_READ_AHEAD, LBER_OPT_ON );
ber_sockbuf_set_option( ct->c[i].c_sb, LBER_SOCKBUF_OPT_MAX_INCOMING_SIZE, &maxbersize );
#endif /* !USE_OPENLDAP */
-#ifndef _WIN32
/* all connections start out invalid */
ct->fd[i].fd = SLAPD_INVALID_SOCKET;
-#endif
+
/* The connection table has a double linked list running through it.
* This is used to find out which connections should be looked at
* in the poll loop. Slot 0 in the table is always the head of
@@ -109,31 +108,6 @@ void connection_table_free(Connection_Table *ct)
slapi_ch_free((void**)&ct);
}
-
-#ifdef _WIN32
-/*
- * This function looks up connection by nspr fd. It is
- * slow because it iterrates through the entire connection
- * array. Currently, it is only used on NT in secure_read_function
- * to handle I/O timeout on SSL socket we should almost never
- * happen.
- */
-Connection*
-connection_table_get_connection_from_fd(Connection_Table *ct,PRFileDesc *prfd)
-{
- int i;
- for (i = 0; i < ct->size; i++)
- {
- if (ct->c[i].c_prfd == prfd)
- {
- return (&(ct->c[i]));
- }
- }
-
- return NULL;
-}
-#endif
-
void
connection_table_abandon_all_operations(Connection_Table *ct)
{
@@ -434,15 +408,7 @@ connection_table_as_entry(Connection_Table *ct, Slapi_Entry *e)
nreadwaiters++;
}
-#ifdef _WIN32
- {
- struct tm *pt;
- pt = gmtime( &ct->c[i].c_starttime );
- memcpy(&utm, pt, sizeof(struct tm) );
- }
-#else
gmtime_r( &ct->c[i].c_starttime, &utm );
-#endif
strftime( buf2, sizeof(buf2), "%Y%m%d%H%M%SZ", &utm );
/*
diff --git a/ldap/servers/slapd/csngen.c b/ldap/servers/slapd/csngen.c
index f87f2d1..5214c45 100644
--- a/ldap/servers/slapd/csngen.c
+++ b/ldap/servers/slapd/csngen.c
@@ -40,16 +40,9 @@
# include <config.h>
#endif
-
/*
* csngen.c - CSN Generator
*/
-
-#ifdef _WIN32
-#define _WIN32_WINNT 0x0400
-#include <windows.h>
-#endif
-
#include <string.h>
#include "prcountr.h"
#include "slap.h"
diff --git a/ldap/servers/slapd/daemon.c b/ldap/servers/slapd/daemon.c
index af378f5..820921c 100644
--- a/ldap/servers/slapd/daemon.c
+++ b/ldap/servers/slapd/daemon.c
@@ -42,12 +42,6 @@
#include <string.h>
#include <sys/types.h>
-#ifdef _WIN32
-#include <windows.h>
-#include <process.h> /* for getpid */
-#include "proto-ntutil.h"
-#include "ntslapdmessages.h"
-#else
#include <unistd.h>
#include <sys/socket.h>
#include <errno.h>
@@ -62,7 +56,6 @@
#if defined(HAVE_MNTENT_H)
#include <mntent.h>
#endif
-#endif
#include <time.h>
#include <signal.h>
#if defined(IRIX6_2) || defined(IRIX6_3)
@@ -74,13 +67,11 @@
#endif
#include <fcntl.h>
#define TCPLEN_T int
-#if !defined( _WIN32 )
#ifdef NEED_FILIO
#include <sys/filio.h>
#else /* NEED_FILIO */
#include <sys/ioctl.h>
#endif /* NEED_FILIO */
-#endif /* !defined( _WIN32 ) */
/* for some reason, linux tty stuff defines CTIME */
#include <stdio.h>
#ifdef LINUX
@@ -116,9 +107,6 @@ int slapd_wakeup_timer = SLAPD_WAKEUP_TIMER; /* time in ms to wakeup */
short slapd_housekeeping_timer = 10;
#endif /* notdef GGOODREPL */
-/* Do we support timeout on socket send() ? */
-int have_send_timeouts = 0;
-
PRFileDesc* signalpipe[2];
static int writesignalpipe = SLAPD_INVALID_SOCKET;
static int readsignalpipe = SLAPD_INVALID_SOCKET;
@@ -155,9 +143,6 @@ static int get_configured_connection_table_size();
static void get_loopback_by_addr( void );
#endif
-#ifdef XP_WIN32
-static int createlistensocket(unsigned short port, const PRNetAddr *listenaddr);
-#endif
static PRFileDesc **createprlistensockets(unsigned short port,
PRNetAddr **listenaddr, int secure, int local);
static const char *netaddr2string(const PRNetAddr *addr, char *addrbuf,
@@ -173,141 +158,21 @@ static void setup_pr_read_pds(Connection_Table *ct, PRFileDesc **n_tcps, PRFileD
static void* catch_signals();
#endif
-#if defined( _WIN32 )
-HANDLE hServDoneEvent = NULL;
-#endif
-
static int createsignalpipe( void );
-#if defined( _WIN32 )
-/* Set an event to hook the NT Service termination */
-void *slapd_service_exit_wait()
-{
-#if defined( PURIFYING )
-
-#include <sys/types.h>
-#include <sys/stat.h>
-
- char module[_MAX_FNAME];
- char exit_file_name[_MAX_FNAME];
- char drive[_MAX_DRIVE];
- char dir[_MAX_DIR];
- char fname[_MAX_FNAME];
- char ext[_MAX_EXT];
- struct stat statbuf;
-
- memset( module, 0, sizeof( module ) );
- memset( exit_file_name, 0, sizeof( exit_file_name ) );
-
- GetModuleFileName(GetModuleHandle( NULL ), module, sizeof( module ) );
-
- _splitpath( module, drive, dir, fname, ext );
-
- PR_snprintf( exit_file_name, sizeof(exit_file_name), "%s%s%s", drive, dir, "exitnow.txt" );
-
- LDAPDebug( LDAP_DEBUG_ANY, "PURIFYING - Create %s to terminate the process.\n", exit_file_name, 0, 0 );
-
- while ( TRUE )
- {
- if( stat( exit_file_name, &statbuf ) < 0)
- {
- Sleep( 5000 ); /* 5 Seconds */
- continue;
- }
- LDAPDebug( LDAP_DEBUG_ANY, "slapd shutting down immediately, "
- "\"%s\" exists - don't forget to delete it\n", exit_file_name, 0, 0 );
- g_set_shutdown( SLAPI_SHUTDOWN_SIGNAL );
- return NULL;
- }
-
-#else /* PURIFYING */
-
- DWORD dwWait;
- char szDoneEvent[256];
-
- PR_snprintf(szDoneEvent, sizeof(szDoneEvent), "NS_%s", pszServerName);
-
- hServDoneEvent = CreateEvent( NULL, // default security attributes (LocalSystem)
- TRUE, // manual reset event
- FALSE, // not-signalled
- szDoneEvent );// named after the service itself.
-
- /* Wait indefinitely until hServDoneEvent is signaled. */
- dwWait = WaitForSingleObject( hServDoneEvent, // event object
- INFINITE ); // wait indefinitely
-
- /* The termination event has been signalled, log this occurrence, and signal to exit. */
- ReportSlapdEvent( EVENTLOG_INFORMATION_TYPE, MSG_SERVER_SHUTDOWN_STARTING, 0, NULL );
-
- g_set_shutdown( SLAPI_SHUTDOWN_SIGNAL );
- return NULL;
-#endif /* PURIFYING */
-}
-#endif /* _WIN32 */
-
static char *
get_pid_file()
{
return(pid_file);
}
-static int daemon_configure_send_timeout(int s,size_t timeout /* Miliseconds*/)
-{
- /* Currently this function is only good for NT, and expects the s argument to be a SOCKET */
-#if defined(_WIN32)
- return setsockopt(
- s,
- SOL_SOCKET,
- SO_SNDTIMEO,
- (char*) &timeout,
- sizeof(timeout)
- );
-#else
- return 0;
-#endif
-}
-
-#if defined (_WIN32)
-/* This function is a workaround for accept problem on NT.
- Accept call fires on NT during syn scan even though the connection is not
- open. This causes a resource leak. For more details, see bug 391414.
- Experimentally, we determined that, in case of syn scan, the local
- address is set to 0. This in undocumented and my change in the future
-
- The function returns 0 if this is normal connection
- 1 if this is syn_scan connection
- -1 in case of any other error
- */
-static int
-syn_scan (int sock)
-{
- int rc;
- struct sockaddr_in addr;
- int size = sizeof (addr);
-
- if (sock == SLAPD_INVALID_SOCKET)
- return -1;
-
- rc = getsockname (sock, (struct sockaddr*)&addr, &size);
- if (rc != 0)
- return -1;
- else if (addr.sin_addr.s_addr == 0)
- return 1;
- else
- return 0;
-}
-
-#endif
-
static int
-accept_and_configure(int s, PRFileDesc *pr_acceptfd, PRNetAddr *pr_netaddr,
+accept_and_configure(int s, PRFileDesc *pr_acceptfd, PRNetAddr *pr_netaddr,
int addrlen, int secure, int local, PRFileDesc **pr_clonefd)
{
int ns = 0;
-
PRIntervalTime pr_timeout = PR_MillisecondsToInterval(slapd_wakeup_timer);
-#if !defined( XP_WIN32 ) /* UNIX */
(*pr_clonefd) = PR_Accept(pr_acceptfd, pr_netaddr, pr_timeout);
if( !(*pr_clonefd) ) {
PRErrorCode prerr = PR_GetError();
@@ -316,95 +181,22 @@ accept_and_configure(int s, PRFileDesc *pr_acceptfd, PRNetAddr *pr_netaddr,
prerr, slapd_pr_strerror(prerr), 0 );
return(SLAPD_INVALID_SOCKET);
}
-
ns = configure_pr_socket( pr_clonefd, secure, local );
-#else /* Windows */
- if( secure ) {
- (*pr_clonefd) = PR_Accept(pr_acceptfd, pr_netaddr, pr_timeout);
- if( !(*pr_clonefd) ) {
- PRErrorCode prerr = PR_GetError();
- LDAPDebug( LDAP_DEBUG_ANY, "PR_Accept() failed, "
- SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n",
- prerr, slapd_pr_strerror(prerr), 0 );
-
- /* Bug 613324: Call PR_NT_CancelIo if an error occurs */
- if( (prerr == PR_IO_TIMEOUT_ERROR ) ||
- (prerr == PR_PENDING_INTERRUPT_ERROR) ) {
- if( (PR_NT_CancelIo( pr_acceptfd )) != PR_SUCCESS) {
- prerr = PR_GetError();
- LDAPDebug( LDAP_DEBUG_ANY,
- "PR_NT_CancelIo() failed, "
- SLAPI_COMPONENT_NAME_NSPR
- " error %d (%s)\n",
- prerr, slapd_pr_strerror(prerr), 0 );
- }
- }
- return(SLAPD_INVALID_SOCKET);
- }
-
- ns = configure_pr_socket( pr_clonefd, secure, local );
-
- } else { /* !secure */
- struct sockaddr *addr; /* NOT IPv6 enabled */
-
- addr = (struct sockaddr *) slapi_ch_malloc( sizeof(struct sockaddr) );
- ns = accept (s, addr, (TCPLEN_T *)&addrlen);
-
- if (ns == SLAPD_INVALID_SOCKET) {
- int oserr = errno;
-
- LDAPDebug( LDAP_DEBUG_ANY,
- "accept(%d) failed errno %d (%s)\n",
- s, oserr, slapd_system_strerror(oserr));
- }
-
- else if (syn_scan (ns))
- {
- /* this is a work around for accept problem with SYN scan on NT.
- See bug 391414 for more details */
- LDAPDebug(LDAP_DEBUG_ANY, "syn-scan request is received - ignored\n", 0, 0, 0);
- closesocket (ns);
- ns = SLAPD_INVALID_SOCKET;
- }
-
- PRLDAP_SET_PORT( pr_netaddr, ((struct sockaddr_in *)addr)->sin_port );
- PR_ConvertIPv4AddrToIPv6(((struct sockaddr_in *)addr)->sin_addr.s_addr, &(pr_netaddr->ipv6.ip));
-
- (*pr_clonefd) = NULL;
-
- slapi_ch_free( (void **)&addr );
- configure_ns_socket( &ns );
- }
-#endif
-
return ns;
}
/*
* This is the shiny new re-born daemon function, without all the hair
*/
-#ifdef _WIN32
-static void setup_read_fds(Connection_Table *ct, fd_set *readfds, int n_tcps, int s_tcps );
-static void handle_read_ready(Connection_Table *ct, fd_set *readfds);
-static void set_timeval_ms(struct timeval *t, int ms);
-#endif
/* GGOODREPL static void handle_timeout( void ); */
static int handle_new_connection(Connection_Table *ct, int tcps, PRFileDesc *pr_acceptfd, int secure, int local, Connection **newconn );
#ifdef ENABLE_NUNC_STANS
static void ns_handle_new_connection(struct ns_job_t *job);
#endif
static void handle_pr_read_ready(Connection_Table *ct, PRIntn num_poll);
-#ifdef _WIN32
-static int clear_signal(fd_set *readfdset);
-#else
static int clear_signal(struct POLL_STRUCT *fds);
-#endif
-#ifdef _WIN32
-static void unfurl_banners(Connection_Table *ct,daemon_ports_t *ports, int n_tcps, PRFileDesc *s_tcps);
-#else
static void unfurl_banners(Connection_Table *ct,daemon_ports_t *ports, PRFileDesc **n_tcps, PRFileDesc **s_tcps, PRFileDesc **i_unix);
-#endif
static int write_pid_file();
static int init_shutdown_detect();
@@ -417,59 +209,27 @@ int daemon_pre_setuid_init(daemon_ports_t *ports)
int rc = 0;
if (0 != ports->n_port) {
-#if defined( XP_WIN32 )
- ports->n_socket = createlistensocket((unsigned short)ports->n_port,
- &ports->n_listenaddr);
-#else
ports->n_socket = createprlistensockets(ports->n_port,
ports->n_listenaddr, 0, 0);
-#endif
}
if ( config_get_security() && (0 != ports->s_port) ) {
ports->s_socket = createprlistensockets((unsigned short)ports->s_port,
ports->s_listenaddr, 1, 0);
-#ifdef XP_WIN32
- ports->s_socket_native = PR_FileDesc2NativeHandle(ports->s_socket);
-#endif
} else {
ports->s_socket = SLAPD_INVALID_SOCKET;
-#ifdef XP_WIN32
- ports->s_socket_native = SLAPD_INVALID_SOCKET;
-#endif
}
-#ifndef XP_WIN32
#if defined(ENABLE_LDAPI)
/* ldapi */
if(0 != ports->i_port) {
ports->i_socket = createprlistensockets(1, ports->i_listenaddr, 0, 1);
}
#endif /* ENABLE_LDAPI */
-#endif
return( rc );
}
-
-/* Decide whether we're running on a platform which supports send with timeouts */
-static void detect_timeout_support()
-{
- /* Currently we know that NT4.0 or higher DOES support timeouts */
-#if defined _WIN32
- /* Get the OS revision */
- OSVERSIONINFO ver;
- ver.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
- GetVersionEx(&ver);
- if (ver.dwPlatformId == VER_PLATFORM_WIN32_NT && ver.dwMajorVersion >= 4) {
- have_send_timeouts = 1;
- }
-#else
- /* Some UNIXen do, but for now I don't feel confident which , and whether timeouts really work there */
-#endif
-}
-
-
/*
* The time_shutdown static variable is used to signal the time thread
* to shutdown. We used to shut down the time thread when g_get_shutdown()
@@ -1292,17 +1052,10 @@ void slapd_daemon( daemon_ports_t *ports )
* If you want me to do SSL, pass me something in the ssl port number.
* If you don't, pass me zero.
*/
-
-#if defined( XP_WIN32 )
- int n_tcps = 0;
- int s_tcps_native = 0;
- PRFileDesc *s_tcps = NULL;
-#else
PRFileDesc **n_tcps = NULL;
PRFileDesc **s_tcps = NULL;
PRFileDesc **i_unix = NULL;
PRFileDesc **fdesp = NULL;
-#endif
PRIntn num_poll = 0;
PRIntervalTime pr_timeout = PR_MillisecondsToInterval(slapd_wakeup_timer);
PRThread *time_thread_p;
@@ -1335,13 +1088,10 @@ void slapd_daemon( daemon_ports_t *ports )
/* Retrieve the sockets from their hiding place */
n_tcps = ports->n_socket;
s_tcps = ports->s_socket;
-#ifdef XP_WIN32
- s_tcps_native = ports->s_socket_native;
-#else
+
#if defined(ENABLE_LDAPI)
i_unix = ports->i_socket;
#endif /* ENABLE_LDAPI */
-#endif
if (!enable_nunc_stans) {
createsignalpipe();
@@ -1350,14 +1100,10 @@ void slapd_daemon( daemon_ports_t *ports )
init_shutdown_detect();
if (
-#if defined( XP_WIN32 )
- (n_tcps == SLAPD_INVALID_SOCKET) &&
-#else
(n_tcps == NULL) &&
#if defined(ENABLE_LDAPI)
(i_unix == NULL) &&
#endif /* ENABLE_LDAPI */
-#endif
(s_tcps == NULL) ) { /* nothing to do */
LDAPDebug( LDAP_DEBUG_ANY,
"no port to listen on\n", 0, 0, 0 );
@@ -1365,7 +1111,6 @@ void slapd_daemon( daemon_ports_t *ports )
}
init_op_threads ();
- detect_timeout_support();
/* Start the time thread */
time_thread_p = PR_CreateThread(PR_SYSTEM_THREAD,
@@ -1419,20 +1164,6 @@ void slapd_daemon( daemon_ports_t *ports )
}
/* We are now ready to accept incoming connections */
-#if defined( XP_WIN32 )
- if ( n_tcps != SLAPD_INVALID_SOCKET
- && listen( n_tcps, config_get_listen_backlog_size() ) == -1 ) {
- int oserr = errno;
- char addrbuf[ 256 ];
-
- slapi_log_error(SLAPI_LOG_FATAL, "slapd_daemon",
- "listen() on %s port %d failed: OS error %d (%s)\n",
- netaddr2string(&ports->n_listenaddr, addrbuf, sizeof(addrbuf)),
- ports->n_port, oserr, slapd_system_strerror( oserr ) );
- g_set_shutdown( SLAPI_SHUTDOWN_EXIT );
- listeners++;
- }
-#else
if ( n_tcps != NULL ) {
PRFileDesc **fdesp;
PRNetAddr **nap = ports->n_listenaddr;
@@ -1451,7 +1182,6 @@ void slapd_daemon( daemon_ports_t *ports )
listeners++;
}
}
-#endif
if ( s_tcps != NULL ) {
PRFileDesc **fdesp;
@@ -1472,7 +1202,6 @@ void slapd_daemon( daemon_ports_t *ports )
}
}
-#if !defined( XP_WIN32 )
#if defined(ENABLE_LDAPI)
if( i_unix != NULL ) {
PRFileDesc **fdesp;
@@ -1491,7 +1220,7 @@ void slapd_daemon( daemon_ports_t *ports )
}
}
#endif /* ENABLE_LDAPI */
-#endif
+
listener_idxs = (listener_info *)slapi_ch_calloc(listeners, sizeof(*listener_idxs));
#ifdef ENABLE_NUNC_STANS
if (enable_nunc_stans) {
@@ -1555,64 +1284,27 @@ void slapd_daemon( daemon_ports_t *ports )
/* The meat of the operation is in a loop on a call to select */
while(!enable_nunc_stans && !g_get_shutdown())
{
-#ifdef _WIN32
- fd_set readfds;
- struct timeval wakeup_timer;
- int oserr;
-#endif
int select_return = 0;
-
-#ifndef _WIN32
PRErrorCode prerr;
-#endif
-#ifdef _WIN32
- set_timeval_ms(&wakeup_timer, slapd_wakeup_timer);
- setup_read_fds(the_connection_table,&readfds,n_tcps, s_tcps_native);
- /* This select needs to timeout to give the server a chance to test for shutdown */
- select_return = select(connection_table_size, &readfds, NULL, 0, &wakeup_timer);
-#else
setup_pr_read_pds(the_connection_table,n_tcps,s_tcps,i_unix,&num_poll);
select_return = POLL_FN(the_connection_table->fd, num_poll, pr_timeout);
-#endif
switch (select_return) {
case 0: /* Timeout */
/* GGOODREPL handle_timeout(); */
break;
case -1: /* Error */
-#ifdef _WIN32
- oserr = errno;
- LDAPDebug( LDAP_DEBUG_TRACE,
- "select failed errno %d (%s)\n", oserr,
- slapd_system_strerror(oserr), 0 );
-#else
prerr = PR_GetError();
LDAPDebug( LDAP_DEBUG_TRACE, "PR_Poll() failed, "
SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n",
prerr, slapd_system_strerror(prerr), 0 );
-#endif
break;
default: /* either a new connection or some new data ready */
- /* Figure out if we are dealing with one of the listen sockets */
-#ifdef _WIN32
- /* If so, then handle a new connection */
- if ( n_tcps != SLAPD_INVALID_SOCKET && FD_ISSET( n_tcps, &readfds ) ) {
- handle_new_connection(the_connection_table,n_tcps,NULL,0,0);
- }
- /* If so, then handle a new connection */
- if ( s_tcps != SLAPD_INVALID_SOCKET && FD_ISSET( s_tcps_native,&readfds ) ) {
- handle_new_connection(the_connection_table,SLAPD_INVALID_SOCKET,s_tcps,1,0);
- }
- /* handle new data ready */
- handle_read_ready(the_connection_table,&readfds);
- clear_signal(&readfds);
-#else
/* handle new connections from the listeners */
handle_listeners(the_connection_table);
/* handle new data ready */
handle_pr_read_ready(the_connection_table, connection_table_size);
clear_signal(the_connection_table->fd);
-#endif
break;
}
}
@@ -1625,14 +1317,6 @@ void slapd_daemon( daemon_ports_t *ports )
ps_stop_psearch_system(); /* stop any persistent searches */
}
-#ifdef _WIN32
- if ( n_tcps != SLAPD_INVALID_SOCKET ) {
- closesocket( n_tcps );
- }
- if ( s_tcps != NULL ) {
- PR_Close( s_tcps );
- }
-#else
/* free the listener indexes */
slapi_ch_free((void **)&listener_idxs);
@@ -1670,7 +1354,6 @@ void slapd_daemon( daemon_ports_t *ports )
slapi_ch_free ((void**)&ports->i_listenaddr);
#endif
}
-#endif
/* Might compete with housecleaning thread, but so far so good */
be_flushall();
@@ -1678,14 +1361,12 @@ void slapd_daemon( daemon_ports_t *ports )
housekeeping_stop(); /* Run this after op_thread_cleanup() logged sth */
disk_monitoring_stop(disk_thread_p);
-#ifndef _WIN32
threads = g_get_active_threadcnt();
if ( threads > 0 ) {
LDAPDebug( LDAP_DEBUG_ANY,
"slapd shutting down - waiting for %d thread%s to terminate\n",
threads, ( threads > 1 ) ? "s" : "", 0 );
}
-#endif
threads = g_get_active_threadcnt();
while ( threads > 0 ) {
@@ -1778,16 +1459,12 @@ void slapd_daemon( daemon_ports_t *ports )
time_shutdown = 1;
PR_JoinThread( time_thread_p );
-#ifdef _WIN32
- WSACleanup();
-#else
if ( g_get_shutdown() == SLAPI_SHUTDOWN_DISKFULL ){
/* This is a server-induced shutdown, we need to manually remove the pid file */
if( unlink(get_pid_file()) ){
LDAPDebug( LDAP_DEBUG_ANY, "Failed to remove pid file %s\n", get_pid_file(), 0, 0 );
}
}
-#endif
}
int signal_listner()
@@ -1796,161 +1473,37 @@ int signal_listner()
return( 0 );
}
/* Replaces previous macro---called to bump the thread out of select */
-#if defined( _WIN32 )
- if ( PR_Write( signalpipe[1], "", 1) != 1 ) {
- /* this now means that the pipe is full
- * this is not a problem just go-on
- */
- LDAPDebug( LDAP_DEBUG_CONNS,
- "listener could not write to signal pipe %d\n",
- errno, 0, 0 );
- }
-
-#else
if ( write( writesignalpipe, "", 1) != 1 ) {
- /* this now means that the pipe is full
- * this is not a problem just go-on
- */
- LDAPDebug( LDAP_DEBUG_CONNS,
- "listener could not write to signal pipe %d\n",
- errno, 0, 0 );
+ /* this now means that the pipe is full
+ * this is not a problem just go-on
+ */
+ LDAPDebug( LDAP_DEBUG_CONNS,
+ "listener could not write to signal pipe %d\n",
+ errno, 0, 0 );
}
-#endif
return( 0 );
}
-#ifdef _WIN32
-static int clear_signal(fd_set *readfdset)
-#else
static int clear_signal(struct POLL_STRUCT *fds)
-#endif
{
if (enable_nunc_stans) {
return 0;
}
-#ifdef _WIN32
- if ( FD_ISSET(readsignalpipe, readfdset)) {
-#else
if ( fds[FDS_SIGNAL_PIPE].out_flags & SLAPD_POLL_FLAGS ) {
-#endif
char buf[200];
- LDAPDebug( LDAP_DEBUG_CONNS,
- "listener got signaled\n",
- 0, 0, 0 );
-#ifdef _WIN32
- if ( PR_Read( signalpipe[0], buf, 20 ) < 1 ) {
-#else
+ LDAPDebug( LDAP_DEBUG_CONNS, "listener got signaled\n", 0, 0, 0 );
if ( read( readsignalpipe, buf, 200 ) < 1 ) {
-#endif
- LDAPDebug( LDAP_DEBUG_ANY,
- "listener could not clear signal pipe\n",
+ LDAPDebug( LDAP_DEBUG_ANY, "listener could not clear signal pipe\n",
0, 0, 0 );
}
}
return 0;
}
-#ifdef _WIN32
-static void set_timeval_ms(struct timeval *t, int ms)
-{
- t->tv_sec = ms/1000;
- t->tv_usec = (ms % 1000)*1000;
-}
-#endif
-
-#ifdef _WIN32
-static void setup_read_fds(Connection_Table *ct, fd_set *readfds, int n_tcps, int s_tcps)
-{
- Connection *c= NULL;
- Connection *next= NULL;
- int accept_new_connections;
- static int last_accept_new_connections = -1;
- slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig();
-
- LBER_SOCKET socketdesc = SLAPD_INVALID_SOCKET;
-
- FD_ZERO( readfds );
-
- accept_new_connections = ((ct->size - g_get_current_conn_count())
- > slapdFrontendConfig->reservedescriptors);
- if ( ! accept_new_connections ) {
- if ( last_accept_new_connections ) {
- LDAPDebug( LDAP_DEBUG_ANY, "Not listening for new "
- "connections - too many fds open\n", 0, 0, 0 );
- }
- } else {
- if ( ! last_accept_new_connections &&
- last_accept_new_connections != -1 ) {
- LDAPDebug( LDAP_DEBUG_ANY, "Listening for new "
- "connections again\n", 0, 0, 0 );
- }
- }
- last_accept_new_connections = accept_new_connections;
- if (n_tcps != SLAPD_INVALID_SOCKET && accept_new_connections) {
- FD_SET( n_tcps, readfds );
- LDAPDebug( LDAP_DEBUG_HOUSE,
- "listening for connections on %d\n", n_tcps, 0, 0 );
- }
- if (s_tcps != SLAPD_INVALID_SOCKET && accept_new_connections) {
- FD_SET( s_tcps, readfds );
- LDAPDebug( LDAP_DEBUG_HOUSE,
- "listening for connections on %d\n", s_tcps, 0, 0 );
- }
-
- if ((s_tcps != SLAPD_INVALID_SOCKET)
- && (readsignalpipe != SLAPD_INVALID_SOCKET)) {
- FD_SET( readsignalpipe, readfds );
- }
-
- /* Walk down the list of active connections to find
- * out which connections we should poll over. If a connection
- * is no longer in use, we should remove it from the linked
- * list. */
- c= connection_table_get_first_active_connection (ct);
- while (c)
- {
- next = connection_table_get_next_active_connection (ct, c);
- if ( c->c_mutex == NULL )
- {
- connection_table_move_connection_out_of_active_list(ct,c);
- }
- else
- {
- PR_Lock( c->c_mutex );
- if ( c->c_flags & CONN_FLAG_CLOSING )
- {
- /* A worker thread has marked that this connection
- * should be closed by calling disconnect_server.
- * move this connection out of the active list
- * the last thread to use the connection will close it
- */
- connection_table_move_connection_out_of_active_list(ct,c);
- }
- else if ( c->c_sd == SLAPD_INVALID_SOCKET )
- {
- connection_table_move_connection_out_of_active_list(ct,c);
- }
- else
- {
-#if defined(LDAP_IOCP) /* When we have IO completion ports, we don't want to do this */
- if ( !c->c_gettingber && (c->c_flags & CONN_FLAG_SSL) )
-#else
- if ( !c->c_gettingber )
-#endif
- {
- FD_SET( c->c_sd, readfds );
- }
- }
- PR_Unlock( c->c_mutex );
- }
- c = next;
- }
-}
-#endif /* _WIN32 */
-
static int first_time_setup_pr_read_pds = 1;
static int listen_addr_count = 0;
+
static void
setup_pr_read_pds(Connection_Table *ct, PRFileDesc **n_tcps, PRFileDesc **s_tcps, PRFileDesc **i_unix, PRIntn *num_to_read)
{
@@ -1997,13 +1550,9 @@ setup_pr_read_pds(Connection_Table *ct, PRFileDesc **n_tcps, PRFileDesc **s_tcps
if (!enable_nunc_stans) {
/* The fds entry for the signalpipe is always FDS_SIGNAL_PIPE (== 0) */
count = FDS_SIGNAL_PIPE;
-#if !defined(_WIN32)
ct->fd[count].fd = signalpipe[0];
ct->fd[count].in_flags = SLAPD_POLL_FLAGS;
ct->fd[count].out_flags = 0;
-#else
- ct->fd[count].fd = NULL;
-#endif
count++;
}
/* The fds entry for n_tcps starts with n_tcps and less than n_tcpe */
@@ -2050,7 +1599,6 @@ setup_pr_read_pds(Connection_Table *ct, PRFileDesc **n_tcps, PRFileDesc **s_tcps
ct->s_tcpe = count;
-#if !defined(_WIN32)
#if defined(ENABLE_LDAPI)
ct->i_unixs = count;
/* The fds entry for i_unix starts with i_unixs and less than i_unixe */
@@ -2074,7 +1622,6 @@ setup_pr_read_pds(Connection_Table *ct, PRFileDesc **n_tcps, PRFileDesc **s_tcps
}
ct->i_unixe = count;
#endif
-#endif
first_time_setup_pr_read_pds = 0;
listen_addr_count = count;
@@ -2208,154 +1755,26 @@ daemon_register_reslimits( void )
&idletimeout_reslimit_handle ));
}
-#ifdef _WIN32
-static void
-handle_read_ready(Connection_Table *ct, fd_set *readfds)
-{
- Connection *c= NULL;
- time_t curtime = current_time();
- slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig();
- int idletimeout;
- int maxthreads = config_get_maxthreadsperconn();
-
-#ifdef LDAP_DEBUG
- if ( slapd_ldap_debug & LDAP_DEBUG_CONNS )
- {
- connection_table_dump_activity_to_errors_log(ct);
- }
-#endif /* LDAP_DEBUG */
-
-
- /* Instead of going through the whole connection table to see which
- * connections we can read from, we'll only check the slots in the
- * linked list */
- c = connection_table_get_first_active_connection (ct);
- while ( c!=NULL )
- {
- if ( c->c_mutex != NULL )
- {
- PR_Lock( c->c_mutex );
- if (connection_is_active_nolock (c) && c->c_gettingber == 0 )
- {
- /* read activity */
- short readready= ( FD_ISSET( c->c_sd, readfds ) );
-
- /* read activity */
- if ( readready )
- {
- LDAPDebug( LDAP_DEBUG_CONNS, "read activity on %d\n", c->c_ci, 0, 0 );
- c->c_idlesince = curtime;
-
- /* This is where the work happens ! */
- connection_activity( c, maxthreads);
-
- /* idle timeout */
- }
- else if (( c->c_idletimeout > 0 &&
- (curtime - c->c_idlesince) >= c->c_idletimeout &&
- NULL == c->c_ops )
- {
- disconnect_server_nomutex( c, c->c_connid, -1,
- SLAPD_DISCONNECT_IDLE_TIMEOUT, EAGAIN );
- }
- }
- PR_Unlock( c->c_mutex );
- }
- c = connection_table_get_next_active_connection (ct, c);
- }
-}
-#endif /* _WIN32 */
-
-
static void
handle_pr_read_ready(Connection_Table *ct, PRIntn num_poll)
{
Connection *c;
time_t curtime = current_time();
int maxthreads = config_get_maxthreadsperconn();
-#if defined( XP_WIN32 )
- int i;
-#endif
-#if LDAP_DEBUG
+#if LDAP_DEBUG
if ( slapd_ldap_debug & LDAP_DEBUG_CONNS )
{
connection_table_dump_activity_to_errors_log(ct);
}
#endif /* LDAP_DEBUG */
-#if defined( XP_WIN32 )
- /*
- * WIN32: this function is only called for SSL connections and
- * num_poll indicates exactly how many PR fds we polled on.
- */
- for ( i = 0; i < num_poll; i++ )
- {
- short readready;
- readready = (ct->fd[i].out_flags & SLAPD_POLL_FLAGS);
-
- /* Find the connection we are referring to */
- for ( c = connection_table_get_first_active_connection (ct); c != NULL;
- c = connection_table_get_next_active_connection (ct, c) )
- {
- if ( c->c_mutex != NULL )
- {
- PR_Lock( c->c_mutex );
- if ( c->c_prfd == ct->fd[i].fd )
- {
- break; /* c_mutex is still locked! */
- }
- PR_Unlock( c->c_mutex );
- }
- }
-
- if ( c == NULL )
- { /* connection not found! */
- LDAPDebug( LDAP_DEBUG_CONNS, "handle_pr_read_ready: "
- "connection not found for poll slot %d\n", i,0,0 );
- }
- else
- {
- /* c_mutex is still locked... check for activity and errors */
- if ( !readready && ct->fd[i].out_flags && c->c_prfd == ct->fd[i].fd )
- {
- /* some error occured */
- LDAPDebug( LDAP_DEBUG_CONNS,
- "poll says connection on sd %d is bad "
- "(closing)\n", c->c_sd, 0, 0 );
- disconnect_server_nomutex( c, c->c_connid, -1, SLAPD_DISCONNECT_POLL, EPIPE );
- }
- else if ( readready && c->c_prfd == ct->fd[i].fd )
- {
- /* read activity */
- LDAPDebug( LDAP_DEBUG_CONNS,
- "read activity on %d\n", i, 0, 0 );
- c->c_idlesince = curtime;
-
- /* This is where the work happens ! */
- connection_activity( c );
- }
- else if (( c->c_ideltimeout > 0 &&
- c->c_prfd == ct->fd[i].fd &&
- (curtime - c->c_idlesince) >= c->c_ideltimeout &&
- NULL == c->c_ops )
- {
- /* idle timeout */
- disconnect_server_nomutex( c, c->c_connid, -1,
- SLAPD_DISCONNECT_IDLE_TIMEOUT, EAGAIN );
- }
-
- PR_Unlock( c->c_mutex );
- }
- }
-#else
/*
- * non-WIN32: this function is called for all connections, so we
- * traverse the entire active connection list to find any errors,
- * activity, etc.
+ * This function is called for all connections, so we traverse the entire
+ * active connection list to find any errors, activity, etc.
*/
- for ( c = connection_table_get_first_active_connection (ct); c != NULL;
+ for ( c = connection_table_get_first_active_connection (ct); c != NULL;
c = connection_table_get_next_active_connection (ct, c) )
{
if ( c->c_mutex != NULL )
@@ -2401,7 +1820,7 @@ handle_pr_read_ready(Connection_Table *ct, PRIntn num_poll)
*/
LDAPDebug (LDAP_DEBUG_ANY,
"connection_activity: abandoning conn %" NSPRIu64 " as fd=%d is already closing\n",
- c->c_connid,c->c_sd,0);
+ c->c_connid,c->c_sd,0);
/* The call disconnect_server should do nothing,
* as the connection c should be already set to CLOSING */
disconnect_server_nomutex( c, c->c_connid, -1,
@@ -2420,7 +1839,6 @@ handle_pr_read_ready(Connection_Table *ct, PRIntn num_poll)
PR_Unlock( c->c_mutex );
}
}
-#endif
}
#ifdef ENABLE_NUNC_STANS
@@ -2602,35 +2020,8 @@ ns_handle_pr_read_ready(struct ns_job_t *job)
static int
slapd_poll( void *handle, int output )
{
- int rc;
- int ioblock_timeout = config_get_ioblocktimeout();
-
-#if defined( XP_WIN32 )
- if( !secure ) {
- fd_set handle_set;
- struct timeval timeout;
- int windows_handle = (int) handle;
-
- memset (&timeout, 0, sizeof(timeout));
- if (ioblock_timeout > 0) {
- timeout.tv_sec = ioblock_timeout / 1000;
- timeout.tv_usec = (ioblock_timeout % 1000) * 1000;
- }
- FD_ZERO(&handle_set);
- FD_SET(windows_handle, &handle_set);
- rc = output ? select(FD_SETSIZE, NULL, &handle_set, NULL, &timeout)
- : select(FD_SETSIZE, &handle_set, NULL, NULL, &timeout);
- } else {
- struct POLL_STRUCT pr_pd;
- PRIntervalTime timeout = PR_MillisecondsToInterval( ioblock_timeout );
-
- if (timeout < 0) timeout = 0;
- pr_pd.fd = (PRFileDesc *)handle;
- pr_pd.in_flags = output ? PR_POLL_WRITE : PR_POLL_READ;
- pr_pd.out_flags = 0;
- rc = POLL_FN(&pr_pd, 1, timeout);
- }
-#else
+ int rc;
+ int ioblock_timeout = config_get_ioblocktimeout();
struct POLL_STRUCT pr_pd;
PRIntervalTime timeout = PR_MillisecondsToInterval(ioblock_timeout);
@@ -2638,70 +2029,24 @@ slapd_poll( void *handle, int output )
pr_pd.in_flags = output ? PR_POLL_WRITE : PR_POLL_READ;
pr_pd.out_flags = 0;
rc = POLL_FN(&pr_pd, 1, timeout);
-#endif
if (rc < 0) {
-#if defined( XP_WIN32 )
- if( !secure ) {
- int oserr = errno;
-
- LDAPDebug(LDAP_DEBUG_CONNS, "slapd_poll(%d) error %d (%s)\n",
- handle, oserr, slapd_system_strerror(oserr));
- if ( SLAPD_SYSTEM_WOULD_BLOCK_ERROR(oserr)) {
- rc = 0; /* try again */
- }
- } else {
- PRErrorCode prerr = PR_GetError();
- LDAPDebug(LDAP_DEBUG_CONNS, "slapd_poll(%d) "
- SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n",
- handle, prerr, slapd_pr_strerror(prerr));
- if ( prerr == PR_PENDING_INTERRUPT_ERROR ||
- SLAPD_PR_WOULD_BLOCK_ERROR(prerr)) {
- rc = 0; /* try again */
- }
- }
-#else
- PRErrorCode prerr = PR_GetError();
- LDAPDebug(LDAP_DEBUG_ANY, "slapd_poll(%d) "
- SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n",
- handle, prerr, slapd_pr_strerror(prerr));
- if ( prerr == PR_PENDING_INTERRUPT_ERROR ||
- SLAPD_PR_WOULD_BLOCK_ERROR(prerr)) {
- rc = 0; /* try again */
- }
-#endif
-
+ PRErrorCode prerr = PR_GetError();
+ LDAPDebug(LDAP_DEBUG_ANY, "slapd_poll(%d) "
+ SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n",
+ handle, prerr, slapd_pr_strerror(prerr));
+ if ( prerr == PR_PENDING_INTERRUPT_ERROR ||
+ SLAPD_PR_WOULD_BLOCK_ERROR(prerr))
+ {
+ rc = 0; /* try again */
+ }
} else if (rc == 0 && ioblock_timeout > 0) {
- PRIntn ihandle;
-#if !defined( XP_WIN32 )
- ihandle = PR_FileDesc2NativeHandle((PRFileDesc *)handle);
-#else
- if( secure )
- ihandle = PR_FileDesc2NativeHandle((PRFileDesc *)handle);
- else
- ihandle = (PRIntn)handle;
-#endif
- LDAPDebug(LDAP_DEBUG_ANY, "slapd_poll(%d) timed out\n",
- ihandle, 0, 0);
-#if defined( XP_WIN32 )
- /*
- * Bug 624303 - This connection will be cleaned up soon.
- * During cleanup (see connection_cleanup()), SSL3_SendAlert()
- * will be called by PR_Close(), and its default wTimeout
- * in sslSocket associated with the handle
- * is no time out (I gave up after waited for 30 minutes).
- * It was during this closing period that server won't
- * response to new connection requests.
- * PR_Send() null is a hack here to change the default wTimeout
- * (see ssl_Send()) to one second which affects PR_Close()
- * only in the current scenario.
- */
- if( secure ) {
- PR_Send ((PRFileDesc *)handle, NULL, 0, 0, PR_SecondsToInterval(1));
- }
-#endif
- PR_SetError(PR_IO_TIMEOUT_ERROR, EAGAIN); /* timeout */
- rc = -1;
+ PRIntn ihandle;
+ ihandle = PR_FileDesc2NativeHandle((PRFileDesc *)handle);
+ LDAPDebug(LDAP_DEBUG_ANY, "slapd_poll(%d) timed out\n",
+ ihandle, 0, 0);
+ PR_SetError(PR_IO_TIMEOUT_ERROR, EAGAIN); /* timeout */
+ rc = -1;
}
return rc;
}
@@ -3166,12 +2511,6 @@ handle_new_connection(Connection_Table *ct, int tcps, PRFileDesc *pr_acceptfd, i
*/
conn->c_idletimeout = fecfg->idletimeout;
conn->c_idletimeout_handle = idletimeout_reslimit_handle;
-
-#if defined( XP_WIN32 )
- if( !secure )
- ber_sockbuf_set_option(conn->c_sb,LBER_SOCKBUF_OPT_DESC,&ns);
-#endif
-
conn->c_sd = ns;
conn->c_prfd = pr_clonefd;
conn->c_flags &= ~CONN_FLAG_CLOSING;
@@ -3181,7 +2520,6 @@ handle_new_connection(Connection_Table *ct, int tcps, PRFileDesc *pr_acceptfd, i
conn->c_flags |= CONN_FLAG_SSL;
}
-#ifndef _WIN32
/*
* clear the "returned events" field in ns' slot within the poll fds
* array so that handle_read_ready() doesn't look at out_flags for an
@@ -3193,7 +2531,6 @@ handle_new_connection(Connection_Table *ct, int tcps, PRFileDesc *pr_acceptfd, i
* the connection table to the fds array. This new connection
* won't have a mapping. */
/* fds[ns].out_flags = 0; */
-#endif
#if defined(USE_OPENLDAP)
ber_sockbuf_add_io( conn->c_sb, &openldap_sockbuf_io,
@@ -3206,11 +2543,7 @@ handle_new_connection(Connection_Table *ct, int tcps, PRFileDesc *pr_acceptfd, i
func_pointers.lbextiofn_read = NULL; /* see connection_read_function */
func_pointers.lbextiofn_write = write_function;
func_pointers.lbextiofn_writev = NULL;
-#ifdef _WIN32
- func_pointers.lbextiofn_socket_arg = (struct lextiof_socket_private *) ns;
-#else
func_pointers.lbextiofn_socket_arg = (struct lextiof_socket_private *) pr_clonefd;
-#endif
ber_sockbuf_set_option(conn->c_sb,
LBER_SOCKBUF_OPT_EXT_IO_FNS, &func_pointers);
}
@@ -3247,7 +2580,6 @@ handle_new_connection(Connection_Table *ct, int tcps, PRFileDesc *pr_acceptfd, i
conn->c_extension = factory_create_extension(connection_type,conn,NULL /* Parent */);
#if defined(ENABLE_LDAPI)
-#if !defined( XP_WIN32 )
/* ldapi */
if( local )
{
@@ -3255,7 +2587,6 @@ handle_new_connection(Connection_Table *ct, int tcps, PRFileDesc *pr_acceptfd, i
conn->c_local_ssf = config_get_localssf();
slapd_identify_local_user(conn);
}
-#endif
#endif /* ENABLE_LDAPI */
connection_new_private(conn);
@@ -3331,10 +2662,6 @@ ns_handle_new_connection(struct ns_job_t *job)
static int init_shutdown_detect()
{
-
-#ifdef _WIN32
- PRThread *service_exit_wait_tid;
-#else
/* First of all, we must reset the signal mask to get rid of any blockages
* the process may have inherited from its parent (such as the console), which
* might result in the process not delivering those blocked signals, and thus,
@@ -3350,22 +2677,8 @@ static int init_shutdown_detect()
LDAPDebug( LDAP_DEBUG_TRACE, " %s \n",
rc ? "Failed to reset signal mask":"....Done (signal mask reset)!!", 0, 0 );
}
-#endif
-#ifdef _WIN32
-
- /* Create a thread to wait on the Win32 event which will
- be signalled by the watchdog when the Service is
- being halted. */
- service_exit_wait_tid = PR_CreateThread( PR_USER_THREAD,
- (VFP) (void *) slapd_service_exit_wait, (void *) NULL,
- PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD,
- SLAPD_DEFAULT_THREAD_STACKSIZE);
- if( service_exit_wait_tid == NULL ) {
- LDAPDebug( LDAP_DEBUG_ANY,
- "Error: PR_CreateThread(slapd_service_exit_wait) failed\n", 0, 0, 0 );
- }
-#elif defined ( HPUX10 )
+#if defined ( HPUX10 )
PR_CreateThread ( PR_USER_THREAD,
catch_signals,
NULL,
@@ -3397,36 +2710,18 @@ static int init_shutdown_detect()
(void) SIGNAL( SIGTERM, set_shutdown );
(void) SIGNAL( SIGHUP, set_shutdown );
}
-#endif /* _WIN32 */
+#endif /* HPUX */
return 0;
}
-#if defined( XP_WIN32 )
-static void
-unfurl_banners(Connection_Table *ct,daemon_ports_t *ports, int n_tcps, PRFileDesc *s_tcps)
-#else
static void
unfurl_banners(Connection_Table *ct,daemon_ports_t *ports, PRFileDesc **n_tcps, PRFileDesc **s_tcps, PRFileDesc **i_unix)
-#endif
{
slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig();
char addrbuf[ 256 ];
int isfirsttime = 1;
if ( ct->size <= slapdFrontendConfig->reservedescriptors ) {
-#ifdef _WIN32
- LDAPDebug( LDAP_DEBUG_ANY,
- "ERROR: Not enough descriptors to accept any connections. "
- "This may be because the maxdescriptors configuration "
- "directive is too small, or the reservedescriptors "
- "configuration directive is too large. "
- "Try increasing the number of descriptors available to "
- "the slapd process. The current value is %d. %d "
- "descriptors are currently reserved for internal "
- "slapd use, so the total number of descriptors available "
- "to the process must be greater than %d.\n",
- ct->size, slapdFrontendConfig->reservedescriptors, slapdFrontendConfig->reservedescriptors );
-#else /* _WIN32 */
LDAPDebug( LDAP_DEBUG_ANY,
"ERROR: Not enough descriptors to accept any connections. "
"This may be because the maxdescriptors configuration "
@@ -3439,7 +2734,6 @@ unfurl_banners(Connection_Table *ct,daemon_ports_t *ports, PRFileDesc **n_tcps,
"slapd use, so the total number of descriptors available "
"to the process must be greater than %d.\n",
ct->size, slapdFrontendConfig->reservedescriptors, slapdFrontendConfig->reservedescriptors );
-#endif /* _WIN32 */
exit( 1 );
}
@@ -3449,8 +2743,7 @@ unfurl_banners(Connection_Table *ct,daemon_ports_t *ports, PRFileDesc **n_tcps,
* "slapd started." because some of the administrative programs
* depend on this. See ldap/admin/lib/dsalib_updown.c.
*/
-#if !defined( XP_WIN32 )
- if ( n_tcps != NULL ) { /* standard LDAP */
+ if ( n_tcps != NULL ) { /* standard LDAP */
PRNetAddr **nap = NULL;
for (nap = ports->n_listenaddr; nap && *nap; nap++) {
@@ -3469,7 +2762,7 @@ unfurl_banners(Connection_Table *ct,daemon_ports_t *ports, PRFileDesc **n_tcps,
}
}
- if ( s_tcps != NULL ) { /* LDAP over SSL; separate port */
+ if ( s_tcps != NULL ) { /* LDAP over SSL; separate port */
PRNetAddr **sap = NULL;
for (sap = ports->s_listenaddr; sap && *sap; sap++) {
@@ -3487,23 +2780,7 @@ unfurl_banners(Connection_Table *ct,daemon_ports_t *ports, PRFileDesc **n_tcps,
}
}
}
-#else
- if ( n_tcps != SLAPD_INVALID_SOCKET ) { /* standard LDAP; XP_WIN32 */
- LDAPDebug( LDAP_DEBUG_ANY,
- "slapd started. Listening on %s port %d for LDAP requests\n",
- netaddr2string(&ports->n_listenaddr, addrbuf, sizeof(addrbuf)),
- ports->n_port, 0 );
- }
-
- if ( s_tcps != NULL ) { /* LDAP over SSL; separate port */
- LDAPDebug( LDAP_DEBUG_ANY,
- "Listening on %s port %d for LDAPS requests\n",
- netaddr2string(&ports->s_listenaddr, addrbuf, sizeof(addrbuf)),
- ports->s_port, 0 );
- }
-#endif
-#if !defined( XP_WIN32 )
#if defined(ENABLE_LDAPI)
if ( i_unix != NULL ) { /* LDAPI */
PRNetAddr **iap = ports->i_listenaddr;
@@ -3513,33 +2790,8 @@ unfurl_banners(Connection_Table *ct,daemon_ports_t *ports, PRFileDesc **n_tcps,
(*iap)->local.path, 0 );
}
#endif /* ENABLE_LDAPI */
-#endif
-
}
-#if defined( _WIN32 )
-/* On Windows, we signal the SCM when we're ready to accept connections */
-static int
-write_pid_file()
-{
- if( SlapdIsAService() )
- {
- /* Initialization complete and successful. Set service to running */
- LDAPServerStatus.dwCurrentState = SERVICE_RUNNING;
- LDAPServerStatus.dwCheckPoint = 0;
- LDAPServerStatus.dwWaitHint = 0;
-
- if (!SetServiceStatus(hLDAPServerServiceStatus, &LDAPServerStatus)) {
- ReportSlapdEvent(EVENTLOG_INFORMATION_TYPE, MSG_SERVER_START_FAILED, 1,
- "Could not set Service status.");
- exit(1);
- }
- }
-
- ReportSlapdEvent(EVENTLOG_INFORMATION_TYPE, MSG_SERVER_STARTED, 0, NULL );
- return 0;
-}
-#else /* WIN32 */
/* On UNIX, we create a file with our PID in it */
static int
write_pid_file()
@@ -3561,7 +2813,6 @@ write_pid_file()
}
return -1;
}
-#endif /* WIN32 */
static void
set_shutdown (int sig)
@@ -3575,14 +2826,12 @@ set_shutdown (int sig)
LDAPDebug( LDAP_DEBUG_ANY, "slapd got shutdown signal\n", 0, 0, 0 );
#endif
g_set_shutdown( SLAPI_SHUTDOWN_SIGNAL );
-#ifndef _WIN32
#ifndef LINUX
/* don't mess with USR1/USR2 on linux, used by libpthread */
(void) SIGNAL( SIGUSR2, set_shutdown );
#endif
(void) SIGNAL( SIGTERM, set_shutdown );
(void) SIGNAL( SIGHUP, set_shutdown );
-#endif
}
#ifdef ENABLE_NUNC_STANS
@@ -3621,9 +2870,7 @@ slapd_do_nothing (int sig)
#if 0
LDAPDebug( LDAP_DEBUG_TRACE, "slapd got SIGUSR1\n", 0, 0, 0 );
#endif
-#ifndef _WIN32
(void) SIGNAL( SIGUSR1, slapd_do_nothing );
-#endif
#if 0
/*
@@ -3635,7 +2882,6 @@ slapd_do_nothing (int sig)
}
#endif /* LINUX */
-#ifndef _WIN32
void
slapd_wait4child(int sig)
{
@@ -3658,80 +2904,6 @@ slapd_wait4child(int sig)
(void) SIGNAL( SIGCHLD, slapd_wait4child );
}
-#endif
-
-#ifdef XP_WIN32
-static int
-createlistensocket(unsigned short port, const PRNetAddr *listenaddr)
-{
- int tcps;
- struct sockaddr_in addr;
- char *logname = "createlistensocket";
- char addrbuf[ 256 ];
-
- if (!port) goto suppressed;
-
- PR_ASSERT( listenaddr != NULL );
-
- /* create TCP socket */
- if ((tcps = socket(AF_INET, SOCK_STREAM, 0))
- == SLAPD_INVALID_SOCKET) {
- int oserr = errno;
-
- slapi_log_error(SLAPI_LOG_FATAL, logname,
- "socket() failed: OS error %d (%s)\n",
- oserr, slapd_system_strerror( oserr ));
- goto failed;
- }
-
- /* initialize listener address */
- (void) memset( (void *) &addr, '\0', sizeof(addr) );
- addr.sin_family = AF_INET;
- addr.sin_port = htons( port );
- if (listenaddr->raw.family == PR_AF_INET) {
- addr.sin_addr.s_addr = listenaddr->inet.ip;
- } else if (PR_IsNetAddrType(listenaddr,PR_IpAddrAny)) {
- addr.sin_addr.s_addr = INADDR_ANY;
- } else {
- if (!PR_IsNetAddrType(listenaddr,PR_IpAddrV4Mapped)) {
- /*
- * When Win32 supports IPv6, we will be able to use IPv6
- * addresses here. But not yet.
- */
- slapi_log_error(SLAPI_LOG_FATAL, logname,
- "unable to listen on %s port %d (IPv6 addresses "
- "are not supported on this platform)\n",
- netaddr2string(listenaddr, addrbuf, sizeof(addrbuf)),
- port );
- goto failed;
- }
-
- addr.sin_addr.s_addr = listenaddr->ipv6.ip.pr_s6_addr32[3];
- }
-
- LDAPDebug( LDAP_DEBUG_TRACE, "%s - binding to %s:%d\n",
- logname, inet_ntoa( addr.sin_addr ), port )
-
- if ( bind( tcps, (struct sockaddr *) &addr, sizeof(addr) ) == -1 ) {
- int oserr = errno;
-
- slapi_log_error(SLAPI_LOG_FATAL, logname,
- "bind() on %s port %d failed: OS error %d (%s)\n",
- inet_ntoa( addr.sin_addr ), port, oserr,
- slapd_system_strerror( oserr ));
- goto failed;
- }
-
- return tcps;
-
-failed:
- WSACleanup();
- exit( 1 );
-suppressed:
- return -1;
-} /* createlistensocket */
-#endif /* XP_WIN32 */
-
static PRFileDesc **
createprlistensockets(PRUint16 port, PRNetAddr **listenaddr,
@@ -3839,9 +3011,6 @@ createprlistensockets(PRUint16 port, PRNetAddr **listenaddr,
return( sock );
failed:
-#ifdef XP_WIN32
- WSACleanup();
-#endif /* XP_WIN32 */
exit( 1 );
suppressed:
@@ -3997,17 +3166,6 @@ createsignalpipe( void )
if (enable_nunc_stans) {
return( 0 );
}
-#if defined( _WIN32 )
- if ( PR_NewTCPSocketPair(&signalpipe[0])) {
- PRErrorCode prerr = PR_GetError();
- LDAPDebug( LDAP_DEBUG_ANY, "PR_CreatePipe() failed, "
- SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n",
- prerr, slapd_pr_strerror(prerr), SLAPD_DEFAULT_THREAD_STACKSIZE );
- return( -1 );
- }
- writesignalpipe = PR_FileDesc2NativeHandle(signalpipe[1]);
- readsignalpipe = PR_FileDesc2NativeHandle(signalpipe[0]);
-#else
if ( PR_CreatePipe( &signalpipe[0], &signalpipe[1] ) != 0 ) {
PRErrorCode prerr = PR_GetError();
LDAPDebug( LDAP_DEBUG_ANY, "PR_CreatePipe() failed, "
@@ -4025,7 +3183,6 @@ createsignalpipe( void )
LDAPDebug( LDAP_DEBUG_ANY,"createsignalpipe: failed to set FD for read pipe (%d).\n",
errno, 0, 0);
}
-#endif
return( 0 );
}
@@ -4126,7 +3283,6 @@ int configure_pr_socket( PRFileDesc **pr_socket, int secure, int local )
ns = PR_FileDesc2NativeHandle( *pr_socket );
-#if !defined(_WIN32)
/*
* Some OS or third party libraries may require that low
* numbered file descriptors be available, e.g., the DNS resolver
@@ -4160,7 +3316,6 @@ int configure_pr_socket( PRFileDesc **pr_socket, int secure, int local )
slapd_system_strerror( oserr ) );
}
}
-#endif /* !_WIN32 */
/* Set keep_alive to keep old connections from lingering */
pr_socketoption.option = PR_SockOpt_Keepalive;
@@ -4174,7 +3329,6 @@ int configure_pr_socket( PRFileDesc **pr_socket, int secure, int local )
}
if ( secure ) {
-
pr_socketoption.option = PR_SockOpt_Nonblocking;
pr_socketoption.value.non_blocking = 0;
if ( PR_SetSocketOption( *pr_socket, &pr_socketoption ) == PR_FAILURE ) {
@@ -4186,24 +3340,18 @@ int configure_pr_socket( PRFileDesc **pr_socket, int secure, int local )
}
} else {
/* We always want to have non-blocking I/O */
- pr_socketoption.option = PR_SockOpt_Nonblocking;
- pr_socketoption.value.non_blocking = 1;
- if ( PR_SetSocketOption( *pr_socket, &pr_socketoption ) == PR_FAILURE ) {
- PRErrorCode prerr = PR_GetError();
- LDAPDebug( LDAP_DEBUG_ANY,
- "PR_SetSocketOption(PR_SockOpt_Nonblocking) failed, "
- SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n",
- prerr, slapd_pr_strerror(prerr), 0 );
- }
-
- if ( have_send_timeouts ) {
- daemon_configure_send_timeout(ns,config_get_ioblocktimeout());
- }
-
+ pr_socketoption.option = PR_SockOpt_Nonblocking;
+ pr_socketoption.value.non_blocking = 1;
+ if ( PR_SetSocketOption( *pr_socket, &pr_socketoption ) == PR_FAILURE ) {
+ PRErrorCode prerr = PR_GetError();
+ LDAPDebug( LDAP_DEBUG_ANY,
+ "PR_SetSocketOption(PR_SockOpt_Nonblocking) failed, "
+ SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n",
+ prerr, slapd_pr_strerror(prerr), 0 );
+ }
} /* else (secure) */
if ( !enable_nagle && !local ) {
-
pr_socketoption.option = PR_SockOpt_NoDelay;
pr_socketoption.value.no_delay = 1;
if ( PR_SetSocketOption( *pr_socket, &pr_socketoption ) == PR_FAILURE) {
@@ -4214,25 +3362,20 @@ int configure_pr_socket( PRFileDesc **pr_socket, int secure, int local )
prerr, slapd_pr_strerror( prerr ), 0 );
}
} else if( !local) {
- pr_socketoption.option = PR_SockOpt_NoDelay;
- pr_socketoption.value.no_delay = 0;
- if ( PR_SetSocketOption( *pr_socket, &pr_socketoption ) == PR_FAILURE) {
+ pr_socketoption.option = PR_SockOpt_NoDelay;
+ pr_socketoption.value.no_delay = 0;
+ if ( PR_SetSocketOption( *pr_socket, &pr_socketoption ) == PR_FAILURE) {
PRErrorCode prerr = PR_GetError();
LDAPDebug( LDAP_DEBUG_ANY,
- "PR_SetSocketOption(PR_SockOpt_NoDelay) failed, "
- SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n",
- prerr, slapd_pr_strerror( prerr ), 0 );
+ "PR_SetSocketOption(PR_SockOpt_NoDelay) failed, "
+ SLAPI_COMPONENT_NAME_NSPR " error %d (%s)\n",
+ prerr, slapd_pr_strerror( prerr ), 0 );
}
} /* else (!enable_nagle) */
-
return ns;
-
}
-
-
-
void configure_ns_socket( int * ns )
{
@@ -4244,9 +3387,6 @@ void configure_ns_socket( int * ns )
enable_nagle = 1;
#endif
- if ( have_send_timeouts ) {
- daemon_configure_send_timeout( *ns, config_get_ioblocktimeout() );
- }
/* set the nagle */
if ( !enable_nagle ) {
on = 1;
diff --git a/ldap/servers/slapd/delete.c b/ldap/servers/slapd/delete.c
index 6d1a45b..025df9f 100644
--- a/ldap/servers/slapd/delete.c
+++ b/ldap/servers/slapd/delete.c
@@ -55,9 +55,7 @@
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
-#ifndef _WIN32
#include <sys/socket.h>
-#endif
#include "slap.h"
#include "pratom.h"
diff --git a/ldap/servers/slapd/detach.c b/ldap/servers/slapd/detach.c
index 51a369c..3516c65 100644
--- a/ldap/servers/slapd/detach.c
+++ b/ldap/servers/slapd/detach.c
@@ -58,12 +58,10 @@
#include <sys/stat.h>
#endif /* svr4 */
#include <fcntl.h>
-#ifndef _WIN32
#include <errno.h>
#include <sys/file.h>
#include <sys/ioctl.h>
#include <sys/resource.h>
-#endif
#include <signal.h>
#ifdef LINUX
#undef CTIME
diff --git a/ldap/servers/slapd/dn.c b/ldap/servers/slapd/dn.c
index d10715e..0e22f55 100644
--- a/ldap/servers/slapd/dn.c
+++ b/ldap/servers/slapd/dn.c
@@ -46,10 +46,8 @@
#include <ctype.h>
#include <string.h>
#include <sys/types.h>
-#ifndef _WIN32
#include <sys/time.h>
#include <sys/socket.h>
-#endif
#include "slap.h"
#include <plhash.h>
diff --git a/ldap/servers/slapd/dse.c b/ldap/servers/slapd/dse.c
index 55e5aa5..7d7276f 100644
--- a/ldap/servers/slapd/dse.c
+++ b/ldap/servers/slapd/dse.c
@@ -67,10 +67,7 @@
#include <prio.h>
#include <prcountr.h>
#include "slap.h"
-
-#if !defined (_WIN32)
#include <pwd.h>
-#endif /* _WIN32 */
/* #define SLAPI_DSE_DEBUG */ /* define this to force trace log */
/* messages to always be logged */
diff --git a/ldap/servers/slapd/entry.c b/ldap/servers/slapd/entry.c
index 981a02d..f931fa6 100644
--- a/ldap/servers/slapd/entry.c
+++ b/ldap/servers/slapd/entry.c
@@ -46,9 +46,7 @@
#include <string.h>
#include <ctype.h>
#include <sys/types.h>
-#ifndef _WIN32
#include <sys/socket.h>
-#endif
#undef DEBUG /* disable counters */
#include <prcountr.h>
#include "slap.h"
diff --git a/ldap/servers/slapd/fe.h b/ldap/servers/slapd/fe.h
index 27d858e..ae67491 100644
--- a/ldap/servers/slapd/fe.h
+++ b/ldap/servers/slapd/fe.h
@@ -49,13 +49,6 @@
/*
* Global Variables...
*/
-#ifdef LDAP_DEBUG
-#if defined( _WIN32 )
-#ifndef DONT_DECLARE_SLAPD_LDAP_DEBUG
-extern __declspec(dllimport) int slapd_ldap_debug;
-#endif /* DONT_DECLARE_SLAPD_LDAP_DEBUG */
-#endif
-#endif
extern Slapi_Counter *ops_initiated;
extern Slapi_Counter *ops_completed;
extern Slapi_Counter *max_threads_count;
diff --git a/ldap/servers/slapd/fedse.c b/ldap/servers/slapd/fedse.c
index d10fb3e..ce4e1f1 100644
--- a/ldap/servers/slapd/fedse.c
+++ b/ldap/servers/slapd/fedse.c
@@ -70,10 +70,7 @@
#include <dlfcn.h>
#include "slap.h"
#include "fe.h"
-
-#if !defined (_WIN32)
#include <pwd.h>
-#endif /* _WIN32 */
extern char ** getSupportedCiphers();
extern char ** getEnabledCiphers();
diff --git a/ldap/servers/slapd/fileio.c b/ldap/servers/slapd/fileio.c
index 8a2482a..181d163 100644
--- a/ldap/servers/slapd/fileio.c
+++ b/ldap/servers/slapd/fileio.c
@@ -47,260 +47,20 @@
#include <sys/types.h>
#include <errno.h>
#include <stdlib.h>
-#ifndef _WIN32
#include <sys/param.h>
#include <unistd.h>
#include <pwd.h>
-#endif
#include "slap.h"
#include "pw.h"
#include <prio.h>
-#if defined( XP_WIN32 )
-
-#include <prinit.h> /* PR_CallOnce */
-#include <string.h> /* memmove, memcpy */
-
-#define g_EOF (-1)
-
-static PRInt32 PR_CALLBACK readText(PRFileDesc *f, void *buf, PRInt32 amount)
-{
- auto PRInt32 size = *(signed char*)&(f->secret);
- auto char* readAhead = ((char*)&(f->secret)) + 1;
- if ( size == g_EOF ) {
- f->secret = NULL;
- return 0;
- }
- if ( size > amount ) {
- return 0;
- }
- if ( size > 0 ) {
- memcpy( buf, readAhead, size );
- }
- f->secret = NULL;
- while (1) {
- auto PRInt32 len = amount - size;
- auto char* head;
- auto PRInt32 rval;
- if (len > 0) {
- head = (char*)buf + size;
- } else if (size > 0 && '\r' == ((char*)buf)[size-1]) {
- head = readAhead;
- len = 1;
- } else {
- break;
- }
- rval = PR_Read( f->lower, head, len );
- if ( rval < 0 ) { /* error */
- return rval;
- }
- if ( rval == 0 ) { /* EOF */
- if ( size ) {
- *(signed char*)&(f->secret) = g_EOF;
- }
- return size;
- }
- if (head == readAhead) {
- if ( '\n' == *readAhead ) {
- ((char*)buf)[size-1] = '\n';
- } else {
- *(signed char*)&(f->secret) = rval;
- }
- break;
- } else {
- auto char* tail = head + rval;
- auto char* dest = NULL;
- auto char* p;
- for ( p = head; p < tail; p++ ) {
- if ( *p == '\n' && p > (char*)buf && *(p - 1) == '\r' )
- {
- if ( dest == NULL ) { /* first CRLF */
- dest = p - 1;
- } else {
- auto size_t len = (p - 1) - head;
- memmove( dest, head, len );
- dest += len;
- }
- head = p; /* '\n' */
- --rval; /* ignore '\r' */
- }
- }
- if ( dest != NULL ) {
- auto size_t len = tail - head;
- memmove( dest, head, len );
- }
- size += rval;
- }
- }
- return size;
-}
-
-static PRInt32 PR_CALLBACK seekText(PRFileDesc *f, PRInt32 offset, PRSeekWhence how)
-{
- f->secret = NULL;
- return PR_Seek(f->lower, offset, how);
-}
-
-static PRInt64 PR_CALLBACK seek64Text(PRFileDesc *f, PRInt64 offset, PRSeekWhence how)
-{
- f->secret = NULL;
- return PR_Seek64(f->lower, offset, how);
-}
-
-static PRInt32 PR_CALLBACK writeText(PRFileDesc *f, const void *buf, PRInt32 amount)
-{
- /* note: buf might not be null-terminated */
- auto PRInt32 size = 0;
- auto char* head = (char*)buf;
- auto char* tail = head + amount;
- auto char* p;
- for ( p = head; p <= tail; ++p ) {
- if ( p == tail || *p == '\n' ) {
- auto PRInt32 len = p - head;
- auto PRInt32 rval;
- if ( len > 0 ) {
- rval = PR_Write( f->lower, head, len );
- if ( rval < 0 ) {
- return rval;
- }
- size += rval;
- if ( rval < len ) {
- break;
- }
- }
- if ( p == tail ) {
- break;
- }
- rval = PR_Write( f->lower, "\r", 1 );
- if ( rval < 0 ) {
- return rval;
- }
- if ( rval < 1 ) {
- break;
- }
- head = p;
- }
- }
- return size;
-}
-
-static PRInt32 PR_CALLBACK writevText(PRFileDesc *fd, const PRIOVec *iov, PRInt32 size, PRIntervalTime timeout)
-{
- auto PRInt32 i;
- auto size_t total = 0;
- for (i = 0; i < size; ++i) {
- register PRInt32 rval = PR_Write(fd, iov[i].iov_base, iov[i].iov_len);
- if (rval < 0) return rval;
- total += rval;
- if (rval < iov[i].iov_len) break;
- }
- return total;
-}
-
-/* ONREPL - this is bad because it allows only one thread to use this functionality.
- Noriko said she would fix this before 5.0 ships.
- */
-
-static const char* const g_LayerName = "MdsTextIO";
-static PRDescIdentity g_LayerID;
-static PRIOMethods g_IoMethods;
-
-static PRStatus PR_CALLBACK closeLayer(PRFileDesc* stack)
-{
- auto PRFileDesc* layer = PR_PopIOLayer(stack, g_LayerID);
- if (!layer)
- return PR_FAILURE;
- if (layer->dtor) {
- layer->secret = NULL;
- layer->dtor(layer);
- }
- return PR_Close(stack);
-}
-
-static PRStatus PR_CALLBACK initialize(void)
-{
- g_LayerID = PR_GetUniqueIdentity(g_LayerName);
- if (PR_INVALID_IO_LAYER == g_LayerID) {
- return PR_FAILURE;
- } else {
- auto const PRIOMethods* defaults = PR_GetDefaultIOMethods();
- if (!defaults) {
- return PR_FAILURE;
- } else {
- memcpy (&g_IoMethods, defaults, sizeof(g_IoMethods));
- }
- }
- /* Customize methods: */
- g_IoMethods.read = readText;
- g_IoMethods.seek = seekText;
- g_IoMethods.seek64 = seek64Text;
- g_IoMethods.write = writeText;
- g_IoMethods.writev = writevText; /* ??? Is this necessary? */
- g_IoMethods.close = closeLayer; /* ??? Is this necessary? */
- return PR_SUCCESS;
-}
-
-static PRCallOnceType g_callOnce = {0,0};
-
-/* Push a layer that converts from "\n" to the local filesystem's
- * end-of-line sequence on output, and vice-versa on input.
- * The layer pops itself (if necessary) when the file is closed.
- *
- * This layer does not affect the behavior of PR_Seek or PR_Seek64;
- * their parameters still measure bytes in the lower-level file,
- * and consequently will not add up with the results of PR_Read
- * or PR_Write. For example, if you add up PR_Read return values,
- * and seek backward in the file that many bytes, the cursor will
- * *not* be restored to its original position (unless the data you
- * read didn't require conversion; that is, they didn't contain
- * any newlines, or you're running on Unix).
- *
- * Likewise, the results of PR_Read or PR_Write won't add up to
- * the 'size' field in the result of PRFileInfo or PRFileInfo64.
- */
-static PRStatus pushTextIOLayer(PRFileDesc* stack)
-{
- auto PRStatus rv = PR_CallOnce(&g_callOnce, initialize);
- if (PR_SUCCESS == rv) {
- auto PRFileDesc* layer = PR_CreateIOLayerStub(g_LayerID, &g_IoMethods);
- layer->secret = NULL;
- rv = PR_PushIOLayer(stack, PR_TOP_IO_LAYER, layer);
- }
- return rv;
-}
-
-static PRFileDesc *popTextIOLayer(PRFileDesc* stack)
-{
- PRFileDesc *layer;
- layer = PR_PopIOLayer(stack, g_LayerID);
- if (layer && layer->dtor) {
- layer->secret = NULL;
- layer->dtor(layer);
- }
- return layer;
-}
-
-#endif /* XP_WIN32 */
-
PRInt32
slapi_read_buffer( PRFileDesc *fd, void *buf, PRInt32 amount )
{
PRInt32 rval = 0;
-#if defined( XP_WIN32 )
- PRStatus rv;
-
- rv = pushTextIOLayer( fd );
- if ( PR_SUCCESS != rv ) {
- return -1;
- }
-#endif
rval = PR_Read( fd, buf, amount );
-#if defined( XP_WIN32 )
- popTextIOLayer( fd );
-#endif
-
return rval;
}
@@ -313,21 +73,9 @@ PRInt32
slapi_write_buffer( PRFileDesc *fd, void *buf, PRInt32 amount )
{
PRInt32 rval = 0;
-#if defined( XP_WIN32 )
- PRStatus rv;
-
- rv = pushTextIOLayer( fd );
- if ( PR_SUCCESS != rv ) {
- return -1;
- }
-#endif
rval = PR_Write( fd, buf, amount );
-#if defined( XP_WIN32 )
- popTextIOLayer( fd );
-#endif
-
return rval;
}
@@ -340,15 +88,11 @@ int
slapi_destructive_rename(const char *srcfilename, const char *destfilename)
{
int rv = 0;
-#if defined( XP_WIN32 )
- if (!MoveFileEx(srcfilename, destfilename, MOVEFILE_REPLACE_EXISTING)) {
- rv = GetLastError();
- }
-#else
+
if ( rename(srcfilename, destfilename) < 0 ) {
rv = errno;
}
-#endif
+
return rv;
}
@@ -359,15 +103,11 @@ int
slapi_copy(const char *srcfilename, const char *destfilename)
{
int rv = 0;
-#if defined( XP_WIN32 )
- if (!CopyFile(srcfilename, destfilename, FALSE)) {
- rv = GetLastError();
- }
-#else
+
unlink(destfilename);
if ( link(srcfilename, destfilename) < 0 ) {
rv = errno;
}
-#endif
+
return rv;
}
diff --git a/ldap/servers/slapd/filter.c b/ldap/servers/slapd/filter.c
index 5bebefe..1612147 100644
--- a/ldap/servers/slapd/filter.c
+++ b/ldap/servers/slapd/filter.c
@@ -45,9 +45,7 @@
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
-#ifndef _WIN32
#include <sys/socket.h>
-#endif
#include "slap.h"
#include "slapi-plugin.h"
diff --git a/ldap/servers/slapd/filterentry.c b/ldap/servers/slapd/filterentry.c
index 880169a..1d08c1f 100644
--- a/ldap/servers/slapd/filterentry.c
+++ b/ldap/servers/slapd/filterentry.c
@@ -45,9 +45,7 @@
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
-#ifndef _WIN32
#include <sys/socket.h>
-#endif
#include "slap.h"
static int test_filter_list();
diff --git a/ldap/servers/slapd/generation.c b/ldap/servers/slapd/generation.c
index 55319d4..97b7784 100644
--- a/ldap/servers/slapd/generation.c
+++ b/ldap/servers/slapd/generation.c
@@ -54,12 +54,9 @@ new_dataversion()
{
struct tm t;
char* dataversion;
- time_t curtime= current_time();
-#ifdef _WIN32
- memcpy (&t, gmtime (&curtime), sizeof(t));
-#else
+ time_t curtime = current_time();
+
gmtime_r (&curtime, &t);
-#endif
dataversion = slapi_ch_smprintf("0%.4li%.2i%.2i%.2i%.2i%.2i", 1900L + t.tm_year, 1 + t.tm_mon, t.tm_mday, t.tm_hour, t.tm_min, t.tm_sec);
return dataversion;
}
diff --git a/ldap/servers/slapd/getopt_ext.h b/ldap/servers/slapd/getopt_ext.h
index 92fb434..c702471 100644
--- a/ldap/servers/slapd/getopt_ext.h
+++ b/ldap/servers/slapd/getopt_ext.h
@@ -54,17 +54,6 @@
#include <stdio.h>
#include <string.h>
-#if defined( _WIN32 )
-#include <io.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <stdarg.h>
-#include <ldap.h>
-#include "ntslapdmessages.h"
-#include "proto-ntutil.h"
-#endif
-
#ifdef LINUX
#include <getopt.h>
#endif
diff --git a/ldap/servers/slapd/globals.c b/ldap/servers/slapd/globals.c
index 3eeb2cf..e28362f 100644
--- a/ldap/servers/slapd/globals.c
+++ b/ldap/servers/slapd/globals.c
@@ -59,16 +59,11 @@
#include <time.h>
#include <stdarg.h>
#include <stdlib.h>
-#if defined( _WIN32 )
-#include "ntslapdmessages.h"
-#include "proto-ntutil.h"
-#else
#include <sys/time.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
-#endif
#include "slap.h"
#include "fe.h"
@@ -141,13 +136,6 @@ int __delayed_free = 1;
*/
#endif
-
-#if defined( _WIN32 )
-/* String constants (no change for international) */
-SERVICE_STATUS LDAPServerStatus;
-SERVICE_STATUS_HANDLE hLDAPServerServiceStatus;
-#endif
-
Connection_Table *the_connection_table = NULL;
char *pid_file = "/dev/null";
diff --git a/ldap/servers/slapd/init.c b/ldap/servers/slapd/init.c
index e7c8ab8..31e08da 100644
--- a/ldap/servers/slapd/init.c
+++ b/ldap/servers/slapd/init.c
@@ -45,31 +45,17 @@
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
-#ifndef _WIN32
#include <sys/time.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netdb.h>
-#endif
#include "slap.h"
#include "fe.h"
void
slapd_init()
{
-#ifdef _WIN32
- WSADATA wsadata;
- int err;
-
- if( err = WSAStartup(0x0101, &wsadata ) != 0 ) {
- LDAPDebug( LDAP_DEBUG_ANY,
- "Windows Sockets initialization failed, error %d (%s)\n",
- err, slapd_system_strerror( err ), 0 );
- exit( 1 );
- }
-#endif /* _WIN32 */
-
/* We don't worry about free'ing this stuff
* since the only time we want to do that is when
* the process is exiting. */
diff --git a/ldap/servers/slapd/intrinsics.h b/ldap/servers/slapd/intrinsics.h
index d07b37c..60c3a15 100644
--- a/ldap/servers/slapd/intrinsics.h
+++ b/ldap/servers/slapd/intrinsics.h
@@ -43,42 +43,6 @@
/* Header file used to declare functions which we beat on heavily as intrinsic */
-/* For NT ...*/
-
-#ifdef _WIN32
-__inline static int strcmpi_fast(const char * dst, const char * src)
-{
- int f,l;
- do {
- if ( ((f = (unsigned char)(*(dst++))) >= 'A') && (f <= 'Z') )
- f -= ('A' - 'a');
- if ( ((l = (unsigned char)(*(src++))) >= 'A') && (l <= 'Z') )
- l -= ('A' - 'a');
- } while ( f && (f == l) );
- return(f - l);
-}
-#ifdef strcasecmp
-#undef strcasecmp
-#endif
-#define strcasecmp(x,y) strcmpi_fast(x,y)
-#ifdef strcmpi
-#undef strcmpi
-#endif
-#define strcmpi(x,y) strcmpi_fast(x,y)
-
-__inline static int tolower_fast(int c)
-{
- if ( (c >= 'A') && (c <= 'Z') )
- c = c + ('a' - 'A');
- return c;
-}
-#ifdef tolower
-#undef tolower
-#endif
-#define tolower(x) tolower_fast(x)
-
-#else
-
#if defined(HPUX)
#define INLINE_DIRECTIVE __inline
#elif defined(LINUX)
@@ -145,4 +109,3 @@ INLINE_DIRECTIVE static int strncasecmp_fast(const char * dst, const char * src,
#undef strncasecmp
#endif
#define strncasecmp(x,y,z) strncasecmp_fast(x,y,z)
-#endif /* NT */
diff --git a/ldap/servers/slapd/ldaputil.c b/ldap/servers/slapd/ldaputil.c
index 7daaaf3..5d028a4 100644
--- a/ldap/servers/slapd/ldaputil.c
+++ b/ldap/servers/slapd/ldaputil.c
@@ -82,14 +82,10 @@
#endif
/* ldaputil.c -- LDAP utility functions and wrappers */
-#ifdef _WIN32
-#include <direct.h> /* for getcwd */
-#else
#include <sys/socket.h>
#include <sys/param.h>
#include <unistd.h>
#include <pwd.h>
-#endif
#include <libgen.h>
#include <pk11func.h>
#include "slap.h"
diff --git a/ldap/servers/slapd/libglobs.c b/ldap/servers/slapd/libglobs.c
index d68ec33..968f0f5 100644
--- a/ldap/servers/slapd/libglobs.c
+++ b/ldap/servers/slapd/libglobs.c
@@ -62,11 +62,6 @@
#include <time.h>
#include <stdarg.h>
#include <stdlib.h>
-#if defined( _WIN32 )
-#define R_OK 04
-#include "ntslapdmessages.h"
-#include "proto-ntutil.h"
-#else
#include <sys/time.h>
#include <sys/param.h> /* MAXPATHLEN */
#include <sys/socket.h>
@@ -75,7 +70,6 @@
#include <netdb.h>
#include <unistd.h>
#include <pwd.h> /* pwdnam */
-#endif
#ifdef USE_SYSCONF
#include <unistd.h>
#endif /* USE_SYSCONF */
@@ -87,17 +81,8 @@
#define REMOVE_CHANGELOG_CMD "remove"
-/* On UNIX, there's only one copy of slapd_ldap_debug */
-/* On NT, each module keeps its own module_ldap_debug, which */
-/* points to the process' slapd_ldap_debug */
-#ifdef _WIN32
-int *module_ldap_debug;
-int __declspec(dllexport) slapd_ldap_debug = LDAP_DEBUG_ANY;
-#else
-int slapd_ldap_debug = LDAP_DEBUG_ANY;
-#endif
-
-char *ldap_srvtab = "";
+int slapd_ldap_debug = LDAP_DEBUG_ANY;
+char *ldap_srvtab = "";
/* Note that the 'attrname' arguments are used only for log messages */
typedef int (*ConfigSetFunc)(const char *attrname, char *value,
@@ -880,7 +865,7 @@ static struct config_get_and_set {
NULL, 0,
(void**)&global_slapdFrontendConfig.refer_url,
CONFIG_STRING, NULL, NULL/* deletion is not allowed */},
-#if !defined(_WIN32) && !defined(AIX)
+#if !defined(AIX)
{CONFIG_MAXDESCRIPTORS_ATTRIBUTE, config_set_maxdescriptors,
NULL, 0,
(void**)&global_slapdFrontendConfig.maxdescriptors,
@@ -1426,15 +1411,11 @@ FrontendConfig_init () {
init_minssf_exclude_rootdse = cfg->minssf_exclude_rootdse = LDAP_OFF;
cfg->validate_cert = SLAPD_VALIDATE_CERT_WARN;
-#ifdef _WIN32
- cfg->conntablesize = SLAPD_DEFAULT_CONNTABLESIZE;
-#else
#ifdef USE_SYSCONF
cfg->conntablesize = sysconf( _SC_OPEN_MAX );
#else /* USE_SYSCONF */
cfg->conntablesize = getdtablesize();
#endif /* USE_SYSCONF */
-#endif /* _WIN32 */
init_accesscontrol = cfg->accesscontrol = LDAP_ON;
#if defined(LINUX)
@@ -1623,20 +1604,10 @@ g_get_global_lastmod()
return config_get_lastmod();
}
-
int g_get_slapd_security_on(){
return config_get_security();
}
-
-
-#ifdef _WIN32
-void libldap_init_debug_level(int *val_ptr)
-{
- module_ldap_debug = val_ptr;
-}
-#endif
-
static struct snmp_vars_t global_snmp_vars;
struct snmp_vars_t * g_get_global_snmp_vars(){
@@ -3751,9 +3722,6 @@ config_set_workingdir( const char *attrname, char *value, char *errorbuf, int ap
if ( apply) {
CFG_LOCK_WRITE(slapdFrontendConfig);
slapdFrontendConfig->workingdir = slapi_ch_strdup ( value );
-#ifdef _WIN32
- dostounixpath(slapdFrontendConfig->workingdir);
-#endif /* _WIN32 */
CFG_UNLOCK_WRITE(slapdFrontendConfig);
}
return retVal;
@@ -3910,12 +3878,7 @@ config_set_conntablesize( const char *attrname, char *value, char *errorbuf, int
errno = 0;
nValue = strtol(value, &endp, 0);
-#ifdef _WIN32
- if ( *endp != '\0' || errno == ERANGE || nValue < 1 || nValue > 0xfffffe ) {
- PR_snprintf ( errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, "%s: invalid value \"%s\", connection table size must range from 1 to 0xfffffe", attrname, value );
- retVal = LDAP_OPERATIONS_ERROR;
- }
-#elif !defined(AIX)
+#if !defined(AIX)
if ( *endp != '\0' || errno == ERANGE || nValue < 1 || nValue > maxVal ) {
PR_snprintf ( errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, "%s: invalid value \"%s\", connection table "
@@ -3945,9 +3908,7 @@ config_set_reservedescriptors( const char *attrname, char *value, char *errorbuf
int maxVal = 65535;
long nValue = 0;
char *endp = NULL;
-#ifndef _WIN32
struct rlimit rlp;
-#endif
slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig();
@@ -3955,11 +3916,9 @@ config_set_reservedescriptors( const char *attrname, char *value, char *errorbuf
return LDAP_OPERATIONS_ERROR;
}
-#ifndef _WIN32
if ( 0 == getrlimit( RLIMIT_NOFILE, &rlp ) ) {
maxVal = (int)rlp.rlim_max;
}
-#endif
errno = 0;
nValue = strtol(value, &endp, 10);
@@ -4387,12 +4346,7 @@ config_set_errorlog_level( const char *attrname, char *value, char *errorbuf, in
if ( apply ) {
CFG_LOCK_WRITE(slapdFrontendConfig);
level |= LDAP_DEBUG_ANY;
-
-#ifdef _WIN32
- *module_ldap_debug = level;
-#else
slapd_ldap_debug = level;
-#endif
slapdFrontendConfig->errorloglevel = level;
CFG_UNLOCK_WRITE(slapdFrontendConfig);
}
diff --git a/ldap/servers/slapd/libslapd.def b/ldap/servers/slapd/libslapd.def
index 150147b..7e3c942 100644
--- a/ldap/servers/slapd/libslapd.def
+++ b/ldap/servers/slapd/libslapd.def
@@ -854,8 +854,6 @@ EXPORTS
slapi_mods2entry @838
operation_parameters_new @839
operation_parameters_done @840
- slapi_ch_start_recording @841
- slapi_ch_stop_recording @842
snmp_as_entry @843
slapi_filter_compare @844
; probably temporary:
diff --git a/ldap/servers/slapd/localhost.c b/ldap/servers/slapd/localhost.c
index c946e8d..38edb2f 100644
--- a/ldap/servers/slapd/localhost.c
+++ b/ldap/servers/slapd/localhost.c
@@ -44,9 +44,6 @@
#include <stdio.h>
#include <sys/types.h>
#include <string.h>
-#ifdef _WIN32
-#define MAXHOSTNAMELEN 256
-#else
#include <sys/param.h>
#include <sys/socket.h>
#include <netinet/in.h>
@@ -54,7 +51,6 @@
#include <netdb.h>
#include <arpa/nameser.h>
#include <resolv.h>
-#endif
#include <errno.h>
#include "slap.h"
#if defined(USE_SYSCONF) || defined(LINUX)
@@ -99,77 +95,77 @@ find_localhost_DNS()
char line [MAXHOSTNAMELEN + 8];
if (gethostname (hostname, MAXHOSTNAMELEN)) {
- int oserr = errno;
+ int oserr = errno;
- LDAPDebug (LDAP_DEBUG_ANY, "gethostname() failed, error %d (%s)\n",
- oserr, slapd_system_strerror( oserr ), 0 );
- return NULL;
+ LDAPDebug (LDAP_DEBUG_ANY, "gethostname() failed, error %d (%s)\n",
+ oserr, slapd_system_strerror( oserr ), 0 );
+ return NULL;
}
hp = GETHOSTBYNAME (hostname, &hent, hbuf, sizeof(hbuf), &err);
if (hp == NULL) {
- int oserr = errno;
+ int oserr = errno;
- LDAPDebug( LDAP_DEBUG_ANY,
- "gethostbyname(\"%s\") failed, error %d (%s)\n",
- hostname, oserr, slapd_system_strerror( oserr ));
- return NULL;
+ LDAPDebug( LDAP_DEBUG_ANY,
+ "gethostbyname(\"%s\") failed, error %d (%s)\n",
+ hostname, oserr, slapd_system_strerror( oserr ));
+ return NULL;
}
if (hp->h_name == NULL) {
- LDAPDebug (LDAP_DEBUG_ANY, "gethostbyname(\"%s\")->h_name == NULL\n", hostname, 0, 0);
- return NULL;
+ LDAPDebug (LDAP_DEBUG_ANY, "gethostbyname(\"%s\")->h_name == NULL\n", hostname, 0, 0);
+ return NULL;
}
if (strchr (hp->h_name, '.') != NULL) {
- LDAPDebug (LDAP_DEBUG_CONFIG, "h_name == %s\n", hp->h_name, 0, 0);
- return slapi_ch_strdup (hp->h_name);
+ LDAPDebug (LDAP_DEBUG_CONFIG, "h_name == %s\n", hp->h_name, 0, 0);
+ return slapi_ch_strdup (hp->h_name);
} else if (hp->h_aliases != NULL) {
- for (alias = hp->h_aliases; *alias != NULL; ++alias) {
- if (strchr (*alias, '.') != NULL &&
- strncmp (*alias, hp->h_name, strlen (hp->h_name))) {
- LDAPDebug (LDAP_DEBUG_CONFIG, "h_alias == %s\n", *alias, 0, 0);
- return slapi_ch_strdup (*alias);
- }
- }
+ for (alias = hp->h_aliases; *alias != NULL; ++alias) {
+ if (strchr (*alias, '.') != NULL &&
+ strncmp (*alias, hp->h_name, strlen (hp->h_name))) {
+ LDAPDebug (LDAP_DEBUG_CONFIG, "h_alias == %s\n", *alias, 0, 0);
+ return slapi_ch_strdup (*alias);
+ }
+ }
}
/* The following is copied from dns_guess_domain(),
in ldapserver/lib/base/dnsdmain.c */
domain = NULL;
f = fopen (_PATH_RESCONF, "r"); /* This fopen() will fail on NT, as expected */
if (f != NULL) {
- while (fgets (line, sizeof(line), f)) {
- if (strncasecmp (line, "domain", 6) == 0 && isspace (line[6])) {
- LDAPDebug (LDAP_DEBUG_CONFIG, "%s: %s\n", _PATH_RESCONF, line, 0);
- for (cp = &line[7]; *cp && isspace(*cp); ++cp);
- if (*cp) {
- domain = cp;
- /* ignore subsequent whitespace: */
- for (; *cp && ! isspace (*cp); ++cp);
- if (*cp) {
- *cp = '\0';
- }
- }
- break;
- }
- }
- fclose (f);
+ while (fgets (line, sizeof(line), f)) {
+ if (strncasecmp (line, "domain", 6) == 0 && isspace (line[6])) {
+ LDAPDebug (LDAP_DEBUG_CONFIG, "%s: %s\n", _PATH_RESCONF, line, 0);
+ for (cp = &line[7]; *cp && isspace(*cp); ++cp);
+ if (*cp) {
+ domain = cp;
+ /* ignore subsequent whitespace: */
+ for (; *cp && ! isspace (*cp); ++cp);
+ if (*cp) {
+ *cp = '\0';
+ }
+ }
+ break;
+ }
+ }
+ fclose (f);
}
#ifndef NO_DOMAINNAME
if (domain == NULL) {
- /* No domain found. Try getdomainname. */
- getdomainname (line, sizeof(line));
- LDAPDebug (LDAP_DEBUG_CONFIG, "getdomainname(%s)\n", line, 0, 0);
- if (line[0] != 0) {
- domain = &line[0];
- }
+ /* No domain found. Try getdomainname. */
+ getdomainname (line, sizeof(line));
+ LDAPDebug (LDAP_DEBUG_CONFIG, "getdomainname(%s)\n", line, 0, 0);
+ if (line[0] != 0) {
+ domain = &line[0];
+ }
}
#endif
if (domain == NULL) {
- return NULL;
+ return NULL;
}
PL_strncpyz (hostname, hp->h_name, sizeof(hostname));
if (domain[0] == '.') ++domain;
if (domain[0]) {
- PL_strcatn (hostname, sizeof(hostname), ".");
- PL_strcatn (hostname, sizeof(hostname), domain);
+ PL_strcatn (hostname, sizeof(hostname), ".");
+ PL_strcatn (hostname, sizeof(hostname), domain);
}
LDAPDebug (LDAP_DEBUG_CONFIG, "hostname == %s\n", hostname, 0, 0);
return slapi_ch_strdup (hostname);
@@ -184,21 +180,21 @@ convert_DNS_to_DN (char* DNS)
char* dot;
size_t components;
if (*DNS == '\0') {
- return slapi_ch_strdup ("");
+ return slapi_ch_strdup ("");
}
components = 1;
for (dot = strchr (DNS, '.'); dot != NULL; dot = strchr (dot + 1, '.')) {
- ++components;
+ ++components;
}
DN = slapi_ch_malloc (strlen (DNS) + (components * strlen(RDN)) + 1);
strcpy (DN, RDN);
for (dot = strchr (DNS, '.'); dot != NULL; dot = strchr (dot + 1, '.')) {
- *dot = '\0';
- strcat (DN, DNS);
- strcat (DN, ",");
- strcat (DN, RDN);
- DNS = dot + 1;
- *dot = '.';
+ *dot = '\0';
+ strcat (DN, DNS);
+ strcat (DN, ",");
+ strcat (DN, RDN);
+ DNS = dot + 1;
+ *dot = '.';
}
strcat (DN, DNS);
slapi_dn_normalize (DN);
@@ -210,24 +206,24 @@ static char* localhost_DN = NULL;
char*
get_localhost_DNS()
{
- char *retVal;
- if ( (retVal = config_get_localhost()) == NULL) {
- /* find_localhost_DNS() returns strdup result */
- retVal = find_localhost_DNS();
- }
+ char *retVal;
+ if ( (retVal = config_get_localhost()) == NULL) {
+ /* find_localhost_DNS() returns strdup result */
+ retVal = find_localhost_DNS();
+ }
return retVal;
}
static void
set_localhost_DN()
{
- char *localhost_DNS = config_get_localhost();
-
- if (localhost_DNS != NULL) {
- localhost_DN = convert_DNS_to_DN (localhost_DNS);
- LDAPDebug (LDAP_DEBUG_CONFIG, "DNS %s -> DN %s\n", localhost_DNS, localhost_DN, 0);
- }
- slapi_ch_free( (void **) &localhost_DNS );
+ char *localhost_DNS = config_get_localhost();
+
+ if (localhost_DNS != NULL) {
+ localhost_DN = convert_DNS_to_DN (localhost_DNS);
+ LDAPDebug (LDAP_DEBUG_CONFIG, "DNS %s -> DN %s\n", localhost_DNS, localhost_DN, 0);
+ }
+ slapi_ch_free_string(&localhost_DNS);
}
@@ -238,7 +234,7 @@ get_localhost_DN()
The caller should _not_ free this pointer. */
{
if (localhost_DN == NULL) {
- set_localhost_DN();
+ set_localhost_DN();
}
return localhost_DN;
}
diff --git a/ldap/servers/slapd/lock.c b/ldap/servers/slapd/lock.c
index c62bbd4..20249ed 100644
--- a/ldap/servers/slapd/lock.c
+++ b/ldap/servers/slapd/lock.c
@@ -44,12 +44,10 @@
#include <stdio.h>
#include <sys/types.h>
-#ifndef _WIN32
#include <sys/time.h>
#include <sys/param.h>
#include <sys/file.h>
#include <sys/socket.h>
-#endif
#include "slap.h"
#ifdef USE_LOCKF
#include <unistd.h>
@@ -69,30 +67,22 @@ lock_fopen( char *fname, char *type, FILE **lfp )
}
/* acquire the lock */
-#ifdef _WIN32
- while ( _locking( _fileno( *lfp ), LK_NBLCK, 0xFFFFFFFF ) != 0 ) {
-#else
#ifdef USE_LOCKF
while ( lockf( fileno( *lfp ), F_LOCK, 0 ) != 0 ) {
-#else /* _WIN32 */
+#else
while ( flock( fileno( *lfp ), LOCK_EX ) != 0 ) {
#endif
-#endif /* _WIN32 */
; /* NULL */
}
/* open the log file */
if ( (fp = fopen( fname, type )) == NULL ) {
LDAPDebug( LDAP_DEBUG_ANY, "could not open \"%s\"\n", fname, 0, 0 );
-#ifdef _WIN32
- _locking( _fileno( *lfp ), LK_UNLCK, 0xFFFFFFFF );
-#else /* _WIN32 */
#ifdef USE_LOCKF
lockf( fileno( *lfp ), F_ULOCK, 0 );
#else
flock( fileno( *lfp ), LOCK_UN );
#endif
-#endif /* _WIN32 */
return( NULL );
}
@@ -103,15 +93,11 @@ int
lock_fclose( FILE *fp, FILE *lfp )
{
/* unlock */
-#ifdef _WIN32
- _locking( _fileno( lfp ), LK_UNLCK, 0xFFFFFFFF );
-#else /* _WIN32 */
#ifdef USE_LOCKF
lockf( fileno( lfp ), F_ULOCK, 0 );
#else
flock( fileno( lfp ), LOCK_UN );
#endif
-#endif /* _WIN32 */
fclose( lfp );
return( fclose( fp ) );
diff --git a/ldap/servers/slapd/log.c b/ldap/servers/slapd/log.c
index f41e319..6279831 100644
--- a/ldap/servers/slapd/log.c
+++ b/ldap/servers/slapd/log.c
@@ -54,20 +54,9 @@
#include "log.h"
#include "fe.h"
-#ifndef _WIN32
#include <pwd.h> /* getpwnam */
-#endif
-
-#if defined( XP_WIN32 )
-#include <fcntl.h>
-#include "ntslapdmessages.h"
-#include "proto-ntutil.h"
-extern HANDLE hSlapdEventSource;
-extern LPTSTR pszServerName;
-#define _PSEP '\\'
-#else
#define _PSEP '/'
-#endif
+
/**************************************************************************
* GLOBALS, defines, and ...
*************************************************************************/
@@ -163,28 +152,6 @@ slapd_log_error_proc_internal(
* flushes the buffer if necessary
* LOG_CLOSE(fd) closes the logfile
*/
-#ifdef XP_WIN32
-#define LOG_OPEN_APPEND(fd, filename, mode) \
- (((fd) = fopen((filename), "a")) != NULL)
-#define LOG_OPEN_WRITE(fd, filename, mode) \
- (((fd) = fopen((filename), "w")) != NULL)
-#define LOG_WRITE(fd, buffer, size, headersize) \
- if ( fwrite((buffer), (size), 1, (fd)) != 1 ) \
- {\
- ReportSlapdEvent(EVENTLOG_INFORMATION_TYPE, MSG_SERVER_FAILED_TO_WRITE_LOG, 1, (buffer)); \
- }
-#define LOG_WRITE_NOW(fd, buffer, size, headersize, err) do {\
- (err) = 0; \
- if ( fwrite((buffer), (size), 1, (fd)) != 1 ) \
- { \
- ReportSlapdEvent(EVENTLOG_INFORMATION_TYPE, MSG_SERVER_FAILED_TO_WRITE_LOG, 1, (buffer)); \
- (err) = 1; \
- }; \
- fflush((fd)); \
- } while (0)
-#define LOG_CLOSE(fd) \
- fclose((fd))
-#else /* xp_win32 */
#define LOG_OPEN_APPEND(fd, filename, mode) \
(((fd) = PR_Open((filename), PR_WRONLY | PR_APPEND | PR_CREATE_FILE , \
mode)) != NULL)
@@ -219,7 +186,6 @@ slapd_log_error_proc_internal(
} while (0)
#define LOG_CLOSE(fd) \
PR_Close((fd))
-#endif
/******************************************************************************
@@ -247,41 +213,11 @@ void g_set_detached(int val)
void g_log_init(int log_enabled)
{
slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig();
-#if defined( XP_WIN32 )
- /* char * instancedir = NULL; obsolete. */
- /* To port to Windows, need to support FHS. */
-#endif
ts_time_lock = PR_NewLock();
if (! ts_time_lock)
exit(-1);
-#if defined( XP_WIN32 )
- pszServerName = slapi_ch_malloc( MAX_SERVICE_NAME );
- /* instancedir = config_get_instancedir(); eliminated */
- unixtodospath(instancedir);
- if( !SlapdGetServerNameFromCmdline(pszServerName, instancedir, 1) )
- {
- MessageBox(GetDesktopWindow(), "Failed to get the Directory"
- " Server name from the command-line argument.",
- " ", MB_ICONEXCLAMATION | MB_OK);
- exit( 1 );
- }
- slapi_ch_free((void **)&instancedir);
-
- /* Register with the NT EventLog */
- hSlapdEventSource = RegisterEventSource(NULL, pszServerName );
- if( !hSlapdEventSource )
- {
- char szMessage[256];
- PR_snprintf( szMessage, sizeof(szMessage), "Directory Server %s is terminating. Failed "
- "to set the EventLog source.", pszServerName);
- MessageBox(GetDesktopWindow(), szMessage, " ",
- MB_ICONEXCLAMATION | MB_OK);
- exit( 1 );
- }
-#endif
-
/* ACCESS LOG */
loginfo.log_access_state = 0;
loginfo.log_access_mode = SLAPD_DEFAULT_FILE_MODE;
@@ -1832,16 +1768,8 @@ vslapd_log_emergency_error(LOGFD fp, const char *msg, int locked)
int size;
tnl = current_time();
-#ifdef _WIN32
- {
- struct tm *pt = localtime( &tnl );
- tmsp = &tms;
- memcpy(&tms, pt, sizeof(struct tm) );
- }
-#else
(void)localtime_r( &tnl, &tms );
tmsp = &tms;
-#endif
#ifdef BSD_TIME
tz = tmsp->tm_gmtoff;
#else /* BSD_TIME */
@@ -1888,16 +1816,8 @@ vslapd_log_error(
int err = 0;
tnl = current_time();
-#ifdef _WIN32
- {
- struct tm *pt = localtime( &tnl );
- tmsp = &tms;
- memcpy(&tms, pt, sizeof(struct tm) );
- }
-#else
(void)localtime_r( &tnl, &tms );
tmsp = &tms;
-#endif
#ifdef BSD_TIME
tz = tmsp->tm_gmtoff;
#else /* BSD_TIME */
@@ -1983,18 +1903,12 @@ slapi_log_error( int severity, char *subsystem, char *fmt, ... )
return( -1 );
}
- if (
-#ifdef _WIN32
- *module_ldap_debug
-#else
- slapd_ldap_debug
-#endif
- & slapi_log_map[ severity ] ) {
+ if ( slapd_ldap_debug & slapi_log_map[ severity ] ) {
va_start( ap1, fmt );
va_start( ap2, fmt );
rc = slapd_log_error_proc_internal( subsystem, fmt, ap1, ap2 );
- va_end( ap1 );
- va_end( ap2 );
+ va_end( ap1 );
+ va_end( ap2 );
} else {
rc = 0; /* nothing to be logged --> always return success */
}
@@ -2010,20 +1924,14 @@ slapi_log_error_ext(int severity, char *subsystem, char *fmt, va_list varg1, va_
if ( severity < SLAPI_LOG_MIN || severity > SLAPI_LOG_MAX ) {
(void)slapd_log_error_proc( subsystem, "slapi_log_error: invalid severity %d (message %s)\n",
severity, fmt );
- return( -1 );
+ return( -1 );
}
- if (
- #ifdef _WIN32
- *module_ldap_debug
- #else
- slapd_ldap_debug
- #endif
- & slapi_log_map[ severity ] )
+ if ( slapd_ldap_debug & slapi_log_map[ severity ] )
{
rc = slapd_log_error_proc_internal( subsystem, fmt, varg1, varg2 );
} else {
- rc = 0; /* nothing to be logged --> always return success */
+ rc = 0; /* nothing to be logged --> always return success */
}
return( rc );
@@ -2032,16 +1940,9 @@ slapi_log_error_ext(int severity, char *subsystem, char *fmt, va_list varg1, va_
int
slapi_is_loglevel_set ( const int loglevel )
{
- return (
-#ifdef _WIN32
- *module_ldap_debug
-#else
- slapd_ldap_debug
-#endif
- & slapi_log_map[ loglevel ] ? 1 : 0);
+ return ( slapd_ldap_debug & slapi_log_map[ loglevel ] ? 1 : 0);
}
-
/******************************************************************************
* write in the access log
******************************************************************************/
@@ -2070,16 +1971,8 @@ static int vslapd_log_access(char *fmt, va_list ap)
PR_Unlock(ts_time_lock);
} else {
/* nope... painstakingly create the new strftime buffer */
-#ifdef _WIN32
- {
- struct tm *pt = localtime( &tnl );
- tmsp = &tms;
- memcpy(&tms, pt, sizeof(struct tm) );
- }
-#else
(void)localtime_r( &tnl, &tms );
tmsp = &tms;
-#endif
#ifdef BSD_TIME
tz = tmsp->tm_gmtoff;
@@ -3042,19 +2935,6 @@ log__extract_logheader (FILE *fp, long *f_ctime, PRInt64 *f_size)
/* using an int implies that all logfiles will be under 2G. this is
* probably a safe assumption for now.
*/
-#ifdef XP_WIN32
-static PRInt64
-log__getfilesize(LOGFD fp)
-{
- struct stat info;
- int rv;
-
- if ((rv = fstat(fileno(fp), &info)) != 0) {
- return -1;
- }
- return (PRInt64)info.st_size;
-}
-#else
static PRInt64
log__getfilesize(LOGFD fp)
{
@@ -3076,8 +2956,6 @@ log__getfilesize_with_filename(char *filename)
}
return (PRInt64)info.size; /* type of size is PROffset64 */
}
-#endif
-
/******************************************************************************
* log__enough_freespace
@@ -3090,41 +2968,14 @@ log__getfilesize_with_filename(char *filename)
static int
log__enough_freespace(char *path)
{
-
-#ifdef _WIN32
-DWORD sectorsPerCluster, bytesPerSector, freeClusters, totalClusters;
-char rootpath[4];
-#else
#ifdef LINUX
struct statfs buf;
#else
struct statvfs buf;
#endif /* LINUX */
-#endif
PRInt64 freeBytes;
PRInt64 tmpval;
-
-#ifdef _WIN32
- strncpy(rootpath, path, 3);
- rootpath[3] = '\0';
- /* we should consider using GetDiskFreeSpaceEx here someday */
- if ( !GetDiskFreeSpace(rootpath, §orsPerCluster, &bytesPerSector,
- &freeClusters, &totalClusters)) {
- LDAPDebug(LDAP_DEBUG_ANY,
- "log__enough_freespace: Unable to get the free space\n",0,0,0);
- return 1;
- } else {
- LL_UI2L(freeBytes, freeClusters);
- LL_UI2L(tmpval, sectorsPerCluster);
- LL_MUL(freeBytes, freeBytes, tmpval);
- LL_UI2L(tmpval, bytesPerSector);
- LL_MUL(freeBytes, freeBytes, tmpval);
-/* freeBytes = freeClusters * sectorsPerCluster * bytesPerSector; */
-
- }
-
-#else
#ifdef LINUX
if (statfs(path, &buf) == -1)
#else
@@ -3143,7 +2994,6 @@ char rootpath[4];
LL_MUL(freeBytes, freeBytes, tmpval);
/* freeBytes = buf.f_bavail * buf.f_bsize; */
}
-#endif
LL_UI2L(tmpval, loginfo.log_access_minfreespace);
if (LL_UCMP(freeBytes, <, tmpval)) {
/* if (freeBytes < loginfo.log_access_minfreespace) { */
@@ -3762,13 +3612,10 @@ log__open_errorlogfile(int logfile_state, int locked)
struct logfileinfo *logp;
char buffer[BUFSIZ];
struct passwd *pw = NULL;
-#ifndef _WIN32
int rc = 0;
-#endif
slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig();
-#ifndef _WIN32
if ( slapdFrontendConfig->localuser != NULL &&
slapdFrontendConfig->localuserinfo != NULL ) {
pw = slapdFrontendConfig->localuserinfo;
@@ -3779,7 +3626,6 @@ log__open_errorlogfile(int logfile_state, int locked)
log__error_emergency(buffer, 0, locked);
return LOG_UNABLE_TO_OPENFILE;
}
-#endif
if (!locked) LOG_ERROR_LOCK_WRITE( );
@@ -3857,7 +3703,6 @@ log__open_errorlogfile(int logfile_state, int locked)
return LOG_UNABLE_TO_OPENFILE;
}
-#ifndef _WIN32
/* make sure the logfile is owned by the localuser. If one of the
* alternate ns-slapd modes, such as db2bak, tries to log an error
* at startup, it will create the logfile as root!
@@ -3876,7 +3721,6 @@ log__open_errorlogfile(int logfile_state, int locked)
*/
return LOG_UNABLE_TO_OPENFILE;
}
-#endif
loginfo.log_error_fdes = fp;
if (logfile_state == LOGFILE_REOPENED) {
@@ -4208,16 +4052,8 @@ log_convert_time (time_t ctime, char *tbuf, int type)
{
struct tm *tmsp, tms;
-#ifdef _WIN32
- {
- struct tm *pt = localtime( &ctime );
- tmsp = &tms;
- memcpy(&tms, pt, sizeof(struct tm) );
- }
-#else
(void)localtime_r( &ctime, &tms );
tmsp = &tms;
-#endif
if (type == 1) /* get the short form */
(void) strftime (tbuf, (size_t) TBUFSIZE, "%Y%m%d-%H%M%S",tmsp);
else /* wants the long form */
diff --git a/ldap/servers/slapd/log.h b/ldap/servers/slapd/log.h
index 86e59d9..4f6bed9 100644
--- a/ldap/servers/slapd/log.h
+++ b/ldap/servers/slapd/log.h
@@ -60,14 +60,12 @@
#include <stdarg.h>
#include <sys/types.h>
#include <sys/stat.h>
-#ifndef _WIN32
#include <errno.h>
#ifdef LINUX
#include <sys/statfs.h>
#else
#include <sys/statvfs.h>
#endif
-#endif
#include <fcntl.h>
#include "prio.h"
#include "prprf.h"
@@ -108,11 +106,7 @@
#define PREVLOGFILE "Previous Log File:"
/* see log.c for why this is done */
-#ifdef XP_WIN32
-typedef FILE *LOGFD;
-#else
typedef PRFileDesc *LOGFD;
-#endif
struct logfileinfo {
diff --git a/ldap/servers/slapd/main.c b/ldap/servers/slapd/main.c
index a3ba99b..28f6908 100644
--- a/ldap/servers/slapd/main.c
+++ b/ldap/servers/slapd/main.c
@@ -49,7 +49,7 @@
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
-#if !defined(_WIN32) && !defined(aix)
+#if !defined(aix)
#include <sys/fcntl.h>
#else
#include <fcntl.h>
@@ -58,10 +58,6 @@
#include <stdarg.h>
#include <signal.h>
#include <stdlib.h>
-#if defined( _WIN32 )
-#include "ntslapdmessages.h"
-#include "proto-ntutil.h"
-#else
#include <sys/time.h>
#include <sys/socket.h>
#include <netinet/in.h>
@@ -75,13 +71,10 @@ union semun {
ushort *array;
};
#endif
-#endif
-#if !defined(_WIN32)
#include <unistd.h> /* dup2 */
#include <sys/ipc.h>
#include <sys/sem.h>
#include <sys/param.h> /* MAXPATHLEN */
-#endif
#if defined(__sun)
#include <sys/utsname.h>
#include <sys/systeminfo.h>
@@ -100,10 +93,6 @@ union semun {
#include "smrtheap.h"
#endif
-#if defined( XP_WIN32 )
-void dostounixpath(char *szText);
-#endif
-
/* Forward Declarations */
static void register_objects();
static void process_command_line(int argc, char **argv, char *myname, char **extraname);
@@ -129,7 +118,6 @@ static int slapd_exemode = SLAPD_EXEMODE_UNKNOWN;
static int init_cmd_shutdown_detect()
{
-#ifndef _WIN32
/* First of all, we must reset the signal mask to get rid of any blockages
* the process may have inherited from its parent (such as the console), which
* might result in the process not delivering those blocked signals, and thus,
@@ -145,7 +133,6 @@ static int init_cmd_shutdown_detect()
LDAPDebug( LDAP_DEBUG_TRACE, " %s \n",
rc ? "Failed to reset signal mask":"....Done (signal mask reset)!!", 0, 0 );
}
-#endif
#if defined ( HPUX10 )
PR_CreateThread ( PR_USER_THREAD,
@@ -164,7 +151,7 @@ static int init_cmd_shutdown_detect()
* thread a chance to run. */
DS_Sleep(0);
#endif
-#ifndef _WIN32
+
(void) SIGNAL( SIGPIPE, SIG_IGN );
(void) SIGNAL( SIGCHLD, slapd_wait4child );
#ifndef LINUX
@@ -177,7 +164,7 @@ static int init_cmd_shutdown_detect()
(void) SIGNAL( SIGTERM, cmd_set_shutdown );
(void) SIGNAL( SIGHUP, cmd_set_shutdown );
(void) SIGNAL( SIGINT, cmd_set_shutdown );
-#endif /* _WIN32 */
+
return 0;
}
@@ -191,22 +178,18 @@ cmd_set_shutdown (int sig)
*/
c_set_shutdown();
-#ifndef _WIN32
#ifndef LINUX
/* don't mess with USR1/USR2 on linux, used by libpthread */
(void) SIGNAL( SIGUSR2, cmd_set_shutdown );
#endif
(void) SIGNAL( SIGTERM, cmd_set_shutdown );
(void) SIGNAL( SIGHUP, cmd_set_shutdown );
-#endif
}
#ifdef HPUX10
extern void collation_init();
#endif
-#ifndef WIN32
-
/*
Four cases:
- change ownership of all files in directory (strip_fn=PR_FALSE)
@@ -311,7 +294,6 @@ fix_ownership()
chown_dir_files(slapdFrontendConfig->errorlog, pw, PR_TRUE, PR_TRUE);
}
}
-#endif
/* Changes identity to the named user
* If username == NULL, does nothing.
@@ -319,7 +301,6 @@ fix_ownership()
*/
static int main_setuid(char *username)
{
-#ifndef _WIN32
if (username != NULL) {
struct passwd *pw;
/* Make sure everything in the log and config directory
@@ -348,14 +329,13 @@ static int main_setuid(char *username)
}
}
}
-#endif
return 0;
}
/* set good defaults for front-end config in referral mode */
static void referral_set_defaults(void)
{
-#if !defined(_WIN32) && !defined(AIX)
+#if !defined(AIX)
char errorbuf[SLAPI_DSE_RETURNTEXT_SIZE];
config_set_maxdescriptors( CONFIG_MAXDESCRIPTORS_ATTRIBUTE, "1024", errorbuf, 1);
#endif
@@ -568,12 +548,9 @@ static void slapd_print_version(int verbose)
printf( SLAPD_VENDOR_NAME "\n%s B%s\n", versionstring, buildnum);
- /* not here in Win32 */
-#if !defined(_WIN32)
if (strcmp(buildnum,BUILD_NUM) != 0) {
printf( "ns-slapd: B%s\n", BUILD_NUM);
}
-#endif
slapi_ch_free( (void **)&versionstring);
slapi_ch_free( (void **)&buildnum);
@@ -591,29 +568,6 @@ static void slapd_print_version(int verbose)
plugin_print_versions();
}
-#if defined( _WIN32 )
-/* On Windows, we signal the SCM when we're still starting up */
-static int
-write_start_pid_file()
-{
- if( SlapdIsAService() )
- {
- /* Initialization complete and successful. Set service to running */
- LDAPServerStatus.dwCurrentState = SERVICE_START_PENDING;
- LDAPServerStatus.dwCheckPoint = 1;
- LDAPServerStatus.dwWaitHint = 1000;
-
- if (!SetServiceStatus(hLDAPServerServiceStatus, &LDAPServerStatus)) {
- ReportSlapdEvent(EVENTLOG_INFORMATION_TYPE, MSG_SERVER_START_FAILED, 1,
- "Could not set Service status.");
- exit(1);
- }
- }
-
- ReportSlapdEvent(EVENTLOG_INFORMATION_TYPE, MSG_SERVER_STARTED, 0, NULL );
- return 0;
-}
-#else /* WIN32 */
/* On UNIX, we create a file with our PID in it */
static int
write_start_pid_file()
@@ -635,7 +589,6 @@ write_start_pid_file()
}
return -1;
}
-#endif /* WIN32 */
#ifdef MEMPOOL_EXPERIMENTAL
void _free_wrapper(void *ptr)
@@ -689,23 +642,6 @@ main( int argc, char **argv)
PR_Init( PR_USER_THREAD, PR_PRIORITY_NORMAL, 0 );
FrontendConfig_init();
-#ifdef _WIN32
- /* Break into the debugger if DEBUG_BREAK is set in the environment
- to "slapd" */
- {
- char *s = getenv( "DEBUG_BREAK" );
- if ( (s != NULL) && !stricmp(s, "slapd") )
- DebugBreak();
- }
-
- /* do module debug level init for slapd, and libslapd */
- module_ldap_debug = &slapd_ldap_debug;
- libldap_init_debug_level(&slapd_ldap_debug);
-
- dostounixpath( argv[0] );
- _strlwr( argv[0] );
-
-#else /* _WIN32 */
/* Pause for the debugger if DEBUG_SLEEP is set in the environment */
{
char *s = getenv( "DEBUG_SLEEP" );
@@ -716,27 +652,13 @@ main( int argc, char **argv)
}
}
-
-/* used to set configfile to the default config file name here */
-
-#endif /* _WIN32 */
-
+ /* used to set configfile to the default config file name here */
if ( (myname = strrchr( argv[0], '/' )) == NULL ) {
myname = slapi_ch_strdup( argv[0] );
} else {
myname = slapi_ch_strdup( myname + 1 );
}
-#if defined( XP_WIN32 )
- /* Strip ".exe" if it's there */
- {
- char *pdot;
- if ( (pdot = strrchr( myname, '.' )) != NULL ) {
- *pdot = '\0';
- }
- }
-#endif
-
process_command_line(argc,argv,myname,&extraname);
if (NULL == slapdFrontendConfig->configdir) {
@@ -744,7 +666,6 @@ main( int argc, char **argv)
exit( 1 );
}
-
/* display debugging level if it is anything other than the default */
if ( 0 != ( slapd_ldap_debug & ~LDAP_DEBUG_ANY )) {
slapd_debug_level_log( slapd_ldap_debug );
@@ -866,25 +787,6 @@ main( int argc, char **argv)
/* Set entry points in libslapd */
set_entry_points();
-#if defined( XP_WIN32 )
- if (slapd_exemode == SLAPD_EXEMODE_SLAPD) {
- /* Register with the NT EventLog */
- hSlapdEventSource = RegisterEventSource(NULL, pszServerName );
- if( !hSlapdEventSource ) {
- char szMessage[256];
- PR_snprintf( szMessage, sizeof(szMessage), "Directory Server %s is terminating. Failed "
- "to set the EventLog source.", pszServerName);
- MessageBox(GetDesktopWindow(), szMessage, " ",
- MB_ICONEXCLAMATION | MB_OK);
- exit( 1 );
- }
-
- /* Check to ensure there isn't a copy of this server already running. */
- if( MultipleInstances() )
- exit( 1 );
- }
-#endif
-
/*
* After we read the config file we should make
* sure that everything we needed to read in has
@@ -948,15 +850,12 @@ main( int argc, char **argv)
}
/* Now, sockets are open, so we can safely change identity now */
-
-#ifndef _WIN32
return_value = main_setuid(slapdFrontendConfig->localuser);
if (0 != return_value) {
LDAPDebug( LDAP_DEBUG_ANY, "Failed to change user and group identity to that of %s\n",
slapdFrontendConfig->localuser, 0, 0 );
exit(1);
}
-#endif
/* Do NSS and/or SSL init for those modes other than listening modes */
if ((slapd_exemode != SLAPD_EXEMODE_REFERRAL) &&
@@ -1158,16 +1057,11 @@ main( int argc, char **argv)
}
/* --ugaston: register the start-tls plugin */
-#ifndef _WIN32
if ( slapd_security_library_is_initialized() != 0 ) {
-
-
- start_tls_register_plugin();
- LDAPDebug( LDAP_DEBUG_PLUGIN,
- "Start TLS plugin registered.\n",
- 0, 0, 0 );
+ start_tls_register_plugin();
+ LDAPDebug( LDAP_DEBUG_PLUGIN, "Start TLS plugin registered.\n",
+ 0, 0, 0 );
}
-#endif
passwd_modify_register_plugin();
LDAPDebug( LDAP_DEBUG_PLUGIN,
"Password Modify plugin registered.\n", 0, 0, 0 );
@@ -1215,28 +1109,6 @@ main( int argc, char **argv)
} else if (i_port) {
} else if ( config_get_security()) {
} else {
-#ifdef _WIN32
- if( SlapdIsAService() )
- {
- LDAPServerStatus.dwCurrentState = SERVICE_STOPPED;
- LDAPServerStatus.dwCheckPoint = 0;
- LDAPServerStatus.dwWaitHint = 0;
- LDAPServerStatus.dwWin32ExitCode = 1;
- LDAPServerStatus.dwServiceSpecificExitCode = 1;
-
- SetServiceStatus(hLDAPServerServiceStatus, &LDAPServerStatus);
-
- /* Log this event */
- ReportSlapdEvent(EVENTLOG_INFORMATION_TYPE, MSG_SERVER_START_FAILED, 1,
- "Check server port specification");
- }
- else
- {
- char szMessage[256];
- PR_snprintf( szMessage, sizeof(szMessage), "The Directory Server %s is terminating due to an error. Check server port specification", pszServerName);
- MessageBox(GetDesktopWindow(), szMessage, " ", MB_ICONEXCLAMATION | MB_OK);
- }
-#endif
LDAPDebug( LDAP_DEBUG_ANY,
"Fatal Error---No ports specified. "
"Exiting now.\n", 0, 0, 0 );
@@ -1276,7 +1148,6 @@ main( int argc, char **argv)
{
time( &starttime );
-
slapd_daemon(&ports_info);
}
LDAPDebug( LDAP_DEBUG_ANY, "slapd stopped.\n", 0, 0, 0 );
@@ -1290,10 +1161,6 @@ cleanup:
ndn_cache_destroy();
NSS_Shutdown();
PR_Cleanup();
-#ifdef _WIN32
- /* Clean up the mutex used to interlock processes, before we exit */
- remove_slapd_process();
-#endif
#if ( defined( hpux ) || defined( irix ) || defined( aix ) || defined( OSF1 ))
exit( return_value );
#else
@@ -1648,20 +1515,11 @@ process_command_line(int argc, char **argv, char *myname,
char *p;
/* if LDIF comes through standard input, skip path checking */
if ( optarg_ext[0] != '-' || strlen(optarg_ext) != 1) {
-#if defined( XP_WIN32 )
- if ( optarg_ext[0] != '/' && optarg_ext[0] != '\\'
- && (!isalpha( optarg_ext[0] ) || (optarg_ext[1] != ':')) ) {
- fprintf( stderr, "%s file could not be opened: absolute path "
- " required.\n", optarg_ext );
- break;
- }
-#else
if ( optarg_ext[ 0 ] != '/' ) {
fprintf( stderr, "%s file could not be opened: absolute path "
" required.\n", optarg_ext );
break;
}
-#endif
}
p = (char *) slapi_ch_malloc(strlen(optarg_ext) + 1);
@@ -2266,9 +2124,7 @@ slapd_exemode_ldif2db()
pb.pb_ldif_include = db2ldif_include;
pb.pb_ldif_exclude = db2ldif_exclude;
pb.pb_task_flags = SLAPI_TASK_RUNNING_FROM_COMMANDLINE;
-#ifndef _WIN32
main_setuid(slapdFrontendConfig->localuser);
-#endif
if ( plugin->plg_ldif2db != NULL ) {
return_value = (*plugin->plg_ldif2db)( &pb );
} else {
@@ -2339,11 +2195,9 @@ slapd_exemode_db2ldif(int argc, char** argv)
}
}
-#ifndef _WIN32
/* [622984] db2lidf -r changes database file ownership
* should call setuid before "db2ldif_dump_replica" */
main_setuid(slapdFrontendConfig->localuser);
-#endif
for (instp = cmd_line_instance_names; instp && *instp; instp++) {
int release_me = 0;
@@ -2412,13 +2266,8 @@ slapd_exemode_db2ldif(int argc, char** argv)
pb.pb_ldif_file = NULL;
if ( archive_name ) { /* redirect stdout to this file: */
char *p, *q;
-#if defined( XP_WIN32 )
- char sep = '\\';
- if (NULL != strchr(archive_name, '/'))
- sep = '/';
-#else
char sep = '/';
-#endif
+
my_ldiffile = archive_name;
if (ldif_printkey & EXPORT_APPENDMODE) {
if (instp == cmd_line_instance_names) { /* first export */
@@ -2586,9 +2435,7 @@ static int slapd_exemode_db2index()
pb.pb_db2index_attrs = db2index_attrs;
pb.pb_instance_name = cmd_line_instance_name;
pb.pb_task_flags = SLAPI_TASK_RUNNING_FROM_COMMANDLINE;
-#ifndef _WIN32
main_setuid(slapdFrontendConfig->localuser);
-#endif
return_value = (*plugin->plg_db2index)( &pb );
slapi_ch_free( (void**)&myname );
@@ -2645,9 +2492,7 @@ slapd_exemode_db2archive()
pb.pb_instance_name = NULL;
pb.pb_seq_val = archive_name;
pb.pb_task_flags = SLAPI_TASK_RUNNING_FROM_COMMANDLINE;
-#ifndef _WIN32
main_setuid(slapdFrontendConfig->localuser);
-#endif
return_value = (backend_plugin->plg_db2archive)( &pb );
return return_value;
}
@@ -2702,9 +2547,7 @@ slapd_exemode_archive2db()
pb.pb_instance_name = cmd_line_instance_name;
pb.pb_seq_val = archive_name;
pb.pb_task_flags = SLAPI_TASK_RUNNING_FROM_COMMANDLINE;
-#ifndef _WIN32
main_setuid(slapdFrontendConfig->localuser);
-#endif
return_value = (backend_plugin->plg_archive2db)( &pb );
return return_value;
}
@@ -2769,9 +2612,7 @@ slapd_exemode_upgradedb()
pb.pb_ldif_namespaceid = ldif2db_namespaceid;
pb.pb_ldif2db_noattrindexes = 0;
pb.pb_removedupvals = 0;
-#ifndef _WIN32
main_setuid(slapdFrontendConfig->localuser);
-#endif
if ( backend_plugin->plg_upgradedb != NULL ) {
return_value = (*backend_plugin->plg_upgradedb)( &pb );
} else {
@@ -2846,9 +2687,7 @@ slapd_exemode_upgradednformat()
pb.pb_ldif_namespaceid = ldif2db_namespaceid;
pb.pb_ldif2db_noattrindexes = 0;
pb.pb_removedupvals = 0;
-#ifndef _WIN32
main_setuid(slapdFrontendConfig->localuser);
-#endif
if ( backend_plugin->plg_upgradednformat != NULL ) {
rc = (*backend_plugin->plg_upgradednformat)( &pb );
} else {
diff --git a/ldap/servers/slapd/mempool.c b/ldap/servers/slapd/mempool.c
index f990363..e0871b8 100644
--- a/ldap/servers/slapd/mempool.c
+++ b/ldap/servers/slapd/mempool.c
@@ -437,12 +437,6 @@ slapi_ch_malloc( unsigned long size )
PR_INCREMENT_COUNTER(slapi_ch_counter_malloc);
PR_INCREMENT_COUNTER(slapi_ch_counter_created);
PR_INCREMENT_COUNTER(slapi_ch_counter_exist);
-#if defined(_WIN32) && defined(DEBUG)
- if(recording)
- {
- add_memory_record(newmem,size);
- }
-#endif
return( newmem );
}
@@ -526,13 +520,6 @@ slapi_ch_realloc( char *block, unsigned long size )
counters_created= 1;
}
PR_INCREMENT_COUNTER(slapi_ch_counter_realloc);
-#if defined(_WIN32) && defined(DEBUG)
- if(recording)
- {
- remove_memory_record(block);
- add_memory_record(newmem,size);
- }
-#endif
return( newmem );
}
@@ -607,12 +594,7 @@ slapi_ch_calloc( unsigned long nelem, unsigned long size )
PR_INCREMENT_COUNTER(slapi_ch_counter_calloc);
PR_INCREMENT_COUNTER(slapi_ch_counter_created);
PR_INCREMENT_COUNTER(slapi_ch_counter_exist);
-#if defined(_WIN32) && defined(DEBUG)
- if(recording)
- {
- add_memory_record(newmem,size);
- }
-#endif
+
return( newmem );
}
@@ -638,12 +620,7 @@ slapi_ch_strdup ( const char* s1 )
PR_INCREMENT_COUNTER(slapi_ch_counter_strdup);
PR_INCREMENT_COUNTER(slapi_ch_counter_created);
PR_INCREMENT_COUNTER(slapi_ch_counter_exist);
-#if defined(_WIN32) && defined(DEBUG)
- if(recording)
- {
- add_memory_record(newmem,strlen(s1)+1);
- }
-#endif
+
return newmem;
}
@@ -670,15 +647,9 @@ slapi_ch_free(void **ptr)
unsigned long size;
if (ptr==NULL || *ptr == NULL){
- return;
+ return;
}
-#if defined(_WIN32) && defined(DEBUG)
- if(recording)
- {
- remove_memory_record(*ptr);
- }
-#endif
realptr = (void *)((char *)*ptr - sizeof(unsigned long));
size = *(unsigned long *)realptr;
if (size <= 1024) {
diff --git a/ldap/servers/slapd/modify.c b/ldap/servers/slapd/modify.c
index ab12f56..a452765 100644
--- a/ldap/servers/slapd/modify.c
+++ b/ldap/servers/slapd/modify.c
@@ -63,12 +63,10 @@
#include <time.h>
#include <string.h>
#include <sys/types.h>
-#ifndef _WIN32
#include <sys/socket.h>
-#endif
#include "slap.h"
#include "pratom.h"
-#if defined(irix) || defined(aix) || defined(_WIN32)
+#if defined(irix) || defined(aix)
#include <time.h>
#endif
diff --git a/ldap/servers/slapd/modrdn.c b/ldap/servers/slapd/modrdn.c
index b4658c3..e4efa0c 100644
--- a/ldap/servers/slapd/modrdn.c
+++ b/ldap/servers/slapd/modrdn.c
@@ -55,9 +55,7 @@
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
-#ifndef _WIN32
#include <sys/socket.h>
-#endif
#include "slap.h"
#include "pratom.h"
diff --git a/ldap/servers/slapd/modutil.c b/ldap/servers/slapd/modutil.c
index c9beb20..af1d35b 100644
--- a/ldap/servers/slapd/modutil.c
+++ b/ldap/servers/slapd/modutil.c
@@ -46,9 +46,7 @@
#include <string.h>
#include <time.h>
#include <sys/types.h>
-#ifndef _WIN32
#include <sys/socket.h>
-#endif /* _WIN32 */
#include "slap.h"
#define SIZE_INIT 4 /* initial element size */
diff --git a/ldap/servers/slapd/monitor.c b/ldap/servers/slapd/monitor.c
index 2c15c39..e762885 100644
--- a/ldap/servers/slapd/monitor.c
+++ b/ldap/servers/slapd/monitor.c
@@ -56,9 +56,7 @@
#include <string.h>
#include <sys/types.h>
#include <time.h>
-#ifndef _WIN32
#include <sys/socket.h>
-#endif
#include "slap.h"
#include "fe.h"
@@ -107,29 +105,13 @@ monitor_info(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter, int *ret
val.bv_val = buf;
attrlist_replace( &e->e_attrs, "bytessent", vals );
-#ifdef _WIN32
- {
- struct tm *pt;
- pt = gmtime( &curtime );
- memcpy(&utm, pt, sizeof(struct tm) );
- }
-#else
gmtime_r( &curtime, &utm );
-#endif
strftime( buf, sizeof(buf), "%Y%m%d%H%M%SZ", &utm );
val.bv_val = buf;
val.bv_len = strlen( buf );
attrlist_replace( &e->e_attrs, "currenttime", vals );
-#ifdef _WIN32
- {
- struct tm *pt;
- pt = gmtime( &starttime );
- memcpy(&utm, pt, sizeof(struct tm) );
- }
-#else
gmtime_r( &starttime, &utm );
-#endif
strftime( buf, sizeof(buf), "%Y%m%d%H%M%SZ", &utm );
val.bv_val = buf;
val.bv_len = strlen( buf );
diff --git a/ldap/servers/slapd/operation.c b/ldap/servers/slapd/operation.c
index f27c673..52d17be 100644
--- a/ldap/servers/slapd/operation.c
+++ b/ldap/servers/slapd/operation.c
@@ -45,9 +45,7 @@
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
-#ifndef _WIN32
#include <sys/socket.h>
-#endif
#include "slap.h"
#include "fe.h"
diff --git a/ldap/servers/slapd/opshared.c b/ldap/servers/slapd/opshared.c
index cab911a..9ecebc2 100644
--- a/ldap/servers/slapd/opshared.c
+++ b/ldap/servers/slapd/opshared.c
@@ -201,15 +201,7 @@ modify_update_last_modified_attr(Slapi_PBlock *pb, Slapi_Mods *smods)
/* fill in modifytimestamp */
curtime = current_time();
-#ifdef _WIN32
-{
- struct tm *pt;
- pt = gmtime(&curtime);
- memcpy(&utm, pt, sizeof(struct tm));
-}
-#else
gmtime_r(&curtime, &utm);
-#endif
strftime(buf, sizeof(buf), "%Y%m%d%H%M%SZ", &utm);
bv.bv_val = buf;
bv.bv_len = strlen(bv.bv_val);
diff --git a/ldap/servers/slapd/plugin.c b/ldap/servers/slapd/plugin.c
index e54c01d..1500cff 100644
--- a/ldap/servers/slapd/plugin.c
+++ b/ldap/servers/slapd/plugin.c
@@ -2872,18 +2872,6 @@ plugin_setup(Slapi_Entry *plugin_entry, struct slapi_componentid *group,
status = -1;
goto PLUGIN_CLEANUP;
}
-#ifdef _WIN32
- {
- set_debug_level_fn_t fn;
- /* for Win32 only, attempt to get its debug level init function */
- if ((fn = (set_debug_level_fn_t)sym_load(plugin->plg_libpath,
- "plugin_init_debug_level", plugin->plg_name,
- 0 /* do not report errors */ )) != NULL) {
- /* we hooked the function, so call it */
- (*fn)(module_ldap_debug);
- }
- }
-#endif
}
if (!status && group) /* uses group's config; see plugin_get_config */
diff --git a/ldap/servers/slapd/protect_db.c b/ldap/servers/slapd/protect_db.c
index 6f8b8fe..40685f1 100644
--- a/ldap/servers/slapd/protect_db.c
+++ b/ldap/servers/slapd/protect_db.c
@@ -45,10 +45,6 @@
* slapd from clobbering each other
*/
-
-
-#ifndef _WIN32
-
#define LOCK_FILE "lock"
#define IMPORT_DIR "imports"
#define EXPORT_DIR "exports"
@@ -66,16 +62,10 @@
#include <sys/param.h> /* MAXPATHLEN */
#include <dirent.h>
#include <pwd.h>
-#endif
#include "protect_db.h"
-
#include "slap.h"
-
-#ifndef _WIN32
-/* This is the unix version of the code to protect the db. */
-
static int
grab_lockfile()
{
@@ -551,245 +541,3 @@ is_slapd_running() {
release_lockfile();
return running;
}
-
-#else /* _WIN32 */
-
-/* The NT version of this code */
-
-/* Returns 1 if the mutex named 'mutexName' otherwise it
- * returns 0
- */
-int
-mutex_exists( char *mutexName )
-{
- if ( OpenMutex( SYNCHRONIZE, FALSE, mutexName ) == NULL ) {
- return( 0 );
- } else {
- return( 1 );
- }
-}
-
-/* is_slapd_running():
- * returns 1 if slapd is running, 0 if not
- */
-
-int
-is_slapd_running() {
- char mutexName[ MAXPATHLEN + 1 ];
- char serverMutexName[ MAXPATHLEN + 1 ];
- int result = 0;
- slapdFrontendConfig_t *cfg = getFrontendConfig();
-
- strncpy( mutexName, cfg->lockdir, MAXPATHLEN );
- strncpy( serverMutexName, cfg->lockdir, MAXPATHLEN );
- mutexName[ MAXPATHLEN ] = '\0';
-
- serverMutexName[ MAXPATHLEN ] = '\0';
- strcat( serverMutexName, "/server" );
-
- return mutex_exists ( serverMutexName );
-}
-
-static void fix_mutex_name(char *name)
-{
- /* On NT mutex names cannot contain the '\' character.
- * This functions replaces '\' with '/' in the supplied
- * name. */
- int x;
-
- for (x = 0; name[x] != '\0'; x++) {
- if ('\\' == name[x]) {
- name[x] = '/';
- }
- }
-}
-
-/*
- * We retain any opened handle to the mutex we create here,
- * to use when we shutdown, to delete the mutex prior to
- * signaling that we've exited.
- */
-static HANDLE open_mutex = NULL;
-
-/*
- * Call this to clean up the locks, before signaling
- * that the server is down.
- */
-void
-remove_slapd_process()
-{
- if (open_mutex) {
- CloseHandle(open_mutex);
- }
-}
-
-/* This function makes sure different instances of slapd don't
- * run in conflicting modes at the same time. The WIN32 version
- * uses mutexes as names that the kernel handles. Basically there
- * is a server mutex, and import mutex, and an export mutex. If
- * the server mutex exists, then the server is running. If the
- * import mutex exists, then either ldif2db or bak2db is running.
- * If the export mutex exists, then one or more of db2ldif or db2bak
- * are running. There is also a mutex that is actually locked when
- * checking the existence of the other mutexes. The OS will
- * automatically remove a mutex if no process has a handle on it.
- * returns a 0 if it is ok for the process to run
- * returns a -1 if the process can't run do to a conflict with other
- * slapd processes
- */
-int
-add_new_slapd_process(int exec_mode, int r_flag, int skip_flag)
-{
- char mutexName[ MAXPATHLEN + 1 ];
- char serverMutexName[ MAXPATHLEN + 1 ];
- char importMutexName[ MAXPATHLEN + 1 ];
- char exportMutexName[ MAXPATHLEN + 1 ];
-
- HANDLE mutex;
- SECURITY_ATTRIBUTES mutexAttributes;
- PSECURITY_DESCRIPTOR pSD;
- LPVOID lpMsgBuf;
-
- int result = 0;
-
- slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig();
-
- if (skip_flag) {
- return 0;
- }
-
- /* Create the names for the mutexes */
- PL_strncpyz(mutexName, slapdFrontendConfig->lockdir, sizeof(mutexName));
-
- /* Make sure the name of the mutex is legal. */
- fix_mutex_name(mutexName);
-
- PR_snprintf(serverMutexName, sizeof(serverMutexName), "%s/server", mutexName);
- PR_snprintf(importMutexName, sizeof(importMutexName), "%s/import", mutexName);
- PR_snprintf(exportMutexName, sizeof(exportMutexName), "%s/export", mutexName);
-
- /* Fill in the security crap for the mutex */
- pSD = (PSECURITY_DESCRIPTOR)slapi_ch_malloc( sizeof( SECURITY_DESCRIPTOR ) );
- InitializeSecurityDescriptor( pSD, SECURITY_DESCRIPTOR_REVISION );
- SetSecurityDescriptorDacl( pSD, TRUE, NULL, FALSE );
- mutexAttributes.nLength = sizeof( mutexAttributes );
- mutexAttributes.lpSecurityDescriptor = pSD;
- mutexAttributes.bInheritHandle = FALSE;
-
- /* Get a handle to the main mutex */
- if ( ( mutex = CreateMutex( &mutexAttributes, FALSE, mutexName ) ) == NULL ) {
- FormatMessage(
- FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
- NULL,
- GetLastError(),
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default language */
- (LPTSTR) &lpMsgBuf,
- 0,
- NULL
- );
-
- LDAPDebug( LDAP_DEBUG_ANY, CREATE_MUTEX_ERROR, lpMsgBuf, 0, 0 );
- LocalFree( lpMsgBuf );
- exit( 1 );
- }
-
- /* Lock the main mutex */
- if ( WaitForSingleObject( mutex, INFINITE ) == WAIT_FAILED ) {
- FormatMessage(
- FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
- NULL,
- GetLastError(),
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default language */
- (LPTSTR) &lpMsgBuf,
- 0,
- NULL
- );
-
- LDAPDebug( LDAP_DEBUG_ANY, WAIT_ERROR, lpMsgBuf, 0, 0 );
- LocalFree( lpMsgBuf );
- exit( 1 );
- }
-
-
- switch (exec_mode) {
- case SLAPD_EXEMODE_SLAPD:
- if ( mutex_exists( serverMutexName ) ||
- mutex_exists( importMutexName ) ) {
- LDAPDebug( LDAP_DEBUG_ANY, NO_SERVER_DUE_TO_USE, 0, 0, 0);
- result = -1;
- } else {
- open_mutex = CreateMutex( &mutexAttributes, FALSE, serverMutexName );
- result = 0;
- }
- break;
- case SLAPD_EXEMODE_DB2LDIF:
- if (r_flag) {
- /* When the -r flag is used in db2ldif we need to make sure
- * we get a consistent snapshot of the server. As a result
- * it needs to run by itself, so no other slapd process can
- * change the database while it is running. */
- if ( mutex_exists( serverMutexName ) ||
- mutex_exists( importMutexName ) ||
- mutex_exists( exportMutexName ) ) {
- LDAPDebug(LDAP_DEBUG_ANY, NO_DB2LDIFR_DUE_TO_USE, 0, 0, 0);
- result = -1;
- } else {
- CreateMutex( &mutexAttributes, FALSE, exportMutexName );
- result = 0;
- }
- break;
- }
- case SLAPD_EXEMODE_DB2ARCHIVE:
- if ( mutex_exists( importMutexName ) ) {
- LDAPDebug(LDAP_DEBUG_ANY, NO_EXPORT_DUE_TO_IMPORT, 0, 0, 0);
- result = -1;
- } else {
- CreateMutex( &mutexAttributes, FALSE, exportMutexName );
- result = 0;
- }
- break;
- case SLAPD_EXEMODE_ARCHIVE2DB:
- case SLAPD_EXEMODE_LDIF2DB:
- if ( mutex_exists( serverMutexName ) ||
- mutex_exists( importMutexName ) ||
- mutex_exists( exportMutexName ) ) {
- LDAPDebug(LDAP_DEBUG_ANY, NO_IMPORT_DUE_TO_USE, 0, 0, 0);
- result = -1;
- } else {
- CreateMutex( &mutexAttributes, FALSE, importMutexName );
- result = 0;
- }
- break;
- case SLAPD_EXEMODE_UPGRADEDB:
- if ( mutex_exists( serverMutexName ) ||
- mutex_exists( importMutexName ) ||
- mutex_exists( exportMutexName ) ) {
- LDAPDebug(LDAP_DEBUG_ANY, NO_UPGRADEDB_DUE_TO_USE, 0, 0, 0);
- result = -1;
- } else {
- CreateMutex( &mutexAttributes, FALSE, importMutexName );
- result = 0;
- }
- break;
- case SLAPD_EXEMODE_DBTEST:
- if ( mutex_exists( serverMutexName ) ||
- mutex_exists( importMutexName ) ||
- mutex_exists( exportMutexName ) ) {
- LDAPDebug(LDAP_DEBUG_ANY, NO_DBTEST_DUE_TO_USE, 0, 0, 0);
- result = -1;
- } else {
- CreateMutex( &mutexAttributes, FALSE, importMutexName );
- result = 0;
- }
- break;
- }
-
- /* release the main mutex */
- ReleaseMutex( mutex );
-
- slapi_ch_free((void**)&pSD );
-
- return( result );
-}
-#endif /* _WIN32 */
-
diff --git a/ldap/servers/slapd/proto-slap.h b/ldap/servers/slapd/proto-slap.h
index ea5ff53..dd01999 100644
--- a/ldap/servers/slapd/proto-slap.h
+++ b/ldap/servers/slapd/proto-slap.h
@@ -415,13 +415,11 @@ int config_set_malloc_trim_threshold(const char *attrname, char *value, char *er
int config_set_malloc_mmap_threshold(const char *attrname, char *value, char *errorbuf, int apply);
#endif
-#if !defined(_WIN32) && !defined(AIX)
+#if !defined(AIX)
int config_set_maxdescriptors( const char *attrname, char *value, char *errorbuf, int apply );
-#endif /* !_WIN_32 && !AIX */
+#endif /* !AIX */
-#ifndef _WIN32
int config_set_localuser( const char *attrname, char *value, char *errorbuf, int apply );
-#endif /* !_WIN32 */
#ifdef MEMPOOL_EXPERIMENTAL
int config_set_mempool_switch( const char *attrname, char *value, char *errorbuf, int apply );
@@ -1390,12 +1388,6 @@ void counters_as_entry(Slapi_Entry* e);
void counters_to_errors_log(const char *text);
/*
- * ch_malloc.c
- */
-void slapi_ch_start_recording();
-void slapi_ch_stop_recording();
-
-/*
* snmpcollator.c
*/
void snmp_as_entry(Slapi_Entry* e);
@@ -1468,11 +1460,8 @@ void handle_closed_connection(Connection *);
#ifndef LINUX
void slapd_do_nothing(int);
#endif
-#ifndef _WIN32
void slapd_wait4child (int);
-#else
-void *slapd_service_exit_wait();
-#endif
+
#ifdef ENABLE_NUNC_STANS
void ns_handle_pr_read_ready(struct ns_job_t *job);
#endif
diff --git a/ldap/servers/slapd/pw.c b/ldap/servers/slapd/pw.c
index 3e2dd90..ce46604 100644
--- a/ldap/servers/slapd/pw.c
+++ b/ldap/servers/slapd/pw.c
@@ -55,12 +55,6 @@
#include <string.h>
#include <sys/types.h>
#include <sechash.h>
-#if defined( _WIN32 )
-#undef DEBUG
-#endif /* _WIN32 */
-#if defined( _WIN32 )
-#undef LDAPDebug
-#endif /* _WIN32 */
#if defined( USE_MOZLDAP )
#define LDAP_MOD_OP (0x0007)
#endif /* USE_MOZLDAP */
diff --git a/ldap/servers/slapd/result.c b/ldap/servers/slapd/result.c
index 6ff70e3..ea18a14 100644
--- a/ldap/servers/slapd/result.c
+++ b/ldap/servers/slapd/result.c
@@ -45,12 +45,10 @@
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
-#ifndef _WIN32
#include <sys/time.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <unistd.h>
-#endif
#include <errno.h>
#include <signal.h>
#include "slap.h"
diff --git a/ldap/servers/slapd/saslbind.c b/ldap/servers/slapd/saslbind.c
index 3ec9cd8..a9f79ab 100644
--- a/ldap/servers/slapd/saslbind.c
+++ b/ldap/servers/slapd/saslbind.c
@@ -51,9 +51,7 @@
#include <fe.h>
#include <sasl.h>
#include <saslplug.h>
-#ifndef _WIN32
#include <unistd.h>
-#endif
static char *serverfqdn;
diff --git a/ldap/servers/slapd/slap.h b/ldap/servers/slapd/slap.h
index dd4fc68..1ab8122 100644
--- a/ldap/servers/slapd/slap.h
+++ b/ldap/servers/slapd/slap.h
@@ -76,26 +76,12 @@ static char ptokPBE[34] = "Internal (Software) Token ";
#define SLAPD_EXEMODE_DBVERIFY 12
#define SLAPD_EXEMODE_UPGRADEDNFORMAT 13
-#ifdef _WIN32
-#ifndef DONT_DECLARE_SLAPD_LDAP_DEBUG
-extern __declspec(dllimport) int slapd_ldap_debug; /* XXXmcs: should eliminate this */
-#endif /* DONT_DECLARE_SLAPD_LDAP_DEBUG */
-typedef char *caddr_t;
-void *dlsym(void *a, char *b);
-#define LOG_PID 0x01
-#define LOG_NOWAIT 0x10
-#define LOG_DEBUG 7
-#define POLL_STRUCT PRPollDesc
-#define POLL_FN PR_Poll
-#define RLIM_TYPE int
-#else /* _WIN32 */
#define LDAP_SYSLOG
#include <syslog.h>
#define RLIM_TYPE int
#include <poll.h>
#define POLL_STRUCT PRPollDesc
#define POLL_FN PR_Poll
-#endif /* _WIN32 */
#include <stdio.h> /* for FILE */
#include <stdlib.h>
@@ -112,17 +98,10 @@ void *dlsym(void *a, char *b);
#define LITTLE_ENDIAN __LITTLE_ENDIAN
#endif
#include <cert.h>
-
-#ifndef _WIN32
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <netinet/in.h>
-#endif /* _WIN32 */
-
-#ifdef _WIN32
-#define LDAP_IOCP
-#endif
/* Required to get portable printf/scanf format macros */
#ifdef HAVE_INTTYPES_H
@@ -180,12 +159,8 @@ typedef struct symbol_t {
# include <thread.h>
# define GET_THREAD_ID() thr_self()
#else
-# if defined(_WIN32)
-# define GET_THREAD_ID() GetCurrentThreadId()
-# else
# include <pthread.h>
# define GET_THREAD_ID() pthread_self()
-# endif
#endif
/*
@@ -1553,12 +1528,8 @@ typedef struct conn {
#define START_TLS_OID "1.3.6.1.4.1.1466.20037"
-
-#ifndef _WIN32
#define SLAPD_POLL_FLAGS (POLLIN)
-#else
-#define SLAPD_POLL_FLAGS (PR_POLL_READ)
-#endif
+
/******************************************************************************
* * Online tasks interface (to support import, export, etc)
@@ -1836,10 +1807,6 @@ typedef struct daemon_ports_s {
int s_port;
PRNetAddr **n_listenaddr;
PRNetAddr **s_listenaddr;
-#if defined( XP_WIN32 )
- int n_socket;
- int s_socket_native;
-#else
PRFileDesc **n_socket;
#if defined(ENABLE_LDAPI)
/* ldapi */
@@ -1847,7 +1814,6 @@ typedef struct daemon_ports_s {
int i_port; /* used as a flag only */
PRFileDesc **i_socket;
#endif
-#endif
PRFileDesc **s_socket;
} daemon_ports_t;
@@ -1949,11 +1915,7 @@ typedef struct _slapdEntryPoints {
caddr_t sep_slapd_ssl_init2;
} slapdEntryPoints;
-#if defined( XP_WIN32 )
-#define DLL_IMPORT_DATA _declspec( dllimport )
-#else
#define DLL_IMPORT_DATA
-#endif
/* Log types */
#define SLAPD_ACCESS_LOG 0x1
@@ -2397,9 +2359,7 @@ typedef struct _slapdFrontendConfig {
size_t maxsasliosize; /* limit incoming SASL IO packet size */
char *anon_limits_dn; /* template entry for anonymous resource limits */
slapi_int_t listen_backlog_size; /* size of backlog parameter to PR_Listen */
-#ifndef _WIN32
struct passwd *localuserinfo; /* userinfo of localuser */
-#endif /* _WIN32 */
#ifdef MEMPOOL_EXPERIMENTAL
slapi_onoff_t mempool_switch; /* switch to turn memory pool on/off */
int mempool_maxfreelist; /* max free list length per memory pool item */
@@ -2525,7 +2485,6 @@ extern char *attr_dataversion;
/* for timing certain operations */
#ifdef USE_TIMERS
-#ifndef _WIN32
#include <sys/time.h>
#ifdef LINUX
#define GTOD(t) gettimeofday(t, NULL)
@@ -2537,15 +2496,6 @@ extern char *attr_dataversion;
#define TIMER_STOP(x) GTOD(&(x##_end))
#define TIMER_GET_US(x) (unsigned)(((x##_end).tv_sec - (x##_start).tv_sec) * 100000L + \
((x##_end).tv_usec - (x##_start).tv_usec))
-#else
-#define TIMER_DECL(x) LARGE_INTEGER x##_freq, x##_start, x##_end
-#define TIMER_START(x) do { \
- QueryPerformanceFrequency(&(x##_freq)); \
- QueryPerformanceCounter(&(x##_start)); \
-} while(0)
-#define TIMER_STOP(x) QueryPerformanceCounter(&(x##_end))
-#define TIMER_GET_US(x) (unsigned int)((x##_end.QuadPart - x##_start.QuadPart) / x##_freq.QuadPart)
-#endif /* _WIN32 */
#define TIMER_AVG_DECL(x) \
TIMER_DECL(x); static unsigned int x##_total, x##_count
diff --git a/ldap/servers/slapd/snmp_collator.c b/ldap/servers/slapd/snmp_collator.c
index 80fbfb1..f40d867 100644
--- a/ldap/servers/slapd/snmp_collator.c
+++ b/ldap/servers/slapd/snmp_collator.c
@@ -44,17 +44,14 @@
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
-#ifndef _WIN32
#include <sys/ipc.h>
#include <sys/msg.h>
#include <dirent.h>
#include <semaphore.h>
-#endif
#include <time.h>
#include <signal.h>
#include <string.h>
#include <errno.h>
-
#include "agtmmap.h"
#include "slap.h"
#include "prthread.h"
@@ -257,7 +254,7 @@ void set_snmp_interaction_row(char *host, int port, int error)
g_get_global_snmp_vars()->int_tbl[index].dsFailuresSinceLastSuccess = 0;
g_get_global_snmp_vars()->int_tbl[index].dsFailures = 0;
g_get_global_snmp_vars()->int_tbl[index].dsSuccesses = 1;
- }else{
+ } else {
g_get_global_snmp_vars()->int_tbl[index].dsTimeOfLastSuccess = 0;
g_get_global_snmp_vars()->int_tbl[index].dsFailuresSinceLastSuccess = 1;
g_get_global_snmp_vars()->int_tbl[index].dsFailures = 1;
@@ -265,9 +262,9 @@ void set_snmp_interaction_row(char *host, int port, int error)
}
strncpy(g_get_global_snmp_vars()->int_tbl[index].dsURL, dsURL,
sizeof(g_get_global_snmp_vars()->int_tbl[index].dsURL));
- }else{
- /* just update the appropriate fields */
- g_get_global_snmp_vars()->int_tbl[index].dsTimeOfLastAttempt = time(0);
+ } else {
+ /* just update the appropriate fields */
+ g_get_global_snmp_vars()->int_tbl[index].dsTimeOfLastAttempt = time(0);
if(error == 0){
g_get_global_snmp_vars()->int_tbl[index].dsTimeOfLastSuccess = time(0);
g_get_global_snmp_vars()->int_tbl[index].dsFailuresSinceLastSuccess = 0;
@@ -292,9 +289,9 @@ void set_snmp_interaction_row(char *host, int port, int error)
*
* this should point to root DSE
************************************************************************************/
-static char *make_ds_url(char *host, int port){
-
- char *url;
+static char *make_ds_url(char *host, int port)
+{
+ char *url;
url = slapi_ch_smprintf("ldap://%s:%d/",host, port);
@@ -311,39 +308,37 @@ static char *make_ds_url(char *host, int port){
static int search_interaction_table(char *dsURL, int *isnew)
{
- int i;
- int index = 0;
- time_t oldestattempt;
- time_t currentattempt;
-
- oldestattempt = g_get_global_snmp_vars()->int_tbl[0].dsTimeOfLastAttempt;
- *isnew = 1;
+ int i;
+ int index = 0;
+ time_t oldestattempt;
+ time_t currentattempt;
- for(i=0; i < NUM_SNMP_INT_TBL_ROWS; i++){
- if(!strcmp(g_get_global_snmp_vars()->int_tbl[i].dsURL, "Not Available"))
- {
- /* found it -- this is new, first time for this row */
- index = i;
- break;
- }else if(!strcmp(g_get_global_snmp_vars()->int_tbl[i].dsURL, dsURL)){
- /* found it -- it was already there*/
- *isnew = 0;
- index = i;
- break;
- }else{
- /* not found so figure out oldest row */
- currentattempt = g_get_global_snmp_vars()->int_tbl[i].dsTimeOfLastAttempt;
-
- if(currentattempt <= oldestattempt){
- index=i;
- oldestattempt = currentattempt;
- }
- }
-
- }
+ oldestattempt = g_get_global_snmp_vars()->int_tbl[0].dsTimeOfLastAttempt;
+ *isnew = 1;
- return index;
+ for(i=0; i < NUM_SNMP_INT_TBL_ROWS; i++){
+ if(!strcmp(g_get_global_snmp_vars()->int_tbl[i].dsURL, "Not Available"))
+ {
+ /* found it -- this is new, first time for this row */
+ index = i;
+ break;
+ } else if(!strcmp(g_get_global_snmp_vars()->int_tbl[i].dsURL, dsURL)){
+ /* found it -- it was already there*/
+ *isnew = 0;
+ index = i;
+ break;
+ } else {
+ /* not found so figure out oldest row */
+ currentattempt = g_get_global_snmp_vars()->int_tbl[i].dsTimeOfLastAttempt;
+ if(currentattempt <= oldestattempt){
+ index=i;
+ oldestattempt = currentattempt;
+ }
+ }
+ }
+
+ return index;
}
#ifdef DEBUG_SNMP_INTERACTION
@@ -367,43 +362,6 @@ static void print_snmp_interaction_table()
}
#endif /* DEBUG_SNMP_INTERACTION */
-/*-------------------------------------------------------------------------
- *
- * sc_setevent: Sets the specified event (NT only). The input event has
- * to be created by the subagent during its initialization.
- *
- * Returns: None
- *
- *-----------------------------------------------------------------------*/
-
-#ifdef _WIN32
-void sc_setevent(char *ev)
-{
- HANDLE hTrapEvent;
- DWORD err = NO_ERROR;
-
- /*
- * Set the event handle to force NT SNMP service to call the subagent
- * DLL to generate a trap. Any error will be ignored as the subagent
- * may not have been loaded.
- */
- if ((hTrapEvent = OpenEvent(EVENT_MODIFY_STATE, FALSE,
- (LPCTSTR) ev)) != NULL)
- {
- if (SetEvent(hTrapEvent) == FALSE)
- err = GetLastError();
- }
- else
- err = GetLastError();
-
- if (err != NO_ERROR)
- {
- fprintf(stderr, "Failed to set trap (error = %d).\n", err);
- }
-}
-#endif
-
-
/***********************************************************************************
*
@@ -494,37 +452,32 @@ int snmp_collator_stop()
slapi_eq_cancel(snmp_eq_ctx);
snmp_collator_stopped = 1;
- /* acquire the semaphore */
- snmp_collator_sem_wait();
+ /* acquire the semaphore */
+ snmp_collator_sem_wait();
- /* close the memory map */
- if ((err = agt_mclose_stats(hdl)) != 0)
- {
- fprintf(stderr, "Failed to close stats file (%s) (error = %d).",
- AGT_STATS_FILE, err);
- }
+ /* close the memory map */
+ if ((err = agt_mclose_stats(hdl)) != 0)
+ {
+ fprintf(stderr, "Failed to close stats file (%s) (error = %d).",
+ AGT_STATS_FILE, err);
+ }
- if (remove(tmpstatsfile) != 0)
- {
- fprintf(stderr, "Failed to remove (%s) (error = %d).\n",
- tmpstatsfile, errno);
- }
+ if (remove(tmpstatsfile) != 0)
+ {
+ fprintf(stderr, "Failed to remove (%s) (error = %d).\n",
+ tmpstatsfile, errno);
+ }
- /* close and delete semaphore */
- sem_close(stats_sem);
- sem_unlink(stats_sem_name);
+ /* close and delete semaphore */
+ sem_close(stats_sem);
+ sem_unlink(stats_sem_name);
- /* delete lock */
- slapi_destroy_mutex(interaction_table_mutex);
+ /* delete lock */
+ slapi_destroy_mutex(interaction_table_mutex);
-#ifdef _WIN32
- /* send the event so server down trap gets set on NT */
- sc_setevent(MAGT_NSEV_SNMPTRAP);
+ /* stevross: I probably need to free stats too... make sure to add that later */
-#endif
- /* stevross: I probably need to free stats too... make sure to add that later */
-
-return 0;
+ return 0;
}
/*
diff --git a/ldap/servers/slapd/ssl.c b/ldap/servers/slapd/ssl.c
index 198edbc..233622a 100644
--- a/ldap/servers/slapd/ssl.c
+++ b/ldap/servers/slapd/ssl.c
@@ -42,18 +42,6 @@
/* SSL-related stuff for slapd */
-#if defined( _WINDOWS )
-#include <windows.h>
-#include <winsock.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include "proto-ntutil.h"
-#include <string.h>
-#include <stdlib.h>
-#include <direct.h>
-#include <io.h>
-#endif
-
#include <stdio.h>
#include <sys/param.h>
#include <ssl.h>
@@ -2087,11 +2075,7 @@ slapd_SSL_client_auth (LDAP* ld)
Slapi_Entry *entry = NULL;
char cert_name[1024];
char *token = NULL;
-#ifndef _WIN32
SVRCOREStdPinObj *StdPinObj;
-#else
- SVRCOREAltPinObj *AltPinObj;
-#endif
SVRCOREError err = SVRCORE_Success;
if((family_list = getChildren(configDN))) {
@@ -2203,57 +2187,54 @@ slapd_SSL_client_auth (LDAP* ld)
/* Free config data */
if (!svrcore_setup()) {
-#ifndef _WIN32
- StdPinObj = (SVRCOREStdPinObj *)SVRCORE_GetRegisteredPinObj();
- err = SVRCORE_StdPinGetPin( &pw, StdPinObj, token );
-#else
- AltPinObj = (SVRCOREAltPinObj *)SVRCORE_GetRegisteredPinObj();
- pw = SVRCORE_GetPin( (SVRCOREPinObj *)AltPinObj, token, PR_FALSE);
-#endif
- if ( err != SVRCORE_Success || pw == NULL) {
- errorCode = PR_GetError();
- slapd_SSL_warn("SSL client authentication cannot be used "
- "(no password). (" SLAPI_COMPONENT_NAME_NSPR " error %d - %s)",
- errorCode, slapd_pr_strerror(errorCode));
- } else {
+ StdPinObj = (SVRCOREStdPinObj *)SVRCORE_GetRegisteredPinObj();
+ err = SVRCORE_StdPinGetPin( &pw, StdPinObj, token );
+ if ( err != SVRCORE_Success || pw == NULL) {
+ errorCode = PR_GetError();
+ slapd_SSL_warn("SSL client authentication cannot be used "
+ "(no password). (" SLAPI_COMPONENT_NAME_NSPR " error %d - %s)",
+ errorCode, slapd_pr_strerror(errorCode));
+ } else {
#if defined(USE_OPENLDAP)
- rc = ldap_set_option(ld, LDAP_OPT_X_TLS_KEYFILE, SERVER_KEY_NAME);
- if (rc) {
- slapd_SSL_warn("SSL client authentication cannot be used "
- "unable to set the key to use to %s", SERVER_KEY_NAME);
- }
- rc = ldap_set_option(ld, LDAP_OPT_X_TLS_CERTFILE, cert_name);
- if (rc) {
- slapd_SSL_warn("SSL client authentication cannot be used "
- "unable to set the cert to use to %s", cert_name);
- }
- /* not sure what else needs to be done for client auth - don't
- currently have a way to pass in the password to use to unlock
- the keydb - nor a way to disable caching */
+ rc = ldap_set_option(ld, LDAP_OPT_X_TLS_KEYFILE, SERVER_KEY_NAME);
+ if (rc) {
+ slapd_SSL_warn("SSL client authentication cannot be used "
+ "unable to set the key to use to %s", SERVER_KEY_NAME);
+ }
+ rc = ldap_set_option(ld, LDAP_OPT_X_TLS_CERTFILE, cert_name);
+ if (rc) {
+ slapd_SSL_warn("SSL client authentication cannot be used "
+ "unable to set the cert to use to %s", cert_name);
+ }
+ /*
+ * not sure what else needs to be done for client auth - don't
+ * currently have a way to pass in the password to use to unlock
+ * the keydb - nor a way to disable caching
+ */
#else /* !USE_OPENLDAP */
- rc = ldapssl_enable_clientauth (ld, SERVER_KEY_NAME, pw, cert_name);
- if (rc != 0) {
- errorCode = PR_GetError();
- slapd_SSL_warn("ldapssl_enable_clientauth(%s, %s) %i ("
- SLAPI_COMPONENT_NAME_NSPR " error %d - %s)",
- SERVER_KEY_NAME, cert_name, rc,
- errorCode, slapd_pr_strerror(errorCode));
- } else {
- /* We cannot allow NSS to cache outgoing client auth connections -
- each client auth connection must have it's own non-shared SSL
- connection to the peer so that it will go through the
- entire handshake protocol every time including the use of its
- own unique client cert - see bug 605457
- */
-
- ldapssl_set_option(ld, SSL_NO_CACHE, PR_TRUE);
- }
+ rc = ldapssl_enable_clientauth (ld, SERVER_KEY_NAME, pw, cert_name);
+ if (rc != 0) {
+ errorCode = PR_GetError();
+ slapd_SSL_warn("ldapssl_enable_clientauth(%s, %s) %i ("
+ SLAPI_COMPONENT_NAME_NSPR " error %d - %s)",
+ SERVER_KEY_NAME, cert_name, rc,
+ errorCode, slapd_pr_strerror(errorCode));
+ } else {
+ /*
+ * We cannot allow NSS to cache outgoing client auth connections -
+ * each client auth connection must have it's own non-shared SSL
+ * connection to the peer so that it will go through the
+ * entire handshake protocol every time including the use of its
+ * own unique client cert - see bug 605457
+ */
+ ldapssl_set_option(ld, SSL_NO_CACHE, PR_TRUE);
+ }
#endif
- }
+ }
}
- if (token) slapi_ch_free((void**)&token);
- slapi_ch_free((void**)&pw);
+ slapi_ch_free_string(&token);
+ slapi_ch_free_string(&pw);
LDAPDebug (LDAP_DEBUG_TRACE, "slapd_SSL_client_auth() %i\n", rc, 0, 0);
return rc;
@@ -2289,10 +2270,6 @@ char* slapd_get_tmp_dir()
{
static char tmp[MAXPATHLEN];
char* tmpdir = NULL;;
-#if defined( XP_WIN32 )
- unsigned ilen;
- char pch;
-#endif
tmp[0] = '\0';
@@ -2303,43 +2280,10 @@ char* slapd_get_tmp_dir()
"slapd_get_tmp_dir",
"config_get_tmpdir returns NULL Setting tmp dir to default\n");
-#if defined( XP_WIN32 )
- ilen = sizeof(tmp);
- GetTempPath( ilen, tmp );
- tmp[ilen-1] = (char)0;
- ilen = strlen(tmp);
- /* Remove trailing slash. */
- pch = tmp[ilen-1];
- if( pch == '\\' || pch == '/' )
- tmp[ilen-1] = '\0';
-#else
strcpy(tmp, "/tmp");
-#endif
return slapi_ch_strdup(tmp);
}
-#if defined( XP_WIN32 )
- {
- char *ptr = NULL;
- char *endptr = tmpdir + strlen(tmpdir);
- for(ptr = tmpdir; ptr < endptr; ptr++)
- {
- if('/' == *ptr)
- *ptr = '\\';
- }
- }
-#endif
-
-#if defined( XP_WIN32 )
- if(CreateDirectory(tmpdir, NULL) == 0)
- {
- slapi_log_error(
- SLAPI_LOG_FATAL,
- "slapd_get_tmp_dir",
- "CreateDirectory(%s, NULL) Error: %s\n",
- tmpdir, strerror(errno));
- }
-#else
if(mkdir(tmpdir, 00770) == -1)
{
if (errno == EEXIST) {
@@ -2356,7 +2300,7 @@ char* slapd_get_tmp_dir()
tmpdir, strerror(errno));
}
}
-#endif
+
return ( tmpdir );
}
diff --git a/ldap/servers/slapd/start_tls_extop.c b/ldap/servers/slapd/start_tls_extop.c
index 1efa657..ee86329 100644
--- a/ldap/servers/slapd/start_tls_extop.c
+++ b/ldap/servers/slapd/start_tls_extop.c
@@ -54,8 +54,6 @@
#include <stdio.h>
#include <string.h>
#include <private/pprio.h>
-
-
#include <prio.h>
#include <ssl.h>
#include "slap.h"
@@ -63,8 +61,6 @@
#include "fe.h"
-
-
/* OID of the extended operation handled by this plug-in */
/* #define START_TLS_OID "1.3.6.1.4.1.1466.20037" */
@@ -160,10 +156,6 @@ start_tls( Slapi_PBlock *pb )
char *oid;
Connection *conn;
-#ifdef _WIN32
- PRFileDesc *oldsocket;
- int oldnativesocket;
-#endif
int ldaprc = LDAP_SUCCESS;
char *ldapmsg = NULL;
@@ -211,7 +203,6 @@ start_tls( Slapi_PBlock *pb )
conn = pb->pb_conn;
PR_Lock( conn->c_mutex );
/* cannot call slapi_send_ldap_result with mutex locked - will deadlock if ber_flush returns error */
-#ifndef _WIN32
if ( conn->c_prfd == (PRFileDesc *) NULL ) {
slapi_log_error( SLAPI_LOG_PLUGIN, "start_tls",
"Connection socket not available.\n" );
@@ -219,20 +210,8 @@ start_tls( Slapi_PBlock *pb )
ldapmsg = "Connection socket not available.";
goto unlock_and_return;
}
-#else
- oldnativesocket = conn->c_sd;
- oldsocket = PR_ImportTCPSocket(oldnativesocket);
- if ( oldsocket == (PRFileDesc *) NULL ) {
- slapi_log_error( SLAPI_LOG_PLUGIN, "start_tls",
- "Failed to import NT native socket into NSPR.\n" );
- ldaprc = LDAP_UNAVAILABLE;
- ldapmsg = "Failed to import NT native socket into NSPR.";
- goto unlock_and_return;
- }
-#endif
/* Check whether the Start TLS request can be accepted. */
-
if ( connection_operations_pending( conn, pb->pb_op,
1 /* check for ops where result not yet sent */ )) {
slapi_log_error( SLAPI_LOG_PLUGIN, "start_tls",
@@ -270,7 +249,6 @@ start_tls( Slapi_PBlock *pb )
goto unlock_and_return;
}
-
if ( conn->c_flags & CONN_FLAG_CLOSING ) {
slapi_log_error( SLAPI_LOG_PLUGIN, "start_tls",
"Connection being closed at this moment.\n" );
@@ -279,8 +257,6 @@ start_tls( Slapi_PBlock *pb )
goto unlock_and_return;
}
-
-
/* At first sight, there doesn't seem to be any major impediment to start TLS.
* So, we may as well try initialising SSL. */
@@ -292,14 +268,13 @@ start_tls( Slapi_PBlock *pb )
goto unlock_and_return;
}
-
- /* Enable TLS I/O on the connection */
- connection_set_io_layer_cb(conn, start_tls_io_enable, NULL, NULL);
+ /* Enable TLS I/O on the connection */
+ connection_set_io_layer_cb(conn, start_tls_io_enable, NULL, NULL);
/* Since no specific argument for denying the Start TLS request has been found,
* we send a success response back to the client. */
- ldapmsg = "Start TLS request accepted.Server willing to negotiate SSL.";
- unlock_and_return:
+ ldapmsg = "Start TLS request accepted.Server willing to negotiate SSL.";
+unlock_and_return:
PR_Unlock( conn->c_mutex );
slapi_send_ldap_result( pb, ldaprc, NULL, ldapmsg, 0, NULL );
@@ -345,7 +320,6 @@ start_tls_graceful_closure( Connection *c, Slapi_PBlock * pb, int is_initiator )
/* First thing to do is to finish with whatever operation may be hanging on the
* encrypted session.
*/
-
while ( connection_operations_pending( c, pblock->pb_op,
0 /* wait for all other ops to full complete */ )) {
slapi_log_error( SLAPI_LOG_PLUGIN, "start_tls",
@@ -361,14 +335,12 @@ start_tls_graceful_closure( Connection *c, Slapi_PBlock * pb, int is_initiator )
slapi_send_ldap_result( pblock, LDAP_OPERATIONS_ERROR, NULL,
"SSL_CLOSE_NOTIFY_ALERT", 0, NULL );
-
if ( is_initiator ) {
/* if this call belongs to the initiator of the SSL connection closure, it must first
* wait for the peer to send another close_notify alert back.
*/
}
-
PR_Lock( c->c_mutex );
/* "Unimport" the socket from SSL, i.e. get rid of the upper layer of the
@@ -388,18 +360,8 @@ start_tls_graceful_closure( Connection *c, Slapi_PBlock * pb, int is_initiator )
ssl_fd = PR_PopIOLayer( c->c_prfd, PR_TOP_IO_LAYER );
ssl_fd->dtor( ssl_fd );
-
-#ifndef _WIN32
secure = 0;
ns = configure_pr_socket( &(c->c_prfd), secure, 0 /*never local*/ );
-
-#else
- ns = PR_FileDesc2NativeHandle( c->c_prfd );
- c->c_prfd = NULL;
-
- configure_ns_socket( &ns );
-#endif
-
c->c_sd = ns;
c->c_flags &= ~CONN_FLAG_SSL;
c->c_flags &= ~CONN_FLAG_START_TLS;
@@ -411,8 +373,6 @@ start_tls_graceful_closure( Connection *c, Slapi_PBlock * pb, int is_initiator )
PR_Unlock( c->c_mutex );
-
-
return ( SLAPI_PLUGIN_EXTENDED_SENT_RESULT );
}
diff --git a/ldap/servers/slapd/str2filter.c b/ldap/servers/slapd/str2filter.c
index d5bcc1a..9e2823d 100644
--- a/ldap/servers/slapd/str2filter.c
+++ b/ldap/servers/slapd/str2filter.c
@@ -45,9 +45,7 @@
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
-#ifndef _WIN32
#include <sys/socket.h>
-#endif
#include "slap.h"
static struct slapi_filter *str2list();
diff --git a/ldap/servers/slapd/stubs.c b/ldap/servers/slapd/stubs.c
index cc613fb..0bbc6e6 100644
--- a/ldap/servers/slapd/stubs.c
+++ b/ldap/servers/slapd/stubs.c
@@ -40,20 +40,11 @@
# include <config.h>
#endif
-
-/* Needed because not all functions are currently defined for server3_branch */
-
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include "slap.h"
-#if defined( XP_WIN32 ) /* PK*/
-void *dlsym(void *a, char *b)
-{
- return 0;
-}
-#endif
int type_to_ACCESS_bit( char *p )
{
diff --git a/ldap/servers/slapd/task.c b/ldap/servers/slapd/task.c
index 19a52a3..681e571 100644
--- a/ldap/servers/slapd/task.c
+++ b/ldap/servers/slapd/task.c
@@ -1088,13 +1088,8 @@ static void task_export_thread(void *arg)
} else {
if (strcmp(ldif_file, "-")) { /* not '-' */
char *p;
-#if defined( _WIN32 )
- char sep = '\\';
- if (NULL != strchr(ldif_file, '/'))
- sep = '/';
-#else
char sep = '/';
-#endif
+
this_ldif_file = (char *)slapi_ch_malloc(strlen(ldif_file) +
strlen(*inp) + 2);
p = strrchr(ldif_file, sep);
diff --git a/ldap/servers/slapd/test-plugins/dllmain.c b/ldap/servers/slapd/test-plugins/dllmain.c
index a302e14..d42d227 100644
--- a/ldap/servers/slapd/test-plugins/dllmain.c
+++ b/ldap/servers/slapd/test-plugins/dllmain.c
@@ -45,97 +45,17 @@
*/
#include "ldap.h"
#include "lber.h"
+#include <stdio.h>
-#ifdef _WIN32
-/* Lifted from Q125688
- * How to Port a 16-bit DLL to a Win32 DLL
- * on the MSVC 4.0 CD
- */
-BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
-{
- WSADATA wsadata;
-
- switch (fdwReason)
- {
- case DLL_PROCESS_ATTACH:
- /* Code from LibMain inserted here. Return TRUE to keep the
- DLL loaded or return FALSE to fail loading the DLL.
-
- You may have to modify the code in your original LibMain to
- account for the fact that it may be called more than once.
- You will get one DLL_PROCESS_ATTACH for each process that
- loads the DLL. This is different from LibMain which gets
- called only once when the DLL is loaded. The only time this
- is critical is when you are using shared data sections.
- If you are using shared data sections for statically
- allocated data, you will need to be careful to initialize it
- only once. Check your code carefully.
-
- Certain one-time initializations may now need to be done for
- each process that attaches. You may also not need code from
- your original LibMain because the operating system may now
- be doing it for you.
- */
- /*
- * 16 bit code calls UnlockData()
- * which is mapped to UnlockSegment in windows.h
- * in 32 bit world UnlockData is not defined anywhere
- * UnlockSegment is mapped to GlobalUnfix in winbase.h
- * and the docs for both UnlockSegment and GlobalUnfix say
- * ".. function is oboslete. Segments have no meaning
- * in the 32-bit environment". So we do nothing here.
- */
-
- if( errno = WSAStartup(0x0101, &wsadata ) != 0 )
- return FALSE;
-
- break;
-
- case DLL_THREAD_ATTACH:
- /* Called each time a thread is created in a process that has
- already loaded (attached to) this DLL. Does not get called
- for each thread that exists in the process before it loaded
- the DLL.
-
- Do thread-specific initialization here.
- */
- break;
-
- case DLL_THREAD_DETACH:
- /* Same as above, but called when a thread in the process
- exits.
-
- Do thread-specific cleanup here.
- */
- break;
-
- case DLL_PROCESS_DETACH:
- /* Code from _WEP inserted here. This code may (like the
- LibMain) not be necessary. Check to make certain that the
- operating system is not doing it for you.
- */
- WSACleanup();
- break;
- }
- /* The return value is only used for DLL_PROCESS_ATTACH; all other
- conditions are ignored.
- */
- return TRUE; // successful DLL_PROCESS_ATTACH
-}
-#else
int CALLBACK
LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
{
/*UnlockData( 0 );*/
return( 1 );
}
-#endif
-#ifndef _WIN32
/* The 16-bit version of the RTL does not implement perror() */
-#include <stdio.h>
-
void perror( const char *msg )
{
char buf[128];
@@ -143,4 +63,4 @@ void perror( const char *msg )
OutputDebugString( buf );
}
-#endif
+
diff --git a/ldap/servers/slapd/test-plugins/testbind.c b/ldap/servers/slapd/test-plugins/testbind.c
index 9e44a31..b363761 100644
--- a/ldap/servers/slapd/test-plugins/testbind.c
+++ b/ldap/servers/slapd/test-plugins/testbind.c
@@ -254,9 +254,6 @@ test_search( Slapi_PBlock *pb )
}
/* Initialization function */
-#ifdef _WIN32
-__declspec(dllexport)
-#endif
int
testbind_init( Slapi_PBlock *pb )
{
diff --git a/ldap/servers/slapd/test-plugins/testdatainterop.c b/ldap/servers/slapd/test-plugins/testdatainterop.c
index 504f785..95cdf84 100644
--- a/ldap/servers/slapd/test-plugins/testdatainterop.c
+++ b/ldap/servers/slapd/test-plugins/testdatainterop.c
@@ -139,9 +139,6 @@ static int nullsuffix_bind( Slapi_PBlock *pb );
/*
* Initialization function.
*/
-#ifdef _WIN32
-__declspec(dllexport)
-#endif
int
nullsuffix_init( Slapi_PBlock *pb )
{
diff --git a/ldap/servers/slapd/test-plugins/testentry.c b/ldap/servers/slapd/test-plugins/testentry.c
index 6d4a62b..30563aa 100644
--- a/ldap/servers/slapd/test-plugins/testentry.c
+++ b/ldap/servers/slapd/test-plugins/testentry.c
@@ -99,9 +99,6 @@ Slapi_PluginDesc entrypdesc = { "test-entry", VENDOR, DS_PACKAGE_VERSION,
"sample entry modification plugin" };
/* Entry store plug-in function */
-#ifdef _WIN32
-__declspec(dllexport)
-#endif
int
testentry_scramble( char **entry, unsigned long *len )
{
@@ -122,9 +119,6 @@ testentry_scramble( char **entry, unsigned long *len )
}
/* Entry fetch plug-in function */
-#ifdef _WIN32
-__declspec(dllexport)
-#endif
int
testentry_unscramble( char **entry, unsigned long *len )
{
diff --git a/ldap/servers/slapd/test-plugins/testextendedop.c b/ldap/servers/slapd/test-plugins/testextendedop.c
index 2655d55..ddd7a7f 100644
--- a/ldap/servers/slapd/test-plugins/testextendedop.c
+++ b/ldap/servers/slapd/test-plugins/testextendedop.c
@@ -160,9 +160,6 @@ testexop_babs( Slapi_PBlock *pb )
}
/* Initialization function */
-#ifdef _WIN32
-__declspec(dllexport)
-#endif
int
testexop_init( Slapi_PBlock *pb )
{
diff --git a/ldap/servers/slapd/test-plugins/testgetip.c b/ldap/servers/slapd/test-plugins/testgetip.c
index 7e6f530..1a4625a 100644
--- a/ldap/servers/slapd/test-plugins/testgetip.c
+++ b/ldap/servers/slapd/test-plugins/testgetip.c
@@ -71,11 +71,9 @@
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
-#ifndef _WIN32
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
-#endif
#include "slapi-plugin.h"
#include "nspr.h"
@@ -128,9 +126,6 @@ testgetip( Slapi_PBlock *pb )
return( 0 );
}
-#ifdef _WIN32
-__declspec(dllexport)
-#endif
int
testgetip_init( Slapi_PBlock *pb )
{
diff --git a/ldap/servers/slapd/test-plugins/testpostop.c b/ldap/servers/slapd/test-plugins/testpostop.c
index d91ddd4..cd026e2 100644
--- a/ldap/servers/slapd/test-plugins/testpostop.c
+++ b/ldap/servers/slapd/test-plugins/testpostop.c
@@ -91,11 +91,7 @@
#define _DEL 2
#define _MODRDN 3
-#ifdef _WIN32
-static char changelogfile[MAX_PATH+1];
-#else
static char *changelogfile = "/tmp/changelog";
-#endif
Slapi_PluginDesc postoppdesc = { "test-postop", VENDOR, DS_PACKAGE_VERSION,
"sample post-operation plugin" };
@@ -234,9 +230,6 @@ testpostop_abandon( Slapi_PBlock *pb )
}
/* Initialization function */
-#ifdef _WIN32
-__declspec(dllexport)
-#endif
int
testpostop_init( Slapi_PBlock *pb )
{
@@ -271,11 +264,7 @@ format_localTime( time_t timeval )
{
char* into;
struct tm t;
-#ifdef _WIN32
- memcpy (&t, localtime (&timeval), sizeof(t));
-#else
localtime_r (&timeval, &t);
-#endif
/* Allocate memory for the formatted string. (slapi_ch_malloc()
should be used in server plug-ins instead of malloc().)
@@ -319,17 +308,8 @@ write_changelog(
FILE *fp;
int len, i, j;
char* timestr;
-#ifdef _WIN32
- char szTmpPath[MAX_PATH+1];
-#endif
/* Open the change log file */
-#ifdef _WIN32
- GetTempPath( MAX_PATH, szTmpPath );
- strcpy( changelogfile, szTmpPath );
- strcat( changelogfile, "\\" );
- strcat( changelogfile, "changelog.txt" );
-#endif
if ( changelogfile == NULL ) {
return;
}
diff --git a/ldap/servers/slapd/test-plugins/testpreop.c b/ldap/servers/slapd/test-plugins/testpreop.c
index 9b3be6c..ebef94b 100644
--- a/ldap/servers/slapd/test-plugins/testpreop.c
+++ b/ldap/servers/slapd/test-plugins/testpreop.c
@@ -244,9 +244,6 @@ testpreop_start( Slapi_PBlock *pb )
}
/* Initialization function */
-#ifdef _WIN32
-__declspec(dllexport)
-#endif
int
testpreop_init( Slapi_PBlock *pb )
{
diff --git a/ldap/servers/slapd/test-plugins/testsaslbind.c b/ldap/servers/slapd/test-plugins/testsaslbind.c
index 0dc20e3..bb0ccba 100644
--- a/ldap/servers/slapd/test-plugins/testsaslbind.c
+++ b/ldap/servers/slapd/test-plugins/testsaslbind.c
@@ -159,9 +159,6 @@ testsasl_bind( Slapi_PBlock *pb )
}
/* Initialization function */
-#ifdef _WIN32
-__declspec(dllexport)
-#endif
int
testsasl_init( Slapi_PBlock *pb )
{
diff --git a/ldap/servers/slapd/time.c b/ldap/servers/slapd/time.c
index 95ef5fc..33a9e32 100644
--- a/ldap/servers/slapd/time.c
+++ b/ldap/servers/slapd/time.c
@@ -44,13 +44,11 @@
#include <stdio.h>
#include <sys/types.h>
-#ifndef _WIN32
#ifdef AIX
#include <time.h>
#else
#include <sys/time.h>
#endif
-#endif /* _WIN32 */
#include "slap.h"
#include "fe.h"
@@ -128,13 +126,9 @@ get_timestring(time_t *t)
{
char *timebuf;
-#if defined( _WIN32 )
- timebuf = ctime( t );
-#else
if ( (timebuf = slapi_ch_malloc(32)) == NULL )
- return("No memory for get_timestring");
+ return("No memory for get_timestring");
CTIME(t, timebuf, 32);
-#endif
timebuf[strlen(timebuf) - 1] = '\0'; /* strip out return */
return(timebuf);
}
@@ -142,12 +136,8 @@ get_timestring(time_t *t)
void
free_timestring(char *timestr)
{
-#if defined( _WIN32 )
- return;
-#else
if ( timestr != NULL )
slapi_ch_free((void**)×tr);
-#endif
}
/*
@@ -195,14 +185,7 @@ time_plus_sec (time_t l, long r)
perhaps it would be better to implement it that way. */
struct tm t;
if (r == 0) return l; /* performance optimization */
-#ifdef _WIN32
- {
- struct tm *pt = localtime( &l );
- memcpy(&t, pt, sizeof(struct tm) );
- }
-#else
localtime_r (&l, &t);
-#endif
/* Conceptually, we want to do: t.tm_sec += r;
but to avoid overflowing fields: */
r += t.tm_sec; t.tm_sec = r % 60; r /= 60;
@@ -223,17 +206,12 @@ format_localTime (time_t from)
{
char* into;
struct tm t;
-#ifdef _WIN32
- {
- struct tm *pt = localtime( &from );
- memcpy(&t, pt, sizeof(struct tm) );
- }
-#else
+
localtime_r (&from, &t);
-#endif
+
into = slapi_ch_smprintf("%.4li%.2i%.2i%.2i%.2i%.2i",
1900L + t.tm_year, t.tm_mon + 1, t.tm_mday, t.tm_hour, t.tm_min, t.
-tm_sec);
+ tm_sec);
return into;
}
@@ -297,14 +275,8 @@ format_genTime (time_t from)
{
char* into;
struct tm t;
-#ifdef _WIN32
- {
- struct tm *pt = gmtime( &from );
- memcpy(&t, pt, sizeof(struct tm) );
- }
-#else
+
gmtime_r (&from, &t);
-#endif
into = slapi_ch_malloc (20);
strftime(into, 20, "%Y%m%d%H%M%SZ", &t);
return into;
diff --git a/ldap/servers/slapd/tools/dbscan.c b/ldap/servers/slapd/tools/dbscan.c
index b3d9f14..3fe5844 100644
--- a/ldap/servers/slapd/tools/dbscan.c
+++ b/ldap/servers/slapd/tools/dbscan.c
@@ -56,17 +56,9 @@
#include <errno.h>
#include "db.h"
#include "nspr.h"
-
-#ifdef _WIN32
-#include <windows.h>
-#include <winsock.h>
-extern int getopt();
-extern char *optarg;
-typedef unsigned char uint8_t;
-#else
#include <netinet/in.h>
#include <inttypes.h>
-#endif
+
#if ( defined( hpux ) )
#ifdef _XOPEN_SOURCE_EXTENDED
diff --git a/ldap/servers/slapd/tools/ldaptool-sasl.c b/ldap/servers/slapd/tools/ldaptool-sasl.c
index 3658bda..444a23a 100755
--- a/ldap/servers/slapd/tools/ldaptool-sasl.c
+++ b/ldap/servers/slapd/tools/ldaptool-sasl.c
@@ -61,22 +61,6 @@ typedef struct {
static int get_default(ldaptoolSASLdefaults *defaults, sasl_interact_t *interact, unsigned flags);
static int get_new_value(sasl_interact_t *interact, unsigned flags);
-/* WIN32 does not have getlogin() so roll our own */
-#if defined( _WINDOWS ) || defined( _WIN32 )
-#include "LMCons.h"
-static char *getlogin()
-{
- LPTSTR lpszSystemInfo; /* pointer to system information string */
- DWORD cchBuff = UNLEN; /* size of user name */
- static TCHAR tchBuffer[UNLEN + 1]; /* buffer for expanded string */
-
- lpszSystemInfo = tchBuffer;
- GetUserName(lpszSystemInfo, &cchBuff);
-
- return lpszSystemInfo;
-}
-#endif /* _WINDOWS || _WIN32 */
-
/*
Note that it is important to use "" (the empty string, length 0) as the default
username value for non-interactive cases. This allows the sasl library to find the best
@@ -298,22 +282,6 @@ ldaptool_getpass ( const char *prompt )
{
char *pass;
-#if defined(_WIN32)
- char pbuf[257];
- fputs(prompt,stdout);
- fflush(stdout);
- if (fgets(pbuf,256,stdin) == NULL) {
- pass = NULL;
- } else {
- char *tmp;
-
- tmp = strchr(pbuf,'\n');
- if (tmp) *tmp = '\0';
- tmp = strchr(pbuf,'\r');
- if (tmp) *tmp = '\0';
- pass = strdup(pbuf);
- }
-#else
#if defined(SOLARIS)
/* 256 characters on Solaris */
pass = (char *)getpassphrase(prompt);
@@ -365,7 +333,6 @@ ldaptool_getpass ( const char *prompt )
pass = (char *)getpass(prompt);
#endif
#endif
-#endif
return pass;
}
diff --git a/ldap/servers/slapd/tools/ldclt/data.c b/ldap/servers/slapd/tools/ldclt/data.c
index 590f29a..2a7a651 100644
--- a/ldap/servers/slapd/tools/ldclt/data.c
+++ b/ldap/servers/slapd/tools/ldclt/data.c
@@ -85,21 +85,14 @@ dd/mm/yy | Author | Comments
#include <fcntl.h> /* open(), etc... */
#include <lber.h> /* ldap C-API BER declarations */
#include <ldap.h> /* ldap C-API declarations */
-#ifndef _WIN32 /*JLS 28-11-00*/
#include <unistd.h> /* close(), etc... */
#include <dirent.h> /* opendir(), etc... */
#include <pthread.h> /* pthreads(), etc... */
#include <sys/mman.h> /* mmap(), etc... */
-#endif /*JLS 28-11-00*/
-
#include "port.h" /* Portability definitions */ /*JLS 28-11-00*/
#include "ldclt.h" /* This tool's include file */
-
-
-
-
/* ****************************************************************************
FUNCTION : getExtend
PURPOSE : Get the extension of the given string, i.e. the part
@@ -118,8 +111,6 @@ char *getExtend (
}
-
-
/* ****************************************************************************
FUNCTION : loadImages
PURPOSE : Load the images from the given directory.
@@ -131,15 +122,8 @@ char *getExtend (
int loadImages (
char *dirpath)
{
-#ifdef _WIN32
- WIN32_FIND_DATA fileData; /* Current file */
- HANDLE dirContext; /* Directory context */
- char *findPath = NULL; /* To build the find path */
- char *pt; /* To read the images */
-#else /* _WIN32 */
DIR *dirp = NULL; /* Directory data */
struct dirent *direntp; /* Directory entry */
-#endif /* _WIN32 */
char *fileName; /* As read from the system */
char name [1024]; /* To build the full path */
struct stat stat_buf; /* To read the image size */
@@ -166,20 +150,6 @@ int loadImages (
/*
* Open the directory
*/
-#ifdef _WIN32
- findPath = (char *) malloc (strlen (dirpath) + 5);
- strcpy (findPath, dirpath);
- strcat (findPath, "/*.*");
- dirContext = FindFirstFile (findPath, &fileData);
- if (dirContext == INVALID_HANDLE_VALUE)
- {
- fprintf (stderr, "ldlct: cannot load images from %s\n", dirpath);
- fprintf (stderr, "ldclt: try using -e imagesdir=path\n"); /*JLS 06-03-01*/
- fflush (stderr);
- rc = -1;
- goto exit;
- }
-#else /* _WIN32 */
dirp = opendir (dirpath);
if (dirp == NULL)
{
@@ -190,21 +160,14 @@ int loadImages (
rc = -1;
goto exit;
}
-#endif /* _WIN32 */
/*
* Process the directory.
* We will only accept the .jpg files, as stated by the RFC.
*/
-#ifdef _WIN32
- fileName = fileData.cFileName;
- do
- {
-#else
while ((direntp = readdir (dirp)) != NULL)
{
fileName = direntp->d_name;
-#endif
if (!strcmp (getExtend (fileName), "jpg"))
{
/*
@@ -260,28 +223,6 @@ int loadImages (
}
mctx.images[mctx.imagesNb-1].length = stat_buf.st_size;
-#ifdef _WIN32
- /*
- * Allocate buffer and read the data :-(
- */
- mctx.images[mctx.imagesNb-1].data = (char *) malloc (stat_buf.st_size);
- if (mctx.images[mctx.imagesNb-1].data == NULL)
- {
- fprintf (stderr, "Cannot malloc(%d) to load %s\n",
- stat_buf.st_size, name);
- fflush (stderr);
- rc = -1;
- goto exit;
- }
- if (read (fd, mctx.images[mctx.imagesNb-1].data, stat_buf.st_size) < 0)
- {
- perror (name);
- fprintf (stderr, "Cannot read(%s)\n", name);
- fflush (stderr);
- rc = -1;
- goto exit;
- }
-#else /* _WIN32 */
/*
* mmap() the image
*/
@@ -295,7 +236,6 @@ int loadImages (
rc = -1;
goto exit;
}
-#endif /* _WIN32 */
/*
* Close the image. The mmap() will remain available, and this
@@ -312,16 +252,11 @@ int loadImages (
fd = -1;
}
}
-#ifdef _WIN32
- } while (FindNextFile(dirContext, &fileData) == TRUE);
-#else
} /* while ((direntp = readdir (dirp)) != NULL) */
-#endif
exit:
/*
* Close the directory
*/
-#ifndef _WIN32
if (dirp && closedir (dirp) < 0)
{
perror (dirpath);
@@ -329,14 +264,11 @@ exit:
fflush (stderr);
rc = -1;
}
-#endif
+
/*
* Normal end
*/
-#ifdef _WIN32
- if (findPath) free (findPath);
-#endif
if(fd != -1)
close(fd);
@@ -344,10 +276,6 @@ exit:
}
-
-
-
-
/* ****************************************************************************
FUNCTION : getImage
PURPOSE : Add a random image to the given attribute.
@@ -420,12 +348,6 @@ int getImage (
}
-
-
-
-
-
- /* New */ /*JLS 23-03-01*/
/* ****************************************************************************
FUNCTION : loadDataListFile
PURPOSE : Load the data list file given in argument.
@@ -492,12 +414,6 @@ loadDataListFile (
}
-
-
-
-
-
- /* New */ /*JLS 23-03-01*/
/* ****************************************************************************
FUNCTION : dataListFile
PURPOSE : Find the given data_list_file either in the list of
@@ -536,12 +452,3 @@ dataListFile (
*/
return (dlf);
}
-
-
-
-
-
-
-
-
-/* End of file */
diff --git a/ldap/servers/slapd/tools/ldclt/ldapfct.c b/ldap/servers/slapd/tools/ldclt/ldapfct.c
index 7308951..69a8d62 100644
--- a/ldap/servers/slapd/tools/ldclt/ldapfct.c
+++ b/ldap/servers/slapd/tools/ldclt/ldapfct.c
@@ -245,11 +245,8 @@ dd/mm/yy | Author | Comments
#ifdef LDAP_H_FROM_QA_WKA
#include <proto-ldap.h> /* ldap C-API prototypes */
#endif
-#ifndef _WIN32 /*JLS 29-11-00*/
#include <unistd.h> /* close(), etc... */
#include <pthread.h> /* pthreads(), etc... */
-#endif /*JLS 29-11-00*/
-
#include "port.h" /* Portability definitions */ /*JLS 29-11-00*/
#include "ldclt.h" /* This tool's include file */
#include "utils.h" /* Utilities functions */ /*JLS 14-11-00*/
@@ -298,12 +295,6 @@ my_ldap_err2string (
}
-
-
-
-
-
- /* New function */ /*JLS 14-12-00*/
/* ****************************************************************************
FUNCTION : dnFromMessage
PURPOSE : Extract the matcheddnp value from an LDAP (error)
@@ -402,15 +393,6 @@ getBindAndPasswdFromFile (
}
-
-
-
-
-
-
-
-
- /* New function */ /*JLS 05-01-01*/
/* ****************************************************************************
FUNCTION : buildNewBindDN
PURPOSE : Purpose of the fct
@@ -470,11 +452,6 @@ buildNewBindDN (
}
-
-
-
-
-
#if defined(USE_OPENLDAP)
int
refRebindProc(
@@ -538,12 +515,6 @@ refRebindProc (
#endif /* !USE_OPENLDAP */
-
-
-
-
-
- /* New function */ /*JLS 08-03-01*/
/* ****************************************************************************
FUNCTION : referralSetup
PURPOSE : Initiates referral features. This function is called
@@ -584,13 +555,7 @@ referralSetup (
* the same thing !!!!
*/
if (mctx.referral == REFERRAL_REBIND)
-#ifdef _WIN32 /*JLS 14-03-01*/
- ldap_set_rebind_proc (tttctx->ldapCtx, /*JLS 14-03-01*/
- (LDAP_REBINDPROC_CALLBACK *)refRebindProc, /*JLS 14-03-01*/
- (void *)tttctx); /*JLS 14-03-01*/
-#else /*JLS 14-03-01*/
ldap_set_rebind_proc (tttctx->ldapCtx, refRebindProc, (void *)tttctx);
-#endif /*JLS 14-03-01*/
/*
* Normal end
@@ -599,11 +564,6 @@ referralSetup (
}
-
-
-
-
-
#if defined(USE_OPENLDAP)
/* ****************************************************************************
FUNCTION : dirname
@@ -1226,13 +1186,6 @@ connectToServer (
}
-
-
-
-
-
-
-
/* ****************************************************************************
FUNCTION : buildVersatileAttribute
PURPOSE : Build a new attribute value using the definitions of
@@ -1401,14 +1354,6 @@ buildVersatileAttribute (
}
-
-
-
-
-
-
-
-
/* ****************************************************************************
FUNCTION : buildRandomRdnOrFilter
PURPOSE : This function will build a random string (rdn or filter)
@@ -1423,7 +1368,6 @@ int
buildRandomRdnOrFilter (
thread_context *tttctx)
{
-
/*
* Maybe we will operate with a variable base DN ?
*/
@@ -1534,13 +1478,6 @@ buildRandomRdnOrFilter (
}
-
-
-
-
-
-
-
/* ****************************************************************************
FUNCTION : addAttrib
PURPOSE : Add a new attribute to the given LDAPMod array
@@ -1571,9 +1508,6 @@ addAttrib (
}
-
-
-
/* ****************************************************************************
FUNCTION : freeAttrib
PURPOSE : Free an array of addAttrib.
@@ -1606,12 +1540,6 @@ freeAttrib (
}
-
-
-
-
-
-
/* ****************************************************************************
FUNCTION : strList1
PURPOSE : Create a list (array) of two strings
@@ -1638,16 +1566,6 @@ strList1 (
}
-
-
-
-
-
-
-
-
-
- /* New function */ /*JLS 03-08-00*/
/* ****************************************************************************
FUNCTION : printErrorFromLdap
PURPOSE : Print the error message returned by ldap.
@@ -1716,13 +1634,6 @@ printErrorFromLdap (
}
-
-
-
-
-
-
-
/* ****************************************************************************
FUNCTION : buildNewModAttribFile
PURPOSE : Build a new (random or incremental) target DN and the
@@ -1796,8 +1707,6 @@ done:
}
-
-/* New function */ /*JLS 21-11-00*/
/* ****************************************************************************
FUNCTION : buildNewModAttrib
PURPOSE : Build a new (random or incremental) target DN and the
@@ -1847,18 +1756,6 @@ buildNewModAttrib (
}
-
-
-
-
-
-
-
-
-
-
-
- /* New */ /*JLS 19-03-01*/
/* ****************************************************************************
FUNCTION : buildVersatileObject
PURPOSE : Build a new entry using the definitions in the object
@@ -1922,16 +1819,6 @@ buildVersatileObject (
}
-
-
-
-
-
-
-
-
-
-
/* ****************************************************************************
FUNCTION : buildNewEntry
PURPOSE : Build a new (random or incremental) entry, to be used
@@ -2082,18 +1969,6 @@ buildNewEntry (
}
-
-
-
-
-
-
-
-
-
-
-
-
/* ****************************************************************************
FUNCTION : createMissingNodes
PURPOSE : Create the missing intermediate nodes.
@@ -2322,14 +2197,6 @@ createMissingNodes (
}
-
-
-
-
-
-
-
-
/* ****************************************************************************
FUNCTION : getPending
PURPOSE : Get the pending results, and perform some basic controls
@@ -2590,19 +2457,6 @@ getPending (
}
-
-
-
-
-
-
-
-
-
-
-
-
-
/* ****************************************************************************
FUNCTION : doRename
PURPOSE : Perform an ldap_rename() operation.
@@ -2881,12 +2735,6 @@ doRename (
}
-
-
-
-
-
- /* New */ /*JLS 02-04-01*/
/* ****************************************************************************
FUNCTION : ldclt_write_genldif
PURPOSE : Implements buffered write to speed up -e genldif
@@ -2943,14 +2791,6 @@ ldclt_write_genldif (
}
-
-
-
-
-
-
-
- /* New */ /*JLS 19-03-01*/
/* ****************************************************************************
FUNCTION : doGenldif
PURPOSE : Create a ldif file from the given parameters.
@@ -3007,16 +2847,6 @@ doGenldif (
}
-
-
-
-
-
-
-
-
-
-
/* ****************************************************************************
FUNCTION : doAddEntry
PURPOSE : Perform an ldap_add() operation.
@@ -3239,15 +3069,6 @@ doAddEntry (
}
-
-
-
-
-
-
-
-
-
/* ****************************************************************************
FUNCTION : doAttrReplace
PURPOSE : Perform an ldap_modify() operation, to replace an
@@ -3403,7 +3224,6 @@ doAttrReplace (
}
-
/* ****************************************************************************
FUNCTION : doAttrFileReplace
PURPOSE : Perform an ldap_modify() operation, to replace an
@@ -3737,13 +3557,6 @@ doDeleteEntry (
}
-
-
-
-
-
-
- /* New function */ /*JLS 04-05-01*/
/* ****************************************************************************
FUNCTION : doBindOnly
PURPOSE : Perform only bind/unbind operations.
@@ -3777,10 +3590,6 @@ doBindOnly (
}
-
-
-
-
/* ****************************************************************************
FUNCTION : doExactSearch
PURPOSE : Perform one exact search operation.
diff --git a/ldap/servers/slapd/tools/ldclt/ldclt.c b/ldap/servers/slapd/tools/ldclt/ldclt.c
index 2ccba82..aab798b 100644
--- a/ldap/servers/slapd/tools/ldclt/ldclt.c
+++ b/ldap/servers/slapd/tools/ldclt/ldclt.c
@@ -287,13 +287,11 @@ dd/mm/yy | Author | Comments
#ifdef LDAP_H_FROM_QA_WKA
#include <proto-ldap.h> /* ldap C-API prototypes */
#endif
-#ifndef _WIN32 /*JLS 29-11-00*/
#include <pthread.h> /* pthreads(), etc... */
#include <unistd.h> /* close(), etc... */
#include <dlfcn.h> /* dlopen(), etc... */ /*JLS 07-11-00*/
#include <sys/resource.h> /* setrlimit(), etc... */
#include <sys/time.h> /* struct rlimit, etc... */
-#endif
#include "nspr.h"
#include "port.h" /* Portability definitions */ /*JLS 29-11-00*/
@@ -315,15 +313,6 @@ int masterPort=16000;
extern char *ldcltVersion; /* ldclt version */ /*JLS 18-08-00*/
-
-
-
-
-
-
-
-
- /* New function */ /*JLS 18-08-00*/
/* ****************************************************************************
FUNCTION : ldcltExit
PURPOSE : Print the last data then exit the process.
@@ -372,7 +361,6 @@ ldcltExit (
}
- /* New */ /*JLS 23-03-01*/
/* ****************************************************************************
FUNCTION : copyVersAttribute
PURPOSE : Copy a versatile object's attribute
@@ -424,13 +412,6 @@ copyVersAttribute (
}
-
-
-
-
-
-
- /* New */ /*JLS 21-03-01*/
/* ****************************************************************************
FUNCTION : copyVersObject
PURPOSE : Copy a versatile object.
@@ -487,15 +468,6 @@ copyVersObject (
}
-
-
-
-
-
-
-
-
- /* New */ /*JLS 19-03-01*/
/* ****************************************************************************
FUNCTION : tttctxInit
PURPOSE : Initiates the thread context
@@ -554,10 +526,6 @@ tttctxInit (
}
-
-
-
-
/* ****************************************************************************
FUNCTION : runThem
PURPOSE : This function implements the launching of the threads.
@@ -664,12 +632,6 @@ runThem (void)
}
-
-
-
-
-
- /* New function */ /*JLS 17-11-00*/
/* ****************************************************************************
FUNCTION : shutdownThreads
PURPOSE : This function is targeted to shutdown the threads.
@@ -755,11 +717,6 @@ shutdownThreads (void)
}
-
-
-
-
-
/* ****************************************************************************
FUNCTION : monitorThem
PURPOSE : This function will monitor all the client threads.
@@ -938,14 +895,6 @@ monitorThem (void)
}
-
-
-
-
-
-
-
-
/* ****************************************************************************
FUNCTION : printGlobalStatistics
PURPOSE : This function will print the global statistics numbers.
@@ -1099,12 +1048,6 @@ printGlobalStatistics (void)
}
-
-
-
-
-
-#ifndef _WIN32 /*JLS 29-11-00*/
/* ****************************************************************************
FUNCTION : trapVector
PURPOSE : Interruption vector for SIGINT and SIGQUIT
@@ -1130,10 +1073,6 @@ trapVector (
}
return;
}
-#endif /* _WIN32 */ /*JLS 29-11-00*/
-
-
-
/* ****************************************************************************
@@ -1197,13 +1136,6 @@ initMainThread (void)
}
-
-
-
-
-
-
- /* New function */ /*JLS 21-11-00*/
/* ****************************************************************************
FUNCTION : parseFilter
PURPOSE : This function parse a string in the form abcXXXdef
@@ -1252,17 +1184,6 @@ parseFilter (
}
-
-
-
-
-
-
-
-
-
-
-
/* ****************************************************************************
FUNCTION : basicInit
PURPOSE : This function performs the basic initializations of
@@ -1276,9 +1197,7 @@ parseFilter (
int
basicInit (void)
{
-#ifndef _WIN32 /*JLS 29-11-00*/
struct rlimit rlp; /* For setrlimit() */
-#endif /* _WIN32 */ /*JLS 29-11-00*/
int i; /* For the loops */ /*JLS 21-11-00*/
int ret; /* Return value */
int oflags;/* open() flags */ /*JLS 05-04-01*/
@@ -1340,7 +1259,7 @@ basicInit (void)
oflags = O_APPEND|O_WRONLY|O_CREAT; /*JLS 05-04-01*/
else /*JLS 05-04-01*/
oflags = O_EXCL|O_WRONLY|O_CREAT; /*JLS 05-04-01*/
-#if !defined(_WIN32) && !defined(OSF1) && !defined(__LP64__) && !defined(_LP64) /*JLS 05-04-01*/
+#if !defined(OSF1) && !defined(__LP64__) && !defined(_LP64) /*JLS 05-04-01*/
oflags |= O_LARGEFILE; /*JLS 05-04-01*/
#endif /*JLS 03-04-01*/
mctx.genldifFile = open (mctx.genldifName, oflags, 0666); /*JLS 05-04-01*/
@@ -1372,8 +1291,7 @@ basicInit (void)
/*
* Set appropriate number of files...
- */
-#ifndef _WIN32 /*JLS 29-11-00*/
+ */ /*JLS 29-11-00*/
if (mctx.nbThreads > 54)
{
if (getrlimit (RLIMIT_NOFILE, &rlp) < 0)
@@ -1394,7 +1312,6 @@ basicInit (void)
if (mctx.mode & VERBOSE)
printf ("Set file number to %u\n", (unsigned int)rlp.rlim_max);
}
-#endif /* _WIN32 */ /*JLS 29-11-00*/
/*
* Maybe an object to read ?
@@ -1742,12 +1659,6 @@ basicInit (void)
}
-
-
-
-
-
-
/* ****************************************************************************
FUNCTION : printModeValues
PURPOSE : This function is targeted to print the bits mask of
@@ -1843,12 +1754,6 @@ dumpModeValues (void)
}
-
-
-
-
-
-
/*
* Scope parameters (-s sub-options)
*/
@@ -1862,6 +1767,7 @@ char *scopeParams[] = {
NULL
};
+
/* ****************************************************************************
FUNCTION : decodeScopeParams
PURPOSE : Decode the scope parameters (ak asub-options of the
@@ -1902,10 +1808,6 @@ decodeScopeParams (
}
-
-
-
-
/* ****************************************************************************
FUNCTION : saslSetParam
PURPOSE : Sets SASL parameters
@@ -2001,10 +1903,6 @@ saslSetParam (
}
-
-
-
- /* New function */ /*JLS 08-03-01*/
/* ****************************************************************************
FUNCTION : decodeReferralParams
PURPOSE : Decode -e referral params.
@@ -2034,15 +1932,6 @@ decodeReferralParams (
}
-
-
-
-
-
-
-
-
-
/* ****************************************************************************
FUNCTION : addAttrToList
PURPOSE : Add attributes in the attribute list.
@@ -2094,12 +1983,6 @@ addAttrToList (
}
-
-
-
-
-
- /* New */ /*JLS 23-03-01*/
/* ****************************************************************************
FUNCTION : decodeRdnParam
PURPOSE : Decodes a -e rdn=value parameter.
@@ -2147,18 +2030,6 @@ decodeRdnParam (
}
-
-
-
-
-
-
-
-
-
-
-
-
/*
* Exec params (-e sub-options)
*/
@@ -2616,11 +2487,6 @@ decodeExecParams (
}
-
-
-
-
- /* New function */ /*JLS 23-04-01*/
/* ****************************************************************************
FUNCTION : buildArgListString
PURPOSE : Saved the arguments of ldclt into a string.
@@ -2669,12 +2535,6 @@ buildArgListString (
}
-
-
-
-
-
-
/* ****************************************************************************
FUNCTION : main
PURPOSE : Main function of ldclt
diff --git a/ldap/servers/slapd/tools/ldclt/parser.c b/ldap/servers/slapd/tools/ldclt/parser.c
index a02f30d..4386d7b 100644
--- a/ldap/servers/slapd/tools/ldclt/parser.c
+++ b/ldap/servers/slapd/tools/ldclt/parser.c
@@ -80,28 +80,14 @@ dd/mm/yy | Author | Comments
#ifdef LDAP_H_FROM_QA_WKA
#include <proto-ldap.h> /* ldap C-API prototypes */
#endif
-#ifndef _WIN32
#include <unistd.h> /* close(), etc... */
#include <pthread.h> /* pthreads(), etc... */
-#endif
#include "port.h" /* Portability definitions */
#include "ldclt.h" /* This tool's include file */
#include "utils.h" /* Utilities functions */
-
-
-
-
-
-
-
-
-
-
-
-
/* ****************************************************************************
FUNCTION : decodeHow
PURPOSE : Decode the how field
@@ -128,16 +114,6 @@ decodeHow (
}
-
-
-
-
-
-
-
-
-
-
/* ****************************************************************************
FUNCTION : parseVariant
PURPOSE : Parse a variant definition.
@@ -358,17 +334,6 @@ parseVariant (
}
-
-
-
-
-
-
-
-
-
-
-
/* ****************************************************************************
FUNCTION : parseAttribValue
PURPOSE : Parse the right part of attribname: attribvalue.
@@ -467,16 +432,6 @@ parseAttribValue (
}
-
-
-
-
-
-
-
-
-
-
/* ****************************************************************************
FUNCTION : parseLine
PURPOSE : Parse the given line to find an attribute definition.
@@ -546,14 +501,6 @@ parseLine (
}
-
-
-
-
-
-
-
-
/* ****************************************************************************
FUNCTION : readObject
PURPOSE : This function will read an object description from the
@@ -620,9 +567,3 @@ done:
return rc;
}
-
-
-
-
-
-/* End of file */
diff --git a/ldap/servers/slapd/tools/ldclt/port.c b/ldap/servers/slapd/tools/ldclt/port.c
index f21139b..a7a6af6 100644
--- a/ldap/servers/slapd/tools/ldclt/port.c
+++ b/ldap/servers/slapd/tools/ldclt/port.c
@@ -66,218 +66,12 @@ dd/mm/yy | Author | Comments
#include <stdio.h> /* EOF, etc... */
-
-#ifdef _WIN32
-#include <windows.h>
-#include <winbase.h>
-#else
#include <unistd.h> /* sleep(), etc... */ /*JLS 14-03-01*/
#include <pthread.h> /* pthreads(), etc... */
-#endif
-
#include "port.h"
/************************************************************************/
/************************************************************************/
-/**************** NT section ***********************/
-/************************************************************************/
-/************************************************************************/
-
-#ifdef _WIN32
-
-int
-ldclt_mutex_init (
- ldclt_mutex_t *mutex)
-{
- InitializeCriticalSection (mutex);
- return (0);
-}
-
-int
-ldclt_mutex_lock (
- ldclt_mutex_t *mutex)
-{
- EnterCriticalSection(mutex);
- return (0);
-}
-
-int
-ldclt_mutex_unlock (
- ldclt_mutex_t *mutex)
-{
- LeaveCriticalSection (mutex);
- return (0);
-}
-
-void
-ldclt_sleep (
- int nseconds)
-{
- Sleep (1000 * nseconds);
-}
-
-int
-ldclt_thread_create (
- ldclt_tid *tid,
- void *fct,
- void *param)
-{
- CreateThread (NULL, 0, fct, param, 0, tid);
- return (0);
-}
-
-long
-lrand48 (void)
-{
- return ((rand()<<8)+rand());
-}
-
-/*
- * Implements the Unix getopt function for NT systems
- */
-char *optarg;
-int optind;
-int
-getopt (
- int argc,
- char **argv,
- char *optstring)
-{
- static char **prevArgv = NULL; /* Memorize argv to parse */
- static int inOption; /* In option parsing ? */
- static int cNum; /* Current char num */
- int c; /* Current char */
- int i; /* Loops */
-
- /*
- * Initialization - maybe the first time this function is called ?
- */
- if (prevArgv != argv)
- {
- prevArgv = argv;
- optind = 0;
- inOption = 0;
- }
-
- /*
- * Maybe we processed the last chars of the option in the previous call
- */
- if (inOption)
- {
- if (argv[optind][cNum] == '\0')
- inOption = 0;
- }
-
- /*
- * Maybe we should look for '-'
- */
- if (!inOption)
- {
- optind++; /* Next option */
- if (optind == argc) /* No more option */
- return (EOF);
- if (argv[optind][0] != '-') /* Not an option */
- return (EOF);
- if (argv[optind][1] == '\0') /* Only '-' */
- return (EOF);
- cNum = 1; /* Next char to process */
- inOption = 0; /* We are in an option */
- }
-
- /*
- * See if this is a valid option
- */
- c = argv[optind][cNum];
- for (i=0 ; (i<strlen(optstring)) && (c!=optstring[i]) ; i++);
- if (c != optstring[i]) /* Not an option */
- return ('?');
- cNum++; /* Next char */
-
- /*
- * Check if this option requires an argument
- * Note that for the last char of optstring, it is a valid '\0' != ':'
- */
- if (optstring[i+1] != ':') /* No argument */
- return (c);
-
- /*
- * Need an argument...
- * The argument is either the end of argv[optind] or argv[++optind]
- */
- if (argv[optind][cNum] == '\0') /* Must return next argument */
- {
- optind++; /* Next argument */
- if (optind == argc) /* There is no next argument */
- {
- printf ("%s: option requires an argument -- %c\n", argv[0], c);
- return ('?');
- }
- optarg = argv[optind]; /* Set optarg to teh argument argv[] */
- inOption = 0; /* No more in option... */
- return (c);
- }
-
- /*
- * Return the end of the current argv[optind]
- */
- optarg = &(argv[optind][cNum]); /* End of argv[optind] */
- inOption = 0; /* No more in option */
- return (c);
-}
-
-
-/*
- * Implement the Unix getsubopt function for NT systems
- */
-int
-getsubopt(
- char **optionp,
- char **tokens,
- char **valuep)
-{
- int i; /* Loops */
- char *curOpt; /* Current optionp */
-
- curOpt = *optionp; /* Begin of current option */
-
- /*
- * Find the end of the current option
- */
- for (i=0 ; (curOpt[i]!='\0') && (curOpt[i]!=',') ; i++);
- if (curOpt[i] == '\0')
- *optionp = &(curOpt[i]);
- else
- *optionp = &(curOpt[i+1]);
- curOpt[i] = '\0'; /* Do not forget to end this string */
-
- /*
- * Find if there is a subvalue for this option
- */
- for (i=0 ; (curOpt[i]!='\0') && (curOpt[i]!='=') ; i++);
- if (curOpt[i] == '\0')
- *valuep = &(curOpt[i]);
- else
- *valuep = &(curOpt[i+1]);
- curOpt[i] = '\0'; /* Do not forget to end this string */
-
- /*
- * Find if this option is valid...
- */
- for (i=0 ; tokens[i] != NULL ; i++)
- if (!strcmp (curOpt, tokens[i]))
- return (i);
-
- /*
- * Not found...
- */
- return (-1);
-}
-
-
-#else /* NT 4 */
-
-/************************************************************************/
-/************************************************************************/
/**************** Unix section ***********************/
/************************************************************************/
/************************************************************************/
@@ -318,9 +112,3 @@ ldclt_thread_create (
{
return (pthread_create (tid, NULL, fct, param));
}
-
-#endif /* _WIN32 */
-
-
-
-/* End of file */
diff --git a/ldap/servers/slapd/tools/ldclt/port.h b/ldap/servers/slapd/tools/ldclt/port.h
index 6230ea8..cacbf91 100644
--- a/ldap/servers/slapd/tools/ldclt/port.h
+++ b/ldap/servers/slapd/tools/ldclt/port.h
@@ -85,29 +85,6 @@ dd/mm/yy | Author | Comments
#endif /*JLS 03-04-01*/
#endif /*JLS 01-12-00*/
-#ifdef _WIN32 /*JLS 01-12-00*/
-#define LDCLT_NO_DLOPEN 1 /*JLS 01-12-00*/
-#endif /*JLS 01-12-00*/
-
-
-/************************************************************************/
-/************************************************************************/
-/**************** NT section ***********************/
-/************************************************************************/
-/************************************************************************/
-
-#ifdef _WIN32
-
-typedef CRITICAL_SECTION ldclt_mutex_t;
-typedef DWORD ldclt_tid;
-
-extern int getopt (int argc, char **argv, char *optstring);
-extern int getsubopt(char **optionp, char **tokens, char **valuep);
-extern long lrand48 (void);
-extern char *optarg;
-extern int optind;
-
-#else /* _WIN32 */
/************************************************************************/
/************************************************************************/
@@ -118,9 +95,6 @@ extern int optind;
typedef pthread_mutex_t ldclt_mutex_t;
typedef pthread_t ldclt_tid;
-#endif /* _WIN32 */
-
-
/*
* Portability functions common to all platforms
*/
@@ -129,5 +103,3 @@ extern int ldclt_mutex_lock (ldclt_mutex_t *mutex);
extern int ldclt_mutex_unlock (ldclt_mutex_t *mutex);
extern void ldclt_sleep (int nseconds);
extern int ldclt_thread_create (ldclt_tid *tid, void *(*fct)(void *), void *param);
-
-/* End of file */
diff --git a/ldap/servers/slapd/tools/ldclt/scalab01.c b/ldap/servers/slapd/tools/ldclt/scalab01.c
index e64734a..f903c70 100644
--- a/ldap/servers/slapd/tools/ldclt/scalab01.c
+++ b/ldap/servers/slapd/tools/ldclt/scalab01.c
@@ -85,9 +85,7 @@ dd/mm/yy | Author | Comments
#include <stdlib.h> /* malloc(), etc... */
#include <string.h> /* strcpy(), etc... */
#include <errno.h> /* perror(), etc... */
-#ifndef _WIN32
#include <pthread.h> /* pthreads(), etc... */
-#endif
#include <lber.h> /* ldap C-API BER declarations */
#include <ldap.h> /* ldap C-API declarations */
@@ -101,18 +99,12 @@ dd/mm/yy | Author | Comments
#include "scalab01.h" /* Scalab01 specific definitions */
-
-
-
/*
* Private data structures.
*/
scalab01_context s1ctx;
-
-
-
/* ****************************************************************************
FUNCTION : scalab01_init
PURPOSE : Initiates the scalab01 scenario.
@@ -162,11 +154,6 @@ scalab01_init (void)
}
-
-
-
-
-
/* ****************************************************************************
FUNCTION : scalab01Lock
PURPOSE : Lock for single user trying to connect.
@@ -234,12 +221,6 @@ scalab01Lock (
}
-
-
-
-
-
-
/* ****************************************************************************
FUNCTION : scalab01Unlock
PURPOSE : Unlock for single user trying to connect.
@@ -292,13 +273,6 @@ scalab01Unlock (
}
-
-
-
-
-
-
-
/* ****************************************************************************
FUNCTION : scalab01_modemIncr
PURPOSE : Increments the modem nb of cnx
@@ -392,11 +366,6 @@ scalab01_modemDecr (
}
-
-
-
-
-
/* ****************************************************************************
FUNCTION : scalab01_addLogin
PURPOSE : Add a new user login to the s1ctx structure.
@@ -515,13 +484,6 @@ done:
}
-
-
-
-
-
-
-
/* ****************************************************************************
FUNCTION : scalab01_connectSuperuser
PURPOSE : Purpose of the fct
@@ -559,12 +521,6 @@ scalab01_connectSuperuser (void)
}
-
-
-
-
-
-
/* ****************************************************************************
FUNCTION : readAttrValue
PURPOSE : This function will ldap_search the given entry for the
@@ -671,11 +627,6 @@ readAttrValue (
}
-
-
-
-
-
/* ****************************************************************************
FUNCTION : writeAttrValue
PURPOSE : This function will ldap_modify the given entry to
@@ -729,11 +680,6 @@ writeAttrValue (
}
-
-
-
-
-
/* ****************************************************************************
FUNCTION : scalab01_unlock
PURPOSE : Unlock the user given in argument.
@@ -814,12 +760,6 @@ scalab01_unlock (
}
-
-
-
-
-
-
/* ****************************************************************************
FUNCTION : scalab01_control
PURPOSE : This function implements the control loop/thread of
@@ -948,11 +888,6 @@ scalab01_control (
}
-
-
-
-
-
/* ****************************************************************************
FUNCTION : doScalab01
PURPOSE : Implements the client part of the scalab01 scenario.
@@ -1105,10 +1040,3 @@ TBC - this is done in the next loop... - cf connectToServer()
return (0);
}
-
-
-
-
-
-
-/* End of file */
diff --git a/ldap/servers/slapd/tools/ldclt/threadMain.c b/ldap/servers/slapd/tools/ldclt/threadMain.c
index 7af76d4..f74759b 100644
--- a/ldap/servers/slapd/tools/ldclt/threadMain.c
+++ b/ldap/servers/slapd/tools/ldclt/threadMain.c
@@ -154,31 +154,15 @@ dd/mm/yy | Author | Comments
#include <errno.h> /* errno, etc... */ /*JLS 06-03-00*/
#include <lber.h> /* ldap C-API BER declarations */
#include <ldap.h> /* ldap C-API declarations */
-#ifndef _WIN32 /*JLS 29-11-00*/
#include <unistd.h> /* close(), etc... */
#include <pthread.h> /* pthreads(), etc... */
#include <signal.h> /* sigfillset(), etc... */
-#endif /*JLS 29-11-00*/
-
#include "port.h" /* Portability definitions */ /*JLS 29-11-00*/
#include "ldclt.h" /* This tool's include file */
#include "utils.h" /* Utilities functions */ /*JLS 14-11-00*/
#include "scalab01.h" /* Scalab01 specific */ /*JLS 12-01-01*/
-
-
-
-
-
-
-
-
-
-
-
-
- /* New */ /*JLS 15-03-01*/
/* ****************************************************************************
FUNCTION : selectRandomAttrList
PURPOSE : Select a random attr list.
@@ -196,9 +180,6 @@ selectRandomAttrList (
}
-
-
-
/* ****************************************************************************
FUNCTION : randomString
PURPOSE : Return a random string, of length nbDigits.
@@ -219,12 +200,6 @@ randomString (
}
-
-
-
-
-
- /* New */ /*JLS 28-03-01*/
/* ****************************************************************************
FUNCTION : incrementCommonCounterObject
PURPOSE : Purpose of the fct
@@ -309,11 +284,6 @@ incrementCommonCounterObject (
}
-
-
-
-
- /* New */ /*JLS 14-03-01*/
/* ****************************************************************************
FUNCTION : incrementCommonCounter
PURPOSE : Purpose of the fct
@@ -373,9 +343,6 @@ incrementCommonCounter (
}
-
-
-
/* ****************************************************************************
FUNCTION : incrementNbOpers
PURPOSE : Increment the counters tttctx->nbOpers and
@@ -434,11 +401,6 @@ incrementNbOpers (
}
-
-
-
-
-
/* ****************************************************************************
FUNCTION : ignoreError
PURPOSE : Returns true or false depending on the given error
@@ -468,12 +430,6 @@ ignoreError (
}
-
-
-
-
-
-
/* ****************************************************************************
FUNCTION : addErrorStat
PURPOSE : Add the given error number to the statistics.
@@ -562,10 +518,6 @@ addErrorStat (
}
-
-
-
-
/* ****************************************************************************
FUNCTION : msgIdAdd
PURPOSE : Add a new message id to the pending ones.
@@ -630,11 +582,6 @@ msgIdAdd (
}
-
-
-
-
-
/* ****************************************************************************
FUNCTION : msgIdAttribs
PURPOSE : Found the requested message id in the pending list.
@@ -662,12 +609,6 @@ msgIdAttribs (
}
-
-
-
-
-
-
/* ****************************************************************************
FUNCTION : msgIdDN
PURPOSE : Found the requested message id in the pending list.
@@ -695,12 +636,6 @@ msgIdDN (
}
-
-
-
-
-
-
/* ****************************************************************************
FUNCTION : msgIdStr
PURPOSE : Found the requested message id in the pending list.
@@ -728,11 +663,6 @@ msgIdStr (
}
-
-
-
-
-
/* ****************************************************************************
FUNCTION : msgIdDel
PURPOSE : Delete a message id from the pending ones.
@@ -807,13 +737,6 @@ msgIdDel (
}
-
-
-
-
-
-
- /* New function */ /*JLS 17-11-00*/
/* ****************************************************************************
FUNCTION : getThreadStatus
PURPOSE : Get the value of a given thread's status.
@@ -853,10 +776,6 @@ getThreadStatus (
}
-
-
-
- /* New function */ /*JLS 17-11-00*/
/* ****************************************************************************
FUNCTION : setThreadStatus
PURPOSE : Set the value of a given thread's status.
@@ -897,17 +816,6 @@ setThreadStatus (
}
-
-
-
-
-
-
-
-
-
-
-
/* ****************************************************************************
FUNCTION : threadMain
PURPOSE : This function is the main function of the client threads
@@ -1252,4 +1160,3 @@ threadMain (
}
-/* End of file */
diff --git a/ldap/servers/slapd/tools/ldclt/workarounds.c b/ldap/servers/slapd/tools/ldclt/workarounds.c
index f0b8375..508340d 100644
--- a/ldap/servers/slapd/tools/ldclt/workarounds.c
+++ b/ldap/servers/slapd/tools/ldclt/workarounds.c
@@ -79,16 +79,12 @@ dd/mm/yy | Author | Comments
#ifdef SOLARIS_LIBLDAP /*JLS 19-09-00*/
#include "ldap-private.h"
#else /*JLS 19-09-00*/
-#ifndef _WIN32 /*JLS 01-12-00*/
#include <pthread.h> /*JLS 01-12-00*/
-#endif /*JLS 01-12-00*/
#include "port.h" /* Portability definitions */ /*JLS 29-11-00*/
#include "ldclt.h" /*JLS 19-09-00*/
#endif /*JLS 19-09-00*/
-
-
/* ****************************************************************************
FUNCTION : getFdFromLdapSession
PURPOSE : This function is a work-around for the bug 4197228
diff --git a/ldap/servers/slapd/tools/ldif.c b/ldap/servers/slapd/tools/ldif.c
index e4527ba..8ac80df 100644
--- a/ldap/servers/slapd/tools/ldif.c
+++ b/ldap/servers/slapd/tools/ldif.c
@@ -45,14 +45,8 @@
#include <stdlib.h>
#include <memory.h>
#include <sys/types.h>
-#if defined( _WINDOWS ) || defined( _WIN32 )
-#include <windows.h>
-#include <io.h>
-#include <fcntl.h>
-#else
#include <unistd.h> /* for read() */
#include <sys/socket.h>
-#endif
#include "ldap.h"
#include "ldif.h"
@@ -114,9 +108,6 @@ int main( int argc, char **argv )
char buf[BUFSIZ];
char *val;
int nread, max, cur;
-#if defined( _WINDOWS ) || defined( _WIN32 )
- _setmode( _fileno( stdin ), _O_BINARY );
-#endif
if (( val = (char *) malloc( BUFSIZ )) == NULL ) {
perror( "malloc" );
diff --git a/ldap/servers/slapd/tools/migratecred.c b/ldap/servers/slapd/tools/migratecred.c
index c1e37bf..3c876f0 100644
--- a/ldap/servers/slapd/tools/migratecred.c
+++ b/ldap/servers/slapd/tools/migratecred.c
@@ -50,9 +50,7 @@
#include <unistd.h>
#endif
-#ifndef _WIN32
#include <sys/param.h> /* MAXPATHLEN */
-#endif
#include "../plugins/rever/rever.h"
#include "getopt_ext.h"
@@ -63,22 +61,6 @@ static void usage(char *name)
fprintf(stderr, "New plugin path defaults to [%s] if not given\n", PLUGINDIR);
exit(1);
}
-
-#ifdef _WIN32
-/* converts '\' chars to '/' */
-static void dostounixpath(char *szText)
-{
- if(szText)
- {
- while(*szText)
- {
- if( *szText == '\\' )
- *szText = '/';
- szText++;
- }
- }
-}
-#endif
/* Script used during migration: replication and
chaining backend credentials must be converted.
@@ -118,16 +100,10 @@ main( int argc, char **argv)
{
case 'o':
oldpath = strdup(optarg);
-#ifdef _WIN32
- dostounixpath(oldpath);
-#endif /* _WIN32 */
break;
case 'n':
newpath = strdup(optarg);
-#ifdef _WIN32
- dostounixpath(newpath);
-#endif /* _WIN32 */
break;
case 'c':
{
@@ -151,10 +127,6 @@ main( int argc, char **argv)
break;
case 'p':
pluginpath = strdup(optarg);
-#ifdef _WIN32
- dostounixpath(pluginpath);
-#endif /* _WIN32 */
-
break;
default:
usage(cmd);
@@ -171,9 +143,6 @@ main( int argc, char **argv)
}
-#if defined( XP_WIN32 )
- shared_lib = ".dll";
-#else
#ifdef HPUX
#ifdef __ia64
shared_lib = ".so";
@@ -191,13 +160,9 @@ main( int argc, char **argv)
shared_lib = ".so";
#endif
#endif
-#endif
if (!pluginpath) {
pluginpath = strdup(PLUGINDIR);
-#ifdef _WIN32
- dostounixpath(pluginpath);
-#endif /* _WIN32 */
}
if (access(pluginpath, R_OK)) {
diff --git a/ldap/servers/slapd/tools/mmldif.c b/ldap/servers/slapd/tools/mmldif.c
index 156d892..68a774c 100644
--- a/ldap/servers/slapd/tools/mmldif.c
+++ b/ldap/servers/slapd/tools/mmldif.c
@@ -47,11 +47,8 @@
#include <time.h>
#include <stdlib.h>
#include <ldap.h>
-#ifndef _WIN32
-# define stricmp strcasecmp
-#else
-# include <io.h>
-#endif
+
+#define stricmp strcasecmp
#include <nss.h>
#include <pk11func.h>
@@ -68,11 +65,6 @@
#define FALSE 0
#endif
-#ifdef _WIN32
-int slapd_ldap_debug = 0;
-int *module_ldap_debug;
-#endif
-
/*
* VSTRING was defined in PMDF headers.
*/
@@ -661,11 +653,6 @@ int mm_init(int argc, char * argv[])
}
}
-#ifdef _WIN32
- module_ldap_debug = &slapd_ldap_debug;
- libldap_init_debug_level(&slapd_ldap_debug);
-#endif
-
if (ofn != NULL) {
ofp = fopen(ofn, "w");
if (ofp == NULL) {
diff --git a/ldap/servers/slapd/tools/pwenc.c b/ldap/servers/slapd/tools/pwenc.c
index 6760be4..826a956 100644
--- a/ldap/servers/slapd/tools/pwenc.c
+++ b/ldap/servers/slapd/tools/pwenc.c
@@ -40,12 +40,7 @@
# include <config.h>
#endif
-#if defined( _WIN32 )
-#include <sys/stat.h> /* for S_IREAD and S_IWRITE */
-#include <windows.h>
-#include <time.h>
-#include "proto-ntutil.h"
-#else
+
#include <sys/socket.h>
#include <sys/errno.h>
#include <sys/param.h>
@@ -55,7 +50,6 @@
* break other builds so far */
#include <unistd.h>
#endif
-#endif
#include <stdio.h>
#include <string.h>
#include <ctype.h>
@@ -70,9 +64,6 @@
int ldap_syslog;
int ldap_syslog_level;
int slapd_ldap_debug = LDAP_DEBUG_ANY;
-#ifdef _WIN32
-int *module_ldap_debug;
-#endif
int detached;
FILE *error_logfp;
FILE *access_logfp;
@@ -176,11 +167,6 @@ main( argc, argv )
name = argv[ 0 ];
pwsp = cmppwsp = NULL;
-#ifdef _WIN32
- module_ldap_debug = &slapd_ldap_debug;
- libldap_init_debug_level(&slapd_ldap_debug);
-#endif
-
PR_Init( PR_USER_THREAD, PR_PRIORITY_NORMAL, 0 );
/* Initialize NSS to make ds_salted_sha1_pw_enc() work */
diff --git a/ldap/servers/slapd/tools/rsearch/addthread.c b/ldap/servers/slapd/tools/rsearch/addthread.c
index a3e5568..457920c 100644
--- a/ldap/servers/slapd/tools/rsearch/addthread.c
+++ b/ldap/servers/slapd/tools/rsearch/addthread.c
@@ -44,9 +44,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#ifdef XP_UNIX
#include <unistd.h>
-#endif
#include "nspr.h"
#include <netinet/tcp.h> /* for TCP_NODELAY */
#include "ldap.h"
diff --git a/ldap/servers/slapd/tools/rsearch/main.c b/ldap/servers/slapd/tools/rsearch/main.c
index 33bc0a1..a8c17a7 100644
--- a/ldap/servers/slapd/tools/rsearch/main.c
+++ b/ldap/servers/slapd/tools/rsearch/main.c
@@ -48,10 +48,7 @@
#include <stdio.h>
#include <stdlib.h>
-#ifdef XP_UNIX
#include <unistd.h>
-
-#endif
#include "nspr.h"
#include "rsearch.h"
#include "nametable.h"
diff --git a/ldap/servers/slapd/tools/rsearch/nametable.c b/ldap/servers/slapd/tools/rsearch/nametable.c
index 03a6ae1..9ab1376 100644
--- a/ldap/servers/slapd/tools/rsearch/nametable.c
+++ b/ldap/servers/slapd/tools/rsearch/nametable.c
@@ -56,11 +56,7 @@ struct _nametable {
int get_large_random_number()
{
-#ifdef _WIN32
- return rand();
-#else
return random();
-#endif
}
@@ -133,11 +129,11 @@ int nt_push(NameTable *nt, char *s)
char **ndata;
if (nt->size >= nt->capacity) {
- /* expando! */
- nt->capacity += NT_STEP;
- ndata = (char **)realloc(nt->data, sizeof(char *) * nt->capacity);
- if (!ndata) return 0;
- nt->data = ndata;
+ /* expando! */
+ nt->capacity += NT_STEP;
+ ndata = (char **)realloc(nt->data, sizeof(char *) * nt->capacity);
+ if (!ndata) return 0;
+ nt->data = ndata;
}
nt->data[nt->size++] = s;
return nt->size;
diff --git a/ldap/servers/slapd/tools/rsearch/rsearch.c b/ldap/servers/slapd/tools/rsearch/rsearch.c
index f56da7f..5579467 100644
--- a/ldap/servers/slapd/tools/rsearch/rsearch.c
+++ b/ldap/servers/slapd/tools/rsearch/rsearch.c
@@ -56,9 +56,7 @@
#include <stdlib.h>
#include <time.h>
#include <string.h>
-#ifdef XP_UNIX
#include <unistd.h>
-#endif
#include "nspr.h"
#include "rsearch.h"
#include "nametable.h"
diff --git a/ldap/servers/slapd/tools/rsearch/searchthread.c b/ldap/servers/slapd/tools/rsearch/searchthread.c
index 9f1d127..e520f71 100644
--- a/ldap/servers/slapd/tools/rsearch/searchthread.c
+++ b/ldap/servers/slapd/tools/rsearch/searchthread.c
@@ -44,9 +44,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#ifdef XP_UNIX
#include <unistd.h>
-#endif
#include <time.h>
#include <errno.h>
#include "nspr.h"
diff --git a/ldap/servers/slapd/unbind.c b/ldap/servers/slapd/unbind.c
index 8cedeec..2392f8a 100644
--- a/ldap/servers/slapd/unbind.c
+++ b/ldap/servers/slapd/unbind.c
@@ -57,9 +57,7 @@
#include <stdio.h>
#include <sys/types.h>
-#ifndef _WIN32
#include <sys/socket.h>
-#endif
#include "slap.h"
void
diff --git a/ldap/servers/slapd/uniqueidgen.c b/ldap/servers/slapd/uniqueidgen.c
index dad44df..c7f9976 100644
--- a/ldap/servers/slapd/uniqueidgen.c
+++ b/ldap/servers/slapd/uniqueidgen.c
@@ -43,14 +43,10 @@
/* uniqueidgen.c - implementation for uniqueID generator */
#include <string.h>
-
-#ifndef _WIN32 /* for ntoh* functions */
#include <sys/types.h>
#include <sys/time.h>
#include <sys/sysinfo.h>
#include <sys/utsname.h>
-#endif
-
#include "nspr.h"
#include "slap.h"
#include "uuid.h"
diff --git a/ldap/servers/slapd/util.c b/ldap/servers/slapd/util.c
index 3690bf7..271f342 100644
--- a/ldap/servers/slapd/util.c
+++ b/ldap/servers/slapd/util.c
@@ -41,15 +41,11 @@
#endif
/* util.c -- utility functions -- functions available form libslapd */
-#ifdef _WIN32
-#include <direct.h> /* for getcwd */
-#else
#include <sys/socket.h>
#include <sys/param.h>
#include <unistd.h>
#include <pwd.h>
#include <stdint.h>
-#endif
#include <fcntl.h>
#include <libgen.h>
#include <pk11func.h>
@@ -57,20 +53,15 @@
#include "prtime.h"
#include "prinrval.h"
#include "snmp_collator.h"
+#include <sys/time.h>
#define UTIL_ESCAPE_NONE 0
#define UTIL_ESCAPE_HEX 1
#define UTIL_ESCAPE_BACKSLASH 2
-#if defined( _WIN32 )
-#define _PSEP "\\"
-#define _PSEP2 "\\\\"
-#define _CSEP '\\'
-#else
#define _PSEP "/"
#define _PSEP2 "//"
#define _CSEP '/'
-#endif
/* slapi_filter_sprintf macros */
#define ATTRSIZE 256 /* size allowed for an attr name */
@@ -832,16 +823,9 @@ is_abspath(const char *path)
return 0; /* empty path is not absolute? */
}
-#if defined( XP_WIN32 )
- if (path[0] == '/' || path[0] == '\\' ||
- (isalpha(path[0]) && (path[1] == ':'))) {
- return 1; /* Windows abs path */
- }
-#else
if (path[0] == '/') {
return 1; /* unix abs path */
}
-#endif
return 0; /* not an abs path */
}
@@ -930,26 +914,10 @@ rel2abspath_ext( char *relpath, char *cwd )
char abspath[ MAXPATHLEN + 1 ];
char *retpath = NULL;
-#if defined( _WIN32 )
- CHAR szDrive[_MAX_DRIVE];
- CHAR szDir[_MAX_DIR];
- CHAR szFname[_MAX_FNAME];
- CHAR szExt[_MAX_EXT];
-#endif
-
if ( relpath == NULL ) {
return NULL;
}
-#if defined( _WIN32 )
- memset (&szDrive, 0, sizeof (szDrive));
- memset (&szDir, 0, sizeof (szDir));
- memset (&szFname, 0, sizeof (szFname));
- memset (&szExt, 0, sizeof (szExt));
- _splitpath( relpath, szDrive, szDir, szFname, szExt );
- if( szDrive[0] && szDir[0] )
- return( slapi_ch_strdup( relpath ));
-#endif
if ( relpath[ 0 ] == _CSEP ) { /* absolute path */
PR_snprintf(abspath, sizeof(abspath), "%s", relpath);
} else { /* relative path */
@@ -1087,30 +1055,11 @@ Description:
for the number of milliseconds specified.
************************************************************************/
-
-
-#if defined(_WIN32)
-
-#include "windows.h"
-
-
-void DS_Sleep(PRIntervalTime ticks)
-{
-DWORD mSecs = PR_IntervalToMilliseconds(ticks);
-
- Sleep(mSecs);
-}
-
-#else /*** UNIX ***/
-
-
-#include <sys/time.h>
-
-
-void DS_Sleep(PRIntervalTime ticks)
+void
+DS_Sleep(PRIntervalTime ticks)
{
-long mSecs = PR_IntervalToMilliseconds(ticks);
-struct timeval tm;
+ long mSecs = PR_IntervalToMilliseconds(ticks);
+ struct timeval tm;
tm.tv_sec = mSecs / 1000;
tm.tv_usec = (mSecs % 1000) * 1000;
@@ -1118,7 +1067,6 @@ struct timeval tm;
select(0,NULL,NULL,NULL,&tm);
}
-#endif
/*****************************************************************************
@@ -1186,7 +1134,6 @@ strarray2str( char **a, char *buf, size_t buflen, int include_quotes )
Returns 0 upon success or non-zero otherwise, usually -1 if
some system error occurred
*/
-#ifndef _WIN32
int
slapd_chown_if_not_owner(const char *filename, uid_t uid, gid_t gid)
{
@@ -1213,7 +1160,6 @@ slapd_chown_if_not_owner(const char *filename, uid_t uid, gid_t gid)
close(fd);
return result;
}
-#endif
/*
* Compare 2 pathes
diff --git a/ldap/servers/slapd/uuid.c b/ldap/servers/slapd/uuid.c
index a514a56..8c167ce 100644
--- a/ldap/servers/slapd/uuid.c
+++ b/ldap/servers/slapd/uuid.c
@@ -67,18 +67,11 @@
#include <stdlib.h>
#include <time.h>
#include <pk11func.h>
-
-#ifdef _WIN32
-#include <sys/stat.h> /* for S_IREAD and S_IWRITE */
-#else
#include <sys/types.h>
#include <sys/time.h>
#include <sys/sysinfo.h>
#include <sys/utsname.h>
#include <unistd.h> /* gethostname() */
-#endif
-
-
#include "slap.h"
#include "uuid.h"
#include "sechash.h"
diff --git a/ldap/servers/slapd/uuid.h b/ldap/servers/slapd/uuid.h
index a97aeb8..3c5dc67 100644
--- a/ldap/servers/slapd/uuid.h
+++ b/ldap/servers/slapd/uuid.h
@@ -68,13 +68,8 @@
#define UUID_H
/* Set this to what your compiler uses for 64 bit data type */
-#ifdef _WIN32
-#define unsigned64_t unsigned __int64
-#define I64(C) C
-#else
#define unsigned64_t unsigned long long
#define I64(C) C##LL
-#endif
/***** uuid related data types *****/
/*
diff --git a/ldap/servers/snmp/ntagt/msrvdefs.mak b/ldap/servers/snmp/ntagt/msrvdefs.mak
index 2072549..1e52dde 100644
--- a/ldap/servers/snmp/ntagt/msrvdefs.mak
+++ b/ldap/servers/snmp/ntagt/msrvdefs.mak
@@ -146,7 +146,7 @@ endif
OPTIMIZE_FLAGS = -O2
CFLAGS = $(DLL_CFLAGS) -DSVR4 -D__svr4__ -DSOLARIS \
-DHAVE_NIS -DHAS_GETSPNAM -DHAS_FGETPWENT \
- -DXP_UNIX -DSTATOBJS \
+ -DSTATOBJS \
-DMSRV_RELEASE=\"$(MSRV_RELEASE)\" \
-DOSVERSION=$(OSVERSION) -D_REENTRANT
LD_EXTRAS = -L/tools/ns/lib -lthread -lsocket -lnsl -lgen -ldl
@@ -177,7 +177,6 @@ endif
OPTIMIZE_FLAGS = -O -Olimit 4096
CFLAGS = $(DLL_CFLAGS) -DIRIX -DSTATOBJS \
-DHAVE_NIS -DHAS_GETSPNAM -DHAS_FGETPWENT \
- -DXP_UNIX \
-DMSRV_RELEASE=\"$(MSRV_RELEASE)\" \
-DOSVERSION=$(OSVERSION)
@@ -208,7 +207,7 @@ ifeq ($(ARCH), HPUX)
DLL_LDFLAGS = -b
OPTIMIZE_FLAGS = -O
CFLAGS = -DHPUX -DSTATOBJS -DHAVE_NIS \
- -DXP_UNIX -DHAS_FGETPWENT \
+ -DHAS_FGETPWENT \
-DMSRV_RELEASE=\"$(MSRV_RELEASE)\" \
-DOSVERSION=$(OSVERSION)
LD_EXTRAS = -Wl,+b,/usr/lib,+s \
@@ -234,7 +233,7 @@ ifeq ($(ARCH), OSF1)
DLL_CXXFLAGS =
DLL_LDFLAGS =
OPTIMIZE_FLAGS = -O
- CFLAGS = -DOSF1 -DSTATOBJS -DHAVE_NIS -DXP_UNIX \
+ CFLAGS = -DOSF1 -DSTATOBJS -DHAVE_NIS \
-DHAS_FGETPWENT \
-DMSRV_RELEASE=\"$(MSRV_RELEASE)\" \
-DOSVERSION=$(OSVERSION)
@@ -272,7 +271,7 @@ ifeq ($(ARCH), AIX)
DLL_CXXFLAGS =
OPTIMIZE_FLAGS = -O
CFLAGS = -DAIX -DAIXV3 -DAIXV4 -DSTATOBJS \
- -DHAVE_NIS -DXP_UNIX -mcpu=common\
+ -DHAVE_NIS -mcpu=common\
-DMSRV_RELEASE=\"$(MSRV_RELEASE)\" \
-DOSVERSION=$(OSVERSION)
LD_EXTRAS = -L/gnu/install/lib -L/gnu/install/lib/gcc-lib/powerpc-ibm-aix4.1.4.0/2.7.2.1/common -lstdc++ -ls -lsvld -lgcc -lc_r
@@ -293,7 +292,7 @@ endif
# DLL_CXXFLAGS =
# OPTIMIZE_FLAGS = -O
# CFLAGS = -DAIX -DAIXV3 -DSTATOBJS \
-# -DHAVE_NIS -DXP_UNIX \
+# -DHAVE_NIS \
# -DMSRV_RELEASE=\"$(MSRV_RELEASE)\"
# LD_EXTRAS = -L/tools/ns/lib -liostream -ls
# MSRV_INCLUDES = -I/tools/ns/lib/g++-include
diff --git a/ldap/systools/idsktune.c b/ldap/systools/idsktune.c
index e0f485c..f36b780 100644
--- a/ldap/systools/idsktune.c
+++ b/ldap/systools/idsktune.c
@@ -66,7 +66,7 @@ static char *build_date = "23-FEBRUARY-2012";
#include <sys/time.h>
#endif
-#if !defined(_WIN32) && !defined(__VMS)
+#if !defined(__VMS)
#include <sys/resource.h>
#include <unistd.h>
#endif
@@ -82,12 +82,6 @@ static char *build_date = "23-FEBRUARY-2012";
#define IDDS_HAVE_STATVFS
#endif
-#if defined(_WIN32)
-#include <windows.h>
-#define MAXPATHLEN 1024
-extern char *optarg;
-#endif
-
#if defined(IDDS_SYSV_INCLUDE) || defined(IDDS_BSD_INCLUDE)
#include <sys/utsname.h>
#include <sys/stat.h>
@@ -1390,16 +1384,15 @@ static void gen_tests (void)
aix_check_patches();
#endif
-#if !defined(_WIN32)
- if (access("/usr/sbin/prtconf",X_OK) == 0) {
+
+if (access("/usr/sbin/prtconf",X_OK) == 0) {
if (flag_debug) printf("DEBUG : /usr/sbin/prtconf\n");
- if (iii_pio_procparse("/usr/sbin/prtconf",
- III_PIO_SZ(ptb_prtconf),
+ if (iii_pio_procparse("/usr/sbin/prtconf", III_PIO_SZ(ptb_prtconf),
ptb_prtconf) == -1) {
- perror("/usr/sbin/prtconf");
+ perror("/usr/sbin/prtconf");
}
- }
-#endif
+}
+
#if defined(__osf__)
phys_mb = (idds_osf_get_memk())/1024;
@@ -1532,12 +1525,10 @@ static void gen_tests (void)
if (flag_debug) printf("DEBUG : %d MB swap configured\n", swap_mb);
}
-#ifndef _WIN32
uid = getuid();
if (uid != 0) {
uid = geteuid();
}
-#endif
#if defined(__sun)
if (uid != 0) {
@@ -1565,11 +1556,9 @@ static void gen_tests (void)
sun_check_etcsystem();
#endif
-#ifndef _WIN32
if (uid != 0) {
printf("\n");
}
-#endif
if (flag_html) printf("</P>\n");
}
@@ -2814,9 +2803,7 @@ static void check_disk_quota(char mntbuf[MAXPATHLEN])
static void disk_tests(void)
{
-#ifndef _WIN32
struct rlimit r;
-#endif
char mntbuf[MAXPATHLEN];
if (client) return;
@@ -2902,7 +2889,6 @@ static void disk_tests(void)
/* The function hasn't been used. #if 0 to get rid of compiler warning */
static int get_disk_usage(char *s)
{
-#ifndef _WIN32
char cmd[8192];
char buf[8192];
FILE *fp;
@@ -2920,15 +2906,11 @@ static int get_disk_usage(char *s)
fclose (fp);
i = atoi(buf);
return (i / 1024);
-#else
- return 0;
-#endif
}
#endif
static void check_mem_size(int ro,char *rn)
{
-#ifndef _WIN32
struct rlimit r;
int rprev;
long m_mb;
@@ -2968,13 +2950,10 @@ static void check_mem_size(int ro,char *rn)
#endif
printf("\n");
}
-
-#endif
}
static void limits_tests(void)
{
-#ifndef _WIN32
struct rlimit r;
#if defined(RLIMIT_NOFILE)
@@ -3055,8 +3034,6 @@ static void limits_tests(void)
#if defined(RLIMIT_AS)
check_mem_size(RLIMIT_AS,"RLIMIT_AS");
#endif
-
-#endif
}
/*
@@ -3068,12 +3045,6 @@ static void ids_get_platform(char *buf)
#if defined(IDDS_LINUX_INCLUDE) || defined(__osf__) || defined(_AIX) || defined(__hpux) || defined(IDDS_BSD_INCLUDE)
struct utsname u;
#endif
-#if defined(_WIN32)
- SYSTEM_INFO sysinfo;
- OSVERSIONINFO osinfo;
- char osbuf[128];
-
-#endif
#if defined(__hpux) || defined(_AIX)
char model[128];
char procstr[128];
@@ -3084,43 +3055,7 @@ static void ids_get_platform(char *buf)
long cpuvers, cputype;
#endif
-#if defined(_WIN32)
- osinfo.dwOSVersionInfoSize = sizeof(osinfo);
- GetSystemInfo(&sysinfo);
- sprintf(osbuf,"win32");
- if (GetVersionEx(&osinfo) != 0) {
- if (osinfo.dwPlatformId == VER_PLATFORM_WIN32_NT) {
- sprintf(osbuf,"winnt%d.%d.%d",
- osinfo.dwMajorVersion,
- osinfo.dwMinorVersion,
- osinfo.dwBuildNumber);
- if (osinfo.szCSDVersion[0]) {
- strcat(osbuf," (");
- strcat(osbuf,osinfo.szCSDVersion);
- strcat(osbuf,")");
- }
- }
- }
-
- switch(sysinfo.wProcessorArchitecture) {
- case PROCESSOR_ARCHITECTURE_INTEL:
- sprintf(buf,"i%d86-unknown-%s",sysinfo.wProcessorLevel,osbuf);
- break;
- case PROCESSOR_ARCHITECTURE_ALPHA:
- sprintf(buf,"alpha%d-unknown-%s",
- sysinfo.wProcessorLevel,osbuf);
- break;
- case PROCESSOR_ARCHITECTURE_MIPS:
- sprintf(buf,"mips-unknown-%s",osbuf);
- break;
- case PROCESSOR_ARCHITECTURE_PPC:
- sprintf(buf,"ppc-unknown-%s",osbuf);
- break;
- case PROCESSOR_ARCHITECTURE_UNKNOWN:
- sprintf(buf,"unknown-unknown-%s",osbuf);
- break;
- }
-#else
+
#if defined(IDDS_LINUX_INCLUDE)
if (uname(&u) == 0) {
sprintf(buf,"%s-unknown-linux%s",
@@ -3247,7 +3182,6 @@ static void ids_get_platform(char *buf)
#endif /* AIX */
#endif /* SUN */
#endif /* LINUX */
-#endif /* WIN32 */
}
static int count_processors(void)
@@ -3304,9 +3238,6 @@ int main(int argc,char *argv[])
{
int i;
-#ifdef _WIN32
-
-#else
while((i = getopt(argc,argv,"DvHqcCi:")) != EOF) {
switch(i) {
case 'D':
@@ -3336,7 +3267,6 @@ int main(int argc,char *argv[])
break;
}
}
-#endif
#if defined(_AIX)
if (1) {
diff --git a/lib/base/dns.cpp b/lib/base/dns.cpp
index 62d3e44..8704a39 100644
--- a/lib/base/dns.cpp
+++ b/lib/base/dns.cpp
@@ -48,20 +48,14 @@
#define DNS_GUESSING
#include "netsite.h"
-#ifdef XP_UNIX
#include "systems.h"
-#else /* XP_WIN32 */
-#include "base/systems.h"
-#endif /* XP_WIN32 */
/* Under NT, these are taken care of by net.h including winsock.h */
-#ifdef XP_UNIX
#include <arpa/inet.h> /* inet_ntoa */
#include <netdb.h> /* struct hostent */
#ifdef NEED_GHN_PROTO
extern "C" int gethostname (char *name, size_t namelen);
#endif
-#endif
#include <stdio.h>
#include <nspr.h>
diff --git a/lib/base/dnsdmain.cpp b/lib/base/dnsdmain.cpp
index 7cbc056..7430077 100644
--- a/lib/base/dnsdmain.cpp
+++ b/lib/base/dnsdmain.cpp
@@ -49,16 +49,11 @@
#include "netsite.h"
#include <string.h>
#include <stdio.h>
-#ifdef XP_UNIX
#include <unistd.h>
-#endif
#include <ctype.h>
#include "util.h"
-
-/* Under NT, this is taken care of by net.h including winsock.h */
-#ifdef XP_UNIX
#include <netdb.h> /* struct hostent */
-#endif
+
extern "C" {
#include <nspr.h>
}
@@ -68,7 +63,6 @@ extern "C" {
/* This is contained in resolv.h on most systems. */
#define _PATH_RESCONF "/etc/resolv.conf"
-#ifdef XP_UNIX
NSPR_BEGIN_EXTERN_C
#ifdef Linux
extern int getdomainname(char *, size_t);
@@ -83,7 +77,6 @@ extern int gethostname (char *name, int namelen);
#endif
#endif
NSPR_END_EXTERN_C
-#endif
/* ---------------------------- dns_guess_domain -------------------------- */
diff --git a/lib/base/file.cpp b/lib/base/file.cpp
index 82a1852..b3f7234 100644
--- a/lib/base/file.cpp
+++ b/lib/base/file.cpp
@@ -57,18 +57,7 @@
#include <stdlib.h>
#include <signal.h>
#endif
-#ifdef XP_WIN32
-#include <time.h> /* time */
-#include <sys/stat.h> /* stat */
-#include <errno.h>
-#include <direct.h>
-#include <base/nterr.h>
-/* Removed for ns security integration
-#include <xp_error.h>
-*/
-#endif
#include <prerror.h>
-
#include "private/pprio.h"
#include "prlock.h"
@@ -89,60 +78,8 @@ PRLock *_atomic_write_lock = NULL;
*/
NSAPI_PUBLIC int system_stat(char *path, struct stat *finfo)
{
-#ifdef XP_WIN32
-
- int chop, l;
-
-/* The NT stat is very peculiar about directory names. */
-/* XXX aruna - there is a bug here, maybe in the C runtime.
- * Stating the same path in a separate program succeeds. From
- * jblack's profiling, this needs to be replaced by the Win32
- * calls anyway.*/
-
- l = strlen(path);
- if((path[l - 1] == '/') &&
- (!(isalpha(path[0]) && (!strcmp(&path[1], ":/")))))
- {
- chop = 1;
- path[--l] = '\0';
- }
- else chop = 0;
-#endif /* XP_WIN32 */
-
-#ifdef XP_UNIX
if(stat(path, finfo) == -1)
return -1;
-#else /* XP_WIN32 */
-
- if(_stat(path, (struct _stat *)finfo) == -1) {
- /* XXXMB - this sucks;
- * try to convert to an error code we'll expect...
- */
- switch(errno) {
- case ENOENT: PR_SetError(PR_FILE_NOT_FOUND_ERROR, errno); break;
- default: PR_SetError(PR_UNKNOWN_ERROR, errno); break;
- }
- return -1;
- }
-
- /* NT sets the time fields to -1 if it thinks that the file
- * is a device ( like com1.html, lpt1.html etc) In this case
- * simply set last modified time to the current time....
- */
-
- if (finfo->st_mtime == -1) {
- finfo->st_mtime = time(NULL);
- }
- if (finfo->st_atime == -1) {
- finfo->st_atime = 0;
- }
- if (finfo->st_ctime == -1) {
- finfo->st_ctime = 0;
- }
- if(chop)
- path[l++] = '/';
-
-#endif /* XP_WIN32 */
if(S_ISREG(finfo->st_mode) && (path[strlen(path) - 1] == '/')) {
/* File with trailing slash */
@@ -173,7 +110,6 @@ NSAPI_PUBLIC int system_fwrite(SYS_FILE fd, char *buf, int sz) {
/* ---------------------------- Standard UNIX ----------------------------- */
-#ifdef XP_UNIX
#include <sys/file.h> /* flock */
@@ -225,20 +161,11 @@ NSAPI_PUBLIC int system_nocoredumps(void)
return 0;
#endif
}
-#endif /* XP_UNIX */
/* --------------------------- file_setinherit ---------------------------- */
NSAPI_PUBLIC int file_setinherit(SYS_FILE fd, int value)
{
-#if defined(XP_WIN32)
- int ret;
-
-// ret = SetHandleInformation((HANDLE)PR_FileDesc2NativeHandle(fd), 0, value?HANDLE_FLAG_INHERIT:0);
- // This function did nothing before since the mask was set to 0.
- ret = SetHandleInformation((HANDLE)PR_FileDesc2NativeHandle(fd), HANDLE_FLAG_INHERIT, value?HANDLE_FLAG_INHERIT:0);
- return ret==0?-1:0;
-#elif defined(XP_UNIX)
int flags = 0;
PRInt32 nativeFD;
PRFileDesc *bottom = fd;
@@ -272,7 +199,6 @@ fprintf(stderr, "\nInfo(file_setinherit): Native file descriptor is %d\n", nativ
fcntl(PR_FileDesc2NativeHandle(fd), F_SETFD, flags);
return 0;
*/
-#endif
}
NSAPI_PUBLIC SYS_FILE system_fopenRO(char *p)
@@ -317,197 +243,14 @@ NSAPI_PUBLIC int system_fclose(SYS_FILE fd)
}
-#ifdef FILE_WIN32
-
-int CgiBuffering;
-
-NSAPI_PUBLIC SYS_FILE system_fopen(char *path, int access, int flags)
-{
- char p2[MAX_PATH];
- SYS_FILE ret;
- HANDLE fd;
-
- if (strlen(path) >= MAX_PATH) {
- return SYS_ERROR_FD;
- }
-
- file_unix2local(path, p2);
-
- fd = CreateFile(p2, access, FILE_SHARE_READ | FILE_SHARE_WRITE,
- NULL, flags, 0, NULL);
- ret = PR_ImportFile((int32)fd);
-
- if(ret == INVALID_HANDLE_VALUE)
- return SYS_ERROR_FD;
-
- return ret;
-}
-
-
-
-NSAPI_PUBLIC int system_pread(SYS_FILE fd, char *buf, int BytesToRead) {
- unsigned long BytesRead = 0;
- int result = 0;
- BOOLEAN TimeoutSet = FALSE;
-
- /* XXXMB - nspr20 should be able to do this; but right now it doesn't
- * return proper error info.
- * fix it later...
- */
- if(ReadFile((HANDLE)PR_FileDesc2NativeHandle(fd), (LPVOID)buf, BytesToRead, &BytesRead, NULL) == FALSE) {
- if (GetLastError() == ERROR_BROKEN_PIPE) {
- return IO_EOF;
- } else {
- return IO_ERROR;
- }
- }
- return (BytesRead ? BytesRead : IO_EOF);
-}
-
-NSAPI_PUBLIC int system_pwrite(SYS_FILE fd, char *buf, int BytesToWrite)
-{
- unsigned long BytesWritten;
-
- if (WriteFile((HANDLE)PR_FileDesc2NativeHandle(fd), (LPVOID)buf,
- BytesToWrite, &BytesWritten, NULL) == FALSE) {
- return IO_ERROR;
- }
- return BytesWritten;
-}
-
-
-NSAPI_PUBLIC int system_fwrite_atomic(SYS_FILE fd, char *buf, int sz)
-{
- int ret;
-
-#if 0
- if(system_flock(fd) == IO_ERROR)
- return IO_ERROR;
-#endif
- /* XXXMB - this is technically thread unsafe, but it catches any
- * callers of fwrite_atomic when we're single threaded and just coming
- * to life.
- */
- if (!_atomic_write_lock) {
- _atomic_write_lock = PR_NewLock();
- }
- PR_Lock(_atomic_write_lock);
- ret = system_fwrite(fd,buf,sz);
- PR_Unlock(_atomic_write_lock);
-#if 0
- if(system_ulock(fd) == IO_ERROR)
- return IO_ERROR;
-#endif
- return ret;
-}
-
-
-NSAPI_PUBLIC void file_unix2local(char *path, char *p2)
-{
- /* Try to handle UNIX-style paths */
- if((!strchr(path, FILE_PATHSEP))) {
- int x;
-
- for(x = 0; path[x]; x++)
- p2[x] = (path[x] == '/' ? '\\' : path[x]);
- p2[x] = '\0';
- }
- else
- strcpy(p2, path);
-}
-
-
-NSAPI_PUBLIC int system_nocoredumps(void)
-{
- return 0;
-}
-
-/* --------------------------- system_winerr ------------------------------ */
-
-
-#include <winsock.h>
-#include <errno.h>
-#include "util.h"
-
-NSAPI_PUBLIC char *system_winsockerr(void)
-{
- int errn = WSAGetLastError();
-
- return FindError(errn);
-}
-
-NSAPI_PUBLIC char *system_winerr(void)
-{
- int errn = GetLastError();
-
- if (errn == 0)
- errn = WSAGetLastError();
- return FindError(errn);
-}
-
-/* ------------------------- Dir related stuff ---------------------------- */
-
-
-NSAPI_PUBLIC SYS_DIR dir_open(char *pathp)
-{
- dir_s *ret = (dir_s *) MALLOC(sizeof(dir_s));
- char path[MAX_PATH];
- int l;
-
- if (strlen(pathp) >= MAX_PATH) {
- return NULL;
- }
-
- l = util_sprintf(path, "%s", pathp) - 1;
- path[strlen(pathp)] = '\0';
- if(path[strlen(path) - 1] != FILE_PATHSEP)
- strcpy (path + strlen(path), "\\*.*");
- else
- util_sprintf(path, "%s*.*", path);
-
- ret->de.d_name = NULL;
- if( (ret->dp = FindFirstFile(path, &ret->fdata)) != INVALID_HANDLE_VALUE)
- return ret;
- FREE(ret);
- return NULL;
-}
-
-NSAPI_PUBLIC SYS_DIRENT *dir_read(SYS_DIR ds)
-{
- if(FindNextFile(ds->dp, &ds->fdata) == FALSE)
- return NULL;
- if(ds->de.d_name)
- FREE(ds->de.d_name);
- ds->de.d_name = STRDUP(ds->fdata.cFileName);
-
- return &ds->de;
-}
-
-NSAPI_PUBLIC void dir_close(SYS_DIR ds)
-{
- FindClose(ds->dp);
- if(ds->de.d_name)
- FREE(ds->de.d_name);
- FREE(ds);
-}
-
-#endif /* FILE_WIN32 */
-
NSAPI_PUBLIC int file_notfound(void)
{
-#ifdef FILE_WIN32
- int errn = PR_GetError();
- return (errn == PR_FILE_NOT_FOUND_ERROR);
-#else
return (errno == ENOENT);
-#endif
}
-#ifdef XP_UNIX
#if !defined(SNI) && !defined(LINUX)
extern char *sys_errlist[];
#endif /* SNI */
-#endif
#define ERRMSG_SIZE 35
#ifdef THREAD_ANY
@@ -528,9 +271,6 @@ void system_errmsg_init(void)
#if defined(THREAD_ANY)
errmsg_key = systhread_newkey();
#endif
-#ifdef XP_WIN32
- HashNtErrors();
-#endif
if (!_atomic_write_lock)
_atomic_write_lock = PR_NewLock();
}
@@ -542,9 +282,6 @@ NSAPI_PUBLIC int system_errmsg_fn(char **buff, size_t maxlen)
char *lmsg = 0; /* Local message pointer */
size_t msglen = 0;
PRErrorCode nscp_error;
-#ifdef XP_WIN32
- LPTSTR sysmsg = 0;
-#endif
nscp_error = PR_GetError();
@@ -566,21 +303,6 @@ NSAPI_PUBLIC int system_errmsg_fn(char **buff, size_t maxlen)
lmsg = static_error;
}
} else {
-#if defined(XP_WIN32)
- msglen = FormatMessage(
- FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_ALLOCATE_BUFFER,
- NULL,
- GetLastError(),
- LOCALE_SYSTEM_DEFAULT,
- (LPTSTR)&sysmsg,
- 0,
- 0);
- if (msglen > 0)
- lmsg = sysmsg;
- else
- lmsg = system_winerr();
- SetLastError(0);
-#else
/* replaced
#if defined(SNI) || defined(LINUX)
/ C++ platform has no definition for sys_errlist /
@@ -589,9 +311,8 @@ NSAPI_PUBLIC int system_errmsg_fn(char **buff, size_t maxlen)
lmsg = sys_errlist[errno];
#endif
with lmsg =strerror(errno);*/
- lmsg=strerror(errno);
+ lmsg=strerror(errno);
errno = 0;
-#endif
}
/* At this point lmsg points to something. */
@@ -604,12 +325,6 @@ with lmsg =strerror(errno);*/
else
msglen = 0;
-#ifdef XP_WIN32
- /* NT's FormatMessage() dynamically allocated the msg; free it */
- if (sysmsg)
- LocalFree(sysmsg);
-#endif
-
return msglen;
}
diff --git a/lib/base/fsmutex.cpp b/lib/base/fsmutex.cpp
index f43f4c0..47eceaf 100644
--- a/lib/base/fsmutex.cpp
+++ b/lib/base/fsmutex.cpp
@@ -54,14 +54,9 @@
#endif
#include "base/util.h"
-#ifdef XP_WIN32
-typedef HANDLE sys_fsmutex_t;
-#endif
-#ifdef XP_UNIX
#include "base/file.h"
typedef SYS_FILE sys_fsmutex_t;
-#endif
typedef struct {
@@ -78,7 +73,6 @@ typedef struct {
/* ----------------------------- fsmutex_init ----------------------------- */
-#ifdef XP_UNIX
static int
_fsmutex_create(fsmutex_s *fsm, char *name, int number)
{
@@ -99,21 +93,6 @@ _fsmutex_create(fsmutex_s *fsm, char *name, int number)
fsm->mutex = lfd;
return 0;
}
-#endif
-
-#ifdef XP_WIN32
-static int
-_fsmutex_create(fsmutex_s *fsm, char *name, int number)
-{
- char tn[256];
- util_snprintf(tn, sizeof(tn), "%s.%d", name, number);
-
- fsm->id = NULL;
- fsm->mutex = CreateMutex(NULL, FALSE,
- (fsm->flags & FSMUTEX_VISIBLE ? tn : NULL));
- return (fsm->mutex ? 0 : -1);
-}
-#endif
NSAPI_PUBLIC FSMUTEX
fsmutex_init(char *name, int number, int flags)
@@ -132,20 +111,16 @@ fsmutex_init(char *name, int number, int flags)
return (FSMUTEX) ret;
}
-#ifdef XP_UNIX
NSAPI_PUBLIC void
fsmutex_setowner(FSMUTEX fsm, uid_t uid, gid_t gid)
{
if(!geteuid())
(void) chown( ((fsmutex_s *)fsm)->id, uid, gid);
}
-#endif
/* -------------------------- fsmutex_terminate --------------------------- */
-
-#ifdef XP_UNIX
static void
_fsmutex_delete(fsmutex_s *fsm)
{
@@ -154,15 +129,6 @@ _fsmutex_delete(fsmutex_s *fsm)
PERM_FREE(fsm->id);
PR_Close(fsm->mutex);
}
-#endif
-
-#ifdef XP_WIN32
-static void
-_fsmutex_delete(fsmutex_s *fsm)
-{
- CloseHandle(fsm->mutex);
-}
-#endif
NSAPI_PUBLIC void
fsmutex_terminate(FSMUTEX id)
@@ -189,7 +155,6 @@ fsmutex_lock(FSMUTEX id)
if(fsm->flags & FSMUTEX_NEEDCRIT)
crit_enter(fsm->crit);
#endif
-#ifdef XP_UNIX
#ifdef THREAD_NSPR_USER
/* Poll to avoid blocking. XXXrobm If errno is wrong this may go awry. */
while(system_tlock(fsm->mutex) == -1)
@@ -197,10 +162,6 @@ fsmutex_lock(FSMUTEX id)
#else
system_flock(fsm->mutex );
#endif
-#endif
-#ifdef XP_WIN32
- WaitForSingleObject(fsm->mutex, INFINITE);
-#endif
}
@@ -211,12 +172,7 @@ NSAPI_PUBLIC void
fsmutex_unlock(FSMUTEX id)
{
fsmutex_s *fsm = (fsmutex_s *) id;
-#ifdef XP_UNIX
system_ulock(fsm->mutex);
-#endif
-#ifdef XP_WIN32
- ReleaseMutex(fsm->mutex);
-#endif
#ifdef THREAD_ANY
if(fsm->flags & FSMUTEX_NEEDCRIT)
crit_exit(fsm->crit);
diff --git a/lib/base/net.cpp b/lib/base/net.cpp
index 53c79f3..17f9d14 100644
--- a/lib/base/net.cpp
+++ b/lib/base/net.cpp
@@ -55,13 +55,11 @@
#include "util.h"
#include <string.h>
-#ifdef XP_UNIX
#include <arpa/inet.h> /* inet_ntoa */
#include <netdb.h> /* hostent stuff */
#ifdef NEED_GHN_PROTO
extern "C" int gethostname (char *name, size_t namelen);
#endif
-#endif /* XP_UNIX */
#ifdef LINUX
#include <sys/ioctl.h> /* ioctl */
#endif
@@ -71,11 +69,7 @@ extern "C" int gethostname (char *name, size_t namelen);
/* ---------------------------- util_hostname ----------------------------- */
-#ifdef XP_UNIX
#include <sys/param.h>
-#else /* WIN32 */
-#define MAXHOSTNAMELEN 255
-#endif /* XP_UNIX */
/* Defined in dns.cpp */
char *net_find_fqdn(PRHostEnt *p);
diff --git a/lib/base/shexp.cpp b/lib/base/shexp.cpp
index 11938cb..9783c30 100644
--- a/lib/base/shexp.cpp
+++ b/lib/base/shexp.cpp
@@ -239,11 +239,7 @@ int _shexp_match(char *str, char *exp)
case '\\':
++y;
default:
-#ifdef XP_UNIX
if(str[x] != exp[y])
-#else /* XP_WIN32 */
- if(strnicmp(str + x, exp + y, 1))
-#endif /* XP_WIN32 */
ret = NOMATCH;
break;
}
@@ -286,11 +282,7 @@ NSAPI_PUBLIC int shexp_cmp(char *str, char *exp)
case INVALID_SXP:
return -1;
case NON_SXP:
-#ifdef XP_UNIX
return (strcmp(exp,str) ? 1 : 0);
-#else /* XP_WIN32 */
- return (stricmp(exp,str) ? 1 : 0);
-#endif /* XP_WIN32 */
default:
return shexp_match(str, exp);
}
diff --git a/lib/base/system.cpp b/lib/base/system.cpp
index c4cbfd0..0138172 100644
--- a/lib/base/system.cpp
+++ b/lib/base/system.cpp
@@ -50,10 +50,6 @@
#include "prlog.h"
#include "base/ereport.h"
-#ifdef XP_WIN32
-#include <windows.h>
-#endif
-
#include "base/systems.h" /* find out if we have malloc pools */
static int thread_malloc_key = -1;
diff --git a/lib/base/systhr.cpp b/lib/base/systhr.cpp
index 87d3252..6bf64bd 100644
--- a/lib/base/systhr.cpp
+++ b/lib/base/systhr.cpp
@@ -67,18 +67,6 @@ int32 PR_SetSysfdTableSize(int table_size);
#endif
#include "systems.h"
-#ifdef THREAD_WIN32
-#include <process.h>
-
-typedef struct {
- HANDLE hand;
- DWORD id;
-} sys_thread_s;
-
-#endif
-
-
-
#if defined (USE_NSPR)
#if defined(__hpux) && defined(__ia64)
@@ -173,7 +161,6 @@ NSAPI_PUBLIC void systhread_sleep(int milliseconds)
NSAPI_PUBLIC void systhread_init(char *name)
{
PR_Init(PR_USER_THREAD, PR_PRIORITY_NORMAL, 256);
-#ifdef XP_UNIX
#ifdef LINUX
/*
* NSPR 4.6 does not export PR_SetSysfdTableSize
@@ -192,7 +179,6 @@ NSAPI_PUBLIC void systhread_init(char *name)
#else
PR_SetSysfdTableSize(PR_GetSysfdTableMax());
#endif
-#endif
}
@@ -223,83 +209,5 @@ NSAPI_PUBLIC void systhread_dummy(void)
}
-#elif defined(THREAD_WIN32)
-
-#include <nspr/prthread.h>
-#define DEFAULT_STACKSIZE 262144
-
-NSPR_BEGIN_EXTERN_C
-
-NSAPI_PUBLIC
-SYS_THREAD systhread_start(int prio, int stksz, void (*fn)(void *), void *arg)
-{
- sys_thread_s *ret = (sys_thread_s *) MALLOC(sizeof(sys_thread_s));
-
- if ((ret->hand = (HANDLE)_beginthreadex(NULL, stksz, (unsigned (__stdcall *)(void *))fn,
- arg, 0, &ret->id)) == 0) {
- FREE(ret);
- return NULL;
- }
- return (void *)ret;
-}
-
-NSPR_END_EXTERN_C
-
-NSAPI_PUBLIC SYS_THREAD systhread_current(void)
-{
- /* XXXrobm this is busted.... */
- return GetCurrentThread();
-}
-
-NSAPI_PUBLIC void systhread_timerset(int usec)
-{
-}
-
-NSAPI_PUBLIC SYS_THREAD systhread_attach(void)
-{
- return NULL;
-}
-
-NSAPI_PUBLIC void systhread_yield(void)
-{
- systhread_sleep(0);
-}
-
-NSAPI_PUBLIC void systhread_terminate(SYS_THREAD thr)
-{
- TerminateThread(((sys_thread_s *)thr)->hand, 0);
-}
-
-
-NSAPI_PUBLIC void systhread_sleep(int milliseconds)
-{
- /* XXXrobm there must be a better way to do this */
- HANDLE sem = CreateSemaphore(NULL, 1, 4, "sleeper");
- WaitForSingleObject(sem, INFINITE);
- WaitForSingleObject(sem, milliseconds);
- CloseHandle(sem);
-}
-
-NSAPI_PUBLIC void systhread_init(char *name)
-{
- PR_Init(PR_USER_THREAD, 1, 0);
-}
-
-
-NSAPI_PUBLIC int systhread_newkey()
-{
- return TlsAlloc();
-}
-
-NSAPI_PUBLIC void *systhread_getdata(int key)
-{
- return (void *)TlsGetValue(key);
-}
-
-NSAPI_PUBLIC void systhread_setdata(int key, void *data)
-{
- TlsSetValue(key, data);
-}
-
#endif
diff --git a/lib/base/util.cpp b/lib/base/util.cpp
index 164d1a0..5ab096a 100644
--- a/lib/base/util.cpp
+++ b/lib/base/util.cpp
@@ -47,18 +47,12 @@
* Rob McCool
*/
-#ifdef XP_UNIX
#include <sys/types.h>
#include <sys/wait.h>
#include <stdlib.h>
#include "prthread.h"
-#endif /* XP_UNIX */
-
#include "base/util.h"
-
-#ifdef XP_UNIX
#include <sys/types.h>
-#endif /* WIN32 */
/* ------------------------------ util_itoa ------------------------------- */
@@ -225,12 +219,10 @@ int util_strncasecmp(CASECMPARG_T char *one, CASECMPARG_T char *two, int n)
static char sccsid[] = "@(#)strftime.c 5.11 (Berkeley) 2/24/91";
#endif /* LIBC_SCCS and not lint */
-#ifdef XP_UNIX
#include <sys/types.h>
#include <sys/time.h>
#include <string.h>
#include <stdio.h>
-#endif
static const char *afmt[] = {
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat",
diff --git a/lib/ldaputil/dbconf.c b/lib/ldaputil/dbconf.c
index 1ffdab7..0642d02 100644
--- a/lib/ldaputil/dbconf.c
+++ b/lib/ldaputil/dbconf.c
@@ -431,21 +431,17 @@ int dbconf_read_config_file_sub (const char *file,
buf[0] = 0;
-#ifdef XP_WIN32
- if ((fp = fopen(file, "rt")) == NULL)
-#else
if ((fp = fopen(file, "r")) == NULL)
-#endif
{
- return LDAPU_ERR_CANNOT_OPEN_FILE;
+ return LDAPU_ERR_CANNOT_OPEN_FILE;
}
/* Allocate DBConfInfo_t */
conf_info = (DBConfInfo_t *)malloc(sizeof(DBConfInfo_t));
if (!conf_info) {
- fclose(fp);
- return LDAPU_ERR_OUT_OF_MEMORY;
+ fclose(fp);
+ return LDAPU_ERR_OUT_OF_MEMORY;
}
memset((void *)conf_info, 0, sizeof(DBConfInfo_t));
@@ -459,11 +455,11 @@ int dbconf_read_config_file_sub (const char *file,
}
if (rv != LDAPU_SUCCESS) {
- dbconf_free_confinfo(conf_info);
- *conf_info_out = 0;
+ dbconf_free_confinfo(conf_info);
+ *conf_info_out = 0;
}
else {
- *conf_info_out = conf_info;
+ *conf_info_out = conf_info;
}
fclose(fp);
@@ -489,13 +485,9 @@ int dbconf_read_default_dbinfo_sub (const char *file,
buf[0] = 0;
-#ifdef XP_WIN32
- if ((fp = fopen(file, "rt")) == NULL)
-#else
if ((fp = fopen(file, "r")) == NULL)
-#endif
{
- return LDAPU_ERR_CANNOT_OPEN_FILE;
+ return LDAPU_ERR_CANNOT_OPEN_FILE;
}
/* Read each db info until eof or dbname == default*/
@@ -504,16 +496,16 @@ int dbconf_read_default_dbinfo_sub (const char *file,
while(!eof &&
((rv = read_db_info(fp, buf, &db_info, directive, directive_len, &eof)) == LDAPU_SUCCESS))
{
- if (!strcmp(db_info->dbname, DBCONF_DEFAULT_DBNAME)) break;
- dbconf_free_dbinfo(db_info);
- db_info = NULL;
+ if (!strcmp(db_info->dbname, DBCONF_DEFAULT_DBNAME)) break;
+ dbconf_free_dbinfo(db_info);
+ db_info = NULL;
}
if (rv != LDAPU_SUCCESS) {
- *db_info_out = 0;
+ *db_info_out = 0;
}
else {
- *db_info_out = db_info;
+ *db_info_out = db_info;
}
fclose(fp);
@@ -533,25 +525,11 @@ NSAPI_PUBLIC int dbconf_read_default_dbinfo (const char *file,
*/
int ldapu_strcasecmp (const char *s1, const char *s2)
{
-#ifdef XP_WIN32
- int ls1, ls2; /* tolower values of chars in s1 & s2 resp. */
-#endif
if (!s1) return !s2 ? 0 : 0-tolower(*s2);
else if (!s2) return tolower(*s1);
-#ifdef XP_WIN32
- while(*s1 && *s2 && (ls1 = tolower(*s1)) == (ls2 = tolower(*s2))) { s1++; s2++; }
-
- if (!*s1)
- return *s2 ? 0-tolower(*s2) : 0;
- else if (!*s2)
- return tolower(*s1);
- else
- return ls1 - ls2;
-#else
return strcasecmp(s1, s2);
-#endif
}
NSAPI_PUBLIC int ldapu_dbinfo_attrval (DBConfDBInfo_t *db_info,
diff --git a/lib/ldaputil/init.c b/lib/ldaputil/init.c
index ffbde7e..9dbed5f 100644
--- a/lib/ldaputil/init.c
+++ b/lib/ldaputil/init.c
@@ -56,12 +56,6 @@
#include "slapi-plugin.h"
-#ifdef XP_WIN32
-#define DLL_SUFFIX ".dll"
-#ifndef FILE_PATHSEP
-#define FILE_PATHSEP '\\'
-#endif
-#else
#ifndef FILE_PATHSEP
#define FILE_PATHSEP '/'
#endif
@@ -74,7 +68,6 @@
#else
#define DLL_SUFFIX ".so"
#endif
-#endif
static int load_server_libs (const char *dir)
{
@@ -189,9 +182,7 @@ static LDAPUDispatchVector_t __ldapu_vector = {
ldapu_free
};
-#ifdef XP_UNIX
LDAPUDispatchVector_t *__ldapu_table = &__ldapu_vector;
-#endif
#if 0
NSAPI_PUBLIC int CertMapDLLInitFn(LDAPUDispatchVector_t **table)
diff --git a/lib/libaccess/acl.yy.cpp b/lib/libaccess/acl.yy.cpp
index 7f81da0..012d3d0 100644
--- a/lib/libaccess/acl.yy.cpp
+++ b/lib/libaccess/acl.yy.cpp
@@ -474,11 +474,7 @@ char *acltext;
#include <stdio.h>
#include <ctype.h>
#include <libaccess/aclerror.h>
-#ifdef XP_WIN32
-#include <io.h>
-#endif
#include "plstr.h"
-
#include "parse.h"
#include "aclscan.h"
diff --git a/lib/libaccess/aclscan.l b/lib/libaccess/aclscan.l
index fc96691..7f8c535 100644
--- a/lib/libaccess/aclscan.l
+++ b/lib/libaccess/aclscan.l
@@ -50,11 +50,7 @@
#include <stdio.h>
#include <ctype.h>
#include <libaccess/aclerror.h>
-#ifdef XP_WIN32
-#include <io.h>
-#endif
#include "plstr.h"
-
#include "parse.h"
#include "aclscan.h"
diff --git a/lib/libaccess/lasdns.cpp b/lib/libaccess/lasdns.cpp
index 93730c7..1958e82 100644
--- a/lib/libaccess/lasdns.cpp
+++ b/lib/libaccess/lasdns.cpp
@@ -47,18 +47,11 @@
#include <stdio.h>
#include <string.h>
-
-#ifdef XP_WIN32
-/* #include <winsock2.h> */
-#include <winsock.h>
-#else
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
-#endif
-
#include <netsite.h>
extern "C" {
#include <prnetdb.h>
diff --git a/lib/libaccess/permhash.h b/lib/libaccess/permhash.h
index e47281c..b661c3f 100644
--- a/lib/libaccess/permhash.h
+++ b/lib/libaccess/permhash.h
@@ -100,11 +100,7 @@ PR_CompareCaseStrings(const void *v1, const void *v2)
const char *s1 = (const char *)v1;
const char *s2 = (const char *)v2;
-#ifdef XP_WIN32
- return (util_strcasecmp(s1, s2) == 0);
-#else
return (strcasecmp(s1, s2) == 0);
-#endif
}
#endif /* NO_ACL_HASH_FUNCS */
diff --git a/lib/libadmin/error.c b/lib/libadmin/error.c
index a277cd8..b6d6754 100644
--- a/lib/libadmin/error.c
+++ b/lib/libadmin/error.c
@@ -50,10 +50,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#ifdef XP_WIN32
-#include <windows.h>
-#include "base/nterr.h"
-#endif
#include <base/file.h>
#define ERROR_HTML "error.html"
@@ -70,22 +66,9 @@ char *error_headers[MAX_ERROR] =
"Unexpected Failure",
"Warning"};
-#ifdef XP_UNIX
#define get_error() errno
#define verbose_error() system_errmsg()
-#else /* XP_WIN32 */
-int get_error()
-{
- int error = GetLastError();
- return(error ? error: WSAGetLastError());
-}
-char *verbose_error()
-{
- /* Initialize error hash tables */
- HashNtErrors();
- return alert_word_wrap(system_errmsg(), WORD_WRAP_WIDTH, "\\n");
-}
-#endif /* XP_WIN32 */
+
void _report_error(int type, char *info, char *details, int shouldexit)
{
@@ -100,9 +83,6 @@ void _report_error(int type, char *info, char *details, int shouldexit)
fprintf(stdout, "</SCRIPT>\n");
if(shouldexit) {
-#ifdef XP_WIN32
- WSACleanup();
-#endif
exit(0);
}
}
diff --git a/lib/libadmin/util.c b/lib/libadmin/util.c
index bbc6804..e187e05 100644
--- a/lib/libadmin/util.c
+++ b/lib/libadmin/util.c
@@ -51,33 +51,24 @@
#include "private/pprio.h"
#include <base/file.h>
-#ifdef XP_UNIX
#include <dirent.h>
#include <sys/types.h>
#include <fcntl.h>
-#else
-#include <sys/stat.h>
-#endif /* WIN32? */
-
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
-#ifdef XP_UNIX
+
SYS_FILE lf;
-#elif defined(XP_WIN32)
-HANDLE lf;
-#endif
+
char *get_flock_path(void)
{
char *result="";
char *port=getenv("SERVER_PORT");
-#ifdef XP_UNIX
result=(char *) MALLOC(strlen("/tmp/lock.%%s.")+strlen(port)+4);
sprintf(result, "/tmp/lock.%%s.%s", port);
-#endif
return result;
}
8 years, 10 months
ldap/servers
by Noriko Hosoi
ldap/servers/slapd/libglobs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 37eca99e53144274efed4f0eb7ce2a3f05e10f81
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Tue Jun 9 21:10:46 2015 -0700
Ticket #48191 - RFE: Adding nsslapd-maxsimplepaged-per-conn Adding nsslapd-maxsimplepaged-per-conn
Description: Fixing an error reported by the jenkins test, which was introduced
by commit 54a680b74f2995f3476c19fc80ddf514a5711930.
diff --git a/ldap/servers/slapd/libglobs.c b/ldap/servers/slapd/libglobs.c
index 3b53f32..d68ec33 100644
--- a/ldap/servers/slapd/libglobs.c
+++ b/ldap/servers/slapd/libglobs.c
@@ -1136,7 +1136,7 @@ static struct config_get_and_set {
{CONFIG_MAXSIMPLEPAGED_PER_CONN_ATTRIBUTE, config_set_maxsimplepaged_per_conn,
NULL, 0,
(void**)&global_slapdFrontendConfig.maxsimplepaged_per_conn,
- CONFIG_INT, config_get_maxsimplepaged_per_conn, DEFAULT_MAXSIMPLEPAGED_PER_CONN_STR},
+ CONFIG_INT, (ConfigGetFunc)config_get_maxsimplepaged_per_conn, DEFAULT_MAXSIMPLEPAGED_PER_CONN_STR},
#ifdef ENABLE_NUNC_STANS
,{CONFIG_ENABLE_NUNC_STANS, config_set_enable_nunc_stans,
NULL, 0,
8 years, 10 months
dirsrvtests/tickets ldap/servers
by Mark Reynolds
dirsrvtests/tickets/ticket48170_test.py | 88 +++++++++++++++++++++++
ldap/servers/slapd/back-ldbm/ldbm_attr.c | 30 ++++---
ldap/servers/slapd/back-ldbm/ldbm_index_config.c | 10 ++
ldap/servers/slapd/back-ldbm/proto-back-ldbm.h | 2
4 files changed, 113 insertions(+), 17 deletions(-)
New commits:
commit fe647caff4da5939f8e0a927ab3b3c7360929d6d
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Tue Jun 9 19:20:31 2015 -0400
Ticket 48170 - Parse nsIndexType correctly
Bug Description: When parsing the nsIndexType attribute value, we were
only checking the length of the value to compare. If
there were additional characters, or index types, they
would be silently ignored.
Fix Description: Properly check the value of nsIndexType, and return an
error where appropriate, and improve error logging to
include index entry
https://fedorahosted.org/389/ticket/48170
Reviewed by: rmeggins(Thanks!)
diff --git a/dirsrvtests/tickets/ticket48170_test.py b/dirsrvtests/tickets/ticket48170_test.py
new file mode 100644
index 0000000..82c5815
--- /dev/null
+++ b/dirsrvtests/tickets/ticket48170_test.py
@@ -0,0 +1,88 @@
+import os
+import sys
+import time
+import ldap
+import logging
+import pytest
+from lib389 import DirSrv, Entry, tools, tasks
+from lib389.tools import DirSrvTools
+from lib389._constants import *
+from lib389.properties import *
+from lib389.tasks import *
+from lib389.utils import *
+
+logging.getLogger(__name__).setLevel(logging.DEBUG)
+log = logging.getLogger(__name__)
+
+installation1_prefix = None
+
+
+class TopologyStandalone(object):
+ def __init__(self, standalone):
+ standalone.open()
+ self.standalone = standalone
+
+
+(a)pytest.fixture(scope="module")
+def topology(request):
+ global installation1_prefix
+ if installation1_prefix:
+ args_instance[SER_DEPLOYED_DIR] = installation1_prefix
+
+ # Creating standalone instance ...
+ standalone = DirSrv(verbose=False)
+ args_instance[SER_HOST] = HOST_STANDALONE
+ args_instance[SER_PORT] = PORT_STANDALONE
+ args_instance[SER_SERVERID_PROP] = SERVERID_STANDALONE
+ args_instance[SER_CREATION_SUFFIX] = DEFAULT_SUFFIX
+ args_standalone = args_instance.copy()
+ standalone.allocate(args_standalone)
+ instance_standalone = standalone.exists()
+ if instance_standalone:
+ standalone.delete()
+ standalone.create()
+ standalone.open()
+
+ # Clear out the tmp dir
+ standalone.clearTmpDir(__file__)
+
+ return TopologyStandalone(standalone)
+
+
+def test_ticket48170(topology):
+ '''
+ Attempt to add a nsIndexType wikth an invalid value: "eq,pres"
+ '''
+
+ INDEX_DN = 'cn=cn,cn=index,cn=userroot,cn=ldbm database,cn=plugins,cn=config'
+ REJECTED = False
+ try:
+ topology.standalone.modify_s(INDEX_DN, [(ldap.MOD_ADD, 'nsINdexType', 'eq,pres')])
+ except ldap.UNWILLING_TO_PERFORM:
+ log.info('Index update correctly rejected')
+ REJECTED = True
+
+ if not REJECTED:
+ log.fatal('Invalid nsIndexType value was incorrectly accepted.')
+ assert False
+
+ log.info('Test complete')
+
+
+def test_ticket48170_final(topology):
+ topology.standalone.delete()
+ log.info('Testcase PASSED')
+
+
+def run_isolated():
+ global installation1_prefix
+ installation1_prefix = None
+
+ topo = topology(True)
+ test_ticket48170(topo)
+ test_ticket48170_final(topo)
+
+
+if __name__ == '__main__':
+ run_isolated()
+
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_attr.c b/ldap/servers/slapd/back-ldbm/ldbm_attr.c
index 877d536..81481cf 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_attr.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_attr.c
@@ -654,7 +654,7 @@ attr_index_idlistsize_config(Slapi_Entry *e, struct attrinfo *ai, char *returnte
return rc;
}
-void
+int
attr_index_config(
backend *be,
char *fname,
@@ -685,7 +685,7 @@ attr_index_config(
attrValue = slapi_value_get_berval(sval);
} else {
LDAPDebug(LDAP_DEBUG_ANY, "attr_index_config: Missing indexing arguments\n", 0, 0, 0);
- return;
+ return -1;
}
a = attrinfo_new();
@@ -707,19 +707,19 @@ attr_index_config(
for (j = slapi_attr_first_value(attr, &sval); j != -1;j = slapi_attr_next_value(attr, j, &sval)) {
hasIndexType = 1;
attrValue = slapi_value_get_berval(sval);
- if ( strncasecmp( attrValue->bv_val, "pres", 4 ) == 0 ) {
+ if ( strcasecmp( attrValue->bv_val, "pres" ) == 0 ) {
a->ai_indexmask |= INDEX_PRESENCE;
- } else if ( strncasecmp( attrValue->bv_val, "eq", 2 ) == 0 ) {
+ } else if ( strcasecmp( attrValue->bv_val, "eq" ) == 0 ) {
a->ai_indexmask |= INDEX_EQUALITY;
- } else if ( strncasecmp( attrValue->bv_val, "approx", 6 ) == 0 ) {
+ } else if ( strcasecmp( attrValue->bv_val, "approx" ) == 0 ) {
a->ai_indexmask |= INDEX_APPROX;
- } else if ( strncasecmp( attrValue->bv_val, "subtree", 7 ) == 0 ) {
+ } else if ( strcasecmp( attrValue->bv_val, "subtree" ) == 0 ) {
/* subtree should be located before "sub" */
a->ai_indexmask |= INDEX_SUBTREE;
a->ai_dup_cmp_fn = entryrdn_compare_dups;
- } else if ( strncasecmp( attrValue->bv_val, "sub", 3 ) == 0 ) {
+ } else if ( strcasecmp( attrValue->bv_val, "sub" ) == 0 ) {
a->ai_indexmask |= INDEX_SUB;
- } else if ( strncasecmp( attrValue->bv_val, "none", 4 ) == 0 ) {
+ } else if ( strcasecmp( attrValue->bv_val, "none" ) == 0 ) {
if ( a->ai_indexmask != 0 ) {
LDAPDebug(LDAP_DEBUG_ANY,
"%s: line %d: index type \"none\" cannot be combined with other types\n",
@@ -727,19 +727,19 @@ attr_index_config(
}
a->ai_indexmask = INDEX_OFFLINE; /* note that the index isn't available */
} else {
- LDAPDebug(LDAP_DEBUG_ANY,
- "%s: line %d: unknown index type \"%s\" (ignored)\n",
- fname, lineno, attrValue->bv_val);
- LDAPDebug(LDAP_DEBUG_ANY,
+ slapi_log_error(SLAPI_LOG_FATAL, "attr_index_config",
+ "%s: line %d: unknown index type \"%s\" (ignored) in entry (%s), "
"valid index types are \"pres\", \"eq\", \"approx\", or \"sub\"\n",
- 0, 0, 0);
+ fname, lineno, attrValue->bv_val, slapi_entry_get_dn(e));
+ attrinfo_delete(&a);
+ return -1;
}
}
if(hasIndexType == 0){
/* indexType missing, error out */
LDAPDebug(LDAP_DEBUG_ANY, "attr_index_config: Missing index type\n", 0, 0, 0);
attrinfo_delete(&a);
- return;
+ return -1;
}
}
@@ -929,6 +929,8 @@ attr_index_config(
/* duplicate - existing version updated */
attrinfo_delete(&a);
}
+
+ return 0;
}
/*
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_index_config.c b/ldap/servers/slapd/back-ldbm/ldbm_index_config.c
index 51801f5..577b47f 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_index_config.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_index_config.c
@@ -96,7 +96,10 @@ static int ldbm_index_parse_entry(ldbm_instance *inst, Slapi_Entry *e,
}
/* ok the entry is good to process, pass it to attr_index_config */
- attr_index_config(inst->inst_be, (char *)trace_string, 0, e, 0, 0);
+ if (attr_index_config(inst->inst_be, (char *)trace_string, 0, e, 0, 0)){
+ slapi_ch_free_string(index_name);
+ return LDAP_OPERATIONS_ERROR;
+ }
return LDAP_SUCCESS;
}
@@ -247,7 +250,10 @@ ldbm_instance_index_config_modify_callback(Slapi_PBlock *pb, Slapi_Entry *e,
return SLAPI_DSE_CALLBACK_ERROR;
}
- attr_index_config(inst->inst_be, "from DSE modify", 0, entryAfter, 0, 0);
+ if(attr_index_config(inst->inst_be, "from DSE modify", 0, entryAfter, 0, 0)){
+ *returncode = LDAP_UNWILLING_TO_PERFORM;
+ return SLAPI_DSE_CALLBACK_ERROR;
+ }
return SLAPI_DSE_CALLBACK_OK;
}
diff --git a/ldap/servers/slapd/back-ldbm/proto-back-ldbm.h b/ldap/servers/slapd/back-ldbm/proto-back-ldbm.h
index 01fe915..fa227f3 100644
--- a/ldap/servers/slapd/back-ldbm/proto-back-ldbm.h
+++ b/ldap/servers/slapd/back-ldbm/proto-back-ldbm.h
@@ -55,7 +55,7 @@ void attr_masks( backend *be, char *type, int *indexmask,
int *syntaxmask );
void attr_masks_ex( backend *be, char *type, int *indexmask,
int *syntaxmask, struct attrinfo **at );
-void attr_index_config( backend *be, char *fname, int lineno,
+int attr_index_config( backend *be, char *fname, int lineno,
Slapi_Entry *e, int init, int none );
int ldbm_compute_init();
void attrinfo_deletetree(ldbm_instance *inst);
8 years, 10 months
2 commits - dirsrvtests/tickets ldap/servers
by Noriko Hosoi
dirsrvtests/tickets/ticket48191_test.py | 312 ++++++++++++++++++++++++++++++++
ldap/servers/slapd/libglobs.c | 52 +++++
ldap/servers/slapd/opshared.c | 5
ldap/servers/slapd/pagedresults.c | 16 +
ldap/servers/slapd/proto-slap.h | 4
ldap/servers/slapd/slap.h | 3
6 files changed, 391 insertions(+), 1 deletion(-)
New commits:
commit bed6f0d549d7817f5ab58a1b6a1b60f29c84d752
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Tue Jun 9 15:40:55 2015 -0700
Ticket #48191 - CI test: added test cases for ticket 48191
Description: Adding nsslapd-maxsimplepaged-per-conn
diff --git a/dirsrvtests/tickets/ticket48191_test.py b/dirsrvtests/tickets/ticket48191_test.py
new file mode 100644
index 0000000..4011cb2
--- /dev/null
+++ b/dirsrvtests/tickets/ticket48191_test.py
@@ -0,0 +1,312 @@
+import os
+import sys
+import time
+import ldap
+import logging
+import pytest
+from lib389 import DirSrv, Entry, tools, tasks
+from lib389.tools import DirSrvTools
+from lib389._constants import *
+from lib389.properties import *
+from lib389.tasks import *
+from ldap.controls import SimplePagedResultsControl
+from ldap.controls.simple import GetEffectiveRightsControl
+
+log = logging.getLogger(__name__)
+
+installation_prefix = None
+
+CONFIG_DN = 'cn=config'
+MYSUFFIX = 'o=ticket48191.org'
+MYSUFFIXBE = 'ticket48191'
+
+_MYLDIF = 'ticket48191.ldif'
+
+SEARCHFILTER = '(objectclass=*)'
+
+
+class TopologyStandalone(object):
+ def __init__(self, standalone):
+ standalone.open()
+ self.standalone = standalone
+
+
+(a)pytest.fixture(scope="module")
+def topology(request):
+ '''
+ This fixture is used to standalone topology for the 'module'.
+ '''
+ global installation_prefix
+
+ if installation_prefix:
+ args_instance[SER_DEPLOYED_DIR] = installation_prefix
+
+ standalone = DirSrv(verbose=False)
+
+ # Args for the standalone instance
+ args_instance[SER_HOST] = HOST_STANDALONE
+ args_instance[SER_PORT] = PORT_STANDALONE
+ args_instance[SER_SERVERID_PROP] = SERVERID_STANDALONE
+ args_standalone = args_instance.copy()
+ standalone.allocate(args_standalone)
+
+ # Get the status of the instance and restart it if it exists
+ instance_standalone = standalone.exists()
+
+ # Remove the instance
+ if instance_standalone:
+ standalone.delete()
+
+ # Create the instance
+ standalone.create()
+
+ # Used to retrieve configuration information (dbdir, confdir...)
+ standalone.open()
+
+ # clear the tmp directory
+ standalone.clearTmpDir(__file__)
+
+ # Here we have standalone instance up and running
+ return TopologyStandalone(standalone)
+
+
+def test_ticket48191_setup(topology):
+ """
+ Import 20 entries
+ Set nsslapd-maxsimplepaged-per-conn in cn=config
+ If the val is negative, no limit.
+ If the value is 0, the simple paged results is disabled.
+ If the value is positive, the value is the max simple paged results requests per connection.
+ The setting has to be dynamic.
+ """
+ log.info('Testing Ticket 48191 - Config parameter nsslapd-maxsimplepaged-per-conn')
+
+ # bind as directory manager
+ topology.standalone.log.info("Bind as %s" % DN_DM)
+ topology.standalone.simple_bind_s(DN_DM, PASSWORD)
+
+ topology.standalone.log.info("\n\n######################### SETUP SUFFIX o=ticket48191.org ######################\n")
+
+ topology.standalone.backend.create(MYSUFFIX, {BACKEND_NAME: MYSUFFIXBE})
+ topology.standalone.mappingtree.create(MYSUFFIX, bename=MYSUFFIXBE)
+
+ topology.standalone.log.info("\n\n######################### Generate Test data ######################\n")
+
+ # get tmp dir
+ mytmp = topology.standalone.getDir(__file__, TMP_DIR)
+ if mytmp is None:
+ mytmp = "/tmp"
+
+ MYLDIF = '%s%s' % (mytmp, _MYLDIF)
+ os.system('ls %s' % MYLDIF)
+ os.system('rm -f %s' % MYLDIF)
+ if hasattr(topology.standalone, 'prefix'):
+ prefix = topology.standalone.prefix
+ else:
+ prefix = None
+ dbgen_prog = prefix + '/bin/dbgen.pl'
+ topology.standalone.log.info('dbgen_prog: %s' % dbgen_prog)
+ os.system('%s -s %s -o %s -n 14' % (dbgen_prog, MYSUFFIX, MYLDIF))
+ cmdline = 'egrep dn: %s | wc -l' % MYLDIF
+ p = os.popen(cmdline, "r")
+ dnnumstr = p.readline()
+ global dnnum
+ dnnum = int(dnnumstr)
+ topology.standalone.log.info("We have %d entries.\n", dnnum)
+
+ topology.standalone.log.info("\n\n######################### Import Test data ######################\n")
+
+ args = {TASK_WAIT: True}
+ importTask = Tasks(topology.standalone)
+ importTask.importLDIF(MYSUFFIX, MYSUFFIXBE, MYLDIF, args)
+
+ topology.standalone.log.info("\n\n######################### SEARCH ALL ######################\n")
+ topology.standalone.log.info("Bind as %s and add the READ/SEARCH SELFDN aci" % DN_DM)
+ topology.standalone.simple_bind_s(DN_DM, PASSWORD)
+
+ global entries
+ entries = topology.standalone.search_s(MYSUFFIX, ldap.SCOPE_SUBTREE, SEARCHFILTER)
+ topology.standalone.log.info("Returned %d entries.\n", len(entries))
+
+ #print entries
+
+ assert dnnum == len(entries)
+
+ topology.standalone.log.info('%d entries are successfully imported.' % dnnum)
+
+def test_ticket48191_run_0(topology):
+ topology.standalone.log.info("\n\n######################### SEARCH WITH SIMPLE PAGED RESULTS CONTROL (no nsslapd-maxsimplepaged-per-conn) ######################\n")
+
+ page_size = 4
+ spr_req_ctrl = SimplePagedResultsControl(True, size=page_size, cookie='')
+
+ known_ldap_resp_ctrls = {
+ SimplePagedResultsControl.controlType: SimplePagedResultsControl,
+ }
+
+ topology.standalone.log.info("Calling search_ext...")
+ msgid = topology.standalone.search_ext(MYSUFFIX,
+ ldap.SCOPE_SUBTREE,
+ SEARCHFILTER,
+ ['cn'],
+ serverctrls=[spr_req_ctrl])
+ pageddncnt = 0
+ pages = 0
+ while True:
+ pages += 1
+
+ topology.standalone.log.info("Getting page %d" % pages)
+ rtype, rdata, rmsgid, responcectrls = topology.standalone.result3(msgid, resp_ctrl_classes=known_ldap_resp_ctrls)
+ topology.standalone.log.info("%d results" % len(rdata))
+ pageddncnt += len(rdata)
+
+ topology.standalone.log.info("Results:")
+ for dn, attrs in rdata:
+ topology.standalone.log.info("dn: %s" % dn)
+
+ pctrls = [
+ c for c in responcectrls if c.controlType == SimplePagedResultsControl.controlType
+ ]
+ if not pctrls:
+ topology.standalone.log.info('Warning: Server ignores RFC 2696 control.')
+ break
+
+ if pctrls[0].cookie:
+ spr_req_ctrl.cookie = pctrls[0].cookie
+ topology.standalone.log.info("cookie: %s" % spr_req_ctrl.cookie)
+ msgid = topology.standalone.search_ext(MYSUFFIX,
+ ldap.SCOPE_SUBTREE,
+ SEARCHFILTER,
+ ['cn'],
+ serverctrls=[spr_req_ctrl])
+ else:
+ topology.standalone.log.info("No cookie")
+ break
+
+ topology.standalone.log.info("Paged result search returned %d entries in %d pages.\n", pageddncnt, pages)
+
+ global dnnum
+ global entries
+ assert dnnum == len(entries)
+ assert pages == (dnnum / page_size)
+
+def test_ticket48191_run_1(topology):
+ topology.standalone.log.info("\n\n######################### SEARCH WITH SIMPLE PAGED RESULTS CONTROL (nsslapd-maxsimplepaged-per-conn: 0) ######################\n")
+
+ topology.standalone.modify_s(CONFIG_DN, [(ldap.MOD_REPLACE, 'nsslapd-maxsimplepaged-per-conn', '0')])
+
+ page_size = 4
+ spr_req_ctrl = SimplePagedResultsControl(True, size=page_size, cookie='')
+
+ known_ldap_resp_ctrls = {
+ SimplePagedResultsControl.controlType: SimplePagedResultsControl,
+ }
+
+ topology.standalone.log.info("Calling search_ext...")
+ msgid = topology.standalone.search_ext(MYSUFFIX,
+ ldap.SCOPE_SUBTREE,
+ SEARCHFILTER,
+ ['cn'],
+ serverctrls=[spr_req_ctrl])
+
+ topology.standalone.log.fatal('Unexpected success')
+ try:
+ rtype, rdata, rmsgid, responcectrls = topology.standalone.result3(msgid, resp_ctrl_classes=known_ldap_resp_ctrls)
+ except ldap.UNWILLING_TO_PERFORM, e:
+ topology.standalone.log.info('Returned the expected RC UNWILLING_TO_PERFORM')
+ return
+ except ldap.LDAPError, e:
+ topology.standalone.log.fatal('Unexpected error: ' + e.message['desc'])
+ assert False
+ topology.standalone.log.info("Type %d" % rtype)
+ topology.standalone.log.info("%d results" % len(rdata))
+ assert False
+
+def test_ticket48191_run_2(topology):
+ topology.standalone.log.info("\n\n######################### SEARCH WITH SIMPLE PAGED RESULTS CONTROL (nsslapd-maxsimplepaged-per-conn: 1000) ######################\n")
+
+ topology.standalone.modify_s(CONFIG_DN, [(ldap.MOD_REPLACE, 'nsslapd-maxsimplepaged-per-conn', '1000')])
+
+ page_size = 4
+ spr_req_ctrl = SimplePagedResultsControl(True, size=page_size, cookie='')
+
+ known_ldap_resp_ctrls = {
+ SimplePagedResultsControl.controlType: SimplePagedResultsControl,
+ }
+
+ topology.standalone.log.info("Calling search_ext...")
+ msgid = topology.standalone.search_ext(MYSUFFIX,
+ ldap.SCOPE_SUBTREE,
+ SEARCHFILTER,
+ ['cn'],
+ serverctrls=[spr_req_ctrl])
+ pageddncnt = 0
+ pages = 0
+ while True:
+ pages += 1
+
+ topology.standalone.log.info("Getting page %d" % pages)
+ rtype, rdata, rmsgid, responcectrls = topology.standalone.result3(msgid, resp_ctrl_classes=known_ldap_resp_ctrls)
+ topology.standalone.log.info("%d results" % len(rdata))
+ pageddncnt += len(rdata)
+
+ topology.standalone.log.info("Results:")
+ for dn, attrs in rdata:
+ topology.standalone.log.info("dn: %s" % dn)
+
+ pctrls = [
+ c for c in responcectrls if c.controlType == SimplePagedResultsControl.controlType
+ ]
+ if not pctrls:
+ topology.standalone.log.info('Warning: Server ignores RFC 2696 control.')
+ break
+
+ if pctrls[0].cookie:
+ spr_req_ctrl.cookie = pctrls[0].cookie
+ topology.standalone.log.info("cookie: %s" % spr_req_ctrl.cookie)
+ msgid = topology.standalone.search_ext(MYSUFFIX,
+ ldap.SCOPE_SUBTREE,
+ SEARCHFILTER,
+ ['cn'],
+ serverctrls=[spr_req_ctrl])
+ else:
+ topology.standalone.log.info("No cookie")
+ break
+
+ topology.standalone.log.info("Paged result search returned %d entries in %d pages.\n", pageddncnt, pages)
+
+ global dnnum
+ global entries
+ assert dnnum == len(entries)
+ assert pages == (dnnum / page_size)
+
+ topology.standalone.log.info("ticket48191 was successfully verified.")
+
+
+def test_ticket48191_final(topology):
+ topology.standalone.delete()
+ log.info('Testcase PASSED')
+
+
+def run_isolated():
+ '''
+ run_isolated is used to run these test cases independently of a test scheduler (xunit, py.test..)
+ To run isolated without py.test, you need to
+ - edit this file and comment '@pytest.fixture' line before 'topology' function.
+ - set the installation prefix
+ - run this program
+ '''
+ global installation_prefix
+ installation_prefix = None
+
+ topo = topology(True)
+ test_ticket48191_setup(topo)
+ test_ticket48191_run_0(topo)
+ test_ticket48191_run_1(topo)
+ test_ticket48191_run_2(topo)
+ test_ticket48191_final(topo)
+
+
+if __name__ == '__main__':
+ run_isolated()
+
commit 5fd0cdfcc1e409c43ab700e35079ada7701c63a4
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Tue Jun 9 14:03:17 2015 -0700
Ticket #48191 - RFE: Adding nsslapd-maxsimplepaged-per-conn
Description: Asynchronous simple paged results requests could add too much load
the server can handle. Adding a config parameter to restrict the requests.
cn=config
nsslapd-maxsimplepaged-per-conn: INT
If nsslapd-maxsimplepaged-per-conn is configured with a positive integer,
Asynchronous simple paged results requests per connection is limitted by the
value. If the requests exceed the value, it returns LDAP_UNWILLING_TO_PERFORM.
If the value is negative, there is no limit (default behaviour).
If the value is 0, a simple paged results is disabled.
https://fedorahosted.org/389/ticket/48191
Reviewed by rmeggins(a)redhat.com (Thank you, Rich!)
diff --git a/ldap/servers/slapd/libglobs.c b/ldap/servers/slapd/libglobs.c
index 5aee1c4..3b53f32 100644
--- a/ldap/servers/slapd/libglobs.c
+++ b/ldap/servers/slapd/libglobs.c
@@ -186,6 +186,8 @@ static int invalid_sasl_mech(char *str);
#define DEFAULT_MAXBERSIZE 2097152
#define DEFAULT_SASL_MAXBUFSIZE "2097152"
#define SLAPD_DEFAULT_SASL_MAXBUFSIZE 2097152
+#define DEFAULT_MAXSIMPLEPAGED_PER_CONN (-1)
+#define DEFAULT_MAXSIMPLEPAGED_PER_CONN_STR "-1"
#ifdef MEMPOOL_EXPERIMENTAL
#define DEFAULT_MEMPOOL_MAXFREELIST "1024"
#endif
@@ -1130,7 +1132,11 @@ static struct config_get_and_set {
{CONFIG_GLOBAL_BACKEND_LOCK, config_set_global_backend_lock,
NULL, 0,
(void**)&global_slapdFrontendConfig.global_backend_lock,
- CONFIG_ON_OFF, (ConfigGetFunc)config_get_global_backend_lock, &init_global_backend_local}
+ CONFIG_ON_OFF, (ConfigGetFunc)config_get_global_backend_lock, &init_global_backend_local},
+ {CONFIG_MAXSIMPLEPAGED_PER_CONN_ATTRIBUTE, config_set_maxsimplepaged_per_conn,
+ NULL, 0,
+ (void**)&global_slapdFrontendConfig.maxsimplepaged_per_conn,
+ CONFIG_INT, config_get_maxsimplepaged_per_conn, DEFAULT_MAXSIMPLEPAGED_PER_CONN_STR},
#ifdef ENABLE_NUNC_STANS
,{CONFIG_ENABLE_NUNC_STANS, config_set_enable_nunc_stans,
NULL, 0,
@@ -1585,6 +1591,7 @@ FrontendConfig_init () {
init_dynamic_plugins = cfg->dynamic_plugins = LDAP_OFF;
init_cn_uses_dn_syntax_in_dns = cfg->cn_uses_dn_syntax_in_dns = LDAP_OFF;
init_global_backend_local = LDAP_OFF;
+ cfg->maxsimplepaged_per_conn = DEFAULT_MAXSIMPLEPAGED_PER_CONN;
#ifdef ENABLE_NUNC_STANS
init_enable_nunc_stans = cfg->enable_nunc_stans = LDAP_OFF;
#endif
@@ -7864,6 +7871,49 @@ config_set_auditlog_enabled(int value){
CFG_ONOFF_UNLOCK_WRITE(slapdFrontendConfig);
}
+int
+config_set_maxsimplepaged_per_conn( const char *attrname, char *value, char *errorbuf, int apply )
+{
+ int retVal = LDAP_SUCCESS;
+ slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig();
+ long size;
+ char *endp;
+
+ if ( config_value_is_null( attrname, value, errorbuf, 0 )) {
+ return LDAP_OPERATIONS_ERROR;
+ }
+
+ errno = 0;
+ size = strtol(value, &endp, 10);
+ if ( *endp != '\0' || errno == ERANGE){
+ retVal = LDAP_OPERATIONS_ERROR;
+ PR_snprintf(errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, "(%s) value (%s) is invalid\n",
+ attrname, value);
+ return retVal;
+ }
+
+ if ( !apply ) {
+ return retVal;
+ }
+
+ CFG_LOCK_WRITE(slapdFrontendConfig);
+
+ slapdFrontendConfig->maxsimplepaged_per_conn = size;
+
+ CFG_UNLOCK_WRITE(slapdFrontendConfig);
+ return retVal;
+}
+
+int
+config_get_maxsimplepaged_per_conn()
+{
+ slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig();
+ int retVal;
+
+ retVal = slapdFrontendConfig->maxsimplepaged_per_conn;
+ return retVal;
+}
+
#if defined(LINUX)
int
config_set_malloc_mxfast(const char *attrname, char *value, char *errorbuf, int apply)
diff --git a/ldap/servers/slapd/opshared.c b/ldap/servers/slapd/opshared.c
index 9a5a141..cab911a 100644
--- a/ldap/servers/slapd/opshared.c
+++ b/ldap/servers/slapd/opshared.c
@@ -552,6 +552,11 @@ op_shared_search (Slapi_PBlock *pb, int send_result)
rc = LDAP_SUCCESS;
goto free_and_return;
}
+ } else if (LDAP_UNWILLING_TO_PERFORM == rc) {
+ send_ldap_result(pb, LDAP_UNWILLING_TO_PERFORM, NULL,
+ "Simple Paged Results Search exceeded administration limit",
+ 0, NULL);
+ goto free_and_return;
} else {
/* parse paged-results-control failed */
if (iscritical) { /* return an error since it's critical */
diff --git a/ldap/servers/slapd/pagedresults.c b/ldap/servers/slapd/pagedresults.c
index a7fe2cd..9a78540 100644
--- a/ldap/servers/slapd/pagedresults.c
+++ b/ldap/servers/slapd/pagedresults.c
@@ -89,6 +89,7 @@ pagedresults_parse_control_value( Slapi_PBlock *pb,
PagedResults *prp = NULL;
time_t ctime = current_time();
int i;
+ int maxreqs = config_get_maxsimplepaged_per_conn();
LDAPDebug0Args(LDAP_DEBUG_TRACE, "--> pagedresults_parse_control_value\n");
if ( NULL == conn || NULL == op || NULL == pagesize || NULL == index ) {
@@ -118,6 +119,13 @@ pagedresults_parse_control_value( Slapi_PBlock *pb,
"<-- pagedresults_parse_control_value: corrupted control value\n");
return LDAP_PROTOCOL_ERROR;
}
+ if (!maxreqs)
+ {
+ LDAPDebug1Arg(LDAP_DEBUG_ANY,
+ "pagedresults_parse_control_value: simple paged results requests per conn exeeded the limit: %d\n",
+ maxreqs);
+ return LDAP_UNWILLING_TO_PERFORM;
+ }
PR_Lock(conn->c_mutex);
/* the ber encoding is no longer needed */
@@ -158,6 +166,14 @@ pagedresults_parse_control_value( Slapi_PBlock *pb,
}
}
}
+ if ((maxreqs > 0) && (*index >= maxreqs)) {
+ rc = LDAP_UNWILLING_TO_PERFORM;
+ LDAPDebug1Arg(LDAP_DEBUG_TRACE,
+ "pagedresults_parse_control_value: simple paged results requests per conn exeeded the limit: %d\n",
+ maxreqs);
+ goto bail;
+ }
+
if ((*index > -1) && (*index < conn->c_pagedresults.prl_maxlen) &&
!conn->c_pagedresults.prl_list[*index].pr_mutex) {
conn->c_pagedresults.prl_list[*index].pr_mutex = PR_NewLock();
diff --git a/ldap/servers/slapd/proto-slap.h b/ldap/servers/slapd/proto-slap.h
index 8410e66..ea5ff53 100644
--- a/ldap/servers/slapd/proto-slap.h
+++ b/ldap/servers/slapd/proto-slap.h
@@ -428,6 +428,8 @@ int config_set_mempool_switch( const char *attrname, char *value, char *errorbuf
int config_set_mempool_maxfreelist( const char *attrname, char *value, char *errorbuf, int apply );
#endif /* MEMPOOL_EXPERIMENTAL */
+int config_set_maxsimplepaged_per_conn( const char *attrname, char *value, char *errorbuf, int apply );
+
int config_get_SSLclientAuth();
int config_get_ssl_check_hostname();
char *config_get_SSL3ciphers();
@@ -613,6 +615,8 @@ int config_get_malloc_trim_threshold();
int config_get_malloc_mmap_threshold();
#endif
+int config_get_maxsimplepaged_per_conn();
+
int is_abspath(const char *);
char* rel2abspath( char * );
char* rel2abspath_ext( char *, char * );
diff --git a/ldap/servers/slapd/slap.h b/ldap/servers/slapd/slap.h
index b7c6e80..dd4fc68 100644
--- a/ldap/servers/slapd/slap.h
+++ b/ldap/servers/slapd/slap.h
@@ -2169,6 +2169,8 @@ typedef struct _slapdEntryPoints {
#define CONFIG_CN_USES_DN_SYNTAX_IN_DNS "nsslapd-cn-uses-dn-syntax-in-dns"
+#define CONFIG_MAXSIMPLEPAGED_PER_CONN_ATTRIBUTE "nsslapd-maxsimplepaged-per-conn"
+
/* getenv alternative */
#define CONFIG_MALLOC_MXFAST "nsslapd-malloc-mxfast"
#define CONFIG_MALLOC_TRIM_THRESHOLD "nsslapd-malloc-trim-threshold"
@@ -2435,6 +2437,7 @@ typedef struct _slapdFrontendConfig {
slapi_onoff_t dynamic_plugins; /* allow plugins to be dynamically enabled/disabled */
slapi_onoff_t cn_uses_dn_syntax_in_dns; /* indicates the cn value in dns has dn syntax */
slapi_onoff_t global_backend_lock;
+ slapi_int_t maxsimplepaged_per_conn;/* max simple paged results reqs handled per connection */
#ifdef ENABLE_NUNC_STANS
slapi_onoff_t enable_nunc_stans;
#endif
8 years, 10 months
dirsrvtests/tickets ldap/servers
by Mark Reynolds
dirsrvtests/tickets/ticket47640_test.py | 122 ++++++++++++++++++++++++
ldap/servers/plugins/linkedattrs/linked_attrs.c | 56 +++++------
2 files changed, 152 insertions(+), 26 deletions(-)
New commits:
commit cdb83c417b28299b88e2a9ad896b78ef0f1a8fa2
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Tue Jun 9 15:32:57 2015 -0400
Ticket 47640 - Linked attributes transaction not aborted when
linked entry does not exit
Bug Description: When adding an entry and the target entry does not exist,
the operation is still allowed.
Fix Description: Return an error and useful error message to the client.
https://fedorahosted.org/389/ticket/47640
Reviewed by: nhosoi(Thanks!)
diff --git a/dirsrvtests/tickets/ticket47640_test.py b/dirsrvtests/tickets/ticket47640_test.py
new file mode 100644
index 0000000..648337e
--- /dev/null
+++ b/dirsrvtests/tickets/ticket47640_test.py
@@ -0,0 +1,122 @@
+import os
+import sys
+import time
+import ldap
+import logging
+import pytest
+from lib389 import DirSrv, Entry, tools, tasks
+from lib389.tools import DirSrvTools
+from lib389._constants import *
+from lib389.properties import *
+from lib389.tasks import *
+from lib389.utils import *
+
+logging.getLogger(__name__).setLevel(logging.DEBUG)
+log = logging.getLogger(__name__)
+
+installation1_prefix = None
+
+
+class TopologyStandalone(object):
+ def __init__(self, standalone):
+ standalone.open()
+ self.standalone = standalone
+
+
+(a)pytest.fixture(scope="module")
+def topology(request):
+ global installation1_prefix
+ if installation1_prefix:
+ args_instance[SER_DEPLOYED_DIR] = installation1_prefix
+
+ # Creating standalone instance ...
+ standalone = DirSrv(verbose=False)
+ args_instance[SER_HOST] = HOST_STANDALONE
+ args_instance[SER_PORT] = PORT_STANDALONE
+ args_instance[SER_SERVERID_PROP] = SERVERID_STANDALONE
+ args_instance[SER_CREATION_SUFFIX] = DEFAULT_SUFFIX
+ args_standalone = args_instance.copy()
+ standalone.allocate(args_standalone)
+ instance_standalone = standalone.exists()
+ if instance_standalone:
+ standalone.delete()
+ standalone.create()
+ standalone.open()
+
+ # Clear out the tmp dir
+ standalone.clearTmpDir(__file__)
+
+ return TopologyStandalone(standalone)
+
+
+def test_ticket47640(topology):
+ '''
+ Linked Attrs Plugins - verify that if the plugin fails to update the link entry
+ that the entire operation is aborted
+ '''
+
+ # Enable Dynamic plugins, and the linked Attrs plugin
+ try:
+ topology.standalone.modify_s(DN_CONFIG, [(ldap.MOD_REPLACE, 'nsslapd-dynamic-plugins', 'on')])
+ except ldap.LDAPError, e:
+ ldap.fatal('Failed to enable dynamic plugin!' + e.message['desc'])
+ assert False
+
+ try:
+ topology.standalone.plugins.enable(name=PLUGIN_LINKED_ATTRS)
+ except ValueError, e:
+ ldap.fatal('Failed to enable linked attributes plugin!' + e.message['desc'])
+ assert False
+
+ # Add the plugin config entry
+ try:
+ topology.standalone.add_s(Entry(('cn=manager link,cn=Linked Attributes,cn=plugins,cn=config', {
+ 'objectclass': 'top extensibleObject'.split(),
+ 'cn': 'Manager Link',
+ 'linkType': 'seeAlso',
+ 'managedType': 'seeAlso'
+ })))
+ except ldap.LDAPError, e:
+ log.fatal('Failed to add linked attr config entry: error ' + e.message['desc'])
+ assert False
+
+ # Add an entry who has a link to an entry that does not exist
+ OP_REJECTED = False
+ try:
+ topology.standalone.add_s(Entry(('uid=manager,' + DEFAULT_SUFFIX, {
+ 'objectclass': 'top extensibleObject'.split(),
+ 'uid': 'manager',
+ 'seeAlso': 'uid=user,dc=example,dc=com'
+ })))
+ except ldap.UNWILLING_TO_PERFORM:
+ # Success
+ log.info('Add operation correctly rejected.')
+ OP_REJECTED = True
+ except ldap.LDAPError, e:
+ log.fatal('Add operation incorrectly rejected: error %s - ' +
+ 'expected "unwilling to perform"' % e.message['desc'])
+ assert False
+ if not OP_REJECTED:
+ log.fatal('Add operation incorrectly allowed')
+ assert False
+
+ log.info('Test complete')
+
+
+def test_ticket47640_final(topology):
+ topology.standalone.delete()
+ log.info('Testcase PASSED')
+
+
+def run_isolated():
+ global installation1_prefix
+ installation1_prefix = None
+
+ topo = topology(True)
+ test_ticket47640(topo)
+ test_ticket47640_final(topo)
+
+
+if __name__ == '__main__':
+ run_isolated()
+
diff --git a/ldap/servers/plugins/linkedattrs/linked_attrs.c b/ldap/servers/plugins/linkedattrs/linked_attrs.c
index e302867..27984a9 100644
--- a/ldap/servers/plugins/linkedattrs/linked_attrs.c
+++ b/ldap/servers/plugins/linkedattrs/linked_attrs.c
@@ -55,8 +55,6 @@ static Slapi_RWLock *g_config_lock;
static void *_PluginID = NULL;
static char *_PluginDN = NULL;
int plugin_is_betxn = 0;
-/* For future use - enforce all linked attribute operations succeed */
-static int strict_results = 0;
static Slapi_PluginDesc pdesc = { LINK_FEATURE_DESC,
VENDOR,
@@ -108,14 +106,14 @@ static int linked_attrs_config_exists_reverse(struct configEntry *entry);
static int linked_attrs_oktodo(Slapi_PBlock *pb);
void linked_attrs_load_array(Slapi_Value **array, Slapi_Attr *attr);
int linked_attrs_compare(const void *a, const void *b);
-static int linked_attrs_add_backpointers(char *linkdn, struct configEntry *config,
+static int linked_attrs_add_backpointers(Slapi_PBlock *pb, char *linkdn, struct configEntry *config,
Slapi_Mod *smod);
static int linked_attrs_del_backpointers(Slapi_PBlock *pb, char *linkdn,
struct configEntry *config, Slapi_Mod *smod);
static int linked_attrs_replace_backpointers(Slapi_PBlock *pb, char *linkdn,
struct configEntry *config, Slapi_Mod *smod);
-static int linked_attrs_mod_backpointers(char *linkdn, char *type, char *scope,
- int modop, Slapi_ValueSet *targetvals);
+static int linked_attrs_mod_backpointers(Slapi_PBlock *pb, char *linkdn, char *type,
+ char *scope, int modop, Slapi_ValueSet *targetvals);
/*
* Config cache locking functions
@@ -1252,14 +1250,14 @@ linked_attrs_compare(const void *a, const void *b)
* by the values in smod.
*/
static int
-linked_attrs_add_backpointers(char *linkdn, struct configEntry *config,
+linked_attrs_add_backpointers(Slapi_PBlock *pb, char *linkdn, struct configEntry *config,
Slapi_Mod *smod)
{
Slapi_ValueSet *vals = slapi_valueset_new();
int rc = LDAP_SUCCESS;
slapi_valueset_set_from_smod(vals, smod);
- rc = linked_attrs_mod_backpointers(linkdn, config->managedtype, config->scope,
+ rc = linked_attrs_mod_backpointers(pb, linkdn, config->managedtype, config->scope,
LDAP_MOD_ADD, vals);
slapi_valueset_free(vals);
@@ -1294,7 +1292,7 @@ linked_attrs_del_backpointers(Slapi_PBlock *pb, char *linkdn,
slapi_valueset_set_from_smod(vals, smod);
}
- rc = linked_attrs_mod_backpointers(linkdn, config->managedtype, config->scope,
+ rc = linked_attrs_mod_backpointers(pb, linkdn, config->managedtype, config->scope,
LDAP_MOD_DELETE, vals);
slapi_valueset_free(vals);
@@ -1413,13 +1411,13 @@ linked_attrs_replace_backpointers(Slapi_PBlock *pb, char *linkdn,
/* Perform the actual updates to the target entries. */
if (delvals) {
- rc = linked_attrs_mod_backpointers(linkdn, config->managedtype,
+ rc = linked_attrs_mod_backpointers(pb, linkdn, config->managedtype,
config->scope, LDAP_MOD_DELETE, delvals);
slapi_valueset_free(delvals);
}
if (rc == LDAP_SUCCESS && addvals) {
- rc = linked_attrs_mod_backpointers(linkdn, config->managedtype,
+ rc = linked_attrs_mod_backpointers(pb, linkdn, config->managedtype,
config->scope, LDAP_MOD_ADD, addvals);
slapi_valueset_free(addvals);
}
@@ -1437,7 +1435,7 @@ linked_attrs_replace_backpointers(Slapi_PBlock *pb, char *linkdn,
* Performs backpointer management.
*/
static int
-linked_attrs_mod_backpointers(char *linkdn, char *type,
+linked_attrs_mod_backpointers(Slapi_PBlock *pb, char *linkdn, char *type,
char *scope, int modop, Slapi_ValueSet *targetvals)
{
char *val[2];
@@ -1493,13 +1491,19 @@ linked_attrs_mod_backpointers(char *linkdn, char *type,
slapi_modify_internal_set_pb_ext(mod_pb, targetsdn, mods, 0, 0,
linked_attrs_get_plugin_id(), 0);
slapi_modify_internal_pb(mod_pb);
- if (strict_results){
- /* we are enforcing strict results, so return the error */
- slapi_pblock_get(mod_pb, SLAPI_PLUGIN_INTOP_RESULT, &rc);
- if(rc != LDAP_SUCCESS){
- slapi_sdn_free(&targetsdn);
- break;
- }
+ slapi_pblock_get(mod_pb, SLAPI_PLUGIN_INTOP_RESULT, &rc);
+ if(rc != LDAP_SUCCESS){
+ char *err_msg = NULL;
+
+ err_msg = PR_smprintf("Linked Attrs Plugin: Failed to update "
+ "link to target entry (%s) error %d",
+ targetdn, rc);
+ slapi_log_error(SLAPI_LOG_PLUGIN, LINK_PLUGIN_SUBSYSTEM, "%s\n", err_msg);
+ slapi_pblock_set(pb, SLAPI_PB_RESULT_TEXT, err_msg);
+ PR_smprintf_free(err_msg);
+ slapi_sdn_free(&targetsdn);
+ rc = LDAP_UNWILLING_TO_PERFORM;
+ break;
}
/* Initialize the pblock so we can reuse it. */
slapi_pblock_init(mod_pb);
@@ -1684,7 +1688,7 @@ linked_attrs_mod_post_op(Slapi_PBlock *pb)
case LDAP_MOD_ADD:
/* Find the entries pointed to by the new
* values and add the backpointers. */
- rc = linked_attrs_add_backpointers(dn, config, smod);
+ rc = linked_attrs_add_backpointers(pb, dn, config, smod);
break;
case LDAP_MOD_DELETE:
/* Find the entries pointed to by the deleted
@@ -1786,7 +1790,7 @@ linked_attrs_add_post_op(Slapi_PBlock *pb)
slapi_attr_get_valueset(attr, &vals);
slapi_lock_mutex(config->lock);
- rc = linked_attrs_mod_backpointers(dn, config->managedtype,
+ rc = linked_attrs_mod_backpointers(pb, dn, config->managedtype,
config->scope, LDAP_MOD_ADD, vals);
slapi_unlock_mutex(config->lock);
@@ -1875,7 +1879,7 @@ linked_attrs_del_post_op(Slapi_PBlock *pb)
slapi_attr_get_valueset(attr, &vals);
slapi_lock_mutex(config->lock);
- rc = linked_attrs_mod_backpointers(dn, config->managedtype,
+ rc = linked_attrs_mod_backpointers(pb, dn, config->managedtype,
config->scope, LDAP_MOD_DELETE, vals);
slapi_unlock_mutex(config->lock);
@@ -1909,7 +1913,7 @@ linked_attrs_del_post_op(Slapi_PBlock *pb)
slapi_lock_mutex(config->lock);
/* Delete forward link value. */
- rc = linked_attrs_mod_backpointers(dn, config->linktype,
+ rc = linked_attrs_mod_backpointers(pb, dn, config->linktype,
config->scope, LDAP_MOD_DELETE, vals);
slapi_unlock_mutex(config->lock);
@@ -2018,7 +2022,7 @@ linked_attrs_modrdn_post_op(Slapi_PBlock *pb)
slapi_lock_mutex(config->lock);
/* Delete old dn value. */
- rc = linked_attrs_mod_backpointers(old_dn, config->managedtype,
+ rc = linked_attrs_mod_backpointers(pb, old_dn, config->managedtype,
config->scope, LDAP_MOD_DELETE, vals);
slapi_unlock_mutex(config->lock);
@@ -2045,7 +2049,7 @@ linked_attrs_modrdn_post_op(Slapi_PBlock *pb)
slapi_lock_mutex(config->lock);
/* Add new dn value. */
- rc = linked_attrs_mod_backpointers(new_dn, config->managedtype,
+ rc = linked_attrs_mod_backpointers(pb, new_dn, config->managedtype,
config->scope, LDAP_MOD_ADD, vals);
slapi_unlock_mutex(config->lock);
@@ -2079,7 +2083,7 @@ linked_attrs_modrdn_post_op(Slapi_PBlock *pb)
slapi_lock_mutex(config->lock);
/* Delete old dn value. */
- rc = linked_attrs_mod_backpointers(old_dn, config->linktype,
+ rc = linked_attrs_mod_backpointers(pb, old_dn, config->linktype,
config->scope, LDAP_MOD_DELETE, vals);
if(rc != LDAP_SUCCESS){
slapi_log_error(SLAPI_LOG_FATAL, LINK_PLUGIN_SUBSYSTEM,
@@ -2091,7 +2095,7 @@ linked_attrs_modrdn_post_op(Slapi_PBlock *pb)
}
/* Add new dn value. */
- rc = linked_attrs_mod_backpointers(new_dn, config->linktype,
+ rc = linked_attrs_mod_backpointers(pb, new_dn, config->linktype,
config->scope, LDAP_MOD_ADD, vals);
slapi_unlock_mutex(config->lock);
8 years, 10 months