Commit Graph

284 Commits

Author SHA1 Message Date
Kurt Zeilenga
404f953ef0 New pthread_try_link test. Looks for pthread_create and pthread_detach
and, if LinuxThreads, pthread_kill_other_threads_np().
1999-04-07 02:47:15 +00:00
Kurt Zeilenga
bbb7964508 New LinuxThreads detection. Correctly detects FreeBSD's LinuxThreads port
(but not sure if it's usable yet).  Needs to be tested on various versions
of Linux native LinuxThreads.
1999-04-06 23:44:27 +00:00
Kurt Zeilenga
73b846c011 Add ldap_pvt_thread_destory() to un-ldap_pvt_thread_initialize().
Move all SunOS routines (ie: _sleep() and its helpers) to thr_lwp.c
so that it's internals can be 'static'.  Add 'static' to thr_lwp.c.
Add comment to LWP:  NEEDS WORK, may not compile!  Need some
SunOS user to sort out the details.  Volunteers?
1999-04-06 21:57:16 +00:00
Hallvard Furuseth
e78f4140d7 Use macros for the dummy definitions of sys_errlist/sys_errno 1999-04-06 01:25:03 +00:00
Kurt Zeilenga
b4658cbe24 Cleanup socket() detection.
Move select() detection forward, error if not available.
Move select() args type check forward so it can be used in subsequent tests.
1999-04-04 20:36:35 +00:00
Kurt Zeilenga
82453169fc Add select args type & vfork tests for experimentation purposes. 1999-04-04 00:59:32 +00:00
Hallvard Furuseth
9ebd9a0289 Add -U and -G options to set user and group id.
Move socket setup to set_socket(), called before the uid/gid change.
1999-04-03 03:19:07 +00:00
Gary Williams
92d4ccf906 NT port 1999-04-01 16:38:11 +00:00
Kurt Zeilenga
f626fbbd57 Rebuild configure due to MDBM addition. 1999-03-30 04:46:17 +00:00
Juan Gomez
8c23e997e9 MDBM support added. 1999-03-30 04:39:41 +00:00
Juan Gomez
009038a795 MDBM detection feature. 1999-03-30 04:25:52 +00:00
Kurt Zeilenga
b9109a9f20 add wait macros. add LDAP_SIGCHLD. and other misc NT cleanups. 1999-03-29 09:04:35 +00:00
Kurt Zeilenga
db721ca821 Add ioctl_t for arg type (Unix requires 'int', Winsock requires 'u_long'). 1999-03-29 05:28:29 +00:00
Kurt Zeilenga
ff23537bcb Rework ac/socket.h for HAVE_WINSOCK:
tcp_close -> closesocket
  ioctl -> ioctlsocket
Modify codes to use tcp_close() instead of close() for sockets.
Modify ioctl codes to be compatible with WINSOCK.
1999-03-29 05:15:59 +00:00
Kurt Zeilenga
30f953160f Add wait4/3 detection.
Modify slapd_tester to use pid_t and wait macros.  May need to
implement additional macros in ac/wait.h (in addition to
WEXITSTATUS and WIFEXITED).
1999-03-29 01:40:17 +00:00
Kurt Zeilenga
598b7473fe All implementations of lutil_lockf (aka ldap_lockf) block until
the lock is acquired.  Add comments to that effect.  Remove
unnecessary busy loops from slapd/lock.c and slurpd/lock.c.
1999-03-28 22:43:43 +00:00
Kurt Zeilenga
f4161b5bf8 NT doesn't have waitpid() 1999-03-28 22:42:13 +00:00
Kurt Zeilenga
7adc0a65d0 Update lutil_lockf (aka: ldap_lockf) to hide implementation in
library, not header.  Eliminate need for <ac/unistd.h> to sometimes
include <fcntl.h> and/or <sys/file.h>.  Change lock API to expect
fd not FILE*.  Allows wider use and eliminates requirement that
lutil_lockf.h depencency on stdio.h.
Implemented lockf, fcntl, and flock locking in lutil/lockf.c.
Additional implementations (including no-op) may be needed.
Update slapd/lock.c and slurpd/lock.c to use new API.
1999-03-28 21:39:02 +00:00
Ben Collins
5c931bdffa If we are using lutil_lock functions then define NEED_SIMPLE_LOCKING or
liblutil/lockf.c wont be compiled.
1999-03-28 18:07:44 +00:00
Kurt Zeilenga
11add79cb1 Update locking codes. 1999-03-26 17:43:23 +00:00
Ben Collins
cfe36cb71f Added extra checks to locking definitions 1999-03-26 15:10:06 +00:00
Kurt Zeilenga
81acad8937 Add LDAP_DEBUG promotion and include of ac/insert.h 1999-03-26 04:37:39 +00:00
Kurt Zeilenga
61f6d5d8ca Add check for <assert.h> and put include in right file (acconfig.h) 1999-03-20 03:21:19 +00:00
Kurt Zeilenga
f999e1350d Provide global assert solution. <ac/assert.h> (new) is now included
by portable.h with NDEBUG undefined.  This makes assert() is always
available and automatically disables itself when LDAP_DEBUG is undefined.
I've included a basic assert() for pre-STDC compilers.  It relies on
abort() which may not actually be available.  (well replace abort()
with whatever is appropriate if and when we're faced with a pre-STDC
compiler that doesn't have assert()).
1999-03-20 03:13:24 +00:00
Kurt Zeilenga
5a4babde00 Add DEFAULT_EDITOR to ldapconfig.h. Used by ldbmtest and ud. 1999-03-17 22:34:17 +00:00
Kurt Zeilenga
96b2ae55ac Add OL_STRUCT_PASSWD_PW_GECOS test. Checks for pw_gecos in struct passwd. 1999-03-17 22:23:29 +00:00
Kurt Zeilenga
98d3206c42 Rebuild configure and portable.h.in... 1999-03-17 22:10:31 +00:00
Kurt Zeilenga
8694a8395c Add EBCDIC test in preparation for VM port. 1999-03-15 19:31:13 +00:00
Kurt Zeilenga
5f3c7a88dc Add 'extern' to externals. 1999-03-15 01:06:02 +00:00
Ben Collins
13f169ee54 Only declare strdup() if DECL_STRDUP is defined 1999-03-15 00:19:46 +00:00
Ben Collins
e732e12279 configure.in now includes OL_DECL_STRDUP, configure and portable.h.in
rebuilt to reflect it.
1999-03-15 00:18:49 +00:00
Hallvard Furuseth
7927ffe7f3 Add missing parens around Debug macro parameter 1999-03-14 07:15:58 +00:00
Ben Collins
4e733cf024 Macros for file locking/unlocking added (ldap_lockf/ldap_unlockf) 1999-03-13 20:31:55 +00:00
Ben Collins
615923f0d1 Functions for using fcntl to lock/unlock files in case lockf is not available 1999-03-13 19:25:15 +00:00
Ben Collins
ebce51b2db actually define HAVE_SYS_ERRLIST if we have it, if not then declare it locally in ac/errno.h 1999-03-13 18:19:11 +00:00
Ben Collins
362f051a57 Added check for <arpa/inet.h> 1999-03-13 02:17:34 +00:00
Ben Collins
c0b11aa8b5 Added check for getpass() as well as adding it to the -llutil Makefile.in (BeOS will need this) 1999-03-13 02:08:42 +00:00
Ben Collins
8f0aae9b72 #ifdef for <arpa/inet.h> 1999-03-13 01:12:54 +00:00
Kurt Zeilenga
e2d90b3acb Update configure to:
-- fixed gethostbyaddr_r/gethostbyname_r compile warnings
  -- relocated Pthread -mt test to be before -kthread test
1999-03-10 23:31:06 +00:00
Hallvard Furuseth
6de5ba2834 Fix typo -lxttp => -lxtpp in HAVE_XTPP comment 1999-03-09 08:05:27 +00:00
Kurt Zeilenga
53fc115b6f Add LDIF_ to LINE_WIDTH 1999-03-09 00:50:41 +00:00
Kurt Zeilenga
6570ec368c Regenerate configure and friends. 1999-03-08 20:01:17 +00:00
Kurt Zeilenga
8d3f492698 Add GNU readline detection. Needed for saucer enhancement (ITS#96). 1999-03-08 01:48:45 +00:00
Kurt Zeilenga
9e71e09bac Relocate reentrant function checks to before thread library checks.
Disable ctime_r() type check.  Need better test.
1999-03-07 00:22:11 +00:00
Kurt Zeilenga
588a458d78 MSVC5 cleanup...
lber: ifdef'ed out lber_..set_nonblock() function because it used ioctl's.
  If it remains, it needs to be written to support various methods for
  setting non-blocking.  ioctls should probably be last choice.  configure
  could detect existance of fcntl(), ioctl(), etc.
bdb2:
  added .dsp/.dsw files and did some basic cleanup (still needs work).
1999-03-06 00:57:25 +00:00
Kurt Spanier
6da27229d9 1. Fix of ldbmcat segmentation fault bug (ITS#85 and #81).
2. Make ldbm_Env a failure-safe entity.
1999-03-05 11:24:42 +00:00
Juan Gomez
e46c2e494e Added prototypes for ldap_rename2() and ldap_rename2_s(), which generate
a MODDN or MODRDN request depending on the newSuperior parameter.
1999-03-04 03:14:31 +00:00
Kurt Zeilenga
ce6836dbed Apply Hallvard's D4 pthread detection patch. 1999-03-03 23:32:00 +00:00
Juan Gomez
cd90353f10 Added LDAP_TAG_NEWSUPERIOR tag and a brief description about tag
construction which may be useful later when adding new tags. This
in preparation to support moddn v3.
1999-03-03 22:51:43 +00:00
Hallvard Furuseth
45bf79315e Correct typo ldap_count_reference -> ldap_count_references 1999-03-03 17:45:15 +00:00
Bart Hartgers
a81ca18845 Added support in liblber and libldap for partial reads, i.e. situations in
which only part of a LDAPMessage is available on a socket.

The server-code seemed to handle this correctly already, so I didn't touch
it.

My apologies for the hack in ber_get_next :-).
1999-03-03 16:38:56 +00:00
Bart Hartgers
8153a4039b The new&improved Sockbuf. This adds the infrastructure on which
support for TLS and SASL will be build.

Please inform me of any problems.
1999-03-02 20:23:14 +00:00
Kurt Zeilenga
4e160e83b6 Replace IFP() with appropriate full prototypes:
AVL_CMP, AVL_DUP, AVL_FREE, AVL_APPLY.
Apply casts as needed.
Change data pointer from caddr_t to void *.
1999-03-02 00:32:59 +00:00
Kurt Zeilenga
180eed16fe Rebuild autoconf/autoheader generated files after TLS and gethostbyname_r
changes.
1999-03-01 18:55:52 +00:00
Hallvard Furuseth
79f7c85067 Add locale support (slapd.conf keyword "locale") to slapd if HAVE_LOCALE_H 1999-02-22 21:01:24 +00:00
Kurt Zeilenga
aa17fdd0bd Use ldap_pvt_strtok directly and unconditionally.
Implementation no longer uses strtok_r(), it may be broken
or have an odd prototype.
Update configure not to check for strtok/strtok_r nor require
strtok_r to LDAP_API_FEATURE_X_OPENLDAP_REENTRANT.
1999-02-20 20:12:03 +00:00
Kurt Zeilenga
84bafea62e #undef symbols before #defining them. This provides a little protection
when symbol being replaced was defined as a macro.
1999-02-20 18:31:56 +00:00
Hallvard Furuseth
19c2a483e6 fix TOLOWER, it was equal to TOUPPER 1999-02-20 16:22:10 +00:00
Kurt Zeilenga
a71f328831 Import Ben Collins <bcollins@debian.org> Back-TCL for SLAPD. 1999-02-14 19:20:14 +00:00
Kurt Zeilenga
a362bde4a7 Forgot changes made in portable.h need to be imported back into portable.h.nt 1999-02-11 22:33:19 +00:00
Kurt Zeilenga
6e2557f051 Update features for MSVC 5. 1999-02-11 21:49:35 +00:00
Kurt Zeilenga
e4a589d99e Updates for MSVC 5.0. Fix libraries names to be ol{ber,dap,..}32.lib.
Fix library/include paths for building "Release".
Create getpass() from ud's mygetpass().
1999-02-11 21:16:03 +00:00
Kurt Zeilenga
859b1ae451 Detect pthread_detach using #include <pthread.h> (using AC_TRY_LINK)
instead of AC_CHECK_FUNCS() as symbol may be mangled.
1999-02-08 22:54:40 +00:00
Kurt Spanier
42f6e78dd4 Integration of the BDB2 backend into the new init/startup/shutdown schema.
Integration into ./configure ( --enable-bdb2 ).
Adaptation of the test-suite ( 'make' -> ldbm; 'make bdb2-local' -> bdb2 ).
Minor fixes in slapd/libldbm.
1999-02-08 11:42:14 +00:00
Kurt Zeilenga
216049bd12 New Frontend->Backend Interface
Separates per backend type from per backend database initialization
	and startup.  Also supports per type / per backend shutdown.
New frontend startup/shutdown routines are also provided:
	slap_init() slap_startup() slap_shutdown() slap_destroy()
New frontend->backend startup/shutdown is managed by:
	backend_init() backend_startup() backend_shutdown backend_destroy
backend_init() now calls bi_init() to initial all function pointers
for the backend (excepting bi_init() which is now the only hardcoded
entry point).  New entry points are detailed in slap.h struct
backend_info.  backend_info is a per database type structure.
Besides the new startup/shutdown entry points, the new interface
also supports per backend type configuration options.  One could have:

	backend bdb2	(new Berkeley DB 2 backend)
	bdb2_home	/directory

	database bdb2
	...

	*** This code is fairly experimental ***
	*** Much cleanup and testing is still needed ***

see slap.h for details on struct backend_db and backend_info.
1999-02-05 09:03:47 +00:00
Kurt Zeilenga
f4dd466315 Build environment changes including:
Kerberos detection of des_debug
	detection of resolv.h and arpa/nameserv.h
Updated affected codes.
1999-02-04 21:54:38 +00:00
Kurt Zeilenga
366701bdf7 Fix dbcache/entry lock deadlock. If dbcache lock is held, it's
okay to read and write LDBM specific fields (state, refcnt,
LRU.  The id field, though is read-only once set.
cache_find_entry_dn2id(), hence, does not require any entry locks.
cache_find_entry_id() must do a entry_rdwr_trylock() and back
off if busy.
Add new rdwr lock code with trylock() functionality.
Implement entry_rdwr_trylock().
1999-02-04 18:00:50 +00:00
Kurt Zeilenga
1e53519136 Backout recent initialization/startup changes in preparation for
new frontend-backend interface.
1999-02-04 17:36:06 +00:00
Kurt Zeilenga
d671c49b94 Fix set concurrency typos. 1999-02-03 18:29:27 +00:00
Kurt Zeilenga
ee05cd8038 Update AC_DEFINES to use autoconf 1.3 descriptions.
Update acconfig.h to use @TOP@ and @BOTTOM@ to rid ourselves of
the .top/.bot files.
1999-02-03 01:05:41 +00:00
Kurt Zeilenga
fb0489d922 Added --enable-bdb2 for Ksp's Berkeley DB 2 specific slapd backend.
Supports 'yes', 'no' (default), and 'auto'.
1999-02-01 22:19:42 +00:00
Kurt Spanier
314f3f6ed7 Introduction of a backend startup/shutdown function to make backend-specific
initialization after reading slapd.conf, and before starting the daemon
1999-02-01 17:37:43 +00:00
Kurt Zeilenga
9f96ab2fb0 Add ac/sysexits.h for GNU win32 environments.
Fix LDAP_API_VENDOR_VERSION -> LDAP_VENDOR_VERSION bug
1999-02-01 02:47:39 +00:00
Kurt Zeilenga
8981a52ed3 Rebuild configure using autoconf 1.3 (with aclocal from automake 1.4). 1999-02-01 01:36:42 +00:00
Kurt Zeilenga
30d106079d Add cond/rdwr destroy routines. 1999-01-29 05:52:40 +00:00
Kurt Zeilenga
72ba4cfb71 Use -lldap_r instead of -lldap -lthread.
Likely broke things for non-posix threadings....

Update -lldap_r implementation to:
	remove attribute support
	hide thread detachment
	provide concurrency accessors
	provide initialization function
	fix gethostby{addr,name}_r codes (not coverred by HAVE_REENTRANT_FUNCTIONS)
Update servers/libraries to use ldap_pvt_thread_ calls.
Cleanup server codes (no #ifdef HAVE_PTHREAD_THIS or _THATs)!
Removed -llthread
1999-01-28 04:34:55 +00:00
Kurt Zeilenga
c32dcd6365 Fixup begin/end declaration tags
Assume portable.h has been included
Include ldap_cdefs.h at the top.
1999-01-27 21:11:55 +00:00
Kurt Zeilenga
bd6dfe333d LDBM/back-ldbm locking reworked!
back-ldbm was using a cache specific lock to protect non-reentrant
	database routines from being reenterred.  This is inadequate.
	Also, reentrant database systems calls were serialized unnecessarily.

	Non-reentrant database calls must have a big_mutex.  Implemented
	this within -lldbm itself.  library requires ldbm_initialize()
	be called before any other ldbm call to initialize the big_mutex
	and to do any other db specific initialization (ie: such as
	required for DB2).

The dbc_mutex, dbc_cv, & dbc_readers fileds of dbcache are history.
The "reentrant_database" (REENTRANT_DATABASE) define is also axed.
1999-01-26 20:55:54 +00:00
Kurt Zeilenga
321354ecff Add lber_pvt.h with prototypes of lber_pvt_log_print{,f}.
Ripple name change through -llber & -lldap.
Update -lldif to use lber_pvt_log_printf() instead of Debug.
1999-01-26 01:21:35 +00:00
Kurt Zeilenga
f988fdbec1 add ldap_cdef'ing. 1999-01-26 00:04:01 +00:00
Kurt Zeilenga
d7079a10c3 Add support for LBER_OPT_LOG_PRINT_FN option. 1999-01-25 22:55:00 +00:00
Kurt Zeilenga
a31de60768 Minor cleanup of various detections... 1999-01-24 01:33:22 +00:00
Kurt Zeilenga
4863d98084 Remove configure's wait3 test as we don't care about the rusage.
Rewrite all child waits to use wait4 (for consistency only).
1999-01-23 04:03:43 +00:00
Kurt Zeilenga
7c2bcc4e12 Add LDAP_API_FEATURE_X_OPENLDAP to imply this implementation
has OpenLDAP extensions.  (This may be defined on non-OpenLDAP
implmentations that implement features of our API).
The extensions implied by this flag are TBD.
1999-01-23 03:39:06 +00:00
Kurt Zeilenga
ddb0752b8f Move libldap/strdup.c to string.c.
libldap/string.c will hold various string.h replacements.
Removed liblutil/strdup.c
Moved ldap_pvt_strtok to string.c.
Moved prototype of ldap_pvt_strtok to <ac/string.h>.
Added #define strtok_r ldap_pvt_strtok (if strtok_r doesn't exist).
1999-01-22 04:33:29 +00:00
Kurt Zeilenga
2a7794de09 Fix minor typo in lthread.h (which was copied into ldap_pvt_thread.h). 1999-01-22 03:48:31 +00:00
Kurt Spanier
68a8798594 Definition of slapd pid and args files as slapd.conf general parameters;
introduction of pid/agrs parameters to the test-suite slapd.conf files;
creation of sub-directory test/var for storage of pid/args files during test;
update of the slapd and slapd.conf man pages.
(The change reduces dependency on ldapconfig.h, since SLAPD_PIDEXT
 and SLAPD_ARGSEXT are deleted from the code.)
1999-01-21 15:53:54 +00:00
Kurt Zeilenga
e2a15115b0 Update slap_conn to maintain client provided dn and bound dn.
Update slap_op to maintain dn and ndn (derived from conn->c_dn).
Update ldbm_back_bind to return actual bound dn (including rootdn)
	for use in slapd_conn.  Other backends use client dn.
Modify other codes to use ndn (normalized uppercase dn) most everywhere.
Aliasing, Suffixing and modrdn could use more work.
Applied suffixing to compare and modrdn.
1999-01-19 05:10:50 +00:00
Bart Hartgers
41234c2819 Fixed my own stupid mistake of not noticing the 'n' in #ifndef. strdup
should work as it was again...
1999-01-17 15:27:30 +00:00
Kurt Zeilenga
c09da45c85 Run autoconf/autoheader to generate new configure/portable.h.in 1999-01-16 00:59:49 +00:00
Bart Hartgers
b896152290 Updates for the new threading and utility stuff in libldap{_r}. 1999-01-15 14:31:12 +00:00
Kurt Zeilenga
b7beec1663 Initial version of the experimental 'back-perl'
John's still working on the 'perl-test' (the perl backend test module).
1999-01-14 06:33:09 +00:00
Kurt Zeilenga
cb31c7aa9a Update check for res_search. If not available in $LIBS, check
in -lbind then in -lresolv.
1999-01-13 01:11:28 +00:00
Kurt Zeilenga
318531a437 Use pthread_detach() to detach connection threads instead of
creating them detached.  This hopefully will reduce problems on
draft4 pthread implementations related to creating detached
threads (which is _np under draft4) on some platforms without
causing problems with other thread implementations.
1999-01-11 19:04:34 +00:00
Kurt Zeilenga
82b94e2258 Change SLAPD shutdown to do a cond wait on active threads instead
of a busy wait and allow the pthread_yield within the loop to be
removed.  This was the only pthread_yield which was necessary
when usng non-preemptive threads.  As such, the configure.in
sched_yield/pthread_yield missing error can be removed from
configure.in.  If explicit yield function is missing, just provide
a no-op replacement.
Moved declaration of various slapd globals from main.c to init.c
so they can be shared with ldbm tools.
1999-01-11 18:36:40 +00:00
Kurt Zeilenga
334768c1bb Update build environment to fix VPATH support.
make depend, make tests, and make install all work when build directory
  is not the $srcdir.
Also modified library handling such that -lpthread more likely to be last.
WARNING: new orderring requires use of LDFLAGS to set global loader options
  such as -L/usr/local/lib.  If you put this in LIBS, some libraries
  may not be found a link time.
Likely broke Kerberos/LDAPD support.  Don't have those in my testbed.
1999-01-10 02:25:41 +00:00
Kurt Zeilenga
de8c07c62c Updated SLAPD args/pid file codes to use DEFAULT_RUNDIR and DEFAULT_DIRSEP.
Removed old defines.
1999-01-07 18:16:40 +00:00
Kurt Spanier
9c6d384b9a - Make install creates $(RUNDIR)/var for pid and args files of slapd.
- slapd's pid/args file names are based on the servers binary file names,
  providing for multiple servers beeing run on one host.
- slapd supports the -l command line parameter for selection of a
  syslog LOCAL user (-lLOCAL0 .. -lLOCAL7)
- db_appinit() is called during first ldbm_open() in DB 2.x to initialize
  DB debugging features (good to find bugs in the DB code :-)
- a patch for a non-initialized variable in DB's 2.x db_open is provided.
1999-01-05 15:40:58 +00:00
Kurt Zeilenga
114a0cd339 Update ctime_r() argument macro to cache results and to produce
one preprocessor macro instead of two.  Ran aclocal, autoconf,
autoheader to update derived files.  Modify util-int.c to use
CTIME_R_NARGS define and fallback to ctime() if not set.
Made LDAP_API_FEATURE_X_OPENLDAP_REENTRANT dependent upon result.
1999-01-02 23:40:31 +00:00
Bart Hartgers
f9d26dacd4 Teached autoconf to figure out how may arguments ctime_r expects.
Updated util-int.c to use this information.
1999-01-02 00:56:45 +00:00