The world compiles and links....

Need to sort out remaining ifnames and run testsuite.
This commit is contained in:
Kurt Zeilenga 1998-10-22 03:03:07 +00:00
parent 71b34373b7
commit 5b62482fac
52 changed files with 461 additions and 543 deletions

View file

@ -35,9 +35,6 @@
/* define if you have Sun LWP (SunOS style) */
#undef HAVE_LWP
/* define if you have Sun LWP (Solaris style) */
#undef HAVE_LWP_THR
/* define if you have -lncurses */
#undef HAVE_NCURSES
@ -62,6 +59,9 @@
/* define if you have -ltermcap */
#undef HAVE_TERMCAP
/* define if you have Sun LWP (Solaris style) */
#undef HAVE_THR
/* define this for connectionless LDAP support */
#undef LDAP_CONNECTIONLESS

View file

@ -14,11 +14,11 @@
#include <stdio.h>
#include <pwd.h>
#include <time.h>
#include <ctype.h>
#include <ac/string.h>
#include <ac/ctype.h>
#include <ac/krb.h>
#include <ac/string.h>
#include <ac/time.h>
#include <lber.h>
#include <ldap.h>

View file

@ -14,8 +14,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <ac/signal.h>
#include <ac/string.h>
#include <ac/time.h>
#include <ac/wait.h>
@ -172,16 +172,16 @@ static load_editor()
}
if ((pid = fork()) == 0) {
/* child - edit the Directory entry */
(void) signal(SIGINT, SIG_IGN);
(void) SIGNAL(SIGINT, SIG_IGN);
(void) execlp(editor, editor, entry_temp_file, NULL);
/*NOTREACHED*/
(void) fatal(editor);
}
else if (pid > 0) {
/* parent - wait until the child proc is done editing */
handler = signal(SIGINT, SIG_IGN);
handler = SIGNAL(SIGINT, SIG_IGN);
(void) wait(&status);
(void) signal(SIGINT, handler);
(void) SIGNAL(SIGINT, handler);
}
else {
fatal("fork");

View file

@ -13,8 +13,8 @@
#include "portable.h"
#include <stdio.h>
#include <ctype.h>
#include <ac/ctype.h>
#include <ac/string.h>
#include <ac/time.h>

View file

@ -14,8 +14,9 @@
#include "portable.h"
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <ac/string.h>
#include <ac/time.h>
#include <lber.h>
#include <ldap.h>

View file

@ -13,8 +13,8 @@
#include "portable.h"
#include <stdio.h>
#include <ctype.h>
#include <ac/ctype.h>
#include <ac/string.h>
#include <ac/time.h>

View file

@ -20,10 +20,10 @@
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <setjmp.h>
#include <pwd.h>
#include <ac/signal.h>
#include <ac/string.h>
#include <ac/termios.h>
#include <ac/time.h>
@ -657,7 +657,7 @@ initialize_client()
lpp = DEFAULT_TTY_HEIGHT;
col_size = DEFAULT_TTY_WIDTH;
(void) signal(SIGINT, attn);
(void) SIGNAL (SIGINT, attn);
#ifndef NO_TERMCAP
{
@ -682,7 +682,7 @@ initialize_client()
col_size = DEFAULT_TTY_WIDTH;
}
}
(void) signal(SIGWINCH, chwinsz);
(void) SIGNAL (SIGWINCH, chwinsz);
}
#endif
@ -694,7 +694,7 @@ RETSIGTYPE attn()
fflush(stdout);
printf("\n\n INTERRUPTED!\n");
(void) signal(SIGINT, attn);
(void) SIGNAL (SIGINT, attn);
longjmp(env, 1);
}
@ -704,7 +704,7 @@ RETSIGTYPE chwinsz()
{
struct winsize win;
(void) signal(SIGWINCH, SIG_IGN);
(void) SIGNAL (SIGWINCH, SIG_IGN);
if (ioctl(fileno(stdout), TIOCGWINSZ, &win) != -1) {
if (win.ws_row != 0)
lpp = win.ws_row;
@ -712,6 +712,6 @@ RETSIGTYPE chwinsz()
col_size = win.ws_col;
}
(void) signal(SIGWINCH, chwinsz);
(void) SIGNAL (SIGWINCH, chwinsz);
}
#endif

View file

@ -13,13 +13,10 @@
#include "portable.h"
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
#ifndef __STDC__
#include <memory.h>
#endif
#include <sys/types.h>
#include <ac/ctype.h>
#include <ac/string.h>
#include <ac/time.h>
#include <lber.h>
#include <ldap.h>

View file

@ -13,8 +13,8 @@
#include "portable.h"
#include <stdio.h>
#include <ctype.h>
#include <ac/ctype.h>
#include <ac/string.h>
#include <ac/time.h>

View file

@ -1,6 +1,6 @@
#include "portable.h"
#if defined(KERBEROS) && !defined(openbsd)
#if defined(HAVE_KERBEROS) && !defined(openbsd)
/*
* $Source: /repo/OpenLDAP/pkg/ldap/clients/ud/string_to_key.c,v $
* $Author: kurt $
@ -26,35 +26,19 @@
* spm 8/85 MIT project athena
*/
#ifdef KERBEROS_V
#include <kerberosIV/mit-copyright.h>
#include <kerberosIV/des.h>
#else
#include <mit-copyright.h>
#include <des.h>
#endif /* KERBEROS_V */
#include <stdio.h>
/* #include "des_internal.h" */
#if 1
#ifdef KERBEROS_V
#include <kerberosIV/krb.h>
#else
#include <krb.h>
#endif /* KERBEROS_V */
#endif /* 1 */
#include <ac/krb.h>
extern int des_debug;
extern int des_debug_print();
extern void des_fixup_key_parity();
#ifndef AFSKERBEROS
#ifndef HAVE_AFS_KERBEROS
#define WORLDPEACEINOURTIME
#endif
#if defined(WORLDPEACEINOURTIME) /* Use original, not ifs version */
#ifndef KERBEROS_V
#ifndef HAVE_KERBEROS_V
/*
* convert an arbitrary length string to a DES key
*/
@ -141,7 +125,7 @@ des_string_to_key(str,key)
*((unsigned long *) key+1));
}
#endif /* KERBEROS_V */
#endif /* HAVE_KERBEROS_V */
#else /* Use ifs version */
#if 0

View file

@ -14,13 +14,13 @@
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <signal.h>
#include <ac/ctype.h>
#include <ac/errno.h>
#include <ac/signal.h>
#include <ac/string.h>
#include <ac/termios.h>
#include <ac/time.h>
#include <ac/errno.h>
#include <ac/unistd.h>
#include <lber.h>
@ -80,7 +80,7 @@ char *prompt;
fi = stdin;
else
setbuf(fi, (char *)NULL);
sig = signal(SIGINT, SIG_IGN);
sig = SIGNAL (SIGINT, SIG_IGN);
if (fi != stdin) {
if (GETATTR(fileno(fi), &ttyb) < 0)
perror("GETATTR");
@ -134,7 +134,7 @@ char *prompt;
if (SETATTR(fileno(fi), &ttyb) < 0)
perror("SETATTR");
}
(void) signal(SIGINT, sig);
(void) SIGNAL (SIGINT, sig);
if (fi != stdin)
(void) fclose(fi);
else

