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)
-: run this script through /bin/sh
+#! /bin/sh
RP500=ETCDIR/rp500
fatal(s)
char *s;
{
- void exit();
-
if (errno != 0)
perror(s);
#ifdef KERBEROS
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)
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
#else /* NEEDPROTOS */
#if !defined(MACOS) && !defined(DOS) && !defined(_WIN32) && !defined(WINSOCK)
+#include <sys/types.h>
+#include <time.h>
#include <sys/time.h>
#endif
#if defined(WINSOCK)
#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
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 */
#
"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"
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
#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 */
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"; \
+
+/* Revision history
+ *
+ * 5-Jun-96 hodges
+ * Added locking of new_conn_mutex when traversing the c[] array.
+ */
+
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
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 );
}
}
Debug( LDAP_DEBUG_CONNS, "\n", 0, 0, 0 );
+ pthread_mutex_unlock( &new_conn_mutex );
zero.tv_sec = 0;
zero.tv_usec = 0;
* 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 <stdio.h>
#include <string.h>
+#include <time.h>
#include <sys/types.h>
#include <sys/socket.h>
#include "slap.h"
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 )
{
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++;
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,
attr_merge( e, "connection", vals );
}
}
+ pthread_mutex_unlock( &new_conn_mutex );
+
sprintf( buf, "%d", nconns );
val.bv_val = buf;
val.bv_len = strlen( buf );
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 );