Commit Graph

77 Commits

Author SHA1 Message Date
Kurt Zeilenga
68d561a97b Add limited LDAP_INVALID_DN_SYNTAX support. dn_normalize{,_case}() now returns
NULL does not meet basic syntax rules.
1999-07-22 17:14:42 +00:00
Kurt Zeilenga
933908f72f ACL CHANGES:
by <who> <access> changed to by <who>+ <access> (joined with AND)
  added peername=<regex> sockname=<regex> url=<regex>
  removed addr=<regex> (use peername instead).
replace dn_upcase with str2upper and str2lower.  Use where needed.
1999-07-21 20:54:23 +00:00
Julio Sánchez Fernández
f0f29cd82e Backout the input exhaustion change, it loops. Still looking for
the right way.
1999-07-21 13:22:35 +00:00
Julio Sánchez Fernández
76227acb1f Move the input data exhaustion loop to connection.c from daemon.c
Let transport (TLS or somesuch) force reading or writing on
sockets even if the higher layers think otherwise.
1999-07-20 18:02:44 +00:00
Kurt Zeilenga
170836751a Namespace changes
added slap_ and ldbm_ to many structures
  added typedefs to many structures
  used typedefs
New main.c argument parsing with ldap url support (replacing -a address).
New sockaddr_in handling and support for multiple listeners.
1999-07-19 19:40:33 +00:00
Kurt Zeilenga
059ee8c86d (re)introduce o_connid such that STATS doesn't need c_mutex (which it
didn't bother to acquire)...
1999-07-16 22:24:32 +00:00
Julio Sánchez Fernández
ea8669c37d Clear c_needs_tls_acccept on ldap_pvt_tls_accept errors 1999-07-16 18:48:13 +00:00
Julio Sánchez Fernández
68b508d2f0 Move calls to ldap_pvt_tls_accept to connection_read instead of
connection_init so that we get into the select() logic.
Make use of new flags in the connection.
BTW, and before I forget, it sort of works.  I have connected with
a Netscape client using a secure connection and did a failed
search (my test database is empty), but the trace looked correct.
Make sure you have your CA certificate in your Netscape preinstalled.
Otherwise, the connection fails with error 0xFFFFFFFF that is rather
uninformative.
1999-07-16 15:52:17 +00:00
Julio Sánchez Fernández
6d75d0f8fb connection_init now takes one more argument that indicates whether to
use TLS right away or not on that connection.
1999-07-14 19:44:18 +00:00
Kurt Zeilenga
e9c2895472 Add support for unsolicited notifications. 1999-07-07 18:51:39 +00:00
Kurt Zeilenga
daf40a51c1 Abandon all operations upon receiving a BindRequest. 1999-07-02 21:42:53 +00:00
Kurt Zeilenga
b7bbc7504d More bind changes to support SASL/DIGEST.
Added configuration support for "digest-realm <realm>" configure directive.
Added connection state and bind_in_progress fields to cn=monitor connection
attribute.
1999-07-02 19:48:07 +00:00
Kurt Zeilenga
6f8fad20f2 Add conn/op bind_in_progress flags such that operations can detect
if multiple step SASL binds are in progress.
1999-07-02 00:04:47 +00:00
Kurt Zeilenga
f9db1ea889 Rework BER decoding with lieu of LDAPv3 controls (coming soon).
Add place holder for handling LDAPv3 extended operations (coming soon).
1999-06-30 22:43:27 +00:00
Kurt Zeilenga
14820afdd9 Reimplement connection counters. Format of "connection" attribute
changed significantly.
1999-06-30 02:50:40 +00:00
Kurt Zeilenga
1ee85df297 Add framework for sasl and controls. 1999-06-29 03:17:22 +00:00
Kurt Zeilenga
2660d0b42f Remove old U-Mich v3.0 and OLD_LDAP_* crud.
Leave only LDAPv2+ and LDAPv3.
1999-06-29 00:03:34 +00:00
Bastiaan Bakker
e2b5b21155 Added connection initialisation and destruction notification. Now backends can register functions in backend_info.bi_connection_init and backend_info.bi_connection_destroy that will be called when a connection is initialized or destroyed. 1999-06-23 12:31:35 +00:00
Kurt Zeilenga
2d720643be experimental connections_timeout_idle() implementation. 1999-06-19 03:20:01 +00:00
Kurt Zeilenga
669b8f4047 ber_int_t, ber_tag_t, ber_socket_t, ber_len_t
added lber_types.h.nt, lber_types.h.in
removal of NULLxxx internal macros (in favor of NULL).
ch_free added to slapd,slurpd/ch_malloc.c
#define free ch_free (should be removed after s/free/ch_free/g) in proto-slap.h
ch_malloc and friends use ber_memalloc and friends
1999-06-18 23:53:05 +00:00
Kurt Zeilenga
7e4b3bc2e7 initial commit of idletimeout code... everything but the actual timeout. 1999-06-18 22:54:19 +00:00
Kurt Zeilenga
36cb034611 Add test for resched state change in connection_get 1999-06-17 00:48:51 +00:00
Gary Williams
2ffc4b19ea check addr for NULL before copying 1999-06-16 19:15:03 +00:00
Kurt Zeilenga
61eaffeed2 connection_get forgot to unlock c_mutex in not used case! 1999-06-14 20:33:21 +00:00
Kurt Zeilenga
18e5e729ac Resched changes struct state without lock to avoid deadlock.
Hence connection_get must recheck struct state after obtaining
c_mutex to detect close.
1999-06-12 00:29:41 +00:00
Kurt Zeilenga
35e91be482 connection_get:
Connection could be closed before acquiring connections_mutex.
	if c->c_struct_state == SLAP_C_UNUSED, return NULL.
1999-06-12 00:03:39 +00:00
Kurt Zeilenga
0dda34c9e4 Add additional assert in connection get for race debugging. 1999-06-11 23:19:31 +00:00
Kurt Zeilenga
3cfd58eed8 EXPERIMENTAL: move slapd_remove to connections_read/_write as they
acquire c_mutex.
1999-06-11 19:10:45 +00:00
Kurt Zeilenga
35eff96dad Add Debug to help sort out race condition. 1999-06-10 22:21:51 +00:00
Kurt Zeilenga
9a0caa6258 Initialize connection pointer to NULL else won't be able to
detect connection table full properly.
1999-06-04 22:57:19 +00:00
Kurt Zeilenga
95889bc7d8 Fix typo in previous commit. 1999-06-04 22:15:35 +00:00
Kurt Zeilenga
d3181b56b8 Add diagnostics. 1999-06-04 21:43:06 +00:00
Kurt Zeilenga
2d1cf97a56 move connection_close call from connection_input to connection_resched
to avoid accessing c_conn_state after close.
1999-05-27 06:22:59 +00:00
Kurt Zeilenga
5936f97edc Make connection_first/next/done reentrant. 1999-05-27 05:52:38 +00:00
Kurt Zeilenga
f9219d3368 remove redundant memset 0 of connection entry after calloc. 1999-05-27 02:44:13 +00:00
Kurt Zeilenga
1ee8cc51a8 Add comment concerning connections mutex. Need to analysis
locking requires and possibly restructure locking.
1999-05-27 02:29:18 +00:00
Kurt Zeilenga
77cc20be52 Lock (connections_mutex) should be acquired by caller. 1999-05-27 02:16:39 +00:00
Kurt Zeilenga
22d98c85c3 ldap.h:
added comments
 removed LDAP_MAX_ATTR_LEN
 removed LDAP_COMPAT* from <ldap.h> but not code.
 move LDAP_DEFAULT_REFHOPCOUNT to ldap-int.h
 added experimental options macros
 added LDAP_CONTROL_REFERRALS macros
libldap:
 Replace ld_attrbuffer with per use allocated attributed.
 ldap_first/next_attribute attributes now must be freed (as per draft).
 unifdef -DLDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS
1999-05-22 06:11:48 +00:00
Kurt Zeilenga
60a068ae89 don't free connections[i] 1999-05-21 03:52:08 +00:00
Kurt Zeilenga
d8cb38c2ef method tag should be unsigned long.
connection assert should use s, not i.
1999-05-19 07:15:16 +00:00
Kurt Zeilenga
dc07e765f2 Vienna Bulk Commit
This commit includes many changes.  All changes compile under NT but
have not been tested under UNIX.

A Summary of changes (likely incomplete):

NT changes:
	Removed lint.
	Clean up configuration support for "Debug", "Release", "SDebug",
		and "SRelease" configurations.
	Share output directories for clients, libraries,
		and slapd.  (maybe they should be combined further
		and moved to build/{,S}{Debug,Release}).
	Enable threading when _MT is defined.
	Enable debuging when _DEBUG is defined.
	Disable setting of NDEBUG under Release/SRelease.  Asserts
		are disabled in <ac/assert.h> when LDAP_DEBUG is not
		defined.
	Added 'build/main.dsp' Master project.
	Removed non-slapd projects from slapd.dsp (see main.dsp).
	Removed replaced many uses of _WIN32 macro with feature based
		macros.

ldap_cdefs.h changes
	#define LDAP_CONST const
		(see below)
	#define LDAP_F(type) LDAP_F_PRE type LDAP_F_POST
		To allow specifiers to be added before and after
		the type declaration.  (For DLL handling)

LBER/LDAP changes
	Namespace changes:
		s/lber_/ber_/ for here and there.
		s/NAME_ERROR/LDAP_NAME_ERROR/g
	Deleted NULLMSG and other NULL* macros for namespace reasons.
	"const" libraries.  Installed headers (ie: lber.h, ldap.h)
		use LDAP_CONST macro.  Normally set to 'const' when
		__STDC__.  Can be set externally to enable/disable
		'constification' of external interface.  Internal
		interface always uses 'const'.  Did not fix warnings
		in -lldif (in lieu of new LDIF parser).

	Added _ext API implementations (excepting search and bind).
		Need to implement ldap_int_get_controls() for reponses
		with controls.

	Added numberous assert() checks.

LDAP_R
	_MT defines HAVE_NT_THREADS
	Added numberous assert() checks.
	Changed ldap_pthread_t back to unsigned long.  Used cast
	to HANDLE in _join().

LDBM
	Replaced _WIN32 with HAVE_SYSLOG

ud
	Added version string if MKVERSION is not defined.  (MKVERSION
		needs to be set under UNIX).

slapd
	Made connection sockbuf field a pointer to a sockbuf.  This
		removed slap.h dependency on lber-int.h.  lber-int.h now only
		included by those files needing to mess with the sockbuf.
	Used ber_* functions/macros to access sockbuf internals whenever
		possible.
	Added version string if MKVERSION is not defined.  (MKVERSION
		needs to be set under UNIX).
	Removed FD_SET unsigned lint

slapd/tools
	Used EXEEXT to added ".exe" to routines.  Need to define EXEEXT
		under UNIX.

ldappasswd
	Added ldappasswd.dsp.  Ported to NT.  Used getpid() to seed rand().

nt_debug
	Minor cleanup.  Added "portable.h" include and used <ac/*.h> where
	appropriate.  Added const to char* format argument.
1999-05-19 01:12:33 +00:00
Gary Williams
e72b5e5c61 use mutex to protect connection in connection_destroy until task is complete 1999-05-11 13:42:57 +00:00
Gary Williams
628f679f0b move socket.h before errno.h so EWOULDBLOCK is defined on NT 1999-05-06 14:46:48 +00:00
Kurt Zeilenga
b06c4a5576 Winsock changes:
Centralize #define EWOULDBLOCK WSAEWOULDBLOCK to ac/errno.h
Move WSAStartup to slapd_daemon(), add WSACleanup() to match.
1999-04-28 21:21:14 +00:00
Kurt Zeilenga
5dbb2e760f Don't destroy uninitialized connections... 1999-04-28 20:33:25 +00:00
Kurt Zeilenga
c9a2802669 Don't have connection_state_closing() lock connection. Already locked
by callers.
1999-04-26 23:56:02 +00:00
Kurt Zeilenga
fa6fec3c9c Implement "quick" shutdown (similiar in behavior to shutdown
prior to connection management changes).  No "normal" (wait
for pending operations to complete) shutdown mode (yet).
Changes:
 Add connections_destroy() implementation to connections.c.
 Move connections_init() call to slap_daemon().
 Add connections_destroy() call to slap_daemon().
 Add connections_shutdown() implementation to connections.c.
	calls connection_closing()/connection_close() for each
	"in use" connection.
 Add connections_shutdown() call to slap_daemon_task().
1999-04-23 22:50:28 +00:00
Kurt Zeilenga
866f82409c Should clear the write flag upon closing. 1999-04-23 20:47:32 +00:00
Kurt Zeilenga
8082760c0c Update state to closing early. 1999-04-23 20:34:09 +00:00
Kurt Zeilenga
3e05f28963 Modify connection_closing() to abandon operations and wake blocked writer.
Modify send_result to return if connection state is closing.
Modify do_abandon() to remove abandon'ed operation if pending.
1999-04-23 20:22:18 +00:00