359
configure vendored

File diff suppressed because it is too large Load diff

View file

@ -459,8 +459,7 @@ if test $ol_with_threads = auto -o $ol_with_threads = lwp ; then
AC_CHECK_LIB(thread, thr_create, [have_lwp=yes], [have_lwp=no])
if test $have_lwp = yes ; then
AC_DEFINE(HAVE_LWP)
AC_DEFINE(HAVE_LWP_THR)
AC_DEFINE(HAVE_THR)
LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
if test $ol_with_preemptive = auto ; then

View file

@ -78,7 +78,7 @@ typedef struct condition pthread_cond_t;
LDAP_END_DECL
#elif defined( HAVE_LWP_THR )
#elif defined( HAVE_THR )
/**************************************
* *
* thread definitions for Solaris LWP *
@ -178,6 +178,10 @@ LDAP_END_DECL
* *
***********************************/
#ifndef NO_THREADS
#define NO_THREADS 1
#endif
LDAP_BEGIN_DECL
typedef void *(*VFP)();

View file

@ -134,9 +134,6 @@ is provided ``as is'' without express or implied warranty.
/* define if you have Sun LWP (SunOS style) */
#undef HAVE_LWP
/* define if you have Sun LWP (Solaris style) */
#undef HAVE_LWP_THR
/* define if you have -lncurses */
#undef HAVE_NCURSES
@ -161,6 +158,9 @@ is provided ``as is'' without express or implied warranty.
/* define if you have -ltermcap */
#undef HAVE_TERMCAP
/* define if you have Sun LWP (Solaris style) */
#undef HAVE_THR
/* define this for connectionless LDAP support */
#undef LDAP_CONNECTIONLESS
@ -308,6 +308,9 @@ is provided ``as is'' without express or implied warranty.
/* Define if you have the sysconf function. */
#undef HAVE_SYSCONF
/* Define if you have the tempnam function. */
#undef HAVE_TEMPNAM
/* Define if you have the waitpid function. */
#undef HAVE_WAITPID

View file

@ -45,7 +45,7 @@ ldap_bind( LDAP *ld, char *dn, char *passwd, int authmethod )
* name DistinguishedName, -- who
* authentication CHOICE {
* simple [0] OCTET STRING -- passwd
#ifdef KERBEROS
#ifdef HAVE_KERBEROS
* krbv42ldap [1] OCTET STRING
* krbv42dsa [2] OCTET STRING
#endif
@ -60,7 +60,7 @@ ldap_bind( LDAP *ld, char *dn, char *passwd, int authmethod )
case LDAP_AUTH_SIMPLE:
return( ldap_simple_bind( ld, dn, passwd ) );
#ifdef KERBEROS
#ifdef HAVE_KERBEROS
case LDAP_AUTH_KRBV41:
return( ldap_kerberos_bind1( ld, dn ) );
@ -97,7 +97,7 @@ ldap_bind_s( LDAP *ld, char *dn, char *passwd, int authmethod )
case LDAP_AUTH_SIMPLE:
return( ldap_simple_bind_s( ld, dn, passwd ) );
#ifdef KERBEROS
#ifdef HAVE_KERBEROS
case LDAP_AUTH_KRBV4:
return( ldap_kerberos_bind_s( ld, dn ) );

View file

@ -7,7 +7,6 @@
#include "portable.h"
#ifndef NO_CACHE
#ifndef lint
static char copyright[] = "@(#) Copyright (c) 1993 The Regents of the University of Michigan.\nAll rights reserved.\n";
@ -24,6 +23,8 @@ static char copyright[] = "@(#) Copyright (c) 1993 The Regents of the University
#include "ldap.h"
#include "ldap-int.h"
#ifndef LDAP_NOCACHE
static int cache_hash LDAP_P(( BerElement *ber ));
static LDAPMessage *msg_dup LDAP_P(( LDAPMessage *msg ));
static int request_cmp LDAP_P(( BerElement *req1, BerElement *req2 ));
@ -32,9 +33,12 @@ static long msg_size LDAP_P(( LDAPMessage *msg ));
static void check_cache_memused LDAP_P(( LDAPCache *lc ));
static void uncache_entry_or_req LDAP_P(( LDAP *ld, char *dn, int msgid ));
#endif
int
ldap_enable_cache( LDAP *ld, long timeout, long maxmem )
{
#ifndef LDAP_NOCACHE
if ( ld->ld_cache == NULLLDCACHE ) {
if (( ld->ld_cache = (LDAPCache *)malloc( sizeof( LDAPCache )))
== NULLLDCACHE ) {
@ -50,15 +54,20 @@ ldap_enable_cache( LDAP *ld, long timeout, long maxmem )
check_cache_memused( ld->ld_cache );
ld->ld_cache->lc_enabled = 1;
return( 0 );
#else
return( -1 );
#endif
}
void
ldap_disable_cache( LDAP *ld )
{
#ifndef LDAP_NOCACHE
if ( ld->ld_cache != NULLLDCACHE ) {
ld->ld_cache->lc_enabled = 0;
}
#endif
}
@ -66,26 +75,31 @@ ldap_disable_cache( LDAP *ld )
void
ldap_set_cache_options( LDAP *ld, unsigned long opts )
{
#ifndef LDAP_NOCACHE
if ( ld->ld_cache != NULLLDCACHE ) {
ld->ld_cache->lc_options = opts;
}
#endif
}
void
ldap_destroy_cache( LDAP *ld )
{
#ifndef LDAP_NOCACHE
if ( ld->ld_cache != NULLLDCACHE ) {
ldap_flush_cache( ld );
free( (char *)ld->ld_cache );
ld->ld_cache = NULLLDCACHE;
}
#endif
}
void
ldap_flush_cache( LDAP *ld )
{
#ifndef LDAP_NOCACHE
int i;
LDAPMessage *m, *next;
@ -110,29 +124,36 @@ ldap_flush_cache( LDAP *ld )
}
ld->ld_cache->lc_memused = sizeof( LDAPCache );
}
#endif
}
void
ldap_uncache_request( LDAP *ld, int msgid )
{
#ifndef LDAP_NOCACHE
Debug( LDAP_DEBUG_TRACE, "ldap_uncache_request %d ld_cache %lx\n",
msgid, (long) ld->ld_cache, 0 );
uncache_entry_or_req( ld, NULL, msgid );
#endif
}
void
ldap_uncache_entry( LDAP *ld, char *dn )
{
#ifndef LDAP_NOCACHE
Debug( LDAP_DEBUG_TRACE, "ldap_uncache_entry %s ld_cache %lx\n",
dn, (long) ld->ld_cache, 0 );
uncache_entry_or_req( ld, dn, 0 );
#endif
}
#ifndef LDAP_NOCACHE
static void
uncache_entry_or_req( LDAP *ld,
char *dn, /* if non-NULL, uncache entry */
@ -189,10 +210,12 @@ uncache_entry_or_req( LDAP *ld,
}
}
#endif
void
ldap_add_request_to_cache( LDAP *ld, unsigned long msgtype, BerElement *request )
{
#ifndef LDAP_NOCACHE
LDAPMessage *new;
long len;
@ -229,12 +252,14 @@ ldap_add_request_to_cache( LDAP *ld, unsigned long msgtype, BerElement *request
} else {
ld->ld_errno = LDAP_NO_MEMORY;
}
#endif
}
void
ldap_add_result_to_cache( LDAP *ld, LDAPMessage *result )
{
#ifndef LDAP_NOCACHE
LDAPMessage *m, **mp, *req, *new, *prev;
int err, keep;
@ -335,6 +360,7 @@ ldap_add_result_to_cache( LDAP *ld, LDAPMessage *result )
Debug( LDAP_DEBUG_TRACE, "artc: msgid not in request list\n",
0, 0, 0 );
}
#endif
}
@ -348,6 +374,7 @@ ldap_add_result_to_cache( LDAP *ld, LDAPMessage *result )
int
ldap_check_cache( LDAP *ld, unsigned long msgtype, BerElement *request )
{
#ifndef LDAP_NOCACHE
LDAPMessage *m, *new, *prev, *next;
BerElement reqber;
int first, hash;
@ -421,8 +448,12 @@ ldap_check_cache( LDAP *ld, unsigned long msgtype, BerElement *request )
Debug( LDAP_DEBUG_TRACE, "cc: result returned from cache\n", 0, 0, 0 );
return( 0 );
#else
return( -1 );
#endif
}
#ifndef LDAP_NOCACHE
static int
cache_hash( BerElement *ber )

View file

@ -228,7 +228,7 @@ cldap_search_s( LDAP *ld, char *base, int scope, char *filter, char **attrs,
attrsonly )) == -1 ) {
return( ld->ld_errno );
}
#ifndef NO_CACHE
#ifndef LDAP_NOCACHE
if ( ld->ld_cache != NULL && ld->ld_responses != NULL ) {
Debug( LDAP_DEBUG_TRACE, "cldap_search_s res from cache\n",
0, 0, 0 );
@ -236,7 +236,7 @@ cldap_search_s( LDAP *ld, char *base, int scope, char *filter, char **attrs,
ld->ld_responses = ld->ld_responses->lm_next;
return( ldap_result2error( ld, *res, 0 ));
}
#endif /* NO_CACHE */
#endif /* LDAP_NOCACHE */
ret = cldap_result( ld, msgid, res, &cri, base );
} while (ret == -1);
@ -492,11 +492,11 @@ cldap_parsemsg( LDAP *ld, int msgid, BerElement *ber,
}
#endif /* LDAP_DEBUG */
#ifndef NO_CACHE
#ifndef LDAP_NOCACHE
if ( ld->ld_cache != NULL ) {
ldap_add_result_to_cache( ld, ldm );
}
#endif /* NO_CACHE */
#endif /* LDAP_NOCACHE */
if ( chain == NULL ) {
chain = ldm;

View file

@ -59,7 +59,7 @@ ldap_compare( LDAP *ld, char *dn, char *attr, char *value )
return( -1 );
}
#ifndef NO_CACHE
#ifndef LDAP_NOCACHE
if ( ld->ld_cache != NULL ) {
if ( ldap_check_cache( ld, LDAP_REQ_COMPARE, ber ) == 0 ) {
ber_free( ber, 1 );
@ -68,7 +68,7 @@ ldap_compare( LDAP *ld, char *dn, char *attr, char *value )
}
ldap_add_request_to_cache( ld, LDAP_REQ_COMPARE, ber );
}
#endif /* NO_CACHE */
#endif /* LDAP_NOCACHE */
/* send the message */
return ( ldap_send_initial_request( ld, LDAP_REQ_COMPARE, dn, ber ));

View file

@ -245,19 +245,3 @@ ldap_is_dns_dn( char *dn )
strchr( dn, ',' ) == NULL );
}
#if defined( ultrix ) || defined( NeXT )
char *strdup( char *s )
{
char *p;
if ( (p = (char *) malloc( strlen( s ) + 1 )) == NULL )
return( NULL );
strcpy( p, s );
return( p );
}
#endif /* ultrix */

View file

@ -11,7 +11,7 @@
static char copyright[] = "@(#) Copyright (c) 1993 Regents of the University of Michigan.\nAll rights reserved.\n";
#endif
#ifdef KERBEROS
#ifdef HAVE_KERBEROS
#include <stdio.h>
#include <stdlib.h>
@ -103,11 +103,11 @@ ldap_kerberos_bind1( LDAP *ld, char *dn )
free( cred );
#ifndef NO_CACHE
#ifndef LDAP_NOCACHE
if ( ld->ld_cache != NULL ) {
ldap_flush_cache( ld );
}
#endif /* !NO_CACHE */
#endif /* !LDAP_NOCACHE */
/* send the message */
return ( ldap_send_initial_request( ld, LDAP_REQ_BIND, dn, ber ));
@ -290,4 +290,4 @@ ldap_get_kerberosv4_credentials( LDAP *ld, char *who, char *service, int *len )
}
#endif /* !AUTHMAN */
#endif /* KERBEROS */
#endif /* HAVE_KERBEROS */

View file

@ -32,14 +32,14 @@ void ldap_add_result_to_cache LDAP_P(( LDAP *ld, LDAPMessage *result ));
int ldap_check_cache LDAP_P(( LDAP *ld, unsigned long msgtype, BerElement *request ));
#ifdef KERBEROS
#ifdef HAVE_KERBEROS
/*
* in kerberos.c
*/
char *ldap_get_kerberosv4_credentials LDAP_P(( LDAP *ld, char *who, char *service,
int *len ));
#endif /* KERBEROS */
#endif /* HAVE_KERBEROS */
/*
@ -56,9 +56,9 @@ int ldap_connect_to_host( Sockbuf *sb, char *host, unsigned long address, int po
int async );
void ldap_close_connection( Sockbuf *sb );
#ifdef KERBEROS
#ifdef HAVE_KERBEROS
char *ldap_host_connected_to( Sockbuf *sb );
#endif /* KERBEROS */
#endif /* HAVE_KERBEROS */
#ifdef LDAP_REFERRALS
int do_ldap_select( LDAP *ld, struct timeval *timeout );

View file

@ -208,14 +208,14 @@ open_ldap_connection( LDAP *ld, Sockbuf *sb, char *host, int defport,
}
if ( krbinstancep != NULL ) {
#ifdef KERBEROS
#ifdef HAVE_KERBEROS
if (( *krbinstancep = ldap_host_connected_to( sb )) != NULL &&
( p = strchr( *krbinstancep, '.' )) != NULL ) {
*p = '\0';
}
#else /* KERBEROS */
#else /* HAVE_KERBEROS */
krbinstancep = NULL;
#endif /* KERBEROS */
#endif /* HAVE_KERBEROS */
}
return( 0 );

View file

@ -146,7 +146,7 @@ ldap_close_connection( Sockbuf *sb )
}
#ifdef KERBEROS
#ifdef HAVE_KERBEROS
char *
ldap_host_connected_to( Sockbuf *sb )
{
@ -175,7 +175,7 @@ ldap_host_connected_to( Sockbuf *sb )
return( NULL );
}
#endif /* KERBEROS */
#endif /* HAVE_KERBEROS */
#ifdef LDAP_REFERRALS

View file

@ -32,7 +32,7 @@ static void free_servers LDAP_P(( LDAPServer *srvlist ));
#ifdef LDAP_DNS
#tatic LDAPServer *dn2servers LDAP_P(( LDAP *ld, char *dn ));
static LDAPServer *dn2servers LDAP_P(( LDAP *ld, char *dn ));
#endif /* LDAP_DNS */
#ifdef LDAP_REFERRALS

View file

@ -438,11 +438,11 @@ lr->lr_res_matched ? lr->lr_res_matched : "" );
new->lm_msgtype = tag;
new->lm_ber = ber_dup( &ber );
#ifndef NO_CACHE
#ifndef LDAP_NOCACHE
if ( ld->ld_cache != NULL ) {
ldap_add_result_to_cache( ld, new );
}
#endif /* NO_CACHE */
#endif /* LDAP_NOCACHE */
/* is this the one we're looking for? */
if ( msgid == LDAP_RES_ANY || id == msgid ) {

View file

@ -69,11 +69,11 @@ ldap_simple_bind( LDAP *ld, char *dn, char *passwd )
return( -1 );
}
#ifndef NO_CACHE
#ifndef LDAP_NOCACHE
if ( ld->ld_cache != NULL ) {
ldap_flush_cache( ld );
}
#endif /* !NO_CACHE */
#endif /* !LDAP_NOCACHE */
/* send the message */
return( ldap_send_initial_request( ld, LDAP_REQ_BIND, dn, ber ));

View file

@ -61,7 +61,7 @@ ldap_search( LDAP *ld, char *base, int scope, char *filter,
return( -1 );
}
#ifndef NO_CACHE
#ifndef LDAP_NOCACHE
if ( ld->ld_cache != NULL ) {
if ( ldap_check_cache( ld, LDAP_REQ_SEARCH, ber ) == 0 ) {
ber_free( ber, 1 );
@ -70,7 +70,7 @@ ldap_search( LDAP *ld, char *base, int scope, char *filter,
}
ldap_add_request_to_cache( ld, LDAP_REQ_SEARCH, ber );
}
#endif /* NO_CACHE */
#endif /* LDAP_NOCACHE */
/* send the message */
return ( ldap_send_initial_request( ld, LDAP_REQ_SEARCH, base, ber ));

View file

@ -1,33 +1,17 @@
#include "portable.h"
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
#ifdef MACOS
#ifdef THINK_C
#include <console.h>
#include <unix.h>
#include <fcntl.h>
#endif /* THINK_C */
#include "macos.h"
#else /* MACOS */
#if defined( DOS ) || defined( _WIN32 )
#include "msdos.h"
#if defined( WINSOCK ) || defined( _WIN32 )
#include "console.h"
#endif /* WINSOCK */
#else /* DOS */
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <ac/ctype.h>
#include <ac/socket.h>
#include <ac/string.h>
#include <ac/time.h>
#include <ac/unistd.h>
#include <sys/stat.h>
#include <sys/file.h>
#ifndef VMS
#include <fcntl.h>
#include <unistd.h>
#endif /* VMS */
#endif /* DOS */
#endif /* MACOS */
#include "lber.h"
#include "ldap.h"
@ -47,7 +31,7 @@ static void print_ldap_result LDAP_P(( LDAP *ld, LDAPMessage *lm, char *s ));
static void print_search_entry LDAP_P(( LDAP *ld, LDAPMessage *res ));
static void free_list LDAP_P(( char **list ));
#define NOCACHEERRMSG "don't compile with -DNO_CACHE if you desire local caching"
#define NOCACHEERRMSG "don't compile with -DLDAP_NOCACHE if you desire local caching"
char *dnsuffix;
@ -243,7 +227,7 @@ bind_prompt( LDAP *ld, char **dnp, char **passwdp, int *authmethodp,
static char dn[256], passwd[256];
if ( !freeit ) {
#ifdef KERBEROS
#ifdef HAVE_KERBEROS
getline( dn, sizeof(dn), stdin,
"re-bind method (0->simple, 1->krbv41, 2->krbv42, 3->krbv41&2)? " );
if (( *authmethodp = atoi( dn )) == 3 ) {
@ -251,9 +235,9 @@ bind_prompt( LDAP *ld, char **dnp, char **passwdp, int *authmethodp,
} else {
*authmethodp |= 0x80;
}
#else /* KERBEROS */
#else /* HAVE_KERBEROS */
*authmethodp = LDAP_AUTH_SIMPLE;
#endif /* KERBEROS */
#endif /* HAVE_KERBEROS */
getline( dn, sizeof(dn), stdin, "re-bind dn? " );
strcat( dn, dnsuffix );
@ -440,13 +424,13 @@ main(
break;
case 'b': /* asynch bind */
#ifdef KERBEROS
#ifdef HAVE_KERBEROS
getline( line, sizeof(line), stdin,
"method (0->simple, 1->krbv41, 2->krbv42)? " );
method = atoi( line ) | 0x80;
#else /* KERBEROS */
#else /* HAVE_KERBEROS */
method = LDAP_AUTH_SIMPLE;
#endif /* KERBEROS */
#endif /* HAVE_KERBEROS */
getline( dn, sizeof(dn), stdin, "dn? " );
strcat( dn, dnsuffix );
@ -466,7 +450,7 @@ main(
break;
case 'B': /* synch bind */
#ifdef KERBEROS
#ifdef HAVE_KERBEROS
getline( line, sizeof(line), stdin,
"method 0->simple 1->krbv41 2->krbv42 3->krb? " );
method = atoi( line );
@ -474,9 +458,9 @@ main(
method = LDAP_AUTH_KRBV4;
else
method = method | 0x80;
#else /* KERBEROS */
#else /* HAVE_KERBEROS */
method = LDAP_AUTH_SIMPLE;
#endif /* KERBEROS */
#endif /* HAVE_KERBEROS */
getline( dn, sizeof(dn), stdin, "dn? " );
strcat( dn, dnsuffix );
@ -749,9 +733,9 @@ main(
break;
case 'e': /* enable cache */
#ifdef NO_CACHE
#ifdef LDAP_NOCACHE
printf( NOCACHEERRMSG );
#else /* NO_CACHE */
#else /* LDAP_NOCACHE */
getline( line, sizeof(line), stdin, "Cache timeout (secs)? " );
i = atoi( line );
getline( line, sizeof(line), stdin, "Maximum memory to use (bytes)? " );
@ -760,25 +744,25 @@ main(
} else {
printf( "ldap_enable_cache failed\n" );
}
#endif /* NO_CACHE */
#endif /* LDAP_NOCACHE */
break;
case 'x': /* uncache entry */
#ifdef NO_CACHE
#ifdef LDAP_NOCACHE
printf( NOCACHEERRMSG );
#else /* NO_CACHE */
#else /* LDAP_NOCACHE */
getline( line, sizeof(line), stdin, "DN? " );
ldap_uncache_entry( ld, line );
#endif /* NO_CACHE */
#endif /* LDAP_NOCACHE */
break;
case 'X': /* uncache request */
#ifdef NO_CACHE
#ifdef LDAP_NOCACHE
printf( NOCACHEERRMSG );
#else /* NO_CACHE */
#else /* LDAP_NOCACHE */
getline( line, sizeof(line), stdin, "request msgid? " );
ldap_uncache_request( ld, atoi( line ));
#endif /* NO_CACHE */
#endif /* LDAP_NOCACHE */
break;
case 'o': /* set ldap options */
@ -833,9 +817,9 @@ main(
break;
case 'O': /* set cache options */
#ifdef NO_CACHE
#ifdef LDAP_NOCACHE
printf( NOCACHEERRMSG );
#else /* NO_CACHE */
#else /* LDAP_NOCACHE */
getline( line, sizeof(line), stdin, "cache errors (0=smart, 1=never, 2=always)?" );
switch( atoi( line )) {
case 0:
@ -852,7 +836,7 @@ main(
default:
printf( "not a valid cache option\n" );
}
#endif /* NO_CACHE */
#endif /* LDAP_NOCACHE */
break;
case '?': /* help */

View file

@ -3,28 +3,17 @@
* 12 April 1994 by Mark C Smith
*/
#include "portable.h"
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
#include <stdlib.h>
#ifdef MACOS
#include "macos.h"
#else /* MACOS */
#ifdef DOS
#include <malloc.h>
#include "msdos.h"
#else /* DOS */
#include <sys/time.h>
#include <sys/types.h>
#include <sys/file.h>
#endif /* DOS */
#endif /* MACOS */
#include <ac/socket.h>
#include <ac/string.h>
#include <ac/ctype.h>
#include <ac/time.h>
#ifdef VMS
#include <sys/socket.h>
#endif /* VMS */
#include <sys/file.h>
#include "lber.h"
#include "ldap.h"

View file

@ -74,10 +74,10 @@ ldap_ld_free( LDAP *ld, int close )
ldap_msgfree( lm );
}
#ifndef NO_CACHE
#ifndef LDAP_NOCACHE
if ( ld->ld_cache != NULL )
ldap_destroy_cache( ld );
#endif /* !NO_CACHE */
#endif /* !LDAP_NOCACHE */
if ( ld->ld_error != NULL )
free( ld->ld_error );
if ( ld->ld_matched != NULL )

View file

@ -172,7 +172,7 @@ pthread_cond_broadcast( pthread_cond_t *cv )
return( 0 );
}
#elif defined( HAVE_LWP_THR )
#elif defined( HAVE_THR )
/*******************
* *

View file

@ -18,7 +18,8 @@
#include "portable.h"
#include <stdio.h>
#include <signal.h>
#include <ac/signal.h>
#include "slurp.h"
#include "globals.h"

View file

@ -17,8 +17,9 @@
#include "portable.h"
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <ac/string.h>
#include <ac/time.h>
#include <lber.h>
#include <ldap.h>
@ -32,11 +33,11 @@ usage( char *name )
{
fprintf( stderr, "usage: %s\t[-d debug-level] [-s syslog-level]\n", name );
fprintf( stderr, "\t\t[-f slapd-config-file] [-r replication-log-file]\n" );
#ifdef KERBEROS
#ifdef HAVE_KERBEROS
fprintf( stderr, "\t\t[-t tmp-dir] [-o] [-k srvtab-file]\n" );
#else /* KERBEROS */
#else /* HAVE_KERBEROS */
fprintf( stderr, "\t\t[-t tmp-dir] [-o]\n" );
#endif /* KERBEROS */
#endif /* HAVE_KERBEROS */
}
@ -106,11 +107,11 @@ doargs(
g->slurpd_rdir = strdup( optarg );
break;
case 'k': /* name of kerberos srvtab file */
#ifdef KERBEROS
#ifdef HAVE_KERBEROS
g->default_srvtab = strdup( optarg );
#else /* KERBEROS */
#else /* HAVE_KERBEROS */
fprintf( stderr, "must compile with KERBEROS to use -k option\n" );
#endif /* KERBEROS */
#endif /* HAVE_KERBEROS */
break;
case 'h':
usage( g->myname );

View file

@ -17,8 +17,9 @@
#include "portable.h"
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <ac/socket.h>
#include "../slapd/slap.h"

View file

@ -18,9 +18,9 @@
#include "portable.h"
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <ac/string.h>
#include <ac/socket.h>
#include <lber.h>
#include <ldap.h>
@ -31,19 +31,11 @@
#define MAXARGS 100
/* Forward declarations */
#ifdef NEEDPROTOS
static void add_replica( char **, int );
static int parse_replica_line( char **, int, Ri *);
static void parse_line( char *, int *, char ** );
static char *getline( FILE * );
static char *strtok_quote( char *, char * );
#else /* NEEDPROTOS */
static void add_replica();
static int parse_replica_line();
static void parse_line();
static char *getline();
static char *strtok_quote();
#endif /* NEEDPROTOS */
static void add_replica LDAP_P(( char **, int ));
static int parse_replica_line LDAP_P(( char **, int, Ri *));
static void parse_line LDAP_P(( char *, int *, char ** ));
static char *getline LDAP_P(( FILE * ));
static char *strtok_quote LDAP_P(( char *, char * ));
/* current config file line # */
static int lineno;
@ -359,13 +351,13 @@ parse_replica_line(
strlen( BINDMETHSTR ))) {
val = cargv[ i ] + strlen( BINDMETHSTR ) + 1;
if ( !strcasecmp( val, KERBEROSSTR )) {
#ifdef KERBEROS
#ifdef HAVE_KERBEROS
ri->ri_bind_method = AUTH_KERBEROS;
if ( ri->ri_srvtab == NULL ) {
ri->ri_srvtab = strdup( sglob->default_srvtab );
}
gots |= GOT_METHOD;
#else /* KERBEROS */
#else /* HAVE_KERBEROS */
fprintf( stderr, "Error: a bind method of \"kerberos\" was\n" );
fprintf( stderr, "specified in the slapd configuration file,\n" );
fprintf( stderr, "but slurpd was not built with kerberos.\n" );
@ -373,7 +365,7 @@ parse_replica_line(
fprintf( stderr, "kerberos support if you wish to use\n" );
fprintf( stderr, "bindmethod=kerberos\n" );
exit( 1 );
#endif /* KERBEROS */
#endif /* HAVE_KERBEROS */
} else if ( !strcasecmp( val, SIMPLESTR )) {
ri->ri_bind_method = AUTH_SIMPLE;
gots |= GOT_METHOD;

View file

@ -13,21 +13,18 @@
#include "portable.h"
#include <stdio.h>
#include <ac/unistd.h>
#include <ac/signal.h>
#include <sys/types.h>
#ifdef SVR4
#include <sys/stat.h>
#endif /* svr4 */
#include <fcntl.h>
#include <sys/file.h>
#include <sys/ioctl.h>
#include <signal.h>
#include "portable.h"
#ifdef USE_SYSCONF
#include <unistd.h>
#endif /* USE_SYSCONF */
detach()
{
int i, sd, nbits;
@ -35,11 +32,13 @@ detach()
extern int ldap_debug;
#endif
#ifdef USE_SYSCONF
#ifdef HAVE_SYSCONF
nbits = sysconf( _SC_OPEN_MAX );
#else /* USE_SYSCONF */
#elif HAVE_GETDTABLESIZE
nbits = getdtablesize();
#endif /* USE_SYSCONF */
#else
nbits = FD_SETSIZE;
#endif
#ifdef FD_SETSIZE
if ( nbits > FD_SETSIZE ) {
@ -51,7 +50,7 @@ detach()
if ( ldap_debug == 0 ) {
#endif
for ( i = 0; i < 5; i++ ) {
#if defined( sunos5 ) && defined( THREAD_SUNOS5_LWP )
#if HAVE_THR
switch ( fork1() ) {
#else
switch ( fork() ) {
@ -88,14 +87,14 @@ detach()
(void) dup2( sd, 2 );
close( sd );
#ifdef USE_SETSID
#ifdef HAVE_SETSID
setsid();
#else /* USE_SETSID */
#else /* HAVE_SETSID */
if ( (sd = open( "/dev/tty", O_RDWR )) != -1 ) {
(void) ioctl( sd, TIOCNOTTY, NULL );
(void) close( sd );
}
#endif /* USE_SETSID */
#endif /* HAVE_SETSID */
#ifdef LDAP_DEBUG
}
#endif

View file

@ -17,8 +17,9 @@
#include "portable.h"
#include <stdio.h>
#include <ac/string.h>
#include <sys/signal.h>
#include <ac/signal.h>
#include "slurp.h"
#include "globals.h"
@ -40,11 +41,6 @@ static void populate_queue LDAP_P(( char *f ));
static void set_shutdown LDAP_P((void));
void do_nothing LDAP_P((void));
#ifdef DECL_SYS_ERRLIST
extern char *sys_errlist[];
#endif /* DECL_SYS_ERRLIST */
/*
* Main file manager routine. Watches for new data to be appended to the
@ -67,14 +63,11 @@ fm(
* SIG(UNUSED|USR2) - causes slurpd to read its administrative interface file.
* (not yet implemented).
*/
#ifdef SIGSTKFLT
#ifdef HAVE_LINUX_THREADS
(void) SIGNAL( SIGSTKFLT, (void *) do_nothing );
#else
(void) SIGNAL( SIGUSR1, (void *) do_nothing );
#endif
#ifdef SIGUNUSED
(void) SIGNAL( SIGUNUSED, (void *) do_admin );
#else
(void) SIGNAL( SIGUSR1, (void *) do_nothing );
(void) SIGNAL( SIGUSR2, (void *) do_admin );
#endif
(void) SIGNAL( SIGTERM, (void *) set_shutdown );
@ -154,7 +147,7 @@ set_shutdown()
int i;
sglob->slurpd_shutdown = 1; /* set flag */
#ifdef SIGSTKFLT
#ifdef HAVE_LINUX_THREADS
pthread_kill( sglob->fm_tid, SIGSTKFLT ); /* wake up file mgr */
#else
pthread_kill( sglob->fm_tid, SIGUSR1 ); /* wake up file mgr */
@ -179,7 +172,7 @@ set_shutdown()
void
do_nothing()
{
#ifdef SIGSTKFLT
#ifdef HAVE_LINUX_THREADS
(void) SIGNAL( SIGSTKFLT, (void *) do_nothing );
#else
(void) SIGNAL( SIGUSR1, (void *) do_nothing );

View file

@ -14,7 +14,7 @@
* globals.c - initialization code for global data
*/
#include <portable.h>
#include "portable.h"
#include <stdio.h>
@ -62,13 +62,13 @@ Globals *init_globals()
fprintf( stderr, "Cannot initialize queue\n" );
exit( 1 );
}
#ifdef KERBEROS
#ifdef HAVE_KERBEROS
g->default_srvtab = SRVTAB;
#endif /* KERBEROS */
#if defined( THREAD_SUNOS4_LWP )
#endif /* HAVE_KERBEROS */
#if defined( HAVE_LWP )
g->tsl_list = NULL;
mon_create( &g->tsl_mon );
#endif /* THREAD_SUNOS4_LWP */
#endif /* HAVE_LWP */
return g;
}

View file

@ -17,17 +17,12 @@
#include "portable.h"
#include <stdio.h>
#include <ac/errno.h>
#include <ac/string.h>
#include <ac/time.h>
#include <sys/types.h>
#ifdef KERBEROS
#ifdef KERBEROS_V
#include <kerberosIV/krb.h>
#else
#include <krb.h>
#endif /* KERBEROS_V */
#endif /* KERBEROS */
#include <ac/krb.h>
#include <lber.h>
#include <ldap.h>
@ -53,11 +48,7 @@ static int do_unbind LDAP_P(( Ri * ));
/* External references */
#ifdef DECL_SYS_ERRLIST
extern char *sys_errlist[];
#endif /* DECL_SYS_ERRLIST */
extern char *ch_malloc( unsigned long );
extern char *ch_malloc LDAP_P(( unsigned long ));
static char *kattrs[] = {"kerberosName", NULL };
static struct timeval kst = {30L, 0L};
@ -591,7 +582,7 @@ do_bind(
int rc;
int ldrc;
char msgbuf[ 1024];
#ifdef KERBEROS
#ifdef HAVE_KERBEROS
int retval = 0;
int kni, got_tgt;
char **krbnames;
@ -599,7 +590,7 @@ do_bind(
char realm[ REALM_SZ ];
char name[ ANAME_SZ ];
char instance[ INST_SZ ];
#endif /* KERBEROS */
#endif /* HAVE_KERBEROS */
*lderr = 0;
@ -638,12 +629,12 @@ do_bind(
switch ( ri->ri_bind_method ) {
case AUTH_KERBEROS:
#ifndef KERBEROS
#ifndef HAVE_KERBEROS
Debug( LDAP_DEBUG_ANY,
"Error: Kerberos bind for %s:%d, but not compiled w/kerberos\n",
ri->ri_hostname, ri->ri_port, 0 );
return( BIND_ERR_KERBEROS_FAILED );
#else /* KERBEROS */
#else /* HAVE_KERBEROS */
/*
* Bind using kerberos.
* If "bindprincipal" was given in the config file, then attempt
@ -719,7 +710,7 @@ kexit: if ( krbnames != NULL ) {
}
return( retval);
break;
#endif /* KERBEROS */
#endif /* HAVE_KERBEROS */
case AUTH_SIMPLE:
/*
* Bind with a plaintext password.

View file

@ -17,15 +17,14 @@
#include "portable.h"
#include <stdio.h>
#include <sys/time.h>
#include <sys/types.h>
#include <ac/socket.h>
#include <ac/time.h>
#include <ac/unistd.h>
#include <sys/file.h>
#include <sys/param.h>
#include <sys/socket.h>
#include "portable.h"
#ifdef USE_LOCKF
#include <unistd.h>
#endif
#include "../slapd/slap.h"
@ -50,11 +49,12 @@ lock_fopen(
}
/* acquire the lock */
#ifdef USE_LOCKF
while ( lockf( fileno( *lfp ), F_LOCK, 0 ) != 0 ) {
#ifdef HAVE_LOCKF
while ( lockf( fileno( *lfp ), F_LOCK, 0 ) != 0 )
#else
while ( flock( fileno( *lfp ), LOCK_EX ) != 0 ) {
while ( flock( fileno( *lfp ), LOCK_EX ) != 0 )
#endif
{
; /* NULL */
}
@ -62,7 +62,7 @@ lock_fopen(
if ( (fp = fopen( fname, type )) == NULL ) {
Debug( LDAP_DEBUG_ANY,
"Error: could not open \"%s\"\n", fname, 0, 0 );
#ifdef USE_LOCKF
#ifdef HAVE_LOCKF
lockf( fileno( *lfp ), F_ULOCK, 0 );
#else
flock( fileno( *lfp ), LOCK_UN );
@ -82,7 +82,7 @@ lock_fclose(
)
{
/* unlock */
#ifdef USE_LOCKF
#ifdef HAVE_LOCKF
lockf( fileno( lfp ), F_ULOCK, 0 );
#else
flock( fileno( lfp ), LOCK_UN );

View file

@ -28,9 +28,10 @@ extern void fm();
extern int start_replica_thread( Ri * );
extern Globals *init_globals();
extern int sanity();
#if defined( THREAD_SUNOS4_LWP )
#if defined( HAVE_LWP )
extern void start_lwp_scheduler();
#endif /* THREAD_SUNOS4_LWP */
#endif /* HAVE_LWP */
main(
int argc,
@ -41,11 +42,11 @@ main(
int status;
int i;
#ifndef _THREAD
#ifdef NO_THREADS
/* Haven't yet written the non-threaded version */
fprintf( stderr, "slurpd currently requires threads support\n" );
exit( 1 );
#endif /* !_THREAD */
#else
/*
* Create and initialize globals. init_globals() also initializes
@ -95,21 +96,20 @@ main(
* and if not in one-shot mode.
*/
#ifdef LDAP_DEBUG
if (( ldap_debug == 0 ) && !sglob->one_shot_mode ) {
if (( ldap_debug == 0 ) && !sglob->one_shot_mode )
#else /* LDAP_DEBUG */
if ( !sglob->one_shot_mode ) {
if ( !sglob->one_shot_mode )
#endif /* LDAP_DEBUG */
detach();
{
detach();
}
#ifdef _THREAD
#if defined( THREAD_SUNOS4_LWP )
#if defined( HAVE_LWP )
/*
* Need to start a scheduler thread under SunOS 4
*/
start_lwp_scheduler();
#endif /* THREAD_SUNOS4_LWP */
#endif /* HAVE_LWP */
/*
@ -123,7 +123,8 @@ main(
* Start the main file manager thread (in fm.c).
*/
pthread_attr_init( &attr );
#ifndef THREAD_MIT_PTHREADS
#if !defined(HAVE_PTHREADS_D4) && !defined(HAVE_DCE)
/* POSIX_THREADS or compatible
* This is a draft 10 or standard pthreads implementation
*/
@ -134,7 +135,7 @@ main(
exit( 1 );
}
#else /* !THREAD_MIT_PTHREADS */
#else /* !PTHREADS_FINAL */
/*
* This is a draft 4 or earlier pthreads implementation
*/
@ -145,13 +146,14 @@ main(
exit( 1 );
}
#endif /* !THREAD_MIT_PTHREADS */
#endif /* !PTHREADS_FINAL */
pthread_attr_destroy( &attr );
/*
* Wait for the fm thread to finish.
*/
#ifdef POSIX_THREADS
#ifdef HAVE_PTHREADS_FINAL
pthread_join( sglob->fm_tid, (void *) NULL );
#else
pthread_join( sglob->fm_tid, (void *) &status );
@ -160,7 +162,7 @@ main(
* Wait for the replica threads to finish.
*/
for ( i = 0; sglob->replicas[ i ] != NULL; i++ ) {
#ifdef POSIX_THREADS
#ifdef HAVE_PTHREADS_FINAL
pthread_join( sglob->replicas[ i ]->ri_tid, (void *) NULL );
#else
pthread_join( sglob->replicas[ i ]->ri_tid, (void *) &status );
@ -170,12 +172,5 @@ main(
sglob->slurpd_shutdown = 1;
pthread_exit( 0 );
#else /* !_THREAD */
/*
* Non-threaded case.
*/
exit( 0 );
#endif /* !_THREAD */
#endif /* !NO_THREADS */
}

View file

@ -21,9 +21,10 @@
#include "portable.h"
#include <stdio.h>
#include <ac/errno.h>
#include <ac/socket.h>
#include <ac/string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include "../slapd/slap.h"
#include "slurp.h"
@ -33,10 +34,6 @@
extern char *str_getline LDAP_P(( char **next ));
extern void ch_free LDAP_P(( char *p ));
#ifdef DECL_SYS_ERRLIST
extern char *sys_errlist[];
#endif /* DECL_SYS_ERRLIST */
/* Forward references */
static Rh *get_repl_hosts LDAP_P(( char *, int *, char ** ));
static int gettype LDAP_P(( char * ));
@ -84,10 +81,10 @@ Re_free(
"Warning: freeing re (dn: %s) with nonzero refcnt\n",
re->re_dn, 0, 0 );
}
#if !defined( THREAD_SUNOS4_LWP )
#if !defined( HAVE_LWP )
/* This seems to have problems under SunOS lwp */
pthread_mutex_destroy( &re->re_mutex );
#endif /* THREAD_SUNOS4_LWP */
#endif /* HAVE_LWP */
ch_free( re->re_timestamp );
if (( rh = re->re_replicas ) != NULL ) {
for ( i = 0; rh[ i ].rh_hostname != NULL; i++ ) {

View file

@ -20,19 +20,17 @@
#include "portable.h"
#include <stdio.h>
#include <ac/errno.h>
#include <ac/unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include "slurp.h"
#include "globals.h"
#ifdef DECL_SYS_ERRLIST
extern char *sys_errlist[];
#endif /* DECL_SYS_ERRLIST */
/*
* Write a replication record to a reject file. The reject file has the
* same name as the replica's private copy of the file but with ".rej"

View file

@ -63,7 +63,7 @@ start_replica_thread(
pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_DETACHED );
#endif
#ifndef THREAD_MIT_PTHREADS
#if !defined(HAVE_PTHREAD_D4) && !defined(HAVE_DCE)
/* POSIX_THREADS or compatible
* This is a draft 10 or standard pthreads implementation
*/
@ -74,7 +74,7 @@ start_replica_thread(
pthread_attr_destroy( &attr );
return -1;
}
#else /* !THREAD_MIT_PTHREADS */
#else /* !final */
/*
* This is a draft 4 or earlier pthreads implementation
*/
@ -85,7 +85,8 @@ start_replica_thread(
pthread_attr_destroy( &attr );
return -1;
}
#endif /* !THREAD_MIT_PTHREADS */
#endif /* !final */
pthread_attr_destroy( &attr );
return 0;
}

View file

@ -17,16 +17,17 @@
#include "portable.h"
#include <errno.h>
#include <stdio.h>
#include <syslog.h>
#include <ac/errno.h>
#include <ac/string.h>
#include <ac/syslog.h>
#include <ac/time.h>
#include <sys/types.h>
#include <ac/unistd.h>
#include <sys/stat.h>
#include <sys/param.h>
#include <fcntl.h>
#include <unistd.h>
#include <ac/string.h>
#include "slurp.h"
#include "globals.h"
@ -43,10 +44,6 @@ extern char *ch_malloc LDAP_P(( unsigned long ));
int file_nonempty LDAP_P(( char * ));
#ifdef DECL_SYS_ERRLIST
extern char *sys_errlist[];
#endif
/*
* Forward declarations
*/

View file

@ -20,31 +20,20 @@
#include "portable.h"
#include <stdio.h>
#include <signal.h>
#include <ac/signal.h>
#include "slurp.h"
#include "globals.h"
/* External references */
#ifdef NEEDPROTOS
extern void write_reject( Ri *, Re *, int, char * );
extern void do_nothing();
#else /* NEEDPROTOS */
extern void write_reject();
extern void do_nothing();
#endif /* NEEDPROTOS */
extern void write_reject LDAP_P(( Ri *, Re *, int, char * ));
extern void do_nothing LDAP_P(());
/* Forward references */
#ifdef NEEDPROTOS
static int ismine( Ri *, Re * );
static int isnew( Ri *, Re * );
void tsleep( time_t );
#else /* NEEDPROTOS */
static int ismine();
static int isnew();
void tsleep();
#endif /* NEEDPROTOS */
static int ismine LDAP_P(( Ri *, Re * ));
static int isnew LDAP_P(( Ri *, Re * ));
void tsleep LDAP_P(( time_t ));
/*
@ -61,7 +50,7 @@ Ri_process(
int rc ;
char *errmsg;
#ifdef SIGSTKFLT
#ifdef HAVE_LINUX_THREADS
(void) SIGNAL( SIGSTKFLT, (void *) do_nothing );
#else
(void) SIGNAL( SIGUSR1, (void *) do_nothing );
@ -162,7 +151,7 @@ Ri_wake(
if ( ri == NULL ) {
return;
}
#ifdef SIGSTKFLT
#ifdef HAVE_LINUX_THREADS
pthread_kill( ri->ri_tid, SIGSTKFLT );
(void) SIGNAL( SIGSTKFLT, (void *) do_nothing );
#else

View file

@ -42,10 +42,6 @@
/* externs */
extern void Re_dump LDAP_P(( Re *re ));
#ifdef DECL_SYS_ERRLIST
extern char *sys_errlist[];
#endif /* DECL_SYS_ERRLIST */
/*
* Lock the replication queue.
*/

View file

@ -21,12 +21,12 @@
#include "portable.h"
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <ac/unistd.h>
#include <ac/string.h>
#include "slurp.h"
#include "globals.h"
#include "portable.h"
#define FC_DIRBAD 1
#define FC_DIRUNREAD 2
@ -39,11 +39,7 @@
/*
* Forward declarations
*/
#ifdef NEEDPROTOS
static unsigned int filecheck( char * );
#else /* NEEDPROTOS */
static unsigned int filecheck();
#endif /* NEEDPROTOS */
static unsigned int filecheck LDAP_P(( char * ));

View file

@ -15,14 +15,15 @@
#ifndef _SLURPD_H_
#define _SLURPD_H_
#define LDAP_SYSLOG
#include "portable.h"
#include <syslog.h>
#include <errno.h>
#include <sys/types.h>
#define LDAP_SYSLOG
#include <ac/syslog.h>
#include <ac/errno.h>
#include <sys/param.h>
#include "lber.h"
#include "ldap.h"
#include "lthread.h"
@ -319,7 +320,7 @@ typedef struct st {
int (*st_unlock)(); /* read status info from disk */
} St;
#if defined( THREAD_SUNOS4_LWP )
#if defined( HAVE_LWP )
typedef struct tl {
thread_t tl_tid; /* thread being managed */
time_t tl_wake; /* time thread should be resumed */
@ -330,7 +331,7 @@ typedef struct tsl {
tl_t *tsl_list;
mon_t tsl_mon;
} tsl_t;
#endif /* THREAD_SUNOS4_LWP */
#endif /* HAVE_LWP */

View file

@ -20,15 +20,11 @@
#include <stdio.h>
#include <ac/string.h>
#include <unistd.h>
#include <ac/unistd.h>
#include "slurp.h"
#include "globals.h"
#ifdef DECL_SYS_ERRLIST
extern char *sys_errlist[];
#endif /* DECL_SYS_ERRLIST */
/*
* Add information about replica host specified by Ri to list
* of hosts.

View file

@ -25,13 +25,14 @@
*/
#include "portable.h"
#include <stdio.h>
#include "slurp.h"
#include "globals.h"
#if defined( THREAD_SUNOS4_LWP )
#if defined( HAVE_LWP )
extern stkalign_t *get_stack( int * );
extern void free_stack( int );
@ -141,7 +142,7 @@ start_lwp_scheduler()
}
#else /* THREAD_SUNOS4_LWP */
#else /* !HAVE_LWP */
/*
* Here we assume we have fully preemptive threads, and that sleep()
@ -154,7 +155,7 @@ tsleep(
{
sleep( interval );
}
#endif /* THREAD_SUNOS4_LWP */
#endif /* !HAVE_LWP */