From f6c2f2e6ab42b86f621904c641a9c1a66f1ee16d Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Sun, 9 Aug 1998 02:24:07 +0000 Subject: [PATCH 02/18] Merge FreeBSD Make-templates into LDAPworld branch --- Make-common | 12 +++++++----- clients/Make-template | 10 +++++----- doc/Make-template | 14 +++++++------- doc/man/Make-template | 10 +++++----- libraries/Make-template | 10 +++++----- servers/Make-template | 10 +++++----- servers/slurpd/re.c | 2 ++ servers/slurpd/rq.c | 4 ++-- tests/Make-template | 2 +- 9 files changed, 39 insertions(+), 35 deletions(-) diff --git a/Make-common b/Make-common index 32683c7652..405842cc4f 100644 --- a/Make-common +++ b/Make-common @@ -28,8 +28,9 @@ # man pages are put under MANDIR # programs end-users will run are put in BINDIR # -INSTROOT=/usr/local -ETCDIR= $(INSTROOT)/etc +PREFIX?=/usr/local +INSTROOT=${PREFIX} +ETCDIR= $(INSTROOT)/etc/ldap INCLUDEDIR= $(INSTROOT)/include LIBDIR= $(INSTROOT)/lib MANDIR= $(INSTROOT)/man @@ -45,6 +46,7 @@ RUNTIMEETCDIR= $(ETCDIR) ############################################################################# # Passed to every compile (cc or gcc). This is where you put -O or -g, etc. #EXTRACFLAGS=-g +EXTRACFLAGS=-O # Passed to every link (ld). Include -g here if you did in EXTRACFLAGS. #EXTRALDFLAGS=-g @@ -122,8 +124,8 @@ SLAPD_BACKENDS= -DLDAP_LDBM -DLDAP_SHELL -DLDAP_PASSWD # four choices: Berkeley db b-tree, Berkeley db hash, GNU dbm, or ndbm. # # berkeley db btree package -#LDBMBACKEND=-DLDBM_USE_DBBTREE -#LDBMINCLUDE=-I/usr/local/db/include +LDBMBACKEND=-DLDBM_USE_DBBTREE +LDBMINCLUDE=-I/usr/include #LDBMLIB=-ldb # berkeley db hash package #LDBMBACKEND=-DLDBM_USE_DBHASH @@ -134,7 +136,7 @@ SLAPD_BACKENDS= -DLDAP_LDBM -DLDAP_SHELL -DLDAP_PASSWD #LDBMINCLUDE=-I/usr/local/gdbm/include #LDBMLIB=-lgdbm # standard unix ndbm -LDBMBACKEND=-DLDBM_USE_NDBM +#LDBMBACKEND=-DLDBM_USE_NDBM # # if you want to use a non-default threads package change these lines #THREADS=-DNO_THREADS diff --git a/clients/Make-template b/clients/Make-template index 76a02d5a26..8be29e500e 100644 --- a/clients/Make-template +++ b/clients/Make-template @@ -22,7 +22,7 @@ all: FORCE @echo "making all in `$(PWD)`" @for i in *; do \ - if [ -d $$i -a $$i != "RCS" ]; then \ + if [ -d $$i -a $$i != "CVS" ]; then \ echo; echo " cd $$i; $(MAKE) $(MFLAGS) all"; \ ( cd $$i; $(MAKE) $(MFLAGS) all ); \ fi; \ @@ -36,7 +36,7 @@ all: FORCE install: FORCE @echo "making install in `$(PWD)`" @for i in *; do \ - if [ -d $$i -a $$i != "RCS" ]; then \ + if [ -d $$i -a $$i != "CVS" ]; then \ echo; echo " cd $$i; $(MAKE) $(MFLAGS) install"; \ ( cd $$i; $(MAKE) $(MFLAGS) install ); \ fi; \ @@ -49,7 +49,7 @@ install: FORCE clean: FORCE @echo "making clean in `$(PWD)`" @for i in *; do \ - if [ -d $$i -a $$i != "RCS" ]; then \ + if [ -d $$i -a $$i != "CVS" ]; then \ echo; echo " cd $$i; $(MAKE) $(MFLAGS) clean"; \ ( cd $$i; $(MAKE) $(MFLAGS) clean ); \ fi; \ @@ -65,7 +65,7 @@ veryclean: clean depend: FORCE @echo "making depend in `$(PWD)`" @for i in *; do \ - if [ -d $$i -a $$i != "RCS" ]; then \ + if [ -d $$i -a $$i != "CVS" ]; then \ echo; echo " cd $$i; $(MAKE) $(MFLAGS) depend"; \ ( cd $$i; $(MAKE) $(MFLAGS) depend ); \ fi; \ @@ -74,7 +74,7 @@ depend: FORCE links: @echo "making links in `$(PWD)`"; \ for i in .src/*; do \ - if [ -d $$i -a $$i != ".src/RCS" ]; then \ + if [ -d $$i -a $$i != ".src/CVS" ]; then \ d=`basename $$i`; \ ( $(MKDIR) $$d; cd $$d; $(LN) ../.src/$$d .src; \ $(LN) ../.src/$$d/Make-template . ; \ diff --git a/doc/Make-template b/doc/Make-template index 1dea71cc90..0eefcfe18e 100644 --- a/doc/Make-template +++ b/doc/Make-template @@ -22,7 +22,7 @@ all: FORCE @echo "making all in `$(PWD)`" @for i in *; do \ - if [ -d $$i -a $$i != "RCS" ]; then \ + if [ -d $$i -a $$i != "CVS" ]; then \ echo; echo " cd $$i; $(MAKE) $(MFLAGS) all"; \ ( cd $$i; $(MAKE) $(MFLAGS) all ); \ fi; \ @@ -32,7 +32,7 @@ all: FORCE install: FORCE @echo "making install in `$(PWD)`" @for i in *; do \ - if [ -d $$i -a $$i != "RCS" ]; then \ + if [ -d $$i -a $$i != "CVS" ]; then \ echo; echo " cd $$i; $(MAKE) $(MFLAGS) install"; \ ( cd $$i; $(MAKE) $(MFLAGS) install ); \ fi; \ @@ -42,7 +42,7 @@ install: FORCE clean: FORCE @echo "making clean in `$(PWD)`" @for i in *; do \ - if [ -d $$i -a $$i != "RCS" ]; then \ + if [ -d $$i -a $$i != "CVS" ]; then \ echo; echo " cd $$i; $(MAKE) $(MFLAGS) clean"; \ ( cd $$i; $(MAKE) $(MFLAGS) clean ); \ fi; \ @@ -55,7 +55,7 @@ veryclean: clean depend: FORCE @echo "making depend in `$(PWD)`" @for i in *; do \ - if [ -d $$i -a $$i != "RCS" ]; then \ + if [ -d $$i -a $$i != "CVS" ]; then \ echo; echo " cd $$i; $(MAKE) $(MFLAGS) depend"; \ ( cd $$i; $(MAKE) $(MFLAGS) depend ); \ fi; \ @@ -65,7 +65,7 @@ depend: FORCE lint: FORCE @echo "making lint in `$(PWD)`" @for i in *; do \ - if [ -d $$i -a $$i != "RCS" ]; then \ + if [ -d $$i -a $$i != "CVS" ]; then \ echo; echo " cd $$i; $(MAKE) $(MFLAGS) lint"; \ ( cd $$i; $(MAKE) $(MFLAGS) lint ); \ fi; \ @@ -75,7 +75,7 @@ lint: FORCE 5lint: FORCE @echo "making 5lint in `$(PWD)`" @for i in *; do \ - if [ -d $$i -a $$i != "RCS" ]; then \ + if [ -d $$i -a $$i != "CVS" ]; then \ echo; echo " cd $$i; $(MAKE) $(MFLAGS) 5lint"; \ ( cd $$i; $(MAKE) $(MFLAGS) 5lint ); \ fi; \ @@ -85,7 +85,7 @@ lint: FORCE links: @echo "making links in `$(PWD)`"; \ for i in .src/*; do \ - if [ -d $$i -a $$i != ".src/RCS" ]; then \ + if [ -d $$i -a $$i != ".src/CVS" ]; then \ d=`basename $$i`; \ ( $(MKDIR) $$d; cd $$d; $(LN) ../.src/$$d .src; \ $(LN) ../.src/$$d/Make-template . ; \ diff --git a/doc/man/Make-template b/doc/man/Make-template index e975170f3e..8d7f5bf1fa 100644 --- a/doc/man/Make-template +++ b/doc/man/Make-template @@ -22,7 +22,7 @@ all: FORCE @echo "making all in `$(PWD)`" @for i in *; do \ - if [ -d $$i -a $$i != "RCS" ]; then \ + if [ -d $$i -a $$i != "CVS" ]; then \ echo; echo " cd $$i; $(MAKE) $(MFLAGS) all"; \ ( cd $$i; $(MAKE) $(MFLAGS) all ); \ fi; \ @@ -36,7 +36,7 @@ all: FORCE install: FORCE @echo "making install in `$(PWD)`" @for i in *; do \ - if [ -d $$i -a $$i != "RCS" ]; then \ + if [ -d $$i -a $$i != "CVS" ]; then \ echo; echo " cd $$i; $(MAKE) $(MFLAGS) install"; \ ( cd $$i; $(MAKE) $(MFLAGS) install ); \ fi; \ @@ -49,7 +49,7 @@ install: FORCE clean: FORCE @echo "making clean in `$(PWD)`" @for i in *; do \ - if [ -d $$i -a $$i != "RCS" ]; then \ + if [ -d $$i -a $$i != "CVS" ]; then \ echo; echo " cd $$i; $(MAKE) $(MFLAGS) clean"; \ ( cd $$i; $(MAKE) $(MFLAGS) clean ); \ fi; \ @@ -65,7 +65,7 @@ veryclean: clean depend: FORCE @echo "making depend in `$(PWD)`" @for i in *; do \ - if [ -d $$i -a $$i != "RCS" ]; then \ + if [ -d $$i -a $$i != "CVS" ]; then \ echo; echo " cd $$i; $(MAKE) $(MFLAGS) depend"; \ ( cd $$i; $(MAKE) $(MFLAGS) depend ); \ fi; \ @@ -74,7 +74,7 @@ depend: FORCE links: @echo "making links in `$(PWD)`"; \ for i in .src/*; do \ - if [ -d $$i -a $$i != ".src/RCS" ]; then \ + if [ -d $$i -a $$i != ".src/CVS" ]; then \ d=`basename $$i`; \ ( $(MKDIR) $$d; cd $$d; $(LN) ../.src/$$d .src; \ $(LN) ../.src/$$d/Make-template . ; \ diff --git a/libraries/Make-template b/libraries/Make-template index 7f6c06df01..95169e554e 100644 --- a/libraries/Make-template +++ b/libraries/Make-template @@ -26,7 +26,7 @@ all: FORCE @echo "making all in `$(PWD)`" @for i in *; do \ - if [ -d $$i -a $$i != "RCS" ]; then \ + if [ -d $$i -a $$i != "CVS" ]; then \ echo; echo " cd $$i; $(MAKE) $(MFLAGS) all"; \ ( cd $$i; $(MAKE) $(MFLAGS) all ); \ fi; \ @@ -40,7 +40,7 @@ all: FORCE install: FORCE @echo "making install in `$(PWD)`" @for i in *; do \ - if [ -d $$i -a $$i != "RCS" ]; then \ + if [ -d $$i -a $$i != "CVS" ]; then \ echo; echo " cd $$i; $(MAKE) $(MFLAGS) install"; \ ( cd $$i; $(MAKE) $(MFLAGS) install ); \ fi; \ @@ -52,7 +52,7 @@ install: FORCE clean: FORCE @echo "making clean in `$(PWD)`" @for i in *; do \ - if [ -d $$i -a $$i != "RCS" ]; then \ + if [ -d $$i -a $$i != "CVS" ]; then \ echo; echo " cd $$i; $(MAKE) $(MFLAGS) clean"; \ ( cd $$i; $(MAKE) $(MFLAGS) clean ); \ fi; \ @@ -67,7 +67,7 @@ veryclean: clean depend: FORCE @echo "making depend in `$(PWD)`" @for i in *; do \ - if [ -d $$i -a $$i != "RCS" ]; then \ + if [ -d $$i -a $$i != "CVS" ]; then \ echo; echo " cd $$i; $(MAKE) $(MFLAGS) depend"; \ ( cd $$i; $(MAKE) $(MFLAGS) depend ); \ fi; \ @@ -76,7 +76,7 @@ depend: FORCE links: @echo "making links in `$(PWD)`"; \ for i in .src/*; do \ - if [ -d $$i -a $$i != ".src/RCS" ]; then \ + if [ -d $$i -a $$i != ".src/CVS" ]; then \ d=`basename $$i`; \ ( $(MKDIR) $$d; cd $$d; $(LN) ../.src/$$d .src; \ $(LN) ../.src/$$d/Make-template . ; \ diff --git a/servers/Make-template b/servers/Make-template index 39eb1240f1..6dbca325ad 100644 --- a/servers/Make-template +++ b/servers/Make-template @@ -26,7 +26,7 @@ all: FORCE @echo "making all in `$(PWD)`" @for i in *; do \ - if [ -d $$i -a $$i != "RCS" ]; then \ + if [ -d $$i -a $$i != "CVS" ]; then \ echo " cd $$i; $(MAKE) $(MFLAGS) all"; \ ( cd $$i; $(MAKE) $(MFLAGS) all ); \ fi; \ @@ -40,7 +40,7 @@ all: FORCE install: FORCE @echo "making install in `$(PWD)`" @for i in *; do \ - if [ -d $$i -a $$i != "RCS" ]; then \ + if [ -d $$i -a $$i != "CVS" ]; then \ echo " cd $$i; $(MAKE) $(MFLAGS) install"; \ ( cd $$i; $(MAKE) $(MFLAGS) install ); \ fi; \ @@ -53,7 +53,7 @@ install: FORCE clean: FORCE @echo "making clean in `$(PWD)`" @for i in *; do \ - if [ -d $$i -a $$i != "RCS" ]; then \ + if [ -d $$i -a $$i != "CVS" ]; then \ echo " cd $$i; $(MAKE) $(MFLAGS) clean"; \ ( cd $$i; $(MAKE) $(MFLAGS) clean ); \ fi; \ @@ -69,7 +69,7 @@ veryclean: clean depend: FORCE @echo "making depend in `$(PWD)`" @for i in *; do \ - if [ -d $$i -a $$i != "RCS" ]; then \ + if [ -d $$i -a $$i != "CVS" ]; then \ echo " cd $$i; $(MAKE) $(MFLAGS) depend"; \ ( cd $$i; $(MAKE) $(MFLAGS) depend ); \ fi; \ @@ -78,7 +78,7 @@ depend: FORCE links: @echo "making links in `$(PWD)`"; \ for i in .src/*; do \ - if [ -d $$i -a $$i != ".src/RCS" ]; then \ + if [ -d $$i -a $$i != ".src/CVS" ]; then \ d=`basename $$i`; \ ( $(MKDIR) $$d; cd $$d; $(LN) ../.src/$$d .src; \ $(LN) ../.src/$$d/Make-template . ; \ diff --git a/servers/slurpd/re.c b/servers/slurpd/re.c index 4a6dc38237..28d1d09b58 100644 --- a/servers/slurpd/re.c +++ b/servers/slurpd/re.c @@ -31,7 +31,9 @@ extern char *str_getline( char **next ); extern void ch_free( char *p ); +#if !(defined(BSD) && (BSD >= 199306)) extern char *sys_errlist[]; +#endif /* Forward references */ static Rh *get_repl_hosts( char *, int *, char ** ); diff --git a/servers/slurpd/rq.c b/servers/slurpd/rq.c index 54adb4da1a..2745d4fe78 100644 --- a/servers/slurpd/rq.c +++ b/servers/slurpd/rq.c @@ -44,9 +44,9 @@ extern void Re_dump( Re *re ); extern void Re_dump(); #endif /* NEEDPROTOS */ - +#if !(defined(BSD) && (BSD >= 199306)) extern char *sys_errlist[]; - +#endif /* * Lock the replication queue. diff --git a/tests/Make-template b/tests/Make-template index f8cae98bf0..7e49ed6c61 100644 --- a/tests/Make-template +++ b/tests/Make-template @@ -24,7 +24,7 @@ install: FORCE depend: FORCE clean: FORCE - $(RM) test-db/* test-repl/* + $(RM) test-db/[a-z]* test-repl/[a-z]* veryclean: clean From 860038cff14e03dc74ada45e030e6161ba5d2a0d Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Sun, 9 Aug 1998 02:28:45 +0000 Subject: [PATCH 03/18] LDAPworld P1: DEC and other portability issues --- clients/fax500/Make-template | 2 +- clients/fax500/xrpcomp | 2 +- clients/ud/util.c | 2 -- include/ldap.h | 6 ++++-- include/portable.h | 4 ++-- libraries/libldap/ldap-int.h | 23 +++++++++++++++++++++++ libraries/libldap/ldapfilter.conf | 16 +++++++++------- libraries/libldap/open.c | 4 ++++ libraries/libldap/test.c | 6 ++++++ servers/slapd/back-ldbm/Make-template | 2 +- servers/slapd/daemon.c | 10 ++++++++++ servers/slapd/monitor.c | 25 +++++++++++++++++++++---- 12 files changed, 82 insertions(+), 20 deletions(-) diff --git a/clients/fax500/Make-template b/clients/fax500/Make-template index e3b224d772..7d20fb1366 100644 --- a/clients/fax500/Make-template +++ b/clients/fax500/Make-template @@ -55,7 +55,7 @@ fax5version.c: main.o faxtotpc.o $(LDIR)/libldap.a install: rp500 xrpcomp fax500 FORCE -$(MKDIR) -p $(ETCDIR) $(BINDIR) $(INSTALL) $(INSTALLFLAGS) -m 755 rp500 $(ETCDIR) - $(SED) -e 's%ETCDIR%$(ETCDIR)%' xrpcomp > /tmp/xrpcomp.tmp + $(SED) -e 's%ETCDIR%$(RUNTIMEETCDIR)%' xrpcomp > /tmp/xrpcomp.tmp $(INSTALL) $(INSTALLFLAGS) -m 755 /tmp/xrpcomp.tmp $(BINDIR)/xrpcomp $(RM) /tmp/xrpcomp.tmp $(INSTALL) $(INSTALLFLAGS) -m 755 fax500 $(ETCDIR) diff --git a/clients/fax500/xrpcomp b/clients/fax500/xrpcomp index 3a914eac78..39c59e38aa 100644 --- a/clients/fax500/xrpcomp +++ b/clients/fax500/xrpcomp @@ -1,4 +1,4 @@ -: run this script through /bin/sh +#! /bin/sh RP500=ETCDIR/rp500 diff --git a/clients/ud/util.c b/clients/ud/util.c index 2edb5aa265..389b8a0d62 100644 --- a/clients/ud/util.c +++ b/clients/ud/util.c @@ -226,8 +226,6 @@ FILE *where; fatal(s) char *s; { - void exit(); - if (errno != 0) perror(s); #ifdef KERBEROS diff --git a/include/ldap.h b/include/ldap.h index 1eab5bda62..ee956742e7 100644 --- a/include/ldap.h +++ b/include/ldap.h @@ -295,7 +295,7 @@ typedef struct ldapmsg { BerElement *lm_ber; /* the ber encoded message contents */ struct ldapmsg *lm_chain; /* for search - next msg in the resp */ struct ldapmsg *lm_next; /* next response */ - unsigned long lm_time; /* used to maintain cache */ + unsigned int lm_time; /* used to maintain cache */ } LDAPMessage; #define NULLMSG ((LDAPMessage *) NULL) @@ -318,7 +318,7 @@ typedef struct ldap_server { typedef struct ldap_conn { Sockbuf *lconn_sb; int lconn_refcnt; - unsigned long lconn_lastused; /* time */ + unsigned int lconn_lastused; /* time */ int lconn_status; #define LDAP_CONNST_NEEDSOCKET 1 #define LDAP_CONNST_CONNECTING 2 @@ -569,6 +569,8 @@ extern char *strdup(); #else /* NEEDPROTOS */ #if !defined(MACOS) && !defined(DOS) && !defined(_WIN32) && !defined(WINSOCK) +#include +#include #include #endif #if defined(WINSOCK) diff --git a/include/portable.h b/include/portable.h index a91b27a5d5..b64be6c79c 100644 --- a/include/portable.h +++ b/include/portable.h @@ -61,9 +61,9 @@ #endif /* - * on many systems, we should use waitpid() instead of waitN() + * on most systems, we should use waitpid() instead of waitN() */ -#if !defined( USE_WAITPID ) && ( defined( SYSV ) || defined( sunos4 ) || defined( ultrix ) || defined( aix )) +#if !defined( USE_WAITPID ) && !defined( nextstep ) #define USE_WAITPID #endif diff --git a/libraries/libldap/ldap-int.h b/libraries/libldap/ldap-int.h index 10adbe91ff..c44c5910e8 100644 --- a/libraries/libldap/ldap-int.h +++ b/libraries/libldap/ldap-int.h @@ -187,3 +187,26 @@ char **getdxbyname( char *domain ); char **getdxbyname(); #endif /* NEEDPROTOS */ #endif /* LDAP_DNS */ + +#if defined( STR_TRANSLATION ) && defined( LDAP_DEFAULT_CHARSET ) +/* + * in charset.c + * + * added-in this stuff so that libldap.a would build, i.e. refs to + * these routines from open.c would resolve. + * hodges@stanford.edu 5-Feb-96 + */ +#if LDAP_CHARSET_8859 == LDAP_DEFAULT_CHARSET +#ifdef NEEDPROTOS +extern +int ldap_t61_to_8859( char **bufp, unsigned long *buflenp, int free_input ); +extern +int ldap_8859_to_t61( char **bufp, unsigned long *buflenp, int free_input ); +#else /* NEEDPROTOS */ +extern +int ldap_t61_to_8859(); +extern +int ldap_8859_to_t61(); +#endif /* NEEDPROTOS */ +#endif /* LDAP_CHARSET_8859 == LDAP_DEFAULT_CHARSET */ +#endif /* STR_TRANSLATION && LDAP_DEFAULT_CHARSET */ diff --git a/libraries/libldap/ldapfilter.conf b/libraries/libldap/ldapfilter.conf index c602f7d2e7..8abae88636 100644 --- a/libraries/libldap/ldapfilter.conf +++ b/libraries/libldap/ldapfilter.conf @@ -24,33 +24,35 @@ # "finger and ud and go500 and go500gw subtree and web500gw subtree and rp500 and rcpt500 and ufn last" + "^$" "" "(objectclass=*)" "default filter" "=" " " "%v" "arbitrary filter" - "^[0-9][0-9-]*$" " " "(telephoneNumber=*%v)" "phone number" + "^[0-9][0-9\-]*$" " " "(telephoneNumber=*%v)" "phone number" "@" " " "(mail=%v)" "email address" "(mail=%v*)" "start of email address" - "^.[. _].*" ". _" "(cn=%v1* %v2-)" "first initial" + "^.[\. _].*" ". _" "(cn=%v1* %v2-)" "first initial" ".*[. _].$" ". _" "(cn=%v1-*)" "last initial" "[. _]" ". _" "(|(sn=%v1-)(cn=%v1-))" "exact" "(|(sn~=%v1-)(cn~=%v1-))" "approximate" - ".*" ". " "(|(cn=%v1)(sn=%v1)(uid=%v1))" "exact" - "(|(cn~=%v1)(sn~=%v1))" "approximate" + ".*" ". " "(|(cn=%v1)(sn=%v1)(ou=%v1))" "exact" + "(|(cn~=%v1)(sn~=%v1)(ou~=%v1))" "approximate" "go500gw onelevel and web500gw onelevel and ufn first and ufn intermediate" + "^$" "" "(!(objectclass=dSA))" "default filter" "=" " " "%v" "arbitrary filter" - "^..$" " " "(|(o=%v)(c=%v)(l=%v)(co=%v))" "exact" - "(|(o~=%v)(c~=%v)(l~=%v)(co~=%v))" "approximate" + "^..$" " " "(|(o=%v)(c=%v)(l=%v)(co=%v))" "exact2" + "(|(o~=%v)(c~=%v)(l~=%v)(co~=%v))" "approximate2" " " " " "(|(o=%v)(l=%v)(co=%v)(ou=%v))" "exact" "(|(o~=%v)(l~=%v)(co~=%v)(ou~=%v))" "approximate" - "\." " " "(associatedDomain=%v)" "exact" + "\." " " "(associatedDomain=%v)" "exact" ".*" " " "(|(o=%v)(l=%v)(co=%v)(ou=%v))" "exact" "(|(o~=%v)(l~=%v)(co~=%v)(ou~=%v))" "approximate" diff --git a/libraries/libldap/open.c b/libraries/libldap/open.c index 22cd98e377..3ca73f336d 100644 --- a/libraries/libldap/open.c +++ b/libraries/libldap/open.c @@ -148,6 +148,10 @@ ldap_init( char *defhost, int defport ) ld->ld_lberoptions = LBER_USE_DER; ld->ld_refhoplimit = LDAP_DEFAULT_REFHOPLIMIT; +#ifdef LDAP_REFERRALS + ld->ld_options |= LDAP_OPT_REFERRALS; +#endif /* LDAP_REFERRALS */ + #if defined( STR_TRANSLATION ) && defined( LDAP_DEFAULT_CHARSET ) ld->ld_lberoptions |= LBER_TRANSLATE_STRINGS; #if LDAP_CHARSET_8859 == LDAP_DEFAULT_CHARSET diff --git a/libraries/libldap/test.c b/libraries/libldap/test.c index 84f478da80..e9cc1266d2 100644 --- a/libraries/libldap/test.c +++ b/libraries/libldap/test.c @@ -31,6 +31,12 @@ #include "lber.h" #include "ldap.h" +/* including the "internal" defs is legit and nec. since this test routine has + * a-priori knowledge of libldap internal workings. + * hodges@stanford.edu 5-Feb-96 + */ +#include "ldap-int.h" + #if !defined( PCNFS ) && !defined( WINSOCK ) && !defined( MACOS ) #define MOD_USE_BVALS #endif /* !PCNFS && !WINSOCK && !MACOS */ diff --git a/servers/slapd/back-ldbm/Make-template b/servers/slapd/back-ldbm/Make-template index 51ef7a8171..a4b909ded0 100644 --- a/servers/slapd/back-ldbm/Make-template +++ b/servers/slapd/back-ldbm/Make-template @@ -34,7 +34,7 @@ LDFLAGS = -L$(LDIR) $(KRBLIBFLAG) all: FORCE -@echo "$(SLAPD_BACKENDS)" | grep LDAP_LDBM 2>&1 > /dev/null; \ if [ $$? = 0 ]; then \ - $(MAKE) $(MFLAGS) CC=$(CC) libback-ldbm.a; \ + $(MAKE) $(MFLAGS) CC="$(CC)" libback-ldbm.a; \ else \ echo "Include -DLDAP_LDBM in SLAPD_BACKENDS in the"; \ echo "Make-common file to build the ldbm backend"; \ diff --git a/servers/slapd/daemon.c b/servers/slapd/daemon.c index 161fb79cf0..0558d1e162 100644 --- a/servers/slapd/daemon.c +++ b/servers/slapd/daemon.c @@ -1,3 +1,10 @@ + +/* Revision history + * + * 5-Jun-96 hodges + * Added locking of new_conn_mutex when traversing the c[] array. + */ + #include #include #include @@ -164,6 +171,8 @@ daemon( Debug( LDAP_DEBUG_CONNS, "listening for connections on %d, activity on:", tcps, 0, 0 ); + + pthread_mutex_lock( &new_conn_mutex ); for ( i = 0; i < dtblsize; i++ ) { if ( c[i].c_sb.sb_sd != -1 ) { FD_SET( c[i].c_sb.sb_sd, &readfds ); @@ -176,6 +185,7 @@ daemon( } } Debug( LDAP_DEBUG_CONNS, "\n", 0, 0, 0 ); + pthread_mutex_unlock( &new_conn_mutex ); zero.tv_sec = 0; zero.tv_usec = 0; diff --git a/servers/slapd/monitor.c b/servers/slapd/monitor.c index 7dbabc9377..07ead7445d 100644 --- a/servers/slapd/monitor.c +++ b/servers/slapd/monitor.c @@ -10,8 +10,16 @@ * is provided ``as is'' without express or implied warranty. */ +/* Revision history + * + * 5-Jun-96 jeff.hodges@stanford.edu + * Added locking of new_conn_mutex when traversing the c[] array. + * Added locking of currenttime_mutex to protect call(s) to localtime(). + */ + #include #include +#include #include #include #include "slap.h" @@ -32,13 +40,11 @@ extern time_t currenttime; extern time_t starttime; extern int num_conns; +extern pthread_mutex_t new_conn_mutex; +extern pthread_mutex_t currenttime_mutex; extern char Versionstr[]; -/* - * no mutex protection in here - take our chances! - */ - void monitor_info( Connection *conn, Operation *op ) { @@ -73,6 +79,8 @@ monitor_info( Connection *conn, Operation *op ) nconns = 0; nwritewaiters = 0; nreadwaiters = 0; + + pthread_mutex_lock( &new_conn_mutex ); for ( i = 0; i < dtblsize; i++ ) { if ( c[i].c_sb.sb_sd != -1 ) { nconns++; @@ -82,8 +90,11 @@ monitor_info( Connection *conn, Operation *op ) if ( c[i].c_gettingber ) { nreadwaiters++; } + pthread_mutex_lock( ¤ttime_mutex ); ltm = localtime( &c[i].c_starttime ); strftime( buf2, sizeof(buf2), "%y%m%d%H%M%SZ", ltm ); + pthread_mutex_unlock( ¤ttime_mutex ); + pthread_mutex_lock( &c[i].c_dnmutex ); sprintf( buf, "%d : %s : %ld : %ld : %s : %s%s", i, buf2, c[i].c_opsinitiated, c[i].c_opscompleted, @@ -96,6 +107,8 @@ monitor_info( Connection *conn, Operation *op ) attr_merge( e, "connection", vals ); } } + pthread_mutex_unlock( &new_conn_mutex ); + sprintf( buf, "%d", nconns ); val.bv_val = buf; val.bv_len = strlen( buf ); @@ -141,14 +154,18 @@ monitor_info( Connection *conn, Operation *op ) val.bv_len = strlen( buf ); attr_merge( e, "bytessent", vals ); + pthread_mutex_lock( ¤ttime_mutex ); ltm = localtime( ¤ttime ); strftime( buf, sizeof(buf), "%y%m%d%H%M%SZ", ltm ); + pthread_mutex_unlock( ¤ttime_mutex ); val.bv_val = buf; val.bv_len = strlen( buf ); attr_merge( e, "currenttime", vals ); + pthread_mutex_lock( ¤ttime_mutex ); ltm = localtime( &starttime ); strftime( buf, sizeof(buf), "%y%m%d%H%M%SZ", ltm ); + pthread_mutex_unlock( ¤ttime_mutex ); val.bv_val = buf; val.bv_len = strlen( buf ); attr_merge( e, "starttime", vals ); From 8d5c2b41e69bd8802b4730f90a870a9302ba31f2 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Sun, 9 Aug 1998 02:33:01 +0000 Subject: [PATCH 04/18] LDAPworld P3: SLAPD LDBM Generation with Multiple Backends --- clients/fax500/Make-template | 8 +- clients/finger/Make-template | 5 +- clients/gopher/Make-template | 9 +- clients/mail500/Make-template | 4 +- clients/rcpt500/Make-template | 11 +- clients/tools/Make-template | 16 +-- clients/ud/Make-template | 26 ++-- libraries/liblber/Make-template | 6 +- libraries/libldap/Make-template | 77 ++++++------ libraries/libldbm/Make-template | 2 +- libraries/libldif/Make-template | 3 +- libraries/liblthread/Make-template | 4 +- servers/slapd/Make-template | 160 +++++++++++------------- servers/slapd/back-ldbm/Make-template | 122 ++++++++---------- servers/slapd/back-passwd/Make-template | 11 +- servers/slapd/back-shell/Make-template | 63 ++++------ servers/slapd/tools/Make-template | 62 ++++----- servers/slapd/tools/ldif2id2children.c | 2 +- servers/slapd/tools/ldif2id2entry.c | 2 +- servers/slapd/tools/ldif2index.c | 2 +- servers/slapd/tools/ldif2ldbm.c | 8 +- servers/slurpd/Make-template | 99 ++++++--------- 22 files changed, 300 insertions(+), 402 deletions(-) diff --git a/clients/fax500/Make-template b/clients/fax500/Make-template index 7d20fb1366..997cc6513d 100644 --- a/clients/fax500/Make-template +++ b/clients/fax500/Make-template @@ -78,10 +78,10 @@ links: # DO NOT DELETE THIS LINE -- mkdep uses it. # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. -rp500.o: rp500.c ../../include/ldapconfig.h ../../include/lber.h -rp500.o: ../../include/ldap.h -main.o: main.c ../../include/ldapconfig.h ../../include/portable.h -main.o: ../../include/lber.h ../../include/ldap.h +rp500.o: rp500.c ../../include/ldapconfig.h ../../include/proto-lber.h +rp500.o: ../../include/proto-ldap.h +main.o: main.c ../../include/portable.h ../../include/proto-lber.h +main.o: ../../include/proto-ldap.h faxtotpc.o: faxtotpc.c # IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/clients/finger/Make-template b/clients/finger/Make-template index d55329f839..93d8b8dc39 100644 --- a/clients/finger/Make-template +++ b/clients/finger/Make-template @@ -63,8 +63,7 @@ links: # DO NOT DELETE THIS LINE -- mkdep uses it. # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. -main.o: main.c ../../include/lber.h ../../include/ldap.h -main.o: ../../include/disptmpl.h ../../include/portable.h -main.o: ../../include/ldapconfig.h +main.o: main.c ../../include/ldap.h ../../include/proto-ldap.h +main.o: ../../include/portable.h # IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/clients/gopher/Make-template b/clients/gopher/Make-template index 9c45559d7a..18a907038a 100644 --- a/clients/gopher/Make-template +++ b/clients/gopher/Make-template @@ -80,12 +80,11 @@ links: # DO NOT DELETE THIS LINE -- mkdep uses it. # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. -go500.o: go500.c ../../include/portable.h ../../include/ldapconfig.h -go500.o: ../../include/lber.h ../../include/ldap.h ../../include/disptmpl.h -go500gw.o: go500gw.c ../../include/lber.h ../../include/ldap.h -go500gw.o: ../../include/disptmpl.h ../../include/portable.h +go500.o: go500.c ../../include/ldapconfig.h ../../include/proto-lber.h +go500.o: ../../include/proto-ldap.h +go500gw.o: go500gw.c ../../include/ldap.h ../../include/proto-ldap.h go500gw.o: ../../include/ldapconfig.h -detach.o: detach.c ../../include/portable.h +detach.o: detach.c setproctitle.o: setproctitle.c # IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/clients/mail500/Make-template b/clients/mail500/Make-template index bdac2a2fc4..360eaa8b34 100644 --- a/clients/mail500/Make-template +++ b/clients/mail500/Make-template @@ -62,7 +62,7 @@ links: # DO NOT DELETE THIS LINE -- mkdep uses it. # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. -main.o: main.c ../../include/portable.h ../../include/lber.h -main.o: ../../include/ldap.h ../../include/ldapconfig.h +main.o: main.c ../../include/portable.h ../../include/proto-lber.h +main.o: ../../include/proto-ldap.h # IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/clients/rcpt500/Make-template b/clients/rcpt500/Make-template index 2677021a9e..7fc84bdfeb 100644 --- a/clients/rcpt500/Make-template +++ b/clients/rcpt500/Make-template @@ -61,11 +61,10 @@ links: # DO NOT DELETE THIS LINE -- mkdep uses it. # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. -main.o: main.c ../../include/portable.h ../../include/ldapconfig.h rcpt500.h -cmds.o: cmds.c rcpt500.h -help.o: help.c ../../include/portable.h ../../include/ldapconfig.h rcpt500.h -query.o: query.c ../../include/lber.h ../../include/ldap.h -query.o: ../../include/portable.h ../../include/ldapconfig.h -query.o: ../../include/disptmpl.h rcpt500.h +main.o: main.c ../../include/portable.h +cmds.o: cmds.c +help.o: help.c ../../include/portable.h +query.o: query.c ../../include/proto-lber.h ../../include/proto-ldap.h +query.o: ../../include/ldapconfig.h # IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/clients/tools/Make-template b/clients/tools/Make-template index af3b4d5758..4c577dce3d 100644 --- a/clients/tools/Make-template +++ b/clients/tools/Make-template @@ -106,13 +106,13 @@ links: # DO NOT DELETE THIS LINE -- mkdep uses it. # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. -ldapsearch.o: ldapsearch.c ../../include/lber.h ../../include/ldap.h -ldapsearch.o: ../../include/ldif.h ../../include/ldapconfig.h -ldapmodify.o: ldapmodify.c ../../include/lber.h ../../include/ldap.h -ldapmodify.o: ../../include/ldif.h ../../include/ldapconfig.h -ldapdelete.o: ldapdelete.c ../../include/lber.h ../../include/ldap.h -ldapdelete.o: ../../include/ldapconfig.h -ldapmodrdn.o: ldapmodrdn.c ../../include/lber.h ../../include/ldap.h -ldapmodrdn.o: ../../include/ldapconfig.h +ldapsearch.o: ldapsearch.c ../../include/lber.h ../../include/proto-ldap.h +ldapsearch.o: ../../include/ldapconfig.h +ldapmodify.o: ldapmodify.c ../../include/lber.h ../../include/proto-ldap.h +ldapmodify.o: ../../include/ldapconfig.h +ldapdelete.o: ldapdelete.c ../../include/proto-lber.h +ldapdelete.o: ../../include/proto-ldap.h +ldapmodrdn.o: ldapmodrdn.c ../../include/proto-lber.h +ldapmodrdn.o: ../../include/proto-ldap.h # IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/clients/ud/Make-template b/clients/ud/Make-template index 1cba01cbd1..ed9d8faad8 100644 --- a/clients/ud/Make-template +++ b/clients/ud/Make-template @@ -80,21 +80,17 @@ links: # DO NOT DELETE THIS LINE -- mkdep uses it. # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. -main.o: main.c ../../include/lber.h ../../include/ldap.h -main.o: ../../include/ldapconfig.h ../../include/portable.h ud.h -find.o: find.c ../../include/lber.h ../../include/ldap.h ud.h -mod.o: mod.c ../../include/lber.h ../../include/ldap.h ud.h -print.o: print.c ../../include/lber.h ../../include/ldap.h ud.h -auth.o: auth.c ../../include/lber.h ../../include/ldap.h -auth.o: ../../include/ldapconfig.h ud.h -util.o: util.c ../../include/lber.h ../../include/ldap.h -util.o: ../../include/ldapconfig.h ../../include/portable.h ud.h -help.o: help.c ../../include/lber.h ../../include/ldap.h ud.h +main.o: main.c ../../include/lber.h ../../include/proto-ldap.h +main.o: ../../include/portable.h +find.o: find.c ../../include/proto-lber.h ../../include/proto-ldap.h +mod.o: mod.c ../../include/proto-lber.h ../../include/proto-ldap.h +print.o: print.c ../../include/proto-lber.h ../../include/proto-ldap.h +auth.o: auth.c ../../include/proto-lber.h ../../include/proto-ldap.h +util.o: util.c ../../include/proto-lber.h ../../include/ldapconfig.h +help.o: help.c ../../include/proto-lber.h ../../include/proto-ldap.h string_to_key.o: string_to_key.c -group.o: group.c ../../include/lber.h ../../include/ldap.h -group.o: ../../include/ldapconfig.h ud.h -edit.o: edit.c ../../include/lber.h ../../include/ldap.h -edit.o: ../../include/ldapconfig.h ud.h -globals.o: globals.c ud.h +group.o: group.c ../../include/lber.h ../../include/proto-ldap.h +edit.o: edit.c ../../include/lber.h ../../include/proto-ldap.h +globals.o: globals.c # IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/libraries/liblber/Make-template b/libraries/liblber/Make-template index f1b9dd4f36..6f29212711 100644 --- a/libraries/liblber/Make-template +++ b/libraries/liblber/Make-template @@ -77,9 +77,9 @@ links: # DO NOT DELETE THIS LINE -- mkdep uses it. # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. -decode.o: decode.c ../../include/lber.h +decode.o: decode.c ../../include/proto-lber.h encode.o: encode.c ../../include/lber.h -io.o: io.c ../../include/lber.h -bprint.o: bprint.c ../../include/lber.h +io.o: io.c ../../include/proto-lber.h +bprint.o: bprint.c ../../include/proto-lber.h # IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/libraries/libldap/Make-template b/libraries/libldap/Make-template index 9ca5d7f234..8d04b53b77 100644 --- a/libraries/libldap/Make-template +++ b/libraries/libldap/Make-template @@ -96,48 +96,43 @@ links: # DO NOT DELETE THIS LINE -- mkdep uses it. # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. -bind.o: bind.c ../../include/lber.h ../../include/ldap.h -open.o: open.c ../../include/lber.h ../../include/ldap.h ldap-int.h -result.o: result.c ../../include/portable.h ../../include/lber.h -result.o: ../../include/ldap.h ldap-int.h -error.o: error.c ../../include/lber.h ../../include/ldap.h -compare.o: compare.c ../../include/lber.h ../../include/ldap.h ldap-int.h -search.o: search.c ../../include/lber.h ../../include/ldap.h ldap-int.h -modify.o: modify.c ../../include/lber.h ../../include/ldap.h ldap-int.h -add.o: add.c ../../include/lber.h ../../include/ldap.h ldap-int.h -modrdn.o: modrdn.c ../../include/lber.h ../../include/ldap.h ldap-int.h -delete.o: delete.c ../../include/lber.h ../../include/ldap.h ldap-int.h -abandon.o: abandon.c ../../include/lber.h ../../include/ldap.h ldap-int.h -ufn.o: ufn.c ../../include/lber.h ../../include/ldap.h -cache.o: cache.c ../../include/lber.h ../../include/ldap.h ldap-int.h -getfilter.o: getfilter.c ../../include/lber.h ../../include/ldap.h -getfilter.o: ../../include/regex.h -regex.o: regex.c ../../include/portable.h -sbind.o: sbind.c ../../include/lber.h ../../include/ldap.h ldap-int.h -kbind.o: kbind.c ../../include/lber.h ../../include/ldap.h ldap-int.h -unbind.o: unbind.c ../../include/lber.h ../../include/ldap.h ldap-int.h -friendly.o: friendly.c ../../include/lber.h ../../include/ldap.h -cldap.o: cldap.c ../../include/lber.h ../../include/ldap.h ldap-int.h -free.o: free.c ../../include/lber.h ../../include/ldap.h -disptmpl.o: disptmpl.c ../../include/lber.h ../../include/ldap.h -disptmpl.o: ../../include/disptmpl.h -srchpref.o: srchpref.c ../../include/lber.h ../../include/ldap.h -srchpref.o: ../../include/srchpref.h -dsparse.o: dsparse.c ../../include/lber.h ../../include/ldap.h -tmplout.o: tmplout.c ../../include/lber.h ../../include/ldap.h -tmplout.o: ../../include/disptmpl.h -sort.o: sort.c ../../include/lber.h ../../include/ldap.h -getdn.o: getdn.c ../../include/lber.h ../../include/ldap.h -getentry.o: getentry.c ../../include/lber.h ../../include/ldap.h -getattr.o: getattr.c ../../include/lber.h ../../include/ldap.h ldap-int.h -getvalues.o: getvalues.c ../../include/lber.h ../../include/ldap.h -addentry.o: addentry.c ../../include/lber.h ../../include/ldap.h -request.o: request.c ../../include/portable.h ../../include/lber.h -request.o: ../../include/ldap.h ldap-int.h +bind.o: bind.c ../../include/lber.h ../../include/proto-ldap.h +open.o: open.c ../../include/proto-lber.h ../../include/proto-ldap.h +result.o: result.c ../../include/portable.h ../../include/proto-lber.h +result.o: ../../include/proto-ldap.h +error.o: error.c ../../include/lber.h ../../include/proto-ldap.h +compare.o: compare.c ../../include/lber.h ../../include/proto-ldap.h +search.o: search.c ../../include/lber.h ../../include/proto-ldap.h +modify.o: modify.c ../../include/lber.h ../../include/proto-ldap.h +add.o: add.c ../../include/lber.h ../../include/proto-ldap.h +modrdn.o: modrdn.c ../../include/lber.h ../../include/proto-ldap.h +delete.o: delete.c ../../include/lber.h ../../include/proto-ldap.h +abandon.o: abandon.c ../../include/lber.h ../../include/proto-ldap.h +ufn.o: ufn.c ../../include/lber.h ../../include/proto-ldap.h +cache.o: cache.c ../../include/lber.h ../../include/proto-ldap.h +getfilter.o: getfilter.c ../../include/lber.h ../../include/proto-ldap.h +regex.o: regex.c +sbind.o: sbind.c ../../include/lber.h ../../include/proto-ldap.h +kbind.o: kbind.c +unbind.o: unbind.c ../../include/proto-lber.h ../../include/proto-ldap.h +friendly.o: friendly.c ../../include/lber.h ../../include/proto-ldap.h +cldap.o: cldap.c +free.o: free.c ../../include/ldap.h +disptmpl.o: disptmpl.c ../../include/proto-lber.h ../../include/disptmpl.h +srchpref.o: srchpref.c ../../include/proto-lber.h ../../include/srchpref.h +dsparse.o: dsparse.c ../../include/proto-lber.h +tmplout.o: tmplout.c ../../include/proto-lber.h ../../include/proto-ldap.h +sort.o: sort.c ../../include/proto-lber.h ../../include/proto-ldap.h +getdn.o: getdn.c ../../include/lber.h ../../include/proto-ldap.h +getentry.o: getentry.c ../../include/lber.h ../../include/proto-ldap.h +getattr.o: getattr.c ../../include/lber.h ../../include/proto-ldap.h +getvalues.o: getvalues.c ../../include/lber.h ../../include/proto-ldap.h +addentry.o: addentry.c ../../include/lber.h ../../include/proto-ldap.h +request.o: request.c ../../include/portable.h ../../include/proto-lber.h +request.o: ../../include/proto-ldap.h getdxbyname.o: getdxbyname.c -os-ip.o: os-ip.c ../../include/portable.h ../../include/lber.h -os-ip.o: ../../include/ldap.h -url.o: url.c ../../include/lber.h ../../include/ldap.h ldap-int.h +os-ip.o: os-ip.c ../../include/proto-lber.h ../../include/proto-ldap.h +url.o: url.c ../../include/lber.h ../../include/proto-ldap.h charset.o: charset.c # IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/libraries/libldbm/Make-template b/libraries/libldbm/Make-template index 09ad2ee08f..ac7df08700 100644 --- a/libraries/libldbm/Make-template +++ b/libraries/libldbm/Make-template @@ -66,6 +66,6 @@ links: # DO NOT DELETE THIS LINE -- mkdep uses it. # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. -ldbm.o: ldbm.c ../../include/ldbm.h +ldbm.o: ldbm.c # IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/libraries/libldif/Make-template b/libraries/libldif/Make-template index 75061f7e5d..319cc51cb5 100644 --- a/libraries/libldif/Make-template +++ b/libraries/libldif/Make-template @@ -63,7 +63,6 @@ links: # DO NOT DELETE THIS LINE -- mkdep uses it. # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. -line64.o: line64.c ../../include/lber.h ../../include/ldap.h -line64.o: ../../include/ldif.h +line64.o: line64.c ../../include/proto-lber.h ../../include/proto-ldap.h # IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/libraries/liblthread/Make-template b/libraries/liblthread/Make-template index 2344ba925c..c0721b1890 100644 --- a/libraries/liblthread/Make-template +++ b/libraries/liblthread/Make-template @@ -63,7 +63,7 @@ links: # DO NOT DELETE THIS LINE -- mkdep uses it. # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. -thread.o: thread.c ../../include/lthread.h -stack.o: stack.c ../../include/lber.h ../../include/ldap.h +thread.o: thread.c +stack.o: stack.c ../../include/proto-lber.h ../../include/proto-ldap.h # IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/servers/slapd/Make-template b/servers/slapd/Make-template index d3a5f49884..bdeb881c70 100644 --- a/servers/slapd/Make-template +++ b/servers/slapd/Make-template @@ -168,99 +168,79 @@ links: # DO NOT DELETE THIS LINE -- mkdep uses it. # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. -main.o: main.c ../../include/portable.h slap.h ../../include/avl.h -main.o: ../../include/lber.h ../../include/ldap.h ../../include/lthread.h -main.o: ../../include/ldif.h ../../include/ldapconfig.h -daemon.o: daemon.c slap.h ../../include/avl.h ../../include/lber.h -daemon.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldif.h -daemon.o: ../../include/portable.h ../../include/ldapconfig.h -connection.o: connection.c ../../include/portable.h slap.h ../../include/avl.h -connection.o: ../../include/lber.h ../../include/ldap.h ../../include/lthread.h -connection.o: ../../include/ldif.h -search.o: search.c slap.h ../../include/avl.h ../../include/lber.h -search.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldif.h -search.o: ../../include/ldapconfig.h -filter.o: filter.c slap.h ../../include/avl.h ../../include/lber.h -filter.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldif.h -add.o: add.c slap.h ../../include/avl.h ../../include/lber.h -add.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldif.h -charray.o: charray.c slap.h ../../include/avl.h ../../include/lber.h -charray.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldif.h -attr.o: attr.c ../../include/portable.h slap.h ../../include/avl.h -attr.o: ../../include/lber.h ../../include/ldap.h ../../include/lthread.h +main.o: main.c ../../include/portable.h ../../include/avl.h +main.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldapconfig.h +daemon.o: daemon.c ../../include/avl.h ../../include/ldap.h +daemon.o: ../../include/lthread.h ../../include/portable.h +connection.o: connection.c ../../include/portable.h ../../include/avl.h +connection.o: ../../include/ldap.h ../../include/lthread.h +search.o: search.c ../../include/proto-lber.h ../../include/proto-ldap.h +search.o: ../../include/ldif.h +filter.o: filter.c ../../include/proto-lber.h ../../include/proto-ldap.h +filter.o: ../../include/ldif.h +add.o: add.c ../../include/avl.h ../../include/ldap.h +add.o: ../../include/proto-ldap.h ../../include/ldif.h +charray.o: charray.c ../../include/proto-lber.h ../../include/proto-ldap.h +charray.o: ../../include/ldif.h +attr.o: attr.c ../../include/proto-lber.h ../../include/proto-ldap.h attr.o: ../../include/ldif.h -entry.o: entry.c slap.h ../../include/avl.h ../../include/lber.h -entry.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldif.h -config.o: config.c slap.h ../../include/avl.h ../../include/lber.h -config.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldif.h -config.o: ../../include/ldapconfig.h -backend.o: backend.c slap.h ../../include/avl.h ../../include/lber.h -backend.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldif.h -result.o: result.c ../../include/portable.h slap.h ../../include/avl.h -result.o: ../../include/lber.h ../../include/ldap.h ../../include/lthread.h -result.o: ../../include/ldif.h -operation.o: operation.c slap.h ../../include/avl.h ../../include/lber.h -operation.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldif.h -dn.o: dn.c ../../include/portable.h slap.h ../../include/avl.h -dn.o: ../../include/lber.h ../../include/ldap.h ../../include/lthread.h -dn.o: ../../include/ldif.h -compare.o: compare.c slap.h ../../include/avl.h ../../include/lber.h -compare.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldif.h -modify.o: modify.c slap.h ../../include/avl.h ../../include/lber.h -modify.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldif.h -delete.o: delete.c slap.h ../../include/avl.h ../../include/lber.h -delete.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldif.h -modrdn.o: modrdn.c slap.h ../../include/avl.h ../../include/lber.h -modrdn.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldif.h -ch_malloc.o: ch_malloc.c slap.h ../../include/avl.h ../../include/lber.h -ch_malloc.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldif.h -value.o: value.c ../../include/portable.h slap.h ../../include/avl.h -value.o: ../../include/lber.h ../../include/ldap.h ../../include/lthread.h -value.o: ../../include/ldif.h -ava.o: ava.c slap.h ../../include/avl.h ../../include/lber.h -ava.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldif.h -bind.o: bind.c slap.h ../../include/avl.h ../../include/lber.h -bind.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldif.h -unbind.o: unbind.c slap.h ../../include/avl.h ../../include/lber.h -unbind.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldif.h -abandon.o: abandon.c slap.h ../../include/avl.h ../../include/lber.h -abandon.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldif.h -filterentry.o: filterentry.c ../../include/regex.h slap.h ../../include/avl.h -filterentry.o: ../../include/lber.h ../../include/ldap.h -filterentry.o: ../../include/lthread.h ../../include/ldif.h -phonetic.o: phonetic.c ../../include/portable.h slap.h ../../include/avl.h -phonetic.o: ../../include/lber.h ../../include/ldap.h ../../include/lthread.h -phonetic.o: ../../include/ldif.h -regex.o: regex.c ../../include/portable.h -acl.o: acl.c ../../include/regex.h slap.h ../../include/avl.h -acl.o: ../../include/lber.h ../../include/ldap.h ../../include/lthread.h +entry.o: entry.c ../../include/avl.h ../../include/ldap.h +entry.o: ../../include/lthread.h +config.o: config.c ../../include/proto-lber.h ../../include/proto-ldap.h +config.o: ../../include/ldif.h +backend.o: backend.c ../../include/avl.h ../../include/ldap.h +backend.o: ../../include/lthread.h +result.o: result.c ../../include/portable.h ../../include/avl.h +result.o: ../../include/ldap.h ../../include/lthread.h +operation.o: operation.c ../../include/proto-lber.h ../../include/proto-ldap.h +operation.o: ../../include/ldif.h +dn.o: dn.c ../../include/portable.h ../../include/avl.h ../../include/ldap.h +dn.o: ../../include/lthread.h +compare.o: compare.c ../../include/avl.h ../../include/ldap.h +compare.o: ../../include/lthread.h +modify.o: modify.c ../../include/avl.h ../../include/ldap.h +modify.o: ../../include/proto-ldap.h ../../include/ldif.h +delete.o: delete.c ../../include/proto-lber.h ../../include/proto-ldap.h +delete.o: ../../include/ldif.h +modrdn.o: modrdn.c ../../include/proto-lber.h ../../include/proto-ldap.h +modrdn.o: ../../include/ldif.h +ch_malloc.o: ch_malloc.c ../../include/avl.h ../../include/ldap.h +ch_malloc.o: ../../include/lthread.h +value.o: value.c ../../include/portable.h ../../include/avl.h +value.o: ../../include/ldap.h ../../include/lthread.h +ava.o: ava.c ../../include/proto-lber.h ../../include/proto-ldap.h +ava.o: ../../include/ldif.h +bind.o: bind.c ../../include/proto-lber.h ../../include/proto-ldap.h +bind.o: ../../include/ldif.h +unbind.o: unbind.c ../../include/avl.h ../../include/ldap.h +unbind.o: ../../include/lthread.h +abandon.o: abandon.c ../../include/avl.h ../../include/ldap.h +abandon.o: ../../include/lthread.h +filterentry.o: filterentry.c ../../include/proto-lber.h +filterentry.o: ../../include/proto-ldap.h ../../include/ldif.h +phonetic.o: phonetic.c ../../include/portable.h ../../include/avl.h +phonetic.o: ../../include/ldap.h ../../include/lthread.h +regex.o: regex.c +acl.o: acl.c slap.h ../../include/proto-lber.h ../../include/proto-ldap.h acl.o: ../../include/ldif.h -str2filter.o: str2filter.c slap.h ../../include/avl.h ../../include/lber.h -str2filter.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldif.h -aclparse.o: aclparse.c ../../include/regex.h slap.h ../../include/avl.h -aclparse.o: ../../include/lber.h ../../include/ldap.h ../../include/lthread.h -aclparse.o: ../../include/ldif.h ../../include/portable.h -init.o: init.c ../../include/portable.h slap.h ../../include/avl.h -init.o: ../../include/lber.h ../../include/ldap.h ../../include/lthread.h -init.o: ../../include/ldif.h -detach.o: detach.c ../../include/portable.h +str2filter.o: str2filter.c ../../include/avl.h ../../include/ldap.h +str2filter.o: ../../include/lthread.h +aclparse.o: aclparse.c slap.h ../../include/proto-lber.h +aclparse.o: ../../include/proto-ldap.h ../../include/ldif.h +init.o: init.c ../../include/portable.h ../../include/avl.h +init.o: ../../include/ldap.h ../../include/lthread.h +detach.o: detach.c strdup.o: strdup.c tempnam.o: tempnam.c -repl.o: repl.c slap.h ../../include/avl.h ../../include/lber.h -repl.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldif.h -lock.o: lock.c ../../include/portable.h slap.h ../../include/avl.h -lock.o: ../../include/lber.h ../../include/ldap.h ../../include/lthread.h -lock.o: ../../include/ldif.h -schema.o: schema.c slap.h ../../include/avl.h ../../include/lber.h -schema.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldif.h -schemaparse.o: schemaparse.c slap.h ../../include/avl.h ../../include/lber.h -schemaparse.o: ../../include/ldap.h ../../include/lthread.h -schemaparse.o: ../../include/ldif.h -monitor.o: monitor.c slap.h ../../include/avl.h ../../include/lber.h -monitor.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldif.h -monitor.o: ../../include/ldapconfig.h -configinfo.o: configinfo.c slap.h ../../include/avl.h ../../include/lber.h -configinfo.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldif.h -configinfo.o: ../../include/ldapconfig.h +repl.o: repl.c ../../include/proto-lber.h ../../include/lthread.h +lock.o: lock.c ../../include/avl.h ../../include/ldap.h ../../include/lthread.h +schema.o: schema.c ../../include/proto-lber.h ../../include/proto-ldap.h +schema.o: ../../include/ldif.h +schemaparse.o: schemaparse.c ../../include/avl.h ../../include/ldap.h +schemaparse.o: ../../include/lthread.h +monitor.o: monitor.c ../../include/avl.h ../../include/ldap.h +monitor.o: ../../include/proto-ldap.h ../../include/ldif.h +configinfo.o: configinfo.c ../../include/avl.h ../../include/ldap.h +configinfo.o: ../../include/lthread.h ../../include/ldapconfig.h # IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/servers/slapd/back-ldbm/Make-template b/servers/slapd/back-ldbm/Make-template index a4b909ded0..f2fe468b1e 100644 --- a/servers/slapd/back-ldbm/Make-template +++ b/servers/slapd/back-ldbm/Make-template @@ -72,77 +72,59 @@ links: # DO NOT DELETE THIS LINE -- mkdep uses it. # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. -idl.o: idl.c ../slap.h ../../../include/avl.h ../../../include/lber.h -idl.o: ../../../include/ldap.h ../../../include/lthread.h -idl.o: ../../../include/ldif.h ../../../include/ldapconfig.h back-ldbm.h -idl.o: ../../../include/ldbm.h -add.o: add.c ../slap.h ../../../include/avl.h ../../../include/lber.h -add.o: ../../../include/ldap.h ../../../include/lthread.h -add.o: ../../../include/ldif.h back-ldbm.h ../../../include/ldbm.h -search.o: search.c ../slap.h ../../../include/avl.h ../../../include/lber.h -search.o: ../../../include/ldap.h ../../../include/lthread.h -search.o: ../../../include/ldif.h back-ldbm.h ../../../include/ldbm.h -cache.o: cache.c ../slap.h ../../../include/avl.h ../../../include/lber.h -cache.o: ../../../include/ldap.h ../../../include/lthread.h -cache.o: ../../../include/ldif.h back-ldbm.h ../../../include/ldbm.h -dbcache.o: dbcache.c ../../../include/portable.h ../slap.h -dbcache.o: ../../../include/avl.h ../../../include/lber.h -dbcache.o: ../../../include/ldap.h ../../../include/lthread.h -dbcache.o: ../../../include/ldif.h ../../../include/ldapconfig.h back-ldbm.h -dbcache.o: ../../../include/ldbm.h -dn2id.o: dn2id.c ../slap.h ../../../include/avl.h ../../../include/lber.h -dn2id.o: ../../../include/ldap.h ../../../include/lthread.h -dn2id.o: ../../../include/ldif.h back-ldbm.h ../../../include/ldbm.h -id2entry.o: id2entry.c ../slap.h ../../../include/avl.h ../../../include/lber.h -id2entry.o: ../../../include/ldap.h ../../../include/lthread.h -id2entry.o: ../../../include/ldif.h back-ldbm.h ../../../include/ldbm.h -index.o: index.c ../slap.h ../../../include/avl.h ../../../include/lber.h -index.o: ../../../include/ldap.h ../../../include/lthread.h -index.o: ../../../include/ldif.h back-ldbm.h ../../../include/ldbm.h -id2children.o: id2children.c ../slap.h ../../../include/avl.h -id2children.o: ../../../include/lber.h ../../../include/ldap.h -id2children.o: ../../../include/lthread.h ../../../include/ldif.h back-ldbm.h +idl.o: idl.c ../../../include/avl.h ../../../include/proto-lber.h +idl.o: ../../../include/proto-ldap.h ../../../include/ldif.h back-ldbm.h +add.o: add.c ../../../include/proto-lber.h ../../../include/proto-ldap.h +add.o: ../../../include/ldif.h ../../../include/ldbm.h +search.o: search.c ../../../include/proto-lber.h ../../../include/proto-ldap.h +search.o: ../../../include/ldif.h ../../../include/ldbm.h +cache.o: cache.c ../../../include/avl.h ../../../include/proto-lber.h +cache.o: ../../../include/proto-ldap.h ../../../include/ldif.h +cache.o: ../../../include/ldbm.h +dbcache.o: dbcache.c ../../../include/portable.h ../../../include/avl.h +dbcache.o: ../../../include/proto-lber.h ../../../include/proto-ldap.h +dbcache.o: ../../../include/ldif.h back-ldbm.h +dn2id.o: dn2id.c ../../../include/proto-lber.h ../../../include/proto-ldap.h +dn2id.o: ../../../include/ldif.h ../../../include/ldbm.h +id2entry.o: id2entry.c ../../../include/avl.h ../../../include/proto-lber.h +id2entry.o: ../../../include/proto-ldap.h ../../../include/ldif.h +id2entry.o: ../../../include/ldbm.h +index.o: index.c ../../../include/proto-lber.h ../../../include/proto-ldap.h +index.o: ../../../include/ldif.h ../../../include/ldbm.h +id2children.o: id2children.c ../../../include/proto-lber.h +id2children.o: ../../../include/proto-ldap.h ../../../include/ldif.h id2children.o: ../../../include/ldbm.h -nextid.o: nextid.c ../slap.h ../../../include/avl.h ../../../include/lber.h -nextid.o: ../../../include/ldap.h ../../../include/lthread.h -nextid.o: ../../../include/ldif.h back-ldbm.h ../../../include/ldbm.h +nextid.o: nextid.c ../../../include/avl.h ../../../include/proto-lber.h +nextid.o: ../../../include/proto-ldap.h ../../../include/ldif.h +nextid.o: ../../../include/ldbm.h abandon.o: abandon.c -compare.o: compare.c ../slap.h ../../../include/avl.h ../../../include/lber.h -compare.o: ../../../include/ldap.h ../../../include/lthread.h -compare.o: ../../../include/ldif.h back-ldbm.h ../../../include/ldbm.h -modify.o: modify.c ../slap.h ../../../include/avl.h ../../../include/lber.h -modify.o: ../../../include/ldap.h ../../../include/lthread.h -modify.o: ../../../include/ldif.h back-ldbm.h ../../../include/ldbm.h -modrdn.o: modrdn.c ../slap.h ../../../include/avl.h ../../../include/lber.h -modrdn.o: ../../../include/ldap.h ../../../include/lthread.h -modrdn.o: ../../../include/ldif.h back-ldbm.h ../../../include/ldbm.h -delete.o: delete.c ../slap.h ../../../include/avl.h ../../../include/lber.h -delete.o: ../../../include/ldap.h ../../../include/lthread.h -delete.o: ../../../include/ldif.h back-ldbm.h ../../../include/ldbm.h -init.o: init.c ../slap.h ../../../include/avl.h ../../../include/lber.h -init.o: ../../../include/ldap.h ../../../include/lthread.h -init.o: ../../../include/ldif.h back-ldbm.h ../../../include/ldbm.h -config.o: config.c ../slap.h ../../../include/avl.h ../../../include/lber.h -config.o: ../../../include/ldap.h ../../../include/lthread.h -config.o: ../../../include/ldif.h back-ldbm.h ../../../include/ldbm.h -bind.o: bind.c ../slap.h ../../../include/avl.h ../../../include/lber.h -bind.o: ../../../include/ldap.h ../../../include/lthread.h -bind.o: ../../../include/ldif.h back-ldbm.h ../../../include/ldbm.h -attr.o: attr.c ../slap.h ../../../include/avl.h ../../../include/lber.h -attr.o: ../../../include/ldap.h ../../../include/lthread.h -attr.o: ../../../include/ldif.h back-ldbm.h ../../../include/ldbm.h -filterindex.o: filterindex.c ../slap.h ../../../include/avl.h -filterindex.o: ../../../include/lber.h ../../../include/ldap.h -filterindex.o: ../../../include/lthread.h ../../../include/ldif.h back-ldbm.h -filterindex.o: ../../../include/ldbm.h -unbind.o: unbind.c ../slap.h ../../../include/avl.h ../../../include/lber.h -unbind.o: ../../../include/ldap.h ../../../include/lthread.h -unbind.o: ../../../include/ldif.h -kerberos.o: kerberos.c ../slap.h ../../../include/avl.h ../../../include/lber.h -kerberos.o: ../../../include/ldap.h ../../../include/lthread.h -kerberos.o: ../../../include/ldif.h back-ldbm.h ../../../include/ldbm.h -close.o: close.c ../slap.h ../../../include/avl.h ../../../include/lber.h -close.o: ../../../include/ldap.h ../../../include/lthread.h -close.o: ../../../include/ldif.h back-ldbm.h ../../../include/ldbm.h +compare.o: compare.c ../../../include/proto-lber.h +compare.o: ../../../include/proto-ldap.h ../../../include/ldif.h +compare.o: ../../../include/ldbm.h +modify.o: modify.c ../../../include/proto-lber.h ../../../include/proto-ldap.h +modify.o: ../../../include/ldif.h ../../../include/ldbm.h +modrdn.o: modrdn.c ../../../include/proto-lber.h ../../../include/proto-ldap.h +modrdn.o: ../../../include/ldif.h ../../../include/ldbm.h +delete.o: delete.c ../../../include/proto-lber.h ../../../include/proto-ldap.h +delete.o: ../../../include/ldif.h ../../../include/ldbm.h +init.o: init.c ../../../include/proto-lber.h ../../../include/proto-ldap.h +init.o: ../../../include/ldif.h ../../../include/ldbm.h +config.o: config.c ../../../include/proto-lber.h ../../../include/proto-ldap.h +config.o: ../../../include/ldif.h ../../../include/ldbm.h +bind.o: bind.c ../../../include/proto-lber.h ../../../include/proto-ldap.h +bind.o: ../../../include/ldif.h ../../../include/ldbm.h +attr.o: attr.c ../../../include/proto-lber.h ../../../include/proto-ldap.h +attr.o: ../../../include/ldif.h ../../../include/ldbm.h +filterindex.o: filterindex.c ../../../include/avl.h +filterindex.o: ../../../include/proto-lber.h ../../../include/proto-ldap.h +filterindex.o: ../../../include/ldif.h ../../../include/ldbm.h +unbind.o: unbind.c ../../../include/avl.h ../../../include/proto-lber.h +unbind.o: ../../../include/proto-ldap.h ../../../include/ldif.h +kerberos.o: kerberos.c ../../../include/proto-lber.h +kerberos.o: ../../../include/proto-ldap.h ../../../include/ldif.h +kerberos.o: ../../../include/ldbm.h +close.o: close.c ../../../include/avl.h ../../../include/proto-lber.h +close.o: ../../../include/proto-ldap.h ../../../include/ldif.h +close.o: ../../../include/ldbm.h # IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/servers/slapd/back-passwd/Make-template b/servers/slapd/back-passwd/Make-template index 39ea8c292e..6283b10fe9 100644 --- a/servers/slapd/back-passwd/Make-template +++ b/servers/slapd/back-passwd/Make-template @@ -68,11 +68,10 @@ links: # DO NOT DELETE THIS LINE -- mkdep uses it. # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. -search.o: search.c ../../../include/portable.h ../slap.h ../../../include/avl.h -search.o: ../../../include/lber.h ../../../include/ldap.h -search.o: ../../../include/lthread.h ../../../include/ldif.h -config.o: config.c ../../../include/portable.h ../slap.h ../../../include/avl.h -config.o: ../../../include/lber.h ../../../include/ldap.h -config.o: ../../../include/lthread.h ../../../include/ldif.h +search.o: search.c ../../../include/portable.h ../../../include/avl.h +search.o: ../../../include/proto-lber.h ../../../include/proto-ldap.h +search.o: ../../../include/ldif.h +config.o: config.c ../../../include/proto-lber.h ../../../include/proto-ldap.h +config.o: ../../../include/ldif.h # IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/servers/slapd/back-shell/Make-template b/servers/slapd/back-shell/Make-template index 1eb631b57e..b72d05efe0 100644 --- a/servers/slapd/back-shell/Make-template +++ b/servers/slapd/back-shell/Make-template @@ -70,44 +70,31 @@ links: # DO NOT DELETE THIS LINE -- mkdep uses it. # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. -init.o: init.c ../slap.h ../../../include/avl.h ../../../include/lber.h -init.o: ../../../include/ldap.h ../../../include/lthread.h -init.o: ../../../include/ldif.h shell.h -config.o: config.c ../slap.h ../../../include/avl.h ../../../include/lber.h -config.o: ../../../include/ldap.h ../../../include/lthread.h -config.o: ../../../include/ldif.h shell.h -fork.o: fork.c ../slap.h ../../../include/avl.h ../../../include/lber.h -fork.o: ../../../include/ldap.h ../../../include/lthread.h +init.o: init.c ../../../include/avl.h ../../../include/proto-lber.h +init.o: ../../../include/proto-ldap.h ../../../include/ldif.h +config.o: config.c ../../../include/proto-lber.h ../../../include/proto-ldap.h +config.o: ../../../include/ldif.h +fork.o: fork.c ../../../include/proto-lber.h ../../../include/proto-ldap.h fork.o: ../../../include/ldif.h -search.o: search.c ../slap.h ../../../include/avl.h ../../../include/lber.h -search.o: ../../../include/ldap.h ../../../include/lthread.h -search.o: ../../../include/ldif.h shell.h -bind.o: bind.c ../slap.h ../../../include/avl.h ../../../include/lber.h -bind.o: ../../../include/ldap.h ../../../include/lthread.h -bind.o: ../../../include/ldif.h shell.h -unbind.o: unbind.c ../slap.h ../../../include/avl.h ../../../include/lber.h -unbind.o: ../../../include/ldap.h ../../../include/lthread.h -unbind.o: ../../../include/ldif.h shell.h -add.o: add.c ../slap.h ../../../include/avl.h ../../../include/lber.h -add.o: ../../../include/ldap.h ../../../include/lthread.h -add.o: ../../../include/ldif.h shell.h -delete.o: delete.c ../slap.h ../../../include/avl.h ../../../include/lber.h -delete.o: ../../../include/ldap.h ../../../include/lthread.h -delete.o: ../../../include/ldif.h shell.h -modify.o: modify.c ../slap.h ../../../include/avl.h ../../../include/lber.h -modify.o: ../../../include/ldap.h ../../../include/lthread.h -modify.o: ../../../include/ldif.h shell.h -modrdn.o: modrdn.c ../slap.h ../../../include/avl.h ../../../include/lber.h -modrdn.o: ../../../include/ldap.h ../../../include/lthread.h -modrdn.o: ../../../include/ldif.h shell.h -compare.o: compare.c ../slap.h ../../../include/avl.h ../../../include/lber.h -compare.o: ../../../include/ldap.h ../../../include/lthread.h -compare.o: ../../../include/ldif.h shell.h -abandon.o: abandon.c ../slap.h ../../../include/avl.h ../../../include/lber.h -abandon.o: ../../../include/ldap.h ../../../include/lthread.h -abandon.o: ../../../include/ldif.h shell.h -result.o: result.c ../slap.h ../../../include/avl.h ../../../include/lber.h -result.o: ../../../include/ldap.h ../../../include/lthread.h -result.o: ../../../include/ldif.h shell.h +search.o: search.c ../../../include/proto-lber.h ../../../include/proto-ldap.h +search.o: ../../../include/ldif.h +bind.o: bind.c ../../../include/proto-lber.h ../../../include/proto-ldap.h +bind.o: ../../../include/ldif.h +unbind.o: unbind.c ../../../include/proto-lber.h ../../../include/proto-ldap.h +unbind.o: ../../../include/ldif.h +add.o: add.c ../../../include/proto-lber.h ../../../include/proto-ldap.h +add.o: ../../../include/ldif.h +delete.o: delete.c ../../../include/proto-lber.h ../../../include/proto-ldap.h +delete.o: ../../../include/ldif.h +modify.o: modify.c ../../../include/proto-lber.h ../../../include/proto-ldap.h +modify.o: ../../../include/ldif.h +modrdn.o: modrdn.c ../../../include/proto-lber.h ../../../include/proto-ldap.h +modrdn.o: ../../../include/ldif.h +compare.o: compare.c ../../../include/proto-lber.h +compare.o: ../../../include/proto-ldap.h ../../../include/ldif.h +abandon.o: abandon.c ../../../include/avl.h ../../../include/proto-lber.h +abandon.o: ../../../include/proto-ldap.h ../../../include/ldif.h +result.o: result.c ../../../include/proto-lber.h ../../../include/proto-ldap.h +result.o: ../../../include/ldif.h # IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/servers/slapd/tools/Make-template b/servers/slapd/tools/Make-template index 112c4abbd8..14b013ad30 100644 --- a/servers/slapd/tools/Make-template +++ b/servers/slapd/tools/Make-template @@ -178,42 +178,30 @@ links: # DO NOT DELETE THIS LINE -- mkdep uses it. # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. -chlog2replog.o: chlog2replog.c ../../../include/ldif.h -edb2ldif.o: edb2ldif.c -ldapsyntax.o: ldapsyntax.c ../../../include/lber.h ../../../include/ldap.h -ldapsyntax.o: ../../../include/ldif.h ldapsyntax.h -ldif2index.o: ldif2index.c ../slap.h ../../../include/avl.h -ldif2index.o: ../../../include/lber.h ../../../include/ldap.h -ldif2index.o: ../../../include/lthread.h ../../../include/ldif.h -ldif2ldbm.o: ldif2ldbm.c ../slap.h ../../../include/avl.h -ldif2ldbm.o: ../../../include/lber.h ../../../include/ldap.h -ldif2ldbm.o: ../../../include/lthread.h ../../../include/ldif.h -ldif2ldbm.o: ../back-ldbm/back-ldbm.h ../../../include/ldbm.h -ldif2id2entry.o: ldif2id2entry.c ../slap.h ../../../include/avl.h -ldif2id2entry.o: ../../../include/lber.h ../../../include/ldap.h -ldif2id2entry.o: ../../../include/lthread.h ../../../include/ldif.h -ldif2id2entry.o: ../back-ldbm/back-ldbm.h ../../../include/ldbm.h -ldif2id2children.o: ldif2id2children.c ../slap.h ../../../include/avl.h -ldif2id2children.o: ../../../include/lber.h ../../../include/ldap.h -ldif2id2children.o: ../../../include/lthread.h ../../../include/ldif.h -ldif2id2children.o: ../back-ldbm/back-ldbm.h ../../../include/ldbm.h -ldbmcat.o: ldbmcat.c ../../../include/ldbm.h ../slap.h ../../../include/avl.h -ldbmcat.o: ../../../include/lber.h ../../../include/ldap.h -ldbmcat.o: ../../../include/lthread.h ../../../include/ldif.h -centipede.o: centipede.c ../../../include/lber.h ../../../include/ldap.h -centipede.o: ../../../include/ldapconfig.h ../../../include/ldbm.h -sizecount.o: sizecount.c ../../../include/ldbm.h ../../../include/lber.h -sizecount.o: ../../../include/ldap.h ../../../include/portable.h -ldif2ldbm.sed.o: ldif2ldbm.sed.c ../slap.h ../../../include/avl.h -ldif2ldbm.sed.o: ../../../include/lber.h ../../../include/ldap.h -ldif2ldbm.sed.o: ../../../include/lthread.h ../../../include/ldif.h -ldif2ldbm.sed.o: ../back-ldbm/back-ldbm.h ../../../include/ldbm.h -ldbmtest.o: ldbmtest.c ../../../include/portable.h -ldbmtest.o: ../../../include/ldapconfig.h ../slap.h ../../../include/avl.h -ldbmtest.o: ../../../include/lber.h ../../../include/ldap.h -ldbmtest.o: ../../../include/lthread.h ../../../include/ldif.h -ldbmtest.o: ../back-ldbm/back-ldbm.h ../../../include/ldbm.h -ldif.o: ldif.c ../../../include/lber.h ../../../include/ldap.h -ldif.o: ../../../include/ldif.h +ldif2index.o: ldif2index.c ../../../include/avl.h ../../../include/proto-lber.h +ldif2index.o: ../../../include/proto-ldap.h ../../../include/ldif.h +ldif2ldbm.o: ldif2ldbm.c ../../../include/proto-lber.h +ldif2ldbm.o: ../../../include/proto-ldap.h ../../../include/ldif.h +ldif2ldbm.o: ../../../include/ldbm.h +ldif2id2entry.o: ldif2id2entry.c ../../../include/avl.h +ldif2id2entry.o: ../../../include/proto-lber.h ../../../include/proto-ldap.h +ldif2id2entry.o: ../../../include/ldif.h ../../../include/ldbm.h +ldif2id2children.o: ldif2id2children.c ../../../include/avl.h +ldif2id2children.o: ../../../include/proto-lber.h ../../../include/proto-ldap.h +ldif2id2children.o: ../../../include/ldif.h ../../../include/ldbm.h +ldbmcat.o: ldbmcat.c ../../../include/proto-lber.h +ldbmcat.o: ../../../include/proto-ldap.h ../../../include/ldif.h +centipede.o: centipede.c ../../../include/proto-lber.h +centipede.o: ../../../include/proto-ldap.h ../../../include/ldbm.h +sizecount.o: sizecount.c ../../../include/lber.h ../../../include/ldap.h +sizecount.o: ../../../include/proto-ldap.h +ldif2ldbm.sed.o: ldif2ldbm.sed.c ../../../include/avl.h +ldif2ldbm.sed.o: ../../../include/proto-lber.h ../../../include/proto-ldap.h +ldif2ldbm.sed.o: ../../../include/ldif.h ../../../include/ldbm.h +ldbmtest.o: ldbmtest.c ../../../include/ldapconfig.h ../../../include/avl.h +ldbmtest.o: ../../../include/proto-lber.h ../../../include/proto-ldap.h +ldbmtest.o: ../../../include/ldif.h ../../../include/ldbm.h +ldbmtest.o: ../back-ldbm/proto-back-ldbm.h +ldif.o: ldif.c ../../../include/proto-lber.h ../../../include/proto-ldap.h # IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/servers/slapd/tools/ldif2id2children.c b/servers/slapd/tools/ldif2id2children.c index 2fb2aaf603..b53ed8cdd3 100644 --- a/servers/slapd/tools/ldif2id2children.c +++ b/servers/slapd/tools/ldif2id2children.c @@ -121,7 +121,7 @@ main( int argc, char **argv ) fprintf( stderr, "No ldbm database found in config file\n" ); exit( 1 ); } - } else if ( dbnum < 1 || dbnum > nbackends ) { + } else if ( dbnum < 0 || dbnum > (nbackends-1) ) { fprintf( stderr, "Database number selected via -n is out of range\n" ); fprintf( stderr, "Must be in the range 1 to %d (number of databases in the config file)\n", nbackends ); exit( 1 ); diff --git a/servers/slapd/tools/ldif2id2entry.c b/servers/slapd/tools/ldif2id2entry.c index 5c8874c513..be25c22644 100644 --- a/servers/slapd/tools/ldif2id2entry.c +++ b/servers/slapd/tools/ldif2id2entry.c @@ -117,7 +117,7 @@ main( int argc, char **argv ) fprintf( stderr, "No ldbm database found in config file\n" ); exit( 1 ); } - } else if ( dbnum < 1 || dbnum > nbackends ) { + } else if ( dbnum < 0 || dbnum > (nbackends-1) ) { fprintf( stderr, "Database number selected via -n is out of range\n" ); fprintf( stderr, "Must be in the range 1 to %d (number of databases in the config file)\n", nbackends ); exit( 1 ); diff --git a/servers/slapd/tools/ldif2index.c b/servers/slapd/tools/ldif2index.c index af377f6751..20156d2b7d 100644 --- a/servers/slapd/tools/ldif2index.c +++ b/servers/slapd/tools/ldif2index.c @@ -108,7 +108,7 @@ main( int argc, char **argv ) fprintf( stderr, "No ldbm database found in config file\n" ); exit( 1 ); } - } else if ( dbnum < 1 || dbnum > nbackends ) { + } else if ( dbnum < 0 || dbnum > (nbackends-1) ) { fprintf( stderr, "Database number selected via -n is out of range\n" ); fprintf( stderr, "Must be in the range 1 to %d (number of databases in the config file)\n", nbackends ); exit( 1 ); diff --git a/servers/slapd/tools/ldif2ldbm.c b/servers/slapd/tools/ldif2ldbm.c index b2caa7b3cc..79e8c25a85 100644 --- a/servers/slapd/tools/ldif2ldbm.c +++ b/servers/slapd/tools/ldif2ldbm.c @@ -135,7 +135,7 @@ main( int argc, char **argv ) fprintf( stderr, "No ldbm database found in config file\n" ); exit( 1 ); } - } else if ( dbnum < 0 || dbnum > nbackends ) { + } else if ( dbnum < 0 || dbnum > (nbackends-1) ) { fprintf( stderr, "Database number selected via -n is out of range\n" ); fprintf( stderr, "Must be in the range 1 to %d (number of databases in the config file)\n", nbackends ); exit( 1 ); @@ -157,7 +157,7 @@ main( int argc, char **argv ) args[i++] = "-f"; args[i++] = tailorfile; args[i++] = "-n"; - sprintf( buf2, "%d", dbnum ); + sprintf( buf2, "%d", dbnum+1 ); args[i++] = buf2; if ( ldap_debug ) { sprintf( buf3, "%d", ldap_debug ); @@ -179,7 +179,7 @@ main( int argc, char **argv ) args[i++] = "-f"; args[i++] = tailorfile; args[i++] = "-n"; - sprintf( buf2, "%d", dbnum ); + sprintf( buf2, "%d", dbnum+1 ); args[i++] = buf2; if ( ldap_debug ) { sprintf( buf3, "%d", ldap_debug ); @@ -201,7 +201,7 @@ main( int argc, char **argv ) args[i++] = "-f"; args[i++] = tailorfile; args[i++] = "-n"; - sprintf( buf2, "%d", dbnum ); + sprintf( buf2, "%d", dbnum+1 ); args[i++] = buf2; if ( ldap_debug ) { sprintf( buf3, "%d", ldap_debug ); diff --git a/servers/slurpd/Make-template b/servers/slurpd/Make-template index a43494093d..04beedfaec 100644 --- a/servers/slurpd/Make-template +++ b/servers/slurpd/Make-template @@ -81,67 +81,42 @@ links: # DO NOT DELETE THIS LINE -- mkdep uses it. # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. -admin.o: admin.c slurp.h ../../include/lber.h ../../include/ldap.h -admin.o: ../../include/lthread.h ../../include/portable.h -admin.o: ../../include/ldapconfig.h ../../include/ldif.h globals.h slurp.h -args.o: args.c ../../include/lber.h ../../include/ldap.h slurp.h -args.o: ../../include/lber.h ../../include/ldap.h ../../include/lthread.h -args.o: ../../include/portable.h ../../include/ldapconfig.h -args.o: ../../include/ldif.h globals.h slurp.h -ch_malloc.o: ch_malloc.c ../slapd/slap.h ../../include/avl.h -ch_malloc.o: ../../include/lber.h ../../include/ldap.h ../../include/lthread.h -ch_malloc.o: ../../include/ldif.h -config.o: config.c ../../include/lber.h ../../include/ldap.h slurp.h -config.o: ../../include/lber.h ../../include/ldap.h ../../include/lthread.h -config.o: ../../include/portable.h ../../include/ldapconfig.h -config.o: ../../include/ldif.h globals.h slurp.h -detach.o: detach.c ../../include/portable.h -fm.o: fm.c slurp.h ../../include/lber.h ../../include/ldap.h -fm.o: ../../include/lthread.h ../../include/portable.h -fm.o: ../../include/ldapconfig.h ../../include/ldif.h globals.h slurp.h -globals.o: globals.c slurp.h ../../include/lber.h ../../include/ldap.h -globals.o: ../../include/lthread.h ../../include/portable.h -globals.o: ../../include/ldapconfig.h ../../include/ldif.h globals.h slurp.h -ldap_op.o: ldap_op.c ../../include/lber.h ../../include/ldap.h -ldap_op.o: ../../include/portable.h slurp.h ../../include/lber.h -ldap_op.o: ../../include/ldap.h ../../include/lthread.h -ldap_op.o: ../../include/portable.h ../../include/ldapconfig.h -ldap_op.o: ../../include/ldif.h -lock.o: lock.c ../../include/portable.h ../slapd/slap.h ../../include/avl.h -lock.o: ../../include/lber.h ../../include/ldap.h ../../include/lthread.h -lock.o: ../../include/ldif.h -main.o: main.c slurp.h ../../include/lber.h ../../include/ldap.h -main.o: ../../include/lthread.h ../../include/portable.h -main.o: ../../include/ldapconfig.h ../../include/ldif.h globals.h slurp.h -re.o: re.c ../slapd/slap.h ../../include/avl.h ../../include/lber.h -re.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldif.h slurp.h -re.o: ../../include/lber.h ../../include/ldap.h ../../include/lthread.h -re.o: ../../include/portable.h ../../include/ldapconfig.h ../../include/ldif.h -re.o: globals.h slurp.h -reject.o: reject.c slurp.h ../../include/lber.h ../../include/ldap.h -reject.o: ../../include/lthread.h ../../include/portable.h -reject.o: ../../include/ldapconfig.h ../../include/ldif.h globals.h slurp.h -replica.o: replica.c slurp.h ../../include/lber.h ../../include/ldap.h -replica.o: ../../include/lthread.h ../../include/portable.h -replica.o: ../../include/ldapconfig.h ../../include/ldif.h globals.h slurp.h -replog.o: replog.c ../../include/portable.h slurp.h ../../include/lber.h -replog.o: ../../include/ldap.h ../../include/lthread.h ../../include/portable.h -replog.o: ../../include/ldapconfig.h ../../include/ldif.h globals.h slurp.h -ri.o: ri.c slurp.h ../../include/lber.h ../../include/ldap.h -ri.o: ../../include/lthread.h ../../include/portable.h -ri.o: ../../include/ldapconfig.h ../../include/ldif.h globals.h slurp.h -rq.o: rq.c slurp.h ../../include/lber.h ../../include/ldap.h -rq.o: ../../include/lthread.h ../../include/portable.h -rq.o: ../../include/ldapconfig.h ../../include/ldif.h globals.h slurp.h -sanity.o: sanity.c slurp.h ../../include/lber.h ../../include/ldap.h -sanity.o: ../../include/lthread.h ../../include/portable.h -sanity.o: ../../include/ldapconfig.h ../../include/ldif.h globals.h slurp.h -sanity.o: ../../include/portable.h -st.o: st.c slurp.h ../../include/lber.h ../../include/ldap.h -st.o: ../../include/lthread.h ../../include/portable.h -st.o: ../../include/ldapconfig.h ../../include/ldif.h globals.h slurp.h -tsleep.o: tsleep.c slurp.h ../../include/lber.h ../../include/ldap.h -tsleep.o: ../../include/lthread.h ../../include/portable.h -tsleep.o: ../../include/ldapconfig.h ../../include/ldif.h globals.h slurp.h +admin.o: admin.c ../../include/lber.h ../../include/proto-ldap.h +admin.o: ../../include/portable.h ../../include/ldif.h +args.o: args.c ../../include/lber.h ../../include/proto-ldap.h +args.o: ../../include/lthread.h ../../include/ldapconfig.h +ch_malloc.o: ch_malloc.c ../../include/avl.h ../../include/ldap.h +ch_malloc.o: ../../include/lthread.h +config.o: config.c ../../include/lber.h ../../include/proto-ldap.h +config.o: ../../include/lthread.h ../../include/ldapconfig.h +detach.o: detach.c +fm.o: fm.c ../../include/lber.h ../../include/proto-ldap.h +fm.o: ../../include/portable.h ../../include/ldif.h +globals.o: globals.c ../../include/lber.h ../../include/proto-ldap.h +globals.o: ../../include/portable.h ../../include/ldif.h +ldap_op.o: ldap_op.c ../../include/proto-lber.h ../../include/proto-ldap.h +ldap_op.o: ../../include/lthread.h ../../include/ldif.h +lock.o: lock.c ../../include/portable.h ../../include/avl.h +lock.o: ../../include/ldap.h ../../include/lthread.h +main.o: main.c ../../include/lber.h ../../include/proto-ldap.h +main.o: ../../include/portable.h ../../include/ldif.h +re.o: re.c ../slapd/slap.h ../../include/lber.h ../../include/proto-ldap.h +re.o: ../../include/ldif.h ../../include/portable.h +reject.o: reject.c ../../include/lber.h ../../include/proto-ldap.h +reject.o: ../../include/portable.h ../../include/ldif.h +replica.o: replica.c ../../include/lber.h ../../include/proto-ldap.h +replica.o: ../../include/portable.h ../../include/ldif.h +replog.o: replog.c ../../include/portable.h ../../include/proto-lber.h +replog.o: ../../include/proto-ldap.h ../../include/ldapconfig.h +ri.o: ri.c ../../include/lber.h ../../include/proto-ldap.h +ri.o: ../../include/portable.h ../../include/ldif.h +rq.o: rq.c ../../include/lber.h ../../include/proto-ldap.h +rq.o: ../../include/portable.h ../../include/ldif.h +sanity.o: sanity.c ../../include/lber.h ../../include/proto-ldap.h +sanity.o: ../../include/portable.h ../../include/ldif.h +st.o: st.c ../../include/lber.h ../../include/proto-ldap.h +st.o: ../../include/portable.h ../../include/ldif.h +tsleep.o: tsleep.c ../../include/lber.h ../../include/proto-ldap.h +tsleep.o: ../../include/portable.h ../../include/ldif.h # IF YOU PUT ANYTHING HERE IT WILL GO AWAY From fbdb748a7d10977271e00c2a6066e0d02e08fbee Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Sun, 9 Aug 1998 02:36:33 +0000 Subject: [PATCH 05/18] LDAPworld P4: SLAPD Crash when Schema Checking --- servers/slapd/schema.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/servers/slapd/schema.c b/servers/slapd/schema.c index ba16d9b0f1..a5c297fbe3 100644 --- a/servers/slapd/schema.c +++ b/servers/slapd/schema.c @@ -111,14 +111,16 @@ oc_check_allowed( char *type, struct berval **ocl ) /* if we know about the oc */ if ( (oc = oc_find( ocl[i]->bv_val )) != NULL ) { /* does it require the type? */ - for ( j = 0; oc->oc_required[j] != NULL; j++ ) { + for ( j = 0; oc->oc_required != NULL && + oc->oc_required[j] != NULL; j++ ) { if ( strcasecmp( oc->oc_required[j], type ) == 0 ) { return( 0 ); } } /* does it allow the type? */ - for ( j = 0; oc->oc_allowed[j] != NULL; j++ ) { + for ( j = 0; oc->oc_allowed != NULL && + oc->oc_allowed[j] != NULL; j++ ) { if ( strcasecmp( oc->oc_allowed[j], type ) == 0 || strcmp( oc->oc_allowed[j], "*" ) == 0 ) From 835d3ef9bd7261a250c19d3c95f74c7f060e8a87 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Sun, 9 Aug 1998 02:39:52 +0000 Subject: [PATCH 06/18] LDAPworld P5: SLAPD Negation of Non-Indexed Search --- servers/slapd/back-ldbm/idl.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/servers/slapd/back-ldbm/idl.c b/servers/slapd/back-ldbm/idl.c index 60828a2610..ef65444c3d 100644 --- a/servers/slapd/back-ldbm/idl.c +++ b/servers/slapd/back-ldbm/idl.c @@ -726,12 +726,9 @@ idl_notin( if ( a == NULL ) { return( NULL ); } - if ( b == NULL ) { + if ( b == NULL || ALLIDS( b )) { return( idl_dup( a ) ); } - if ( ALLIDS( b ) ) { - return( NULL ); - } if ( ALLIDS( a ) ) { n = idl_alloc( SLAPD_LDBM_MIN_MAXIDS ); From 92f7e6c3c8b5927a25f471208f748b549c2c07f6 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Sun, 9 Aug 1998 02:41:53 +0000 Subject: [PATCH 07/18] LDAPworld P6: SLAPD on AIX --- include/avl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/avl.h b/include/avl.h index 745cc17d61..46a1e7667a 100644 --- a/include/avl.h +++ b/include/avl.h @@ -21,7 +21,7 @@ typedef struct avlnode { caddr_t avl_data; - char avl_bf; + signed char avl_bf; struct avlnode *avl_left; struct avlnode *avl_right; } Avlnode; From 8893be2975709fa548cd993508a6843f88917c10 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Sun, 9 Aug 1998 02:48:03 +0000 Subject: [PATCH 08/18] LDAPworld P7: SLURPD compile problems with SYSERRLIST_IN_STDIO --- servers/slurpd/re.c | 4 ++-- servers/slurpd/rq.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/servers/slurpd/re.c b/servers/slurpd/re.c index 28d1d09b58..18043d98f8 100644 --- a/servers/slurpd/re.c +++ b/servers/slurpd/re.c @@ -31,9 +31,9 @@ extern char *str_getline( char **next ); extern void ch_free( char *p ); -#if !(defined(BSD) && (BSD >= 199306)) +#ifndef SYSERRLIST_IN_STDIO extern char *sys_errlist[]; -#endif +#endif /* SYSERRLIST_IN_STDIO /* Forward references */ static Rh *get_repl_hosts( char *, int *, char ** ); diff --git a/servers/slurpd/rq.c b/servers/slurpd/rq.c index 2745d4fe78..ef94cfa935 100644 --- a/servers/slurpd/rq.c +++ b/servers/slurpd/rq.c @@ -44,9 +44,9 @@ extern void Re_dump( Re *re ); extern void Re_dump(); #endif /* NEEDPROTOS */ -#if !(defined(BSD) && (BSD >= 199306)) +#ifndef SYSERRLIST_IN_STDIO extern char *sys_errlist[]; -#endif +#endif /* SYSERRLIST_IN_STDIO /* * Lock the replication queue. From daeb0284b1d75ae08b6c888e63d3cd2df50d5f41 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Sun, 9 Aug 1998 02:50:17 +0000 Subject: [PATCH 09/18] LDAPworld P8: UD does not compile when NO_CACHE defined --- clients/ud/main.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/clients/ud/main.c b/clients/ud/main.c index cb2030c283..86c0b7567f 100644 --- a/clients/ud/main.c +++ b/clients/ud/main.c @@ -722,3 +722,22 @@ SIG_FN chwinsz() (void) signal(SIGWINCH, chwinsz); } #endif + +#if defined(NO_CACHE) + +void ldap_uncache_entry( LDAP *ld, char *dn ) +{ + +} + +int ldap_enable_cache( LDAP *ld, long timeout, long maxmem ) +{ + return 0; +} + +void ldap_flush_cache( LDAP *ld ) +{ + +} + +#endif /* NO_CACHE */ From 221db1f19a6f03e9fea56125ec16d5bbce80043d Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Sun, 9 Aug 1998 02:52:09 +0000 Subject: [PATCH 10/18] LDAPworld P9: SLAPD crashes with filter containing zero elements --- servers/slapd/filter.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/servers/slapd/filter.c b/servers/slapd/filter.c index 8d990b361d..50016fe6ba 100644 --- a/servers/slapd/filter.c +++ b/servers/slapd/filter.c @@ -135,6 +135,7 @@ get_filter( Connection *conn, BerElement *ber, Filter **filt, char **fstr ) Debug( LDAP_DEBUG_FILTER, "AND\n", 0, 0, 0 ); if ( (err = get_filter_list( conn, ber, &f->f_and, &ftmp )) == 0 ) { + if (ftmp == NULL) ftmp = strdup(""); *fstr = ch_malloc( 4 + strlen( ftmp ) ); sprintf( *fstr, "(&%s)", ftmp ); free( ftmp ); @@ -145,6 +146,7 @@ get_filter( Connection *conn, BerElement *ber, Filter **filt, char **fstr ) Debug( LDAP_DEBUG_FILTER, "OR\n", 0, 0, 0 ); if ( (err = get_filter_list( conn, ber, &f->f_or, &ftmp )) == 0 ) { + if (ftmp == NULL) ftmp = strdup(""); *fstr = ch_malloc( 4 + strlen( ftmp ) ); sprintf( *fstr, "(|%s)", ftmp ); free( ftmp ); @@ -155,6 +157,7 @@ get_filter( Connection *conn, BerElement *ber, Filter **filt, char **fstr ) Debug( LDAP_DEBUG_FILTER, "NOT\n", 0, 0, 0 ); (void) ber_skip_tag( ber, &len ); if ( (err = get_filter( conn, ber, &f->f_not, &ftmp )) == 0 ) { + if (ftmp == NULL) ftmp = strdup(""); *fstr = ch_malloc( 4 + strlen( ftmp ) ); sprintf( *fstr, "(!%s)", ftmp ); free( ftmp ); From 38c92a11510e4c302fac334e5835a7a127e4e31a Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Sun, 9 Aug 1998 02:54:09 +0000 Subject: [PATCH 11/18] LDAPworld P10: SLAPD Index corruption --- servers/slapd/back-ldbm/index.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/servers/slapd/back-ldbm/index.c b/servers/slapd/back-ldbm/index.c index 3d75a091d3..fd13d7ec07 100644 --- a/servers/slapd/back-ldbm/index.c +++ b/servers/slapd/back-ldbm/index.c @@ -3,7 +3,6 @@ #include #include #include -#include #include "slap.h" #include "back-ldbm.h" @@ -130,25 +129,26 @@ index_read( realval = val; tmpval = NULL; if ( prefix != '\0' ) { - int len; + int len = strlen( val ); - if ( (len = strlen( val )) < sizeof(buf) ) { - buf[0] = prefix; - strcpy( &buf[1], val ); + if ( (len + 2) < sizeof(buf) ) { realval = buf; } else { /* value + prefix + null */ tmpval = (char *) ch_malloc( len + 2 ); - tmpval[0] = prefix; - strcat( &tmpval[1], val ); realval = tmpval; } + realval[0] = prefix; + strcpy( &realval[1], val ); } key.dptr = realval; key.dsize = strlen( realval ) + 1; idl = idl_fetch( be, db, key ); + if ( tmpval != NULL ) { + free( tmpval ); + } ldbm_cache_close( be, db ); @@ -181,19 +181,17 @@ add_value( tmpval = NULL; idl = NULL; if ( prefix != '\0' ) { - int len; + int len = strlen( val ); - if ( (len = strlen( val )) < sizeof(buf) ) { - buf[0] = prefix; - strcpy( &buf[1], val ); + if ( (len + 2) < sizeof(buf) ) { realval = buf; } else { /* value + prefix + null */ tmpval = (char *) ch_malloc( len + 2 ); - tmpval[0] = prefix; - strcat( &tmpval[1], val ); realval = tmpval; } + realval[0] = prefix; + strcpy( &realval[1], val ); } key.dptr = realval; From 1cad5fd9b2a086b7d78df33ece8b454bb98b61bd Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Sun, 9 Aug 1998 02:56:52 +0000 Subject: [PATCH 12/18] LDAPworld P13: LDAPv2 client referrals bug --- libraries/libldap/request.c | 21 ++++++++++++++++++++- servers/slapd/back-ldbm/search.c | 5 +++-- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/libraries/libldap/request.c b/libraries/libldap/request.c index b8b50eac7b..5e44c47824 100644 --- a/libraries/libldap/request.c +++ b/libraries/libldap/request.c @@ -178,9 +178,11 @@ send_server_request( LDAP *ld, BerElement *ber, int msgid, LDAPRequest *parentreq, LDAPServer *srvlist, LDAPConn *lc, int bind ) { LDAPRequest *lr; + int incparent; Debug( LDAP_DEBUG_TRACE, "send_server_request\n", 0, 0, 0 ); + incparent = 0; ld->ld_errno = LDAP_SUCCESS; /* optimistic */ if ( lc == NULL ) { @@ -189,6 +191,11 @@ send_server_request( LDAP *ld, BerElement *ber, int msgid, LDAPRequest } else { if (( lc = find_connection( ld, srvlist, 1 )) == NULL ) { + if ( bind && (parentreq != NULL) ) { + /* Remember the bind in the parent */ + incparent = 1; + ++parentreq->lr_outrefcnt; + } lc = new_connection( ld, &srvlist, 0, 1, bind ); } free_servers( srvlist ); @@ -200,6 +207,10 @@ send_server_request( LDAP *ld, BerElement *ber, int msgid, LDAPRequest if ( ld->ld_errno == LDAP_SUCCESS ) { ld->ld_errno = LDAP_SERVER_DOWN; } + if ( incparent ) { + /* Forget about the bind */ + --parentreq->lr_outrefcnt; + } return( -1 ); } @@ -209,6 +220,10 @@ send_server_request( LDAP *ld, BerElement *ber, int msgid, LDAPRequest ld->ld_errno = LDAP_NO_MEMORY; free_connection( ld, lc, 0, 0 ); ber_free( ber, 1 ); + if ( incparent ) { + /* Forget about the bind */ + --parentreq->lr_outrefcnt; + } return( -1 ); } lr->lr_msgid = msgid; @@ -217,7 +232,10 @@ send_server_request( LDAP *ld, BerElement *ber, int msgid, LDAPRequest lr->lr_ber = ber; lr->lr_conn = lc; if ( parentreq != NULL ) { /* sub-request */ - ++parentreq->lr_outrefcnt; + if ( !incparent ) { + /* Increment if we didn't do it before the bind */ + ++parentreq->lr_outrefcnt; + } lr->lr_origid = parentreq->lr_origid; lr->lr_parentcnt = parentreq->lr_parentcnt + 1; lr->lr_parent = parentreq; @@ -442,6 +460,7 @@ free_connection( LDAP *ld, LDAPConn *lc, int force, int unbind ) } break; } + prevlc = tmplc; } free_servers( lc->lconn_server ); if ( lc->lconn_krbinstance != NULL ) { diff --git a/servers/slapd/back-ldbm/search.c b/servers/slapd/back-ldbm/search.c index 6a53be4f11..bad87b1f48 100644 --- a/servers/slapd/back-ldbm/search.c +++ b/servers/slapd/back-ldbm/search.c @@ -377,8 +377,9 @@ subtree_candidates( f->f_or = (Filter *) ch_malloc( sizeof(Filter) ); f->f_or->f_choice = LDAP_FILTER_EQUALITY; f->f_or->f_avtype = strdup( "objectclass" ); - f->f_or->f_avvalue.bv_val = strdup( "referral" ); - f->f_or->f_avvalue.bv_len = strlen( "referral" ); + /* Patch to use normalized uppercase */ + f->f_or->f_avvalue.bv_val = strdup( "REFERRAL" ); + f->f_or->f_avvalue.bv_len = strlen( "REFERRAL" ); f->f_or->f_next = filter; filter = f; From 29eda9c7997e57c4907534e817850389e966c23a Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Sun, 9 Aug 1998 03:04:12 +0000 Subject: [PATCH 13/18] LDAPworldP15: Internal LDAP function rename --- libraries/libldap/abandon.c | 6 +- libraries/libldap/add.c | 4 +- libraries/libldap/cache.c | 14 ++-- libraries/libldap/cldap.c | 8 +- libraries/libldap/compare.c | 8 +- libraries/libldap/delete.c | 4 +- libraries/libldap/getattr.c | 2 +- libraries/libldap/getdxbyname.c | 8 +- libraries/libldap/kbind.c | 22 +++--- libraries/libldap/ldap-int.h | 110 +++++++++++++-------------- libraries/libldap/modify.c | 4 +- libraries/libldap/modrdn.c | 4 +- libraries/libldap/open.c | 12 +-- libraries/libldap/os-ip.c | 23 +++--- libraries/libldap/request.c | 74 +++++++++--------- libraries/libldap/result.c | 22 +++--- libraries/libldap/sbind.c | 4 +- libraries/libldap/search.c | 8 +- libraries/libldap/unbind.c | 16 ++-- libraries/libldap/url.c | 4 +- libraries/macintosh/kerberos-macos.c | 4 +- libraries/macintosh/macos-ip.c | 28 +++---- 22 files changed, 195 insertions(+), 194 deletions(-) diff --git a/libraries/libldap/abandon.c b/libraries/libldap/abandon.c index 18324260bd..377beb7eb3 100644 --- a/libraries/libldap/abandon.c +++ b/libraries/libldap/abandon.c @@ -107,7 +107,7 @@ do_abandon( LDAP *ld, int origid, int msgid ) err = 0; if ( sendabandon ) { /* create a message to send */ - if ( (ber = alloc_ber_with_options( ld )) == NULLBER ) { + if ( (ber = ldap_alloc_ber_with_options( ld )) == NULLBER ) { err = -1; ld->ld_errno = LDAP_NO_MEMORY; } else { @@ -151,10 +151,10 @@ do_abandon( LDAP *ld, int origid, int msgid ) #ifdef LDAP_REFERRALS if ( lr != NULL ) { if ( sendabandon ) { - free_connection( ld, lr->lr_conn, 0, 1 ); + ldap_free_connection( ld, lr->lr_conn, 0, 1 ); } if ( origid == msgid ) { - free_request( ld, lr ); + ldap_free_request( ld, lr ); } } #endif /* LDAP_REFERRALS */ diff --git a/libraries/libldap/add.c b/libraries/libldap/add.c index b79cd09b9d..143e36e161 100644 --- a/libraries/libldap/add.c +++ b/libraries/libldap/add.c @@ -69,7 +69,7 @@ ldap_add( LDAP *ld, char *dn, LDAPMod **attrs ) Debug( LDAP_DEBUG_TRACE, "ldap_add\n", 0, 0, 0 ); /* create a message to send */ - if ( (ber = alloc_ber_with_options( ld )) == NULLBER ) { + if ( (ber = ldap_alloc_ber_with_options( ld )) == NULLBER ) { return( -1 ); } @@ -103,7 +103,7 @@ ldap_add( LDAP *ld, char *dn, LDAPMod **attrs ) } /* send the message */ - return( send_initial_request( ld, LDAP_REQ_ADD, dn, ber )); + return( ldap_send_initial_request( ld, LDAP_REQ_ADD, dn, ber )); } int diff --git a/libraries/libldap/cache.c b/libraries/libldap/cache.c index 197f4fb9e3..7925f08fe0 100644 --- a/libraries/libldap/cache.c +++ b/libraries/libldap/cache.c @@ -214,12 +214,12 @@ uncache_entry_or_req( LDAP *ld, void -add_request_to_cache( LDAP *ld, unsigned long msgtype, BerElement *request ) +ldap_add_request_to_cache( LDAP *ld, unsigned long msgtype, BerElement *request ) { LDAPMessage *new; long len; - Debug( LDAP_DEBUG_TRACE, "add_request_to_cache\n", 0, 0, 0 ); + Debug( LDAP_DEBUG_TRACE, "ldap_add_request_to_cache\n", 0, 0, 0 ); ld->ld_errno = LDAP_SUCCESS; if ( ld->ld_cache == NULLLDCACHE || @@ -229,7 +229,7 @@ add_request_to_cache( LDAP *ld, unsigned long msgtype, BerElement *request ) if (( new = (LDAPMessage *) calloc( 1, sizeof(LDAPMessage) )) != NULL ) { - if (( new->lm_ber = alloc_ber_with_options( ld )) == NULLBER ) { + if (( new->lm_ber = ldap_alloc_ber_with_options( ld )) == NULLBER ) { free( (char *)new ); return; } @@ -256,12 +256,12 @@ add_request_to_cache( LDAP *ld, unsigned long msgtype, BerElement *request ) void -add_result_to_cache( LDAP *ld, LDAPMessage *result ) +ldap_add_result_to_cache( LDAP *ld, LDAPMessage *result ) { LDAPMessage *m, **mp, *req, *new, *prev; int err, keep; - Debug( LDAP_DEBUG_TRACE, "add_result_to_cache: id %d, type %d\n", + Debug( LDAP_DEBUG_TRACE, "ldap_add_result_to_cache: id %d, type %d\n", result->lm_msgid, result->lm_msgtype, 0 ); if ( ld->ld_cache == NULLLDCACHE || @@ -369,14 +369,14 @@ add_result_to_cache( LDAP *ld, LDAPMessage *result ) * will find them. */ int -check_cache( LDAP *ld, unsigned long msgtype, BerElement *request ) +ldap_check_cache( LDAP *ld, unsigned long msgtype, BerElement *request ) { LDAPMessage *m, *new, *prev, *next; BerElement reqber; int first, hash; unsigned long validtime; - Debug( LDAP_DEBUG_TRACE, "check_cache\n", 0, 0, 0 ); + Debug( LDAP_DEBUG_TRACE, "ldap_check_cache\n", 0, 0, 0 ); if ( ld->ld_cache == NULLLDCACHE || ( ld->ld_cache->lc_enabled == 0 )) { diff --git a/libraries/libldap/cldap.c b/libraries/libldap/cldap.c index 19782f77d8..806a6ce91c 100644 --- a/libraries/libldap/cldap.c +++ b/libraries/libldap/cldap.c @@ -170,7 +170,7 @@ cldap_open( char *host, int port ) if ( ld->ld_sb.sb_addrs == NULL #ifdef LDAP_REFERRALS - || ( ld->ld_defconn = new_connection( ld, NULL, 1,0,0 )) == NULL + || ( ld->ld_defconn = ldap_new_connection( ld, NULL, 1,0,0 )) == NULL #endif /* LDAP_REFERRALS */ ) { free( ld ); @@ -316,7 +316,7 @@ cldap_result( LDAP *ld, int msgid, LDAPMessage **res, "cldap_result waiting up to %d seconds for a response\n", tv.tv_sec, 0, 0 ); ber_init( &ber, 0 ); - set_ber_options( ld, &ber ); + ldap_set_ber_options( ld, &ber ); if ( cldap_getmsg( ld, &tv, &ber ) == -1 ) { ret = ld->ld_errno; @@ -432,7 +432,7 @@ cldap_parsemsg( LDAP *ld, int msgid, BerElement *ber, tag != LBER_DEFAULT && rc != LDAP_SUCCESS; tag = ber_next_element( ber, &len, cookie )) { if (( ldm = (LDAPMessage *)calloc( 1, sizeof(LDAPMessage))) - == NULL || ( ldm->lm_ber = alloc_ber_with_options( ld )) + == NULL || ( ldm->lm_ber = ldap_alloc_ber_with_options( ld )) == NULLBER ) { rc = LDAP_NO_MEMORY; break; /* return w/error*/ @@ -506,7 +506,7 @@ cldap_parsemsg( LDAP *ld, int msgid, BerElement *ber, #ifndef NO_CACHE if ( ld->ld_cache != NULL ) { - add_result_to_cache( ld, ldm ); + ldap_add_result_to_cache( ld, ldm ); } #endif /* NO_CACHE */ diff --git a/libraries/libldap/compare.c b/libraries/libldap/compare.c index 74388f1cea..ba9f89850c 100644 --- a/libraries/libldap/compare.c +++ b/libraries/libldap/compare.c @@ -52,7 +52,7 @@ ldap_compare( LDAP *ld, char *dn, char *attr, char *value ) Debug( LDAP_DEBUG_TRACE, "ldap_compare\n", 0, 0, 0 ); /* create a message to send */ - if ( (ber = alloc_ber_with_options( ld )) == NULLBER ) { + if ( (ber = ldap_alloc_ber_with_options( ld )) == NULLBER ) { return( -1 ); } @@ -65,17 +65,17 @@ ldap_compare( LDAP *ld, char *dn, char *attr, char *value ) #ifndef NO_CACHE if ( ld->ld_cache != NULL ) { - if ( check_cache( ld, LDAP_REQ_COMPARE, ber ) == 0 ) { + if ( ldap_check_cache( ld, LDAP_REQ_COMPARE, ber ) == 0 ) { ber_free( ber, 1 ); ld->ld_errno = LDAP_SUCCESS; return( ld->ld_msgid ); } - add_request_to_cache( ld, LDAP_REQ_COMPARE, ber ); + ldap_add_request_to_cache( ld, LDAP_REQ_COMPARE, ber ); } #endif /* NO_CACHE */ /* send the message */ - return ( send_initial_request( ld, LDAP_REQ_COMPARE, dn, ber )); + return ( ldap_send_initial_request( ld, LDAP_REQ_COMPARE, dn, ber )); } int diff --git a/libraries/libldap/delete.c b/libraries/libldap/delete.c index 47e240ea6a..75344ddd88 100644 --- a/libraries/libldap/delete.c +++ b/libraries/libldap/delete.c @@ -51,7 +51,7 @@ ldap_delete( LDAP *ld, char *dn ) Debug( LDAP_DEBUG_TRACE, "ldap_delete\n", 0, 0, 0 ); /* create a message to send */ - if ( (ber = alloc_ber_with_options( ld )) == NULLBER ) { + if ( (ber = ldap_alloc_ber_with_options( ld )) == NULLBER ) { return( -1 ); } @@ -63,7 +63,7 @@ ldap_delete( LDAP *ld, char *dn ) } /* send the message */ - return ( send_initial_request( ld, LDAP_REQ_DELETE, dn, ber )); + return ( ldap_send_initial_request( ld, LDAP_REQ_DELETE, dn, ber )); } diff --git a/libraries/libldap/getattr.c b/libraries/libldap/getattr.c index 50caa774c5..f893529e8c 100644 --- a/libraries/libldap/getattr.c +++ b/libraries/libldap/getattr.c @@ -36,7 +36,7 @@ ldap_first_attribute( LDAP *ld, LDAPMessage *entry, BerElement **ber ) Debug( LDAP_DEBUG_TRACE, "ldap_first_attribute\n", 0, 0, 0 ); - if ( (*ber = alloc_ber_with_options( ld )) == NULLBER ) { + if ( (*ber = ldap_alloc_ber_with_options( ld )) == NULLBER ) { return( NULL ); } diff --git a/libraries/libldap/getdxbyname.c b/libraries/libldap/getdxbyname.c index 50683f6c37..833af5adae 100644 --- a/libraries/libldap/getdxbyname.c +++ b/libraries/libldap/getdxbyname.c @@ -3,7 +3,7 @@ * Copyright (c) 1995 Regents of the University of Michigan. * All rights reserved. * - * getdxbyname - retrieve DX records from the DNS (from TXT records for now) + * ldap_getdxbyname - retrieve DX records from the DNS (from TXT records for now) */ #include #include @@ -47,17 +47,17 @@ extern char *h_errlist[]; /* - * getdxbyname - lookup DNS DX records for domain and return an ordered + * ldap_getdxbyname - lookup DNS DX records for domain and return an ordered * array. */ char ** -getdxbyname( char *domain ) +ldap_getdxbyname( char *domain ) { unsigned char buf[ PACKETSZ ]; char **dxs; int rc; - Debug( LDAP_DEBUG_TRACE, "getdxbyname( %s )\n", domain, 0, 0 ); + Debug( LDAP_DEBUG_TRACE, "ldap_getdxbyname( %s )\n", domain, 0, 0 ); memset( buf, 0, sizeof( buf )); diff --git a/libraries/libldap/kbind.c b/libraries/libldap/kbind.c index ce4a8a7f6d..6ed05253c0 100644 --- a/libraries/libldap/kbind.c +++ b/libraries/libldap/kbind.c @@ -52,7 +52,7 @@ ldap_kerberos_bind1( LDAP *ld, char *dn ) BerElement *ber; char *cred; int rc, credlen; - char *get_kerberosv4_credentials(); + char *ldap_get_kerberosv4_credentials(); #ifdef STR_TRANSLATION int str_translation_on; #endif /* STR_TRANSLATION */ @@ -75,13 +75,13 @@ ldap_kerberos_bind1( LDAP *ld, char *dn ) if ( dn == NULL ) dn = ""; - if ( (cred = get_kerberosv4_credentials( ld, dn, "ldapserver", + if ( (cred = ldap_get_kerberosv4_credentials( ld, dn, "ldapserver", &credlen )) == NULL ) { return( -1 ); /* ld_errno should already be set */ } /* create a message to send */ - if ( (ber = alloc_ber_with_options( ld )) == NULLBER ) { + if ( (ber = ldap_alloc_ber_with_options( ld )) == NULLBER ) { free( cred ); return( -1 ); } @@ -119,7 +119,7 @@ ldap_kerberos_bind1( LDAP *ld, char *dn ) #endif /* !NO_CACHE */ /* send the message */ - return ( send_initial_request( ld, LDAP_REQ_BIND, dn, ber )); + return ( ldap_send_initial_request( ld, LDAP_REQ_BIND, dn, ber )); } int @@ -159,7 +159,7 @@ ldap_kerberos_bind2( LDAP *ld, char *dn ) BerElement *ber; char *cred; int rc, credlen; - char *get_kerberosv4_credentials(); + char *ldap_get_kerberosv4_credentials(); #ifdef STR_TRANSLATION int str_translation_on; #endif /* STR_TRANSLATION */ @@ -169,13 +169,13 @@ ldap_kerberos_bind2( LDAP *ld, char *dn ) if ( dn == NULL ) dn = ""; - if ( (cred = get_kerberosv4_credentials( ld, dn, "x500dsa", &credlen )) + if ( (cred = ldap_get_kerberosv4_credentials( ld, dn, "x500dsa", &credlen )) == NULL ) { return( -1 ); /* ld_errno should already be set */ } /* create a message to send */ - if ( (ber = alloc_ber_with_options( ld )) == NULLBER ) { + if ( (ber = ldap_alloc_ber_with_options( ld )) == NULLBER ) { free( cred ); return( -1 ); } @@ -207,7 +207,7 @@ ldap_kerberos_bind2( LDAP *ld, char *dn ) } /* send the message */ - return ( send_initial_request( ld, LDAP_REQ_BIND, dn, ber )); + return ( ldap_send_initial_request( ld, LDAP_REQ_BIND, dn, ber )); } /* synchronous bind to DSA using kerberos */ @@ -249,19 +249,19 @@ ldap_kerberos_bind_s( LDAP *ld, char *dn ) #ifndef AUTHMAN /* - * get_kerberosv4_credentials - obtain kerberos v4 credentials for ldap. + * ldap_get_kerberosv4_credentials - obtain kerberos v4 credentials for ldap. * The dn of the entry to which to bind is supplied. It's assumed the * user already has a tgt. */ char * -get_kerberosv4_credentials( LDAP *ld, char *who, char *service, int *len ) +ldap_get_kerberosv4_credentials( LDAP *ld, char *who, char *service, int *len ) { KTEXT_ST ktxt; int err; char realm[REALM_SZ], *cred, *krbinstance; - Debug( LDAP_DEBUG_TRACE, "get_kerberosv4_credentials\n", 0, 0, 0 ); + Debug( LDAP_DEBUG_TRACE, "ldap_get_kerberosv4_credentials\n", 0, 0, 0 ); if ( (err = krb_get_tf_realm( tkt_string(), realm )) != KSUCCESS ) { #ifndef NO_USERINTERFACE diff --git a/libraries/libldap/ldap-int.h b/libraries/libldap/ldap-int.h index c44c5910e8..e841a35b5b 100644 --- a/libraries/libldap/ldap-int.h +++ b/libraries/libldap/ldap-int.h @@ -27,14 +27,14 @@ * in cache.c */ #ifdef NEEDPROTOS -void add_request_to_cache( LDAP *ld, unsigned long msgtype, +void ldap_add_request_to_cache( LDAP *ld, unsigned long msgtype, BerElement *request ); -void add_result_to_cache( LDAP *ld, LDAPMessage *result ); -int check_cache( LDAP *ld, unsigned long msgtype, BerElement *request ); +void ldap_add_result_to_cache( LDAP *ld, LDAPMessage *result ); +int ldap_check_cache( LDAP *ld, unsigned long msgtype, BerElement *request ); #else /* NEEDPROTOS */ -void add_request_to_cache(); -void add_result_to_cache(); -int check_cache(); +void ldap_add_request_to_cache(); +void ldap_add_result_to_cache(); +int ldap_check_cache(); #endif /* NEEDPROTOS */ @@ -43,10 +43,10 @@ int check_cache(); * in kerberos.c */ #ifdef NEEDPROTOS -char *get_kerberosv4_credentials( LDAP *ld, char *who, char *service, +char *ldap_get_kerberosv4_credentials( LDAP *ld, char *who, char *service, int *len ); #else /* NEEDPROTOS */ -char *get_kerberosv4_credentials(); +char *ldap_get_kerberosv4_credentials(); #endif /* NEEDPROTOS */ #endif /* KERBEROS */ @@ -67,17 +67,17 @@ int open_ldap_connection(); * in os-ip.c */ #ifdef NEEDPROTOS -int connect_to_host( Sockbuf *sb, char *host, unsigned long address, int port, +int ldap_connect_to_host( Sockbuf *sb, char *host, unsigned long address, int port, int async ); -void close_connection( Sockbuf *sb ); +void ldap_close_connection( Sockbuf *sb ); #else /* NEEDPROTOS */ -int connect_to_host(); -void close_connection(); +int ldap_connect_to_host(); +void ldap_close_connection(); #endif /* NEEDPROTOS */ #ifdef KERBEROS #ifdef NEEDPROTOS -char *host_connected_to( Sockbuf *sb ); +char *ldap_host_connected_to( Sockbuf *sb ); #else /* NEEDPROTOS */ char *host_connected_to(); #endif /* NEEDPROTOS */ @@ -86,22 +86,22 @@ char *host_connected_to(); #ifdef LDAP_REFERRALS #ifdef NEEDPROTOS int do_ldap_select( LDAP *ld, struct timeval *timeout ); -void *new_select_info( void ); -void free_select_info( void *sip ); -void mark_select_write( LDAP *ld, Sockbuf *sb ); -void mark_select_read( LDAP *ld, Sockbuf *sb ); -void mark_select_clear( LDAP *ld, Sockbuf *sb ); -int is_read_ready( LDAP *ld, Sockbuf *sb ); -int is_write_ready( LDAP *ld, Sockbuf *sb ); +void *ldap_new_select_info( void ); +void ldap_free_select_info( void *sip ); +void ldap_mark_select_write( LDAP *ld, Sockbuf *sb ); +void ldap_mark_select_read( LDAP *ld, Sockbuf *sb ); +void ldap_mark_select_clear( LDAP *ld, Sockbuf *sb ); +int ldap_is_read_ready( LDAP *ld, Sockbuf *sb ); +int ldap_is_write_ready( LDAP *ld, Sockbuf *sb ); #else /* NEEDPROTOS */ int do_ldap_select(); -void *new_select_info(); -void free_select_info(); -void mark_select_write(); -void mark_select_read(); -void mark_select_clear(); -int is_read_ready(); -int is_write_ready(); +void *ldap_new_select_info(); +void ldap_free_select_info(); +void ldap_mark_select_write(); +void ldap_mark_select_read(); +void ldap_mark_select_clear(); +int ldap_is_read_ready(); +int ldap_is_write_ready(); #endif /* NEEDPROTOS */ #endif /* LDAP_REFERRALS */ @@ -110,46 +110,46 @@ int is_write_ready(); * in request.c */ #ifdef NEEDPROTOS -int send_initial_request( LDAP *ld, unsigned long msgtype, +int ldap_send_initial_request( LDAP *ld, unsigned long msgtype, char *dn, BerElement *ber ); -BerElement *alloc_ber_with_options( LDAP *ld ); -void set_ber_options( LDAP *ld, BerElement *ber ); +BerElement *ldap_alloc_ber_with_options( LDAP *ld ); +void ldap_set_ber_options( LDAP *ld, BerElement *ber ); #else /* NEEDPROTOS */ -int send_initial_request(); -BerElement *alloc_ber_with_options(); -void set_ber_options(); +int ldap_send_initial_request(); +BerElement *ldap_alloc_ber_with_options(); +void ldap_set_ber_options(); #endif /* NEEDPROTOS */ #if defined( LDAP_REFERRALS ) || defined( LDAP_DNS ) #ifdef NEEDPROTOS -int send_server_request( LDAP *ld, BerElement *ber, int msgid, +int ldap_send_server_request( LDAP *ld, BerElement *ber, int msgid, LDAPRequest *parentreq, LDAPServer *srvlist, LDAPConn *lc, int bind ); -LDAPConn *new_connection( LDAP *ld, LDAPServer **srvlistp, int use_ldsb, +LDAPConn *ldap_new_connection( LDAP *ld, LDAPServer **srvlistp, int use_ldsb, int connect, int bind ); -LDAPRequest *find_request_by_msgid( LDAP *ld, int msgid ); -void free_request( LDAP *ld, LDAPRequest *lr ); -void free_connection( LDAP *ld, LDAPConn *lc, int force, int unbind ); -void dump_connection( LDAP *ld, LDAPConn *lconns, int all ); -void dump_requests_and_responses( LDAP *ld ); +LDAPRequest *ldap_find_request_by_msgid( LDAP *ld, int msgid ); +void ldap_free_request( LDAP *ld, LDAPRequest *lr ); +void ldap_free_connection( LDAP *ld, LDAPConn *lc, int force, int unbind ); +void ldap_dump_connection( LDAP *ld, LDAPConn *lconns, int all ); +void ldap_dump_requests_and_responses( LDAP *ld ); #else /* NEEDPROTOS */ -int send_server_request(); -LDAPConn *new_connection(); -LDAPRequest *find_request_by_msgid(); -void free_request(); -void free_connection(); -void dump_connection(); -void dump_requests_and_responses(); +int ldap_send_server_request(); +LDAPConn *ldap_new_connection(); +LDAPRequest *ldap_find_request_by_msgid(); +void ldap_free_request(); +void ldap_free_connection(); +void ldap_dump_connection(); +void ldap_dump_requests_and_responses(); #endif /* NEEDPROTOS */ #endif /* LDAP_REFERRALS || LDAP_DNS */ #ifdef LDAP_REFERRALS #ifdef NEEDPROTOS -int chase_referrals( LDAP *ld, LDAPRequest *lr, char **errstrp, int *hadrefp ); -int append_referral( LDAP *ld, char **referralsp, char *s ); +int ldap_chase_referrals( LDAP *ld, LDAPRequest *lr, char **errstrp, int *hadrefp ); +int ldap_append_referral( LDAP *ld, char **referralsp, char *s ); #else /* NEEDPROTOS */ -int chase_referrals(); -int append_referral(); +int ldap_chase_referrals(); +int ldap_append_referral(); #endif /* NEEDPROTOS */ #endif /* LDAP_REFERRALS */ @@ -170,10 +170,10 @@ BerElement *ldap_build_search_req(); */ #ifdef NEEDPROTOS int ldap_ld_free( LDAP *ld, int close ); -int send_unbind( LDAP *ld, Sockbuf *sb ); +int ldap_send_unbind( LDAP *ld, Sockbuf *sb ); #else /* NEEDPROTOS */ int ldap_ld_free(); -int send_unbind(); +int ldap_send_unbind(); #endif /* NEEDPROTOS */ @@ -182,9 +182,9 @@ int send_unbind(); * in getdxbyname.c */ #ifdef NEEDPROTOS -char **getdxbyname( char *domain ); +char **ldap_getdxbyname( char *domain ); #else /* NEEDPROTOS */ -char **getdxbyname(); +char **ldap_getdxbyname(); #endif /* NEEDPROTOS */ #endif /* LDAP_DNS */ diff --git a/libraries/libldap/modify.c b/libraries/libldap/modify.c index 316dde787f..63f1cdc023 100644 --- a/libraries/libldap/modify.c +++ b/libraries/libldap/modify.c @@ -69,7 +69,7 @@ ldap_modify( LDAP *ld, char *dn, LDAPMod **mods ) Debug( LDAP_DEBUG_TRACE, "ldap_modify\n", 0, 0, 0 ); /* create a message to send */ - if ( (ber = alloc_ber_with_options( ld )) == NULLBER ) { + if ( (ber = ldap_alloc_ber_with_options( ld )) == NULLBER ) { return( -1 ); } @@ -105,7 +105,7 @@ ldap_modify( LDAP *ld, char *dn, LDAPMod **mods ) } /* send the message */ - return( send_initial_request( ld, LDAP_REQ_MODIFY, dn, ber )); + return( ldap_send_initial_request( ld, LDAP_REQ_MODIFY, dn, ber )); } int diff --git a/libraries/libldap/modrdn.c b/libraries/libldap/modrdn.c index f4624a919a..1532f86917 100644 --- a/libraries/libldap/modrdn.c +++ b/libraries/libldap/modrdn.c @@ -53,7 +53,7 @@ ldap_modrdn2( LDAP *ld, char *dn, char *newrdn, int deleteoldrdn ) Debug( LDAP_DEBUG_TRACE, "ldap_modrdn\n", 0, 0, 0 ); /* create a message to send */ - if ( (ber = alloc_ber_with_options( ld )) == NULLBER ) { + if ( (ber = ldap_alloc_ber_with_options( ld )) == NULLBER ) { return( -1 ); } @@ -65,7 +65,7 @@ ldap_modrdn2( LDAP *ld, char *dn, char *newrdn, int deleteoldrdn ) } /* send the message */ - return ( send_initial_request( ld, LDAP_REQ_MODRDN, dn, ber )); + return ( ldap_send_initial_request( ld, LDAP_REQ_MODRDN, dn, ber )); } int diff --git a/libraries/libldap/open.c b/libraries/libldap/open.c index 3ca73f336d..a145ca0783 100644 --- a/libraries/libldap/open.c +++ b/libraries/libldap/open.c @@ -81,7 +81,7 @@ ldap_open( char *host, int port ) } srv->lsrv_port = ld->ld_defport; - if (( ld->ld_defconn = new_connection( ld, &srv, 1,1,0 )) == NULL ) { + if (( ld->ld_defconn = ldap_new_connection( ld, &srv, 1,1,0 )) == NULL ) { if ( ld->ld_defhost != NULL ) free( srv->lsrv_host ); free( (char *)srv ); ldap_ld_free( ld, 0 ); @@ -126,7 +126,7 @@ ldap_init( char *defhost, int defport ) } #ifdef LDAP_REFERRALS - if (( ld->ld_selectinfo = new_select_info()) == NULL ) { + if (( ld->ld_selectinfo = ldap_new_select_info()) == NULL ) { free( (char*)ld ); return( NULL ); } @@ -136,7 +136,7 @@ ldap_init( char *defhost, int defport ) if ( defhost != NULL && ( ld->ld_defhost = strdup( defhost )) == NULL ) { #ifdef LDAP_REFERRALS - free_select_info( ld->ld_selectinfo ); + ldap_free_select_info( ld->ld_selectinfo ); #endif /* LDAP_REFERRALS */ free( (char*)ld ); return( NULL ); @@ -201,13 +201,13 @@ open_ldap_connection( LDAP *ld, Sockbuf *sb, char *host, int defport, port = defport; } - if (( rc = connect_to_host( sb, curhost, 0L, + if (( rc = ldap_connect_to_host( sb, curhost, 0L, port, async )) != -1 ) { break; } } } else { - rc = connect_to_host( sb, NULL, htonl( INADDR_LOOPBACK ), + rc = ldap_connect_to_host( sb, NULL, htonl( INADDR_LOOPBACK ), defport, async ); } @@ -217,7 +217,7 @@ open_ldap_connection( LDAP *ld, Sockbuf *sb, char *host, int defport, if ( krbinstancep != NULL ) { #ifdef KERBEROS - if (( *krbinstancep = host_connected_to( sb )) != NULL && + if (( *krbinstancep = ldap_host_connected_to( sb )) != NULL && ( p = strchr( *krbinstancep, '.' )) != NULL ) { *p = '\0'; } diff --git a/libraries/libldap/os-ip.c b/libraries/libldap/os-ip.c index ce1ab0e2a8..955a5fab52 100644 --- a/libraries/libldap/os-ip.c +++ b/libraries/libldap/os-ip.c @@ -64,9 +64,10 @@ static char copyright[] = "@(#) Copyright (c) 1995 Regents of the University of #endif /* DOS */ #endif /* MACOS */ +#include "ldap-int.h" int -connect_to_host( Sockbuf *sb, char *host, unsigned long address, +ldap_connect_to_host( Sockbuf *sb, char *host, unsigned long address, int port, int async ) /* * if host == NULL, connect using address @@ -85,7 +86,7 @@ connect_to_host( Sockbuf *sb, char *host, unsigned long address, #endif /* LDAP_REFERRALS */ #endif /* notyet */ - Debug( LDAP_DEBUG_TRACE, "connect_to_host: %s:%d\n", + Debug( LDAP_DEBUG_TRACE, "ldap_connect_to_host: %s:%d\n", ( host == NULL ) ? "(by address)" : host, ntohs( port ), 0 ); connected = use_hp = 0; @@ -174,7 +175,7 @@ connect_to_host( Sockbuf *sb, char *host, unsigned long address, void -close_connection( Sockbuf *sb ) +ldap_close_connection( Sockbuf *sb ) { tcp_close( sb->sb_sd ); } @@ -182,7 +183,7 @@ close_connection( Sockbuf *sb ) #ifdef KERBEROS char * -host_connected_to( Sockbuf *sb ) +ldap_host_connected_to( Sockbuf *sb ) { struct hostent *hp; char *p; @@ -223,7 +224,7 @@ struct selectinfo { void -mark_select_write( LDAP *ld, Sockbuf *sb ) +ldap_mark_select_write( LDAP *ld, Sockbuf *sb ) { struct selectinfo *sip; @@ -236,7 +237,7 @@ mark_select_write( LDAP *ld, Sockbuf *sb ) void -mark_select_read( LDAP *ld, Sockbuf *sb ) +ldap_mark_select_read( LDAP *ld, Sockbuf *sb ) { struct selectinfo *sip; @@ -249,7 +250,7 @@ mark_select_read( LDAP *ld, Sockbuf *sb ) void -mark_select_clear( LDAP *ld, Sockbuf *sb ) +ldap_mark_select_clear( LDAP *ld, Sockbuf *sb ) { struct selectinfo *sip; @@ -261,7 +262,7 @@ mark_select_clear( LDAP *ld, Sockbuf *sb ) int -is_write_ready( LDAP *ld, Sockbuf *sb ) +ldap_is_write_ready( LDAP *ld, Sockbuf *sb ) { struct selectinfo *sip; @@ -272,7 +273,7 @@ is_write_ready( LDAP *ld, Sockbuf *sb ) int -is_read_ready( LDAP *ld, Sockbuf *sb ) +ldap_is_read_ready( LDAP *ld, Sockbuf *sb ) { struct selectinfo *sip; @@ -283,7 +284,7 @@ is_read_ready( LDAP *ld, Sockbuf *sb ) void * -new_select_info() +ldap_new_select_info() { struct selectinfo *sip; @@ -298,7 +299,7 @@ new_select_info() void -free_select_info( void *sip ) +ldap_free_select_info( void *sip ) { free( sip ); } diff --git a/libraries/libldap/request.c b/libraries/libldap/request.c index 5e44c47824..1bbfab9219 100644 --- a/libraries/libldap/request.c +++ b/libraries/libldap/request.c @@ -83,7 +83,7 @@ static BerElement *re_encode_request(); BerElement * -alloc_ber_with_options( LDAP *ld ) +ldap_alloc_ber_with_options( LDAP *ld ) { BerElement *ber; @@ -91,7 +91,7 @@ alloc_ber_with_options( LDAP *ld ) ld->ld_errno = LDAP_NO_MEMORY; #ifdef STR_TRANSLATION } else { - set_ber_options( ld, ber ); + ldap_set_ber_options( ld, ber ); #endif /* STR_TRANSLATION */ } @@ -100,7 +100,7 @@ alloc_ber_with_options( LDAP *ld ) void -set_ber_options( LDAP *ld, BerElement *ber ) +ldap_set_ber_options( LDAP *ld, BerElement *ber ) { ber->ber_options = ld->ld_lberoptions; #ifdef STR_TRANSLATION @@ -114,14 +114,14 @@ set_ber_options( LDAP *ld, BerElement *ber ) int -send_initial_request( LDAP *ld, unsigned long msgtype, char *dn, +ldap_send_initial_request( LDAP *ld, unsigned long msgtype, char *dn, BerElement *ber ) { #if defined( LDAP_REFERRALS ) || defined( LDAP_DNS ) LDAPServer *servers; #endif /* LDAP_REFERRALS || LDAP_DNS */ - Debug( LDAP_DEBUG_TRACE, "send_initial_request\n", 0, 0, 0 ); + Debug( LDAP_DEBUG_TRACE, "ldap_send_initial_request\n", 0, 0, 0 ); #if !defined( LDAP_REFERRALS ) && !defined( LDAP_DNS ) if ( ber_flush( &ld->ld_sb, ber, 1 ) != 0 ) { @@ -165,7 +165,7 @@ send_initial_request( LDAP *ld, unsigned long msgtype, char *dn, } #endif /* LDAP_DNS */ - return( send_server_request( ld, ber, ld->ld_msgid, NULL, servers, + return( ldap_send_server_request( ld, ber, ld->ld_msgid, NULL, servers, NULL, 0 )); #endif /* !LDAP_REFERRALS && !LDAP_DNS */ } @@ -174,13 +174,13 @@ send_initial_request( LDAP *ld, unsigned long msgtype, char *dn, #if defined( LDAP_REFERRALS ) || defined( LDAP_DNS ) int -send_server_request( LDAP *ld, BerElement *ber, int msgid, LDAPRequest +ldap_send_server_request( LDAP *ld, BerElement *ber, int msgid, LDAPRequest *parentreq, LDAPServer *srvlist, LDAPConn *lc, int bind ) { LDAPRequest *lr; int incparent; - Debug( LDAP_DEBUG_TRACE, "send_server_request\n", 0, 0, 0 ); + Debug( LDAP_DEBUG_TRACE, "ldap_send_server_request\n", 0, 0, 0 ); incparent = 0; ld->ld_errno = LDAP_SUCCESS; /* optimistic */ @@ -196,7 +196,7 @@ send_server_request( LDAP *ld, BerElement *ber, int msgid, LDAPRequest incparent = 1; ++parentreq->lr_outrefcnt; } - lc = new_connection( ld, &srvlist, 0, 1, bind ); + lc = ldap_new_connection( ld, &srvlist, 0, 1, bind ); } free_servers( srvlist ); } @@ -218,7 +218,7 @@ send_server_request( LDAP *ld, BerElement *ber, int msgid, LDAPRequest if (( lr = (LDAPRequest *)calloc( 1, sizeof( LDAPRequest ))) == NULL ) { ld->ld_errno = LDAP_NO_MEMORY; - free_connection( ld, lc, 0, 0 ); + ldap_free_connection( ld, lc, 0, 0 ); ber_free( ber, 1 ); if ( incparent ) { /* Forget about the bind */ @@ -258,12 +258,12 @@ send_server_request( LDAP *ld, BerElement *ber, int msgid, LDAPRequest if ( errno == EWOULDBLOCK ) { /* need to continue write later */ lr->lr_status = LDAP_REQST_WRITING; - mark_select_write( ld, lc->lconn_sb ); + ldap_mark_select_write( ld, lc->lconn_sb ); } else { #else /* notyet */ ld->ld_errno = LDAP_SERVER_DOWN; - free_request( ld, lr ); - free_connection( ld, lc, 0, 0 ); + ldap_free_request( ld, lr ); + ldap_free_connection( ld, lc, 0, 0 ); return( -1 ); #endif /* notyet */ #ifdef notyet @@ -276,7 +276,7 @@ send_server_request( LDAP *ld, BerElement *ber, int msgid, LDAPRequest } /* sent -- waiting for a response */ - mark_select_read( ld, lc->lconn_sb ); + ldap_mark_select_read( ld, lc->lconn_sb ); } ld->ld_errno = LDAP_SUCCESS; @@ -285,7 +285,7 @@ send_server_request( LDAP *ld, BerElement *ber, int msgid, LDAPRequest LDAPConn * -new_connection( LDAP *ld, LDAPServer **srvlistp, int use_ldsb, +ldap_new_connection( LDAP *ld, LDAPServer **srvlistp, int use_ldsb, int connect, int bind ) { LDAPConn *lc; @@ -385,7 +385,7 @@ new_connection( LDAP *ld, LDAPServer **srvlistp, int use_ldsb, } if ( err != 0 ) { - free_connection( ld, lc, 1, 0 ); + ldap_free_connection( ld, lc, 1, 0 ); lc = NULL; } } @@ -432,19 +432,19 @@ use_connection( LDAP *ld, LDAPConn *lc ) void -free_connection( LDAP *ld, LDAPConn *lc, int force, int unbind ) +ldap_free_connection( LDAP *ld, LDAPConn *lc, int force, int unbind ) { LDAPConn *tmplc, *prevlc; - Debug( LDAP_DEBUG_TRACE, "free_connection\n", 0, 0, 0 ); + Debug( LDAP_DEBUG_TRACE, "ldap_free_connection\n", 0, 0, 0 ); if ( force || --lc->lconn_refcnt <= 0 ) { if ( lc->lconn_status == LDAP_CONNST_CONNECTED ) { - mark_select_clear( ld, lc->lconn_sb ); + ldap_mark_select_clear( ld, lc->lconn_sb ); if ( unbind ) { - send_unbind( ld, lc->lconn_sb ); + ldap_send_unbind( ld, lc->lconn_sb ); } - close_connection( lc->lconn_sb ); + ldap_close_connection( lc->lconn_sb ); if ( lc->lconn_sb->sb_ber.ber_buf != NULL ) { free( lc->lconn_sb->sb_ber.ber_buf ); } @@ -470,11 +470,11 @@ free_connection( LDAP *ld, LDAPConn *lc, int force, int unbind ) free( (char *)lc->lconn_sb ); } free( lc ); - Debug( LDAP_DEBUG_TRACE, "free_connection: actually freed\n", + Debug( LDAP_DEBUG_TRACE, "ldap_free_connection: actually freed\n", 0, 0, 0 ); } else { lc->lconn_lastused = time( 0 ); - Debug( LDAP_DEBUG_TRACE, "free_connection: refcnt %d\n", + Debug( LDAP_DEBUG_TRACE, "ldap_free_connection: refcnt %d\n", lc->lconn_refcnt, 0, 0 ); } } @@ -482,7 +482,7 @@ free_connection( LDAP *ld, LDAPConn *lc, int force, int unbind ) #ifdef LDAP_DEBUG void -dump_connection( LDAP *ld, LDAPConn *lconns, int all ) +ldap_dump_connection( LDAP *ld, LDAPConn *lconns, int all ) { LDAPConn *lc; @@ -509,7 +509,7 @@ dump_connection( LDAP *ld, LDAPConn *lconns, int all ) void -dump_requests_and_responses( LDAP *ld ) +ldap_dump_requests_and_responses( LDAP *ld ) { LDAPRequest *lr; LDAPMessage *lm, *l; @@ -550,11 +550,11 @@ dump_requests_and_responses( LDAP *ld ) void -free_request( LDAP *ld, LDAPRequest *lr ) +ldap_free_request( LDAP *ld, LDAPRequest *lr ) { LDAPRequest *tmplr, *nextlr; - Debug( LDAP_DEBUG_TRACE, "free_request (origid %d, msgid %d)\n", + Debug( LDAP_DEBUG_TRACE, "ldap_free_request (origid %d, msgid %d)\n", lr->lr_origid, lr->lr_msgid, 0 ); if ( lr->lr_parent != NULL ) { @@ -563,7 +563,7 @@ free_request( LDAP *ld, LDAPRequest *lr ) /* free all referrals (child requests) */ for ( tmplr = lr->lr_refnext; tmplr != NULL; tmplr = nextlr ) { nextlr = tmplr->lr_refnext; - free_request( ld, tmplr ); + ldap_free_request( ld, tmplr ); } } @@ -618,7 +618,7 @@ free_servers( LDAPServer *srvlist ) * XXX merging of errors in this routine needs to be improved */ int -chase_referrals( LDAP *ld, LDAPRequest *lr, char **errstrp, int *hadrefp ) +ldap_chase_referrals( LDAP *ld, LDAPRequest *lr, char **errstrp, int *hadrefp ) { int rc, count, len, newdn; #ifdef LDAP_DNS @@ -629,7 +629,7 @@ chase_referrals( LDAP *ld, LDAPRequest *lr, char **errstrp, int *hadrefp ) LDAPServer *srv; BerElement *ber; - Debug( LDAP_DEBUG_TRACE, "chase_referrals\n", 0, 0, 0 ); + Debug( LDAP_DEBUG_TRACE, "ldap_chase_referrals\n", 0, 0, 0 ); ld->ld_errno = LDAP_SUCCESS; /* optimistic */ *hadrefp = 0; @@ -700,7 +700,7 @@ chase_referrals( LDAP *ld, LDAPRequest *lr, char **errstrp, int *hadrefp ) } else { Debug( LDAP_DEBUG_TRACE, "ignoring unknown referral <%s>\n", ref, 0, 0 ); - rc = append_referral( ld, &unfollowed, ref ); + rc = ldap_append_referral( ld, &unfollowed, ref ); *hadrefp = 1; continue; } @@ -747,14 +747,14 @@ chase_referrals( LDAP *ld, LDAPRequest *lr, char **errstrp, int *hadrefp ) } #endif /* LDAP_DNS */ - if ( srv != NULL && send_server_request( ld, ber, ld->ld_msgid, + if ( srv != NULL && ldap_send_server_request( ld, ber, ld->ld_msgid, lr, srv, NULL, 1 ) >= 0 ) { ++count; } else { Debug( LDAP_DEBUG_ANY, "Unable to chase referral (%s)\n", ldap_err2string( ld->ld_errno ), 0, 0 ); - rc = append_referral( ld, &unfollowed, ref ); + rc = ldap_append_referral( ld, &unfollowed, ref ); } if ( !newdn && refdn != NULL ) { @@ -770,7 +770,7 @@ chase_referrals( LDAP *ld, LDAPRequest *lr, char **errstrp, int *hadrefp ) int -append_referral( LDAP *ld, char **referralsp, char *s ) +ldap_append_referral( LDAP *ld, char **referralsp, char *s ) { int first; @@ -829,7 +829,7 @@ re_encode_request( LDAP *ld, BerElement *origber, int msgid, char **dnp ) return( NULL ); } - if (( ber = alloc_ber_with_options( ld )) == NULLBER ) { + if (( ber = ldap_alloc_ber_with_options( ld )) == NULLBER ) { return( NULL ); } @@ -885,7 +885,7 @@ re_encode_request( LDAP *ld, BerElement *origber, int msgid, char **dnp ) LDAPRequest * -find_request_by_msgid( LDAP *ld, int msgid ) +ldap_find_request_by_msgid( LDAP *ld, int msgid ) { LDAPRequest *lr; @@ -914,7 +914,7 @@ dn2servers( LDAP *ld, char *dn ) /* dn can also be a domain.... */ domain = dn; } - if (( dxs = getdxbyname( domain )) == NULL ) { + if (( dxs = ldap_getdxbyname( domain )) == NULL ) { ld->ld_errno = LDAP_NO_MEMORY; return( NULL ); } diff --git a/libraries/libldap/result.c b/libraries/libldap/result.c index 3f8408df18..90698939d6 100644 --- a/libraries/libldap/result.c +++ b/libraries/libldap/result.c @@ -231,8 +231,8 @@ wait4msg( LDAP *ld, int msgid, int all, struct timeval *timeout, #else /* !LDAP_REFERRALS */ #ifdef LDAP_DEBUG if ( ldap_debug & LDAP_DEBUG_TRACE ) { - dump_connection( ld, ld->ld_conns, 1 ); - dump_requests_and_responses( ld ); + ldap_dump_connection( ld, ld->ld_conns, 1 ); + ldap_dump_requests_and_responses( ld ); } #endif /* LDAP_DEBUG */ for ( lc = ld->ld_conns; lc != NULL; lc = lc->lconn_next ) { @@ -276,7 +276,7 @@ wait4msg( LDAP *ld, int msgid, int all, struct timeval *timeout, nextlc = lc->lconn_next; if ( lc->lconn_status == LDAP_CONNST_CONNECTED && - is_read_ready( ld, + ldap_is_read_ready( ld, lc->lconn_sb )) { rc = read1msg( ld, msgid, all, lc->lconn_sb, lc, result ); @@ -326,7 +326,7 @@ read1msg( LDAP *ld, int msgid, int all, Sockbuf *sb, Debug( LDAP_DEBUG_TRACE, "read1msg\n", 0, 0, 0 ); ber_init( &ber, 0 ); - set_ber_options( ld, &ber ); + ldap_set_ber_options( ld, &ber ); /* get the next message */ if ( (tag = ber_get_next( sb, &len, &ber )) @@ -349,7 +349,7 @@ read1msg( LDAP *ld, int msgid, int all, Sockbuf *sb, } #ifdef LDAP_REFERRALS - if (( lr = find_request_by_msgid( ld, id )) == NULL ) { + if (( lr = ldap_find_request_by_msgid( ld, id )) == NULL ) { Debug( LDAP_DEBUG_ANY, "no request for response with msgid %ld (tossing)\n", id, 0, 0 ); @@ -384,7 +384,7 @@ read1msg( LDAP *ld, int msgid, int all, Sockbuf *sb, != LBER_ERROR ) { if ( lderr != LDAP_SUCCESS ) { /* referrals are in error string */ - refer_cnt = chase_referrals( ld, lr, + refer_cnt = ldap_chase_referrals( ld, lr, &lr->lr_res_error, &hadref ); } @@ -455,11 +455,11 @@ lr->lr_res_matched ? lr->lr_res_matched : "" ); } } - free_request( ld, lr ); + ldap_free_request( ld, lr ); } if ( lc != NULL ) { - free_connection( ld, lc, 0, 1 ); + ldap_free_connection( ld, lc, 0, 1 ); } } } @@ -481,7 +481,7 @@ lr->lr_res_matched ? lr->lr_res_matched : "" ); #ifndef NO_CACHE if ( ld->ld_cache != NULL ) { - add_result_to_cache( ld, new ); + ldap_add_result_to_cache( ld, new ); } #endif /* NO_CACHE */ @@ -557,7 +557,7 @@ build_result_ber( LDAP *ld, BerElement *ber, LDAPRequest *lr ) long along; ber_init( ber, 0 ); - set_ber_options( ld, ber ); + ldap_set_ber_options( ld, ber ); if ( ber_printf( ber, "{it{ess}}", lr->lr_msgid, (long)lr->lr_res_msgtype, lr->lr_res_errno, lr->lr_res_matched ? lr->lr_res_matched : "", @@ -587,7 +587,7 @@ merge_error_info( LDAP *ld, LDAPRequest *parentr, LDAPRequest *lr ) if ( lr->lr_res_errno == LDAP_PARTIAL_RESULTS ) { parentr->lr_res_errno = lr->lr_res_errno; if ( lr->lr_res_error != NULL ) { - (void)append_referral( ld, &parentr->lr_res_error, + (void)ldap_append_referral( ld, &parentr->lr_res_error, lr->lr_res_error ); } } else if ( lr->lr_res_errno != LDAP_SUCCESS && diff --git a/libraries/libldap/sbind.c b/libraries/libldap/sbind.c index 656c722f15..9421b07fee 100644 --- a/libraries/libldap/sbind.c +++ b/libraries/libldap/sbind.c @@ -61,7 +61,7 @@ ldap_simple_bind( LDAP *ld, char *dn, char *passwd ) passwd = ""; /* create a message to send */ - if ( (ber = alloc_ber_with_options( ld )) == NULLBER ) { + if ( (ber = ldap_alloc_ber_with_options( ld )) == NULLBER ) { return( -1 ); } @@ -80,7 +80,7 @@ ldap_simple_bind( LDAP *ld, char *dn, char *passwd ) #endif /* !NO_CACHE */ /* send the message */ - return( send_initial_request( ld, LDAP_REQ_BIND, dn, ber )); + return( ldap_send_initial_request( ld, LDAP_REQ_BIND, dn, ber )); } /* diff --git a/libraries/libldap/search.c b/libraries/libldap/search.c index 2b73ddd07e..c9f984a511 100644 --- a/libraries/libldap/search.c +++ b/libraries/libldap/search.c @@ -80,17 +80,17 @@ ldap_search( LDAP *ld, char *base, int scope, char *filter, #ifndef NO_CACHE if ( ld->ld_cache != NULL ) { - if ( check_cache( ld, LDAP_REQ_SEARCH, ber ) == 0 ) { + if ( ldap_check_cache( ld, LDAP_REQ_SEARCH, ber ) == 0 ) { ber_free( ber, 1 ); ld->ld_errno = LDAP_SUCCESS; return( ld->ld_msgid ); } - add_request_to_cache( ld, LDAP_REQ_SEARCH, ber ); + ldap_add_request_to_cache( ld, LDAP_REQ_SEARCH, ber ); } #endif /* NO_CACHE */ /* send the message */ - return ( send_initial_request( ld, LDAP_REQ_SEARCH, base, ber )); + return ( ldap_send_initial_request( ld, LDAP_REQ_SEARCH, base, ber )); } @@ -126,7 +126,7 @@ ldap_build_search_req( LDAP *ld, char *base, int scope, char *filter, */ /* create a message to send */ - if ( (ber = alloc_ber_with_options( ld )) == NULLBER ) { + if ( (ber = ldap_alloc_ber_with_options( ld )) == NULLBER ) { return( NULLBER ); } diff --git a/libraries/libldap/unbind.c b/libraries/libldap/unbind.c index e7b5c401e6..69231f7db9 100644 --- a/libraries/libldap/unbind.c +++ b/libraries/libldap/unbind.c @@ -55,17 +55,17 @@ ldap_ld_free( LDAP *ld, int close ) /* free LDAP structure and outstanding requests/responses */ for ( lr = ld->ld_requests; lr != NULL; lr = nextlr ) { nextlr = lr->lr_next; - free_request( ld, lr ); + ldap_free_request( ld, lr ); } /* free and unbind from all open connections */ while ( ld->ld_conns != NULL ) { - free_connection( ld, ld->ld_conns, 1, close ); + ldap_free_connection( ld, ld->ld_conns, 1, close ); } #else /* LDAP_REFERRALS */ if ( close ) { - err = send_unbind( ld, &ld->ld_sb ); - close_connection( &ld->ld_sb ); + err = ldap_send_unbind( ld, &ld->ld_sb ); + ldap_close_connection( &ld->ld_sb ); } #endif /* LDAP_REFERRALS */ } else { @@ -106,7 +106,7 @@ ldap_ld_free( LDAP *ld, int close ) #ifdef LDAP_REFERRALS if ( ld->ld_selectinfo != NULL ) - free_select_info( ld->ld_selectinfo ); + ldap_free_select_info( ld->ld_selectinfo ); #endif /* LDAP_REFERRALS */ if ( ld->ld_defhost != NULL ) @@ -125,14 +125,14 @@ ldap_unbind_s( LDAP *ld ) int -send_unbind( LDAP *ld, Sockbuf *sb ) +ldap_send_unbind( LDAP *ld, Sockbuf *sb ) { BerElement *ber; - Debug( LDAP_DEBUG_TRACE, "send_unbind\n", 0, 0, 0 ); + Debug( LDAP_DEBUG_TRACE, "ldap_send_unbind\n", 0, 0, 0 ); /* create a message to send */ - if ( (ber = alloc_ber_with_options( ld )) == NULLBER ) { + if ( (ber = ldap_alloc_ber_with_options( ld )) == NULLBER ) { return( ld->ld_errno ); } diff --git a/libraries/libldap/url.c b/libraries/libldap/url.c index 08b47efd6b..204f2978ff 100644 --- a/libraries/libldap/url.c +++ b/libraries/libldap/url.c @@ -305,10 +305,10 @@ ldap_url_search( LDAP *ld, char *url, int attrsonly ) ber_free( ber, 1 ); } else { #ifdef LDAP_REFERRALS - err = send_server_request( ld, ber, ld->ld_msgid, NULL, srv, + err = ldap_send_server_request( ld, ber, ld->ld_msgid, NULL, srv, NULL, 1 ); #else /* LDAP_REFERRALS */ - err = send_initial_request( ld, LDAP_REQ_SEARCH, + err = ldap_send_initial_request( ld, LDAP_REQ_SEARCH, ludp->lud_dn, ber ); #endif /* LDAP_REFERRALS */ } diff --git a/libraries/macintosh/kerberos-macos.c b/libraries/macintosh/kerberos-macos.c index ee9c31c6b1..cb973795bb 100644 --- a/libraries/macintosh/kerberos-macos.c +++ b/libraries/macintosh/kerberos-macos.c @@ -29,12 +29,12 @@ static char copyright[] = "@(#) Copyright (c) 1994 Regents of the University of #include "ldap-int.h" /* - * get_kerberosv4_credentials - obtain kerberos v4 credentials for ldap. + * ldap_get_kerberosv4_credentials - obtain kerberos v4 credentials for ldap. */ /* ARGSUSED */ char * -get_kerberosv4_credentials( LDAP *ld, char *who, char *service, int *len ) +ldap_get_kerberosv4_credentials( LDAP *ld, char *who, char *service, int *len ) { static short authman_refnum = 0; char *cred, ticket[ MAX_KTXT_LEN ]; diff --git a/libraries/macintosh/macos-ip.c b/libraries/macintosh/macos-ip.c index 3a6a1805c2..011bdf7bf6 100644 --- a/libraries/macintosh/macos-ip.c +++ b/libraries/macintosh/macos-ip.c @@ -19,7 +19,7 @@ static char copyright[] = "@(#) Copyright (c) 1995 Regents of the University of #include "ldap-int.h" int -connect_to_host( Sockbuf *sb, char *host, unsigned long address, +ldap_connect_to_host( Sockbuf *sb, char *host, unsigned long address, int port, int async ) /* * if host == NULL, connect using address @@ -37,7 +37,7 @@ connect_to_host( Sockbuf *sb, char *host, unsigned long address, struct hostInfo hi; #endif /* SUPPORT_OPENTRANSPORT */ - Debug( LDAP_DEBUG_TRACE, "connect_to_host: %s:%d\n", + Debug( LDAP_DEBUG_TRACE, "ldap_connect_to_host: %s:%d\n", ( host == NULL ) ? "(by address)" : host, ntohs( port ), 0 ); if ( host != NULL && gethostinfobyname( host, &hi ) != noErr ) { @@ -78,7 +78,7 @@ connect_to_host( Sockbuf *sb, char *host, unsigned long address, void -close_connection( Sockbuf *sb ) +ldap_close_connection( Sockbuf *sb ) { tcpclose( (tcpstream *)sb->sb_sd ); } @@ -86,7 +86,7 @@ close_connection( Sockbuf *sb ) #ifdef KERBEROS char * -host_connected_to( Sockbuf *sb ) +ldap_host_connected_to( Sockbuf *sb ) { ip_addr addr; @@ -131,13 +131,13 @@ struct selectinfo { void -mark_select_read( LDAP *ld, Sockbuf *sb ) +ldap_mark_select_read( LDAP *ld, Sockbuf *sb ) { struct selectinfo *sip; struct tcpstreaminfo *tcpsip; short i; - Debug( LDAP_DEBUG_TRACE, "mark_select_read: stream %x\n", (tcpstream *)sb->sb_sd, 0, 0 ); + Debug( LDAP_DEBUG_TRACE, "ldap_mark_select_read: stream %x\n", (tcpstream *)sb->sb_sd, 0, 0 ); if (( sip = (struct selectinfo *)ld->ld_selectinfo ) == NULL ) { return; @@ -170,12 +170,12 @@ mark_select_read( LDAP *ld, Sockbuf *sb ) void -mark_select_clear( LDAP *ld, Sockbuf *sb ) +ldap_mark_select_clear( LDAP *ld, Sockbuf *sb ) { struct selectinfo *sip; short i; - Debug( LDAP_DEBUG_TRACE, "mark_select_clear: stream %x\n", (tcpstream *)sb->sb_sd, 0, 0 ); + Debug( LDAP_DEBUG_TRACE, "ldap_mark_select_clear: stream %x\n", (tcpstream *)sb->sb_sd, 0, 0 ); sip = (struct selectinfo *)ld->ld_selectinfo; if ( sip != NULL && sip->si_count > 0 && sip->si_streaminfo != NULL ) { @@ -196,7 +196,7 @@ mark_select_clear( LDAP *ld, Sockbuf *sb ) int -is_read_ready( LDAP *ld, Sockbuf *sb ) +ldap_is_read_ready( LDAP *ld, Sockbuf *sb ) { struct selectinfo *sip; short i; @@ -207,10 +207,10 @@ is_read_ready( LDAP *ld, Sockbuf *sb ) if ( sip->si_streaminfo[ i ].tcpsi_stream == (tcpstream *)sb->sb_sd ) { #ifdef LDAP_DEBUG if ( sip->si_streaminfo[ i ].tcpsi_is_read_ready ) { - Debug( LDAP_DEBUG_TRACE, "is_read_ready: stream %x READY\n", + Debug( LDAP_DEBUG_TRACE, "ldap_is_read_ready: stream %x READY\n", (tcpstream *)sb->sb_sd, 0, 0 ); } else { - Debug( LDAP_DEBUG_TRACE, "is_read_ready: stream %x Not Ready\n", + Debug( LDAP_DEBUG_TRACE, "ldap_is_read_ready: stream %x Not Ready\n", (tcpstream *)sb->sb_sd, 0, 0 ); } #endif /* LDAP_DEBUG */ @@ -219,20 +219,20 @@ is_read_ready( LDAP *ld, Sockbuf *sb ) } } - Debug( LDAP_DEBUG_TRACE, "is_read_ready: stream %x: NOT FOUND\n", (tcpstream *)sb->sb_sd, 0, 0 ); + Debug( LDAP_DEBUG_TRACE, "ldap_is_read_ready: stream %x: NOT FOUND\n", (tcpstream *)sb->sb_sd, 0, 0 ); return( 0 ); } void * -new_select_info() +ldap_new_select_info() { return( (void *)calloc( 1, sizeof( struct selectinfo ))); } void -free_select_info( void *sip ) +ldap_free_select_info( void *sip ) { if ( sip != NULL ) { free( sip ); From 0b0c178c1a08596842a680f83470b6260d1636f0 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Sun, 9 Aug 1998 03:08:09 +0000 Subject: [PATCH 14/18] LDAPworldP16: Search responses may not be returned properly --- libraries/libldap/result.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/libldap/result.c b/libraries/libldap/result.c index 90698939d6..fdf8dedf07 100644 --- a/libraries/libldap/result.c +++ b/libraries/libldap/result.c @@ -542,7 +542,11 @@ lr->lr_res_matched ? lr->lr_res_matched : "" ); prev->lm_next = l->lm_next; *result = l; ld->ld_errno = LDAP_SUCCESS; +#ifndef ultrix + return( l->lm_msgtype ); +#else return( tag ); +#endif } return( -2 ); /* continue looking */ From b63a0b1c6107ed5b7d226c8e5d5b2e739996c962 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Sun, 9 Aug 1998 03:13:49 +0000 Subject: [PATCH 15/18] LDAPworldP19: Patch for Next C-Threads --- include/lthread.h | 35 +++++++- libraries/liblthread/thread.c | 152 +++++++++++++++++++++++++++++++++- 2 files changed, 185 insertions(+), 2 deletions(-) diff --git a/include/lthread.h b/include/lthread.h index d1b34d8ecf..4a3b0a8072 100644 --- a/include/lthread.h +++ b/include/lthread.h @@ -3,7 +3,40 @@ #ifndef _LTHREAD_H #define _LTHREAD_H -#if defined( THREAD_SUNOS4_LWP ) +#if defined ( THREAD_NEXT_CTHREADS ) + +#define _THREAD + +#include + +typedef cthread_fn_t VFP; +typedef int pthread_attr_t; +typedef cthread_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 struct mutex 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 condition pthread_cond_t; + +#elif defined( THREAD_SUNOS4_LWP ) /*********************************** * * * thread definitions for sunos4 * diff --git a/libraries/liblthread/thread.c b/libraries/liblthread/thread.c index 89a85c70b4..47d878ac76 100644 --- a/libraries/liblthread/thread.c +++ b/libraries/liblthread/thread.c @@ -2,7 +2,157 @@ #include #include "lthread.h" -#if defined( THREAD_SUNOS4_LWP ) +#if defined( THREAD_NEXT_CTHREADS ) + +/*********************************************************************** + * * + * under NEXTSTEP or OPENSTEP use CThreads * + * lukeh@xedoc.com.au * + * * + ***********************************************************************/ + +int +pthread_attr_init( pthread_attr_t *attr ) +{ + *attr = 0; + return( 0 ); +} + +int +pthread_attr_destroy( pthread_attr_t *attr ) +{ + return( 0 ); +} + +int +pthread_attr_getdetachstate( pthread_attr_t *attr, int *detachstate ) +{ + *detachstate = *attr; + return( 0 ); +} + +int +pthread_attr_setdetachstate( pthread_attr_t *attr, int detachstate ) +{ + *attr = detachstate; + return( 0 ); +} + +/* ARGSUSED */ +int +pthread_create( + pthread_t *tid, + pthread_attr_t attr, + VFP func, + void *arg +) +{ + *tid = cthread_fork(func, arg); + return ( *tid == NULL ? -1 : 0 ); +} + +void +pthread_yield() +{ + cthread_yield(); +} + +void +pthread_exit( any_t a ) +{ + cthread_exit( a ); +} + +void +pthread_join( pthread_t tid, int *pStatus ) +{ + int status; + status = (int) cthread_join ( tid ); + if (pStatus != NULL) + { + *pStatus = status; + } +} + +/* ARGSUSED */ +void +pthread_kill( pthread_t tid, int sig ) +{ + return; +} + +/* ARGSUSED */ +int +pthread_mutex_init( pthread_mutex_t *mp, pthread_mutexattr_t *attr ) +{ + mutex_init( mp ); + mp->name = NULL; + return ( 0 ); +} + +int +pthread_mutex_destroy( pthread_mutex_t *mp ) +{ + mutex_clear( mp ); + return ( 0 ); +} + +int +pthread_mutex_lock( pthread_mutex_t *mp ) +{ + mutex_lock( mp ); + return ( 0 ); +} + +int +pthread_mutex_unlock( pthread_mutex_t *mp ) +{ + mutex_unlock( mp ); + return ( 0 ); +} + +int +pthread_mutex_trylock( pthread_mutex_t *mp ) +{ + return mutex_try_lock( mp ); +} + +int +pthread_cond_init( pthread_cond_t *cv, pthread_condattr_t *attr ) +{ + condition_init( cv ); + return( 0 ); +} + +int +pthread_cond_destroy( pthread_cond_t *cv ) +{ + condition_clear( cv ); + return( 0 ); +} + +int +pthread_cond_wait( pthread_cond_t *cv, pthread_mutex_t *mp ) +{ + condition_wait( cv, mp ); + return( 0 ); +} + +int +pthread_cond_signal( pthread_cond_t *cv ) +{ + condition_signal( cv ); + return( 0 ); +} + +int +pthread_cond_broadcast( pthread_cond_t *cv ) +{ + condition_broadcast( cv ); + return( 0 ); +} + +#elif defined( THREAD_SUNOS4_LWP ) /*********************************************************************** * * From 29062d06e40e9f27e10915b35c6b6c9933a75a20 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Sun, 9 Aug 1998 03:34:35 +0000 Subject: [PATCH 16/18] LDAPworldP20: Patch for comparing crypt()ed passwords (#ifdef LDAP_CRYPT) --- Make-common | 4 ++ build/Make-append | 2 +- build/platforms/freebsd-gcc/Make-platform | 3 ++ servers/slapd/back-ldbm/bind.c | 52 ++++++++++++++++++++++- servers/slapd/back-ldbm/init.c | 7 +++ 5 files changed, 65 insertions(+), 3 deletions(-) diff --git a/Make-common b/Make-common index 405842cc4f..5867e37262 100644 --- a/Make-common +++ b/Make-common @@ -197,6 +197,10 @@ LDAP_DEBUG=-DLDAP_DEBUG # uncomment this line to enable support for LDAP referrals in libldap LDAP_REFERRALS=-DLDAP_REFERRALS +# uncomment this line to enable support for CRYPT passwords in LDBM +# requires UNIX crypt(3) +LDAP_CRYPT=-DLDAP_CRYPT + # uncomment this line to use soundex for approximate matches in slapd. # the default is to use the metaphone algorithm. #PHONETIC=-DSOUNDEX diff --git a/build/Make-append b/build/Make-append index 67a2f29bb0..32c3d1cc9c 100644 --- a/build/Make-append +++ b/build/Make-append @@ -21,7 +21,7 @@ # DEFS are included in CFLAGS DEFS = $(PLATFORMCFLAGS) $(LDAP_DEBUG) $(KERBEROS) $(AFSKERBEROS) \ $(UOFM) $(UOFA) $(NO_USERINTERFACE) $(CLDAP) $(NO_CACHE) \ - $(LDAP_REFERRALS) $(LDAP_DNS) $(STR_TRANSLATION) \ + $(LDAP_REFERRALS) $(LDAP_CRYPT) $(LDAP_DNS) $(STR_TRANSLATION) \ $(LIBLDAP_CHARSETS) $(LIBLDAP_DEF_CHARSET) \ $(SLAPD_BACKENDS) $(LDBMBACKEND) $(LDBMINCLUDE) $(PHONETIC) diff --git a/build/platforms/freebsd-gcc/Make-platform b/build/platforms/freebsd-gcc/Make-platform index 895b32f2af..9ddba04dc7 100644 --- a/build/platforms/freebsd-gcc/Make-platform +++ b/build/platforms/freebsd-gcc/Make-platform @@ -14,3 +14,6 @@ CC = gcc PLATFORMCFLAGS= -Dfreebsd + +# uncomment this line if using for LDAP_CRYPT +PLATFORMLIBS= -lcrypt diff --git a/servers/slapd/back-ldbm/bind.c b/servers/slapd/back-ldbm/bind.c index 88fd4030c4..a4cbcd397f 100644 --- a/servers/slapd/back-ldbm/bind.c +++ b/servers/slapd/back-ldbm/bind.c @@ -10,6 +10,15 @@ #include "krb.h" #endif +#ifdef LDAP_CRYPT +/* change for crypted passwords -- lukeh */ +#ifdef __NeXT__ +extern char *crypt (char *key, char *salt); +#else +#include +#endif +#endif /* LDAP_CRYPT */ + extern Entry *dn2entry(); extern Attribute *attr_find(); @@ -17,6 +26,40 @@ extern Attribute *attr_find(); extern int krbv4_ldap_auth(); #endif +#ifdef LDAP_CRYPT +pthread_mutex_t crypt_mutex; + +static int +crypted_value_find( + struct berval **vals, + struct berval *v, + int syntax, + int normalize, + struct berval *cred +) +{ + int i; + for ( i = 0; vals[i] != NULL; i++ ) { + if ( syntax != SYNTAX_BIN && + strncasecmp( "{CRYPT}", vals[i]->bv_val, (sizeof("{CRYPT}") - 1 ) ) == 0 ) { + char *userpassword = vals[i]->bv_val + sizeof("{CRYPT}") - 1; + pthread_mutex_lock( &crypt_mutex ); + if ( ( !strcmp( userpassword, crypt( cred->bv_val, userpassword ) ) != 0 ) ) { + pthread_mutex_unlock( &crypt_mutex ); + return ( 0 ); + } + pthread_mutex_unlock( &crypt_mutex ); + } else { + if ( value_cmp( vals[i], v, syntax, normalize ) == 0 ) { + return( 0 ); + } + } + } + + return( 1 ); +} +#endif /* LDAP_CRYPT */ + int ldbm_back_bind( Backend *be, @@ -81,13 +124,18 @@ ldbm_back_bind( return( 1 ); } - if ( value_find( a->a_vals, cred, a->a_syntax, 0 ) != 0 ) { +#ifdef LDAP_CRYPT + if ( crypted_value_find( a->a_vals, cred, a->a_syntax, 0, cred ) != 0 ) +#else + if ( value_find( a->a_vals, cred, a->a_syntax, 0 ) != 0 ) +#endif +{ if ( be_isroot_pw( be, dn, cred ) ) { /* front end will send result */ return( 0 ); } send_ldap_result( conn, op, LDAP_INVALID_CREDENTIALS, - NULL, NULL ); + NULL, NULL ); cache_return_entry( &li->li_cache, e ); return( 1 ); } diff --git a/servers/slapd/back-ldbm/init.c b/servers/slapd/back-ldbm/init.c index b9c5c2f3fa..de8c59a236 100644 --- a/servers/slapd/back-ldbm/init.c +++ b/servers/slapd/back-ldbm/init.c @@ -15,6 +15,10 @@ ldbm_back_init( char *argv[ 4 ]; int i; +#ifdef LDAP_CRYPT + extern pthread_mutex_t crypt_mutex; +#endif /* LDAP_CRYPT */ + /* allocate backend-specific stuff */ li = (struct ldbminfo *) ch_calloc( 1, sizeof(struct ldbminfo) ); @@ -59,6 +63,9 @@ ldbm_back_init( pthread_mutex_init( &li->li_cache.c_mutex, pthread_mutexattr_default ); pthread_mutex_init( &li->li_nextid_mutex, pthread_mutexattr_default ); pthread_mutex_init( &li->li_dbcache_mutex, pthread_mutexattr_default ); +#ifdef LDAP_CRYPT + pthread_mutex_init( &crypt_mutex, pthread_mutexattr_default ); +#endif /* LDAP_CRYPT */ pthread_cond_init( &li->li_dbcache_cv, pthread_condattr_default ); for ( i = 0; i < MAXDBCACHE; i++ ) { pthread_mutex_init( &li->li_dbcache[i].dbc_mutex, From ccc2797a7768662458181dca14d9e2aacb849cef Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Sun, 9 Aug 1998 03:37:22 +0000 Subject: [PATCH 17/18] LDAPworldP21: SLAPD Memory leak/error in filterentry.c --- servers/slapd/filterentry.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/servers/slapd/filterentry.c b/servers/slapd/filterentry.c index 712ff22e2e..4b6807f55a 100644 --- a/servers/slapd/filterentry.c +++ b/servers/slapd/filterentry.c @@ -223,11 +223,12 @@ test_approx_filter( w2 = next_word( w2 ) ) { c2 = phonetic( w2 ); if ( strcmp( c1, c2 ) == 0 ) { + free( c2 ); break; } + free( c2 ); } free( c1 ); - free( c2 ); /* * if we stopped because we ran out of words From 271d678b0eabd7abf15da727685d820ffde56d0c Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Sun, 9 Aug 1998 03:40:29 +0000 Subject: [PATCH 18/18] LDAPworldP22: problem with msgids greater than 32767 on 64bit architectures --- libraries/liblber/decode.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/libraries/liblber/decode.c b/libraries/liblber/decode.c index a722c9eb7a..368dedf4bb 100644 --- a/libraries/liblber/decode.c +++ b/libraries/liblber/decode.c @@ -155,6 +155,7 @@ ber_getnint( BerElement *ber, long *num, int len ) { int diff, sign, i; long netnum; + char *p; /* * The tag and length have already been stripped off. We should @@ -172,11 +173,12 @@ ber_getnint( BerElement *ber, long *num, int len ) if ( ber_read( ber, ((char *) &netnum) + diff, len ) != len ) return( -1 ); - /* sign extend if necessary */ - sign = ((0x80 << ((len - 1) * 8)) & netnum); - if ( sign && len < sizeof(long) ) { - for ( i = sizeof(long) - 1; i > len - 1; i-- ) { - netnum |= (0xffL << (i * 8)); + /* sign extend if necessary */ + p = (char *) &netnum; + sign = (0x80 & *(p+diff) ); + if ( sign && len < sizeof(long) ) { + for ( i = 0; i < diff; i++ ) { + *(p+i) = 0xff; } } *num = LBER_NTOHL( netnum );