Commit 8b2170bc authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Import of FreeBSD LDAP 3.3 Port

parent 42e0d83c
...@@ -28,8 +28,9 @@ ...@@ -28,8 +28,9 @@
# man pages are put under MANDIR # man pages are put under MANDIR
# programs end-users will run are put in BINDIR # programs end-users will run are put in BINDIR
# #
INSTROOT=/usr/local PREFIX?=/usr/local
ETCDIR= $(INSTROOT)/etc INSTROOT=${PREFIX}
ETCDIR= $(INSTROOT)/etc/ldap
INCLUDEDIR= $(INSTROOT)/include INCLUDEDIR= $(INSTROOT)/include
LIBDIR= $(INSTROOT)/lib LIBDIR= $(INSTROOT)/lib
MANDIR= $(INSTROOT)/man MANDIR= $(INSTROOT)/man
...@@ -45,6 +46,7 @@ RUNTIMEETCDIR= $(ETCDIR) ...@@ -45,6 +46,7 @@ RUNTIMEETCDIR= $(ETCDIR)
############################################################################# #############################################################################
# Passed to every compile (cc or gcc). This is where you put -O or -g, etc. # Passed to every compile (cc or gcc). This is where you put -O or -g, etc.
#EXTRACFLAGS=-g #EXTRACFLAGS=-g
EXTRACFLAGS=-O
# Passed to every link (ld). Include -g here if you did in EXTRACFLAGS. # Passed to every link (ld). Include -g here if you did in EXTRACFLAGS.
#EXTRALDFLAGS=-g #EXTRALDFLAGS=-g
...@@ -122,8 +124,8 @@ SLAPD_BACKENDS= -DLDAP_LDBM -DLDAP_SHELL -DLDAP_PASSWD ...@@ -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. # four choices: Berkeley db b-tree, Berkeley db hash, GNU dbm, or ndbm.
# #
# berkeley db btree package # berkeley db btree package
#LDBMBACKEND=-DLDBM_USE_DBBTREE LDBMBACKEND=-DLDBM_USE_DBBTREE
#LDBMINCLUDE=-I/usr/local/db/include LDBMINCLUDE=-I/usr/include
#LDBMLIB=-ldb #LDBMLIB=-ldb
# berkeley db hash package # berkeley db hash package
#LDBMBACKEND=-DLDBM_USE_DBHASH #LDBMBACKEND=-DLDBM_USE_DBHASH
...@@ -134,7 +136,7 @@ SLAPD_BACKENDS= -DLDAP_LDBM -DLDAP_SHELL -DLDAP_PASSWD ...@@ -134,7 +136,7 @@ SLAPD_BACKENDS= -DLDAP_LDBM -DLDAP_SHELL -DLDAP_PASSWD
#LDBMINCLUDE=-I/usr/local/gdbm/include #LDBMINCLUDE=-I/usr/local/gdbm/include
#LDBMLIB=-lgdbm #LDBMLIB=-lgdbm
# standard unix ndbm # standard unix ndbm
LDBMBACKEND=-DLDBM_USE_NDBM #LDBMBACKEND=-DLDBM_USE_NDBM
# #
# if you want to use a non-default threads package change these lines # if you want to use a non-default threads package change these lines
#THREADS=-DNO_THREADS #THREADS=-DNO_THREADS
......
...@@ -31,10 +31,8 @@ install: FORCE ...@@ -31,10 +31,8 @@ install: FORCE
$(INSTALL) $(INSTALLFLAGS) -m 644 $$TMPMAN $(INSTDIR)/$$page; \ $(INSTALL) $(INSTALLFLAGS) -m 644 $$TMPMAN $(INSTDIR)/$$page; \
if [ -f "$$page.links" ]; then \ if [ -f "$$page.links" ]; then \
for link in `$(CAT) $$page.links`; do \ for link in `$(CAT) $$page.links`; do \
echo ".so man$(SECT)/$$page" > $$TMPMAN; \
echo "installing $(INSTDIR)/$$link as link to $$page"; \ echo "installing $(INSTDIR)/$$link as link to $$page"; \
$(INSTALL) $(INSTALLFLAGS) -m 644 $$TMPMAN \ ln -sf $$page.gz $(INSTDIR)/$$link.gz; \
$(INSTDIR)/$$link; \
done; \ done; \
fi; \ fi; \
done; \ done; \
......
...@@ -31,10 +31,8 @@ install: FORCE ...@@ -31,10 +31,8 @@ install: FORCE
$(INSTALL) $(INSTALLFLAGS) -m 644 $$TMPMAN $(INSTDIR)/$$page; \ $(INSTALL) $(INSTALLFLAGS) -m 644 $$TMPMAN $(INSTDIR)/$$page; \
if [ -f "$$page.links" ]; then \ if [ -f "$$page.links" ]; then \
for link in `$(CAT) $$page.links`; do \ for link in `$(CAT) $$page.links`; do \
echo ".so man$(SECT)/$$page" > $$TMPMAN; \
echo "installing $(INSTDIR)/$$link as link to $$page"; \ echo "installing $(INSTDIR)/$$link as link to $$page"; \
$(INSTALL) $(INSTALLFLAGS) -m 644 $$TMPMAN \ ln -sf $$page.gz $(INSTDIR)/$$link.gz; \
$(INSTDIR)/$$link; \
done; \ done; \
fi; \ fi; \
done; \ done; \
......
ldap_modrdn_s ldap_modrdn_s.3
ldap_modrdn2 ldap_modrdn2.3
ldap_modrdn2_s ldap_modrdn2_s.3
...@@ -31,10 +31,8 @@ install: FORCE ...@@ -31,10 +31,8 @@ install: FORCE
$(INSTALL) $(INSTALLFLAGS) -m 644 $$TMPMAN $(INSTDIR)/$$page; \ $(INSTALL) $(INSTALLFLAGS) -m 644 $$TMPMAN $(INSTDIR)/$$page; \
if [ -f "$$page.links" ]; then \ if [ -f "$$page.links" ]; then \
for link in `$(CAT) $$page.links`; do \ for link in `$(CAT) $$page.links`; do \
echo ".so man$(SECT)/$$page" > $$TMPMAN; \
echo "installing $(INSTDIR)/$$link as link to $$page"; \ echo "installing $(INSTDIR)/$$link as link to $$page"; \
$(INSTALL) $(INSTALLFLAGS) -m 644 $$TMPMAN \ ln -sf $$page.gz $(INSTDIR)/$$link.gz; \
$(INSTDIR)/$$link; \
done; \ done; \
fi; \ fi; \
done; \ done; \
......
...@@ -31,10 +31,8 @@ install: FORCE ...@@ -31,10 +31,8 @@ install: FORCE
$(INSTALL) $(INSTALLFLAGS) -m 644 $$TMPMAN $(INSTDIR)/$$page; \ $(INSTALL) $(INSTALLFLAGS) -m 644 $$TMPMAN $(INSTDIR)/$$page; \
if [ -f "$$page.links" ]; then \ if [ -f "$$page.links" ]; then \
for link in `$(CAT) $$page.links`; do \ for link in `$(CAT) $$page.links`; do \
echo ".so man$(SECT)/$$page" > $$TMPMAN; \
echo "installing $(INSTDIR)/$$link as link to $$page"; \ echo "installing $(INSTDIR)/$$link as link to $$page"; \
$(INSTALL) $(INSTALLFLAGS) -m 644 $$TMPMAN \ ln -sf $$page.gz $(INSTDIR)/$$link.gz; \
$(INSTDIR)/$$link; \
done; \ done; \
fi; \ fi; \
done; \ done; \
......
...@@ -20,7 +20,9 @@ ...@@ -20,7 +20,9 @@
#if defined(NeXT) || defined(VMS) #if defined(NeXT) || defined(VMS)
#include <stdlib.h> #include <stdlib.h>
#else /* next || vms */ #else /* next || vms */
#ifndef __FreeBSD__
#include <malloc.h> #include <malloc.h>
#endif
#endif /* next || vms */ #endif /* next || vms */
#if defined(BC31) || defined(_WIN32) #if defined(BC31) || defined(_WIN32)
#include <stdarg.h> #include <stdarg.h>
......
...@@ -20,7 +20,9 @@ ...@@ -20,7 +20,9 @@
#if defined(NeXT) || defined(VMS) #if defined(NeXT) || defined(VMS)
#include <stdlib.h> #include <stdlib.h>
#else /* next || vms */ #else /* next || vms */
#ifndef __FreeBSD__
#include <malloc.h> #include <malloc.h>
#endif
#endif /* next || vms */ #endif /* next || vms */
#if defined( BC31 ) || defined( _WIN32 ) #if defined( BC31 ) || defined( _WIN32 )
#include <stdarg.h> #include <stdarg.h>
......
...@@ -25,7 +25,9 @@ ...@@ -25,7 +25,9 @@
#if defined(NeXT) || defined(VMS) #if defined(NeXT) || defined(VMS)
#include <stdlib.h> #include <stdlib.h>
#else /* next || vms */ #else /* next || vms */
#ifndef __FreeBSD__
#include <malloc.h> #include <malloc.h>
#endif
#endif /* next || vms */ #endif /* next || vms */
#include <errno.h> #include <errno.h>
#include <sys/types.h> #include <sys/types.h>
......
...@@ -150,6 +150,14 @@ select_backend( char * dn ) ...@@ -150,6 +150,14 @@ select_backend( char * dn )
for ( i = 0; i < nbackends; i++ ) { for ( i = 0; i < nbackends; i++ ) {
for ( j = 0; backends[i].be_suffix != NULL && for ( j = 0; backends[i].be_suffix != NULL &&
backends[i].be_suffix[j] != NULL; j++ ) { backends[i].be_suffix[j] != NULL; j++ ) {
/* Add greg@greg.rim.or.jp
* It's quick hack for cheep client
* Some browser offer a NULL base at ldap_search
*/
if(dnlen == 0) {
Debug( LDAP_DEBUG_TRACE, "select_backend: use default backend\n", 0, 0, 0 );
return (&backends[i]);
}
len = strlen( backends[i].be_suffix[j] ); len = strlen( backends[i].be_suffix[j] );
if ( len > dnlen ) { if ( len > dnlen ) {
......
...@@ -68,7 +68,12 @@ daemon( ...@@ -68,7 +68,12 @@ daemon(
#else /* USE_SYSCONF */ #else /* USE_SYSCONF */
dtblsize = getdtablesize(); dtblsize = getdtablesize();
#endif /* USE_SYSCONF */ #endif /* USE_SYSCONF */
/*
* Add greg@greg.rim.or.jp
*/
if(dtblsize > FD_SETSIZE) {
dtblsize = FD_SETSIZE;
}
c = (Connection *) ch_calloc( 1, dtblsize * sizeof(Connection) ); c = (Connection *) ch_calloc( 1, dtblsize * sizeof(Connection) );
for ( i = 0; i < dtblsize; i++ ) { for ( i = 0; i < dtblsize; i++ ) {
...@@ -130,6 +135,7 @@ daemon( ...@@ -130,6 +135,7 @@ daemon(
(void) SIGNAL( SIGUSR1, (void *) do_nothing ); (void) SIGNAL( SIGUSR1, (void *) do_nothing );
(void) SIGNAL( SIGUSR2, (void *) set_shutdown ); (void) SIGNAL( SIGUSR2, (void *) set_shutdown );
(void) SIGNAL( SIGTERM, (void *) set_shutdown ); (void) SIGNAL( SIGTERM, (void *) set_shutdown );
(void) SIGNAL( SIGINT, (void *) set_shutdown );
(void) SIGNAL( SIGHUP, (void *) set_shutdown ); (void) SIGNAL( SIGHUP, (void *) set_shutdown );
Debug( LDAP_DEBUG_ANY, "slapd starting\n", 0, 0, 0 ); Debug( LDAP_DEBUG_ANY, "slapd starting\n", 0, 0, 0 );
...@@ -352,6 +358,7 @@ set_shutdown() ...@@ -352,6 +358,7 @@ set_shutdown()
pthread_kill( listener_tid, SIGUSR1 ); pthread_kill( listener_tid, SIGUSR1 );
(void) SIGNAL( SIGUSR2, (void *) set_shutdown ); (void) SIGNAL( SIGUSR2, (void *) set_shutdown );
(void) SIGNAL( SIGTERM, (void *) set_shutdown ); (void) SIGNAL( SIGTERM, (void *) set_shutdown );
(void) SIGNAL( SIGINT, (void *) set_shutdown );
(void) SIGNAL( SIGHUP, (void *) set_shutdown ); (void) SIGNAL( SIGHUP, (void *) set_shutdown );
} }
......
...@@ -31,7 +31,9 @@ ...@@ -31,7 +31,9 @@
extern char *str_getline( char **next ); extern char *str_getline( char **next );
extern void ch_free( char *p ); extern void ch_free( char *p );
#if !(defined(BSD) && (BSD >= 199306))
extern char *sys_errlist[]; extern char *sys_errlist[];
#endif
/* Forward references */ /* Forward references */
static Rh *get_repl_hosts( char *, int *, char ** ); static Rh *get_repl_hosts( char *, int *, char ** );
......
...@@ -44,9 +44,9 @@ extern void Re_dump( Re *re ); ...@@ -44,9 +44,9 @@ extern void Re_dump( Re *re );
extern void Re_dump(); extern void Re_dump();
#endif /* NEEDPROTOS */ #endif /* NEEDPROTOS */
#if !(defined(BSD) && (BSD >= 199306))
extern char *sys_errlist[]; extern char *sys_errlist[];
#endif
/* /*
* Lock the replication queue. * Lock the replication queue.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment