Kurt Zeilenga [Wed, 20 Jan 1999 20:21:38 +0000 (20:21 +0000)]
Update ldap_first_attribute/ldap_next_attribute to handle
BerElement argument per latest IETF ldapext draft c api spec.
That is, caller is solely responsible for freeing the BerElement
allocated and returned by ldap_first_attribute.
Update man pages accordingly.
Update applications accordingly.
Kurt Zeilenga [Tue, 19 Jan 1999 18:13:30 +0000 (18:13 +0000)]
Update support for dn vs ndn. Build new dn from e->e_dn not frontend
provided dn (which is normalized and uppercased). This preserved
the trailing portion of the dn.
Kurt Zeilenga [Tue, 19 Jan 1999 05:10:50 +0000 (05:10 +0000)]
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.
Kurt Zeilenga [Mon, 18 Jan 1999 17:41:12 +0000 (17:41 +0000)]
Protect return of the locked entry.
Note: we probably can replace the dn2entry_r with dn2id as only the id
is needed unless we're holding the lock for filtercandidates or something
Kurt Zeilenga [Sun, 17 Jan 1999 18:06:52 +0000 (18:06 +0000)]
Reworded paragraph 7 to make it apply to a library of routines
instead of a 'language'.
Added paragraph 8 to clarify software that linked with OpenLDAP
does NOT fall under our copyright (ie: the copyright is non-viral)
and that resulting executables may be used and redistributed without
restriction (including sold for profit).
Bart Hartgers [Thu, 14 Jan 1999 15:19:29 +0000 (15:19 +0000)]
Improved ldap_int_strtok. If strtok_r does not exists, it will be worked
simulated with strspn and strpbrk. If strspn or strpbrk aren't there, they
will be supplied.
In addition, the memory-handling of the ldap_int_gethostby's is better now.
Kurt Zeilenga [Thu, 14 Jan 1999 01:31:43 +0000 (01:31 +0000)]
Revamp build system yet again to move all external libraries to
end of link. Basic order is:
$LDFLAGS internal-libs external-libs $LIBS $LTHREAD_LIBS
LTHREAD_LIBS is last as -lpthread (or equiv) must be last on many systems.
LIBS is next to last as some user might have put -lpthread (or equiv)
in $LIBS.
Kurt Zeilenga [Wed, 13 Jan 1999 01:17:22 +0000 (01:17 +0000)]
Add normalized dn to Entry structure as field e_ndn. Entry
creation codes to provide this field. Update cache_entrydn_cmp
to strcasecmp() the e_ndn instead of e_dn. Note: strcasecmp()
is still used as e_ndn isn't in uppercase. Maybe it should
be. Did not update other codes to use e_ndn. Hence, there
are lots of dn_normalize() calls that could be eliminated.
(The case determination of e_ndn should be made first).
Kurt Zeilenga [Mon, 11 Jan 1999 19:04:34 +0000 (19:04 +0000)]
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.
Kurt Zeilenga [Mon, 11 Jan 1999 18:36:40 +0000 (18:36 +0000)]
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.
Kurt Zeilenga [Sun, 10 Jan 1999 02:25:41 +0000 (02:25 +0000)]
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.
Kurt Zeilenga [Sun, 10 Jan 1999 02:16:48 +0000 (02:16 +0000)]
rename 'struct op' to 'struct slap_op'
rename 'struct conn' to 'struct slap_conn'
rename op_function to slap_op_func for functions add/delete/free
This change is need to avoid clashing with perl internals.
Kurt Zeilenga [Thu, 7 Jan 1999 02:51:08 +0000 (02:51 +0000)]
Modify Add/Delete/Modrdn operations to require write perms on
parent's "children" attribute. Write lock parent to prevent
multiple clients making conflicting operations concurrently.
If parent doesn't exist (ie: is backend root), acquire a writer
lock (a simple mutex) on the "root."
Use -DSLAPD_CHILD_MODIFICATION_WITH_ENTRY_ACL to use the child's
"entry" acl for modrdn/delete operations.
Kurt Spanier [Tue, 5 Jan 1999 15:40:58 +0000 (15:40 +0000)]
- 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.
Kurt Zeilenga [Sat, 2 Jan 1999 23:40:31 +0000 (23:40 +0000)]
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.
Kurt Zeilenga [Wed, 30 Dec 1998 03:35:23 +0000 (03:35 +0000)]
Preliminary Fixes for ITS#24, ITS#26, and ldbm_back_add race condition.
Resolved deadlock by passing target entry to be_group and using
this if dn same as bdn. It might actually be safer to check
entry ids instead of dns.
Resolved bogus add to cache after failed acl check by deferring
cache add until after parent/acl checks have successful been
completed.
Eliminated race condition caused by concurrent adds
of same dn by adding 'li_add_mutex' around the critical section
of code (most of ldbm_back_add).
This code is preliminary and still needs significant testing.
Kurt Zeilenga [Wed, 30 Dec 1998 00:06:27 +0000 (00:06 +0000)]
Cleanup thread handling to resolve non-exiting daemons on FreeBSD.
Seems that calling pthread_exit() in the main (and only active)
thread does not cause the whole process to exit. Very odd.
Anyways, as we want to whole process to exit, we should just exit
after joining with our other threads.
I've also removed dead code for detaching threads we join with.