From: Kurt Zeilenga Date: Wed, 21 Oct 1998 04:34:47 +0000 (+0000) Subject: Use autoconf defines X-Git-Tag: PHP3_TOOL_0_0~18^2~26 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=62a5807bb3c40ee57f569c15116a80a4a67acd90;p=openldap Use autoconf defines --- diff --git a/clients/finger/main.c b/clients/finger/main.c index d9ce474fdb..90d3f0c0ed 100644 --- a/clients/finger/main.c +++ b/clients/finger/main.c @@ -170,11 +170,13 @@ static do_query() exit( 1 ); } -#ifdef USE_SYSCONF +#ifdef HAVE_SYSCONF tblsize = sysconf( _SC_OPEN_MAX ); -#else /* USE_SYSCONF */ +#elif HAVE_GETDTABLESIZE tblsize = getdtablesize(); -#endif /* USE_SYSCONF */ +#else + tblsize = FD_SETSIZE; +#endif #ifdef FD_SETSIZE if (tblsize > FD_SETSIZE) { diff --git a/clients/gopher/detach.c b/clients/gopher/detach.c index ce327fef20..8a8baa670c 100644 --- a/clients/gopher/detach.c +++ b/clients/gopher/detach.c @@ -31,7 +31,7 @@ int debug; #elif defined( HAVE_GETDTABLESIZE ) nbits = getdtablesize(); #else - nbits = 32; + nbits = FD_SETSIZE; #endif #ifdef FD_SETSIZE @@ -73,14 +73,14 @@ int debug; (void) dup2( sd, 2 ); close( sd ); -#ifdef USE_SETSID +#ifdef HAVE_SETSID (void) 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 */ } (void) signal( SIGPIPE, SIG_IGN ); diff --git a/clients/gopher/go500.c b/clients/gopher/go500.c index aef3ea376d..792b45a56e 100644 --- a/clients/gopher/go500.c +++ b/clients/gopher/go500.c @@ -137,11 +137,13 @@ char **argv; } #endif -#ifdef USE_SYSCONF +#ifdef HAVE_SYSCONF dtblsize = sysconf( _SC_OPEN_MAX ); -#else /* USE_SYSCONF */ +#elif HAVE_GETDTABLESIZE dtblsize = getdtablesize(); -#endif /* USE_SYSCONF */ +#else + dtblsize = FD_SETSIZE; +#endif #ifdef FD_SETSIZE if (dtblsize > FD_SETSIZE) { diff --git a/clients/gopher/go500gw.c b/clients/gopher/go500gw.c index 725d2b1c53..2260d6061a 100644 --- a/clients/gopher/go500gw.c +++ b/clients/gopher/go500gw.c @@ -153,7 +153,7 @@ char **argv; #elif HAVE_GETDTABLESIZE dtblsize = getdtablesize(); #else - dtblsize = 32; + dtblsize = FD_SETSIZE; #endif #ifdef FD_SETSIZE diff --git a/clients/rcpt500/query.c b/clients/rcpt500/query.c index 4ba778a1bd..65c57df2d3 100644 --- a/clients/rcpt500/query.c +++ b/clients/rcpt500/query.c @@ -80,11 +80,11 @@ query_cmd( msgp, reply ) /* * open connection to LDAP server and bind as dapuser */ -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS if ( do_cldap ) ldp = cldap_open( ldaphost, ldapport ); else -#endif /* CLDAP */ +#endif /* LDAP_CONNECTIONLESS */ ldp = ldap_open( ldaphost, ldapport ); if ( ldp == NULL ) { @@ -94,9 +94,9 @@ query_cmd( msgp, reply ) return( 0 ); } -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS if ( !do_cldap ) -#endif /* CLDAP */ +#endif /* LDAP_CONNECTIONLESS */ if ( ldap_simple_bind_s( ldp, dapuser, NULL ) != LDAP_SUCCESS ) { report_ldap_err( ldp, reply ); close_ldap( ldp ); @@ -113,11 +113,11 @@ query_cmd( msgp, reply ) matches = 0; #ifdef RCPT500_UFN -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS if ( !do_cldap && strchr( msgp->msg_arg, ',' ) != NULL ) { -#else /* CLDAP */ +#else /* LDAP_CONNECTIONLESS */ if ( strchr( msgp->msg_arg, ',' ) != NULL ) { -#endif /* CLDAP */ +#endif /* LDAP_CONNECTIONLESS */ struct timeval tv; ldap_ufn_setprefix( ldp, searchbase ); @@ -136,12 +136,12 @@ query_cmd( msgp, reply ) for ( lfi = ldap_getfirstfilter( lfdp, "rcpt500", msgp->msg_arg ); lfi != NULL; lfi = ldap_getnextfilter( lfdp )) { -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS if ( do_cldap ) rc = cldap_search_s( ldp, searchbase, LDAP_SCOPE_SUBTREE, lfi->lfi_filter, attrs, 0, &ldmsgp, dapuser ); else -#endif /* CLDAP */ +#endif /* LDAP_CONNECTIONLESS */ rc = ldap_search_s( ldp, searchbase, LDAP_SCOPE_SUBTREE, lfi->lfi_filter, attrs, 0, &ldmsgp ); @@ -223,11 +223,11 @@ query_cmd( msgp, reply ) void close_ldap( LDAP *ld ) { -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS if ( do_cldap ) cldap_close( ld ); else -#endif /* CLDAP */ +#endif /* LDAP_CONNECTIONLESS */ ldap_unbind( ld ); } diff --git a/clients/tools/ldapsearch.c b/clients/tools/ldapsearch.c index bd1b568cf9..97ad7568b8 100644 --- a/clients/tools/ldapsearch.c +++ b/clients/tools/ldapsearch.c @@ -50,7 +50,7 @@ char *s; fprintf( stderr, " -z size lim\tsize limit (in entries) for search\n" ); fprintf( stderr, " -D binddn\tbind dn\n" ); fprintf( stderr, " -w passwd\tbind passwd (for simple authentication)\n" ); -#ifdef KERBEROS +#ifdef HAVE_KERBEROS fprintf( stderr, " -k\t\tuse Kerberos instead of Simple Password authentication\n" ); #endif fprintf( stderr, " -h host\tldap server\n" ); @@ -111,7 +111,7 @@ char **argv; scope = LDAP_SCOPE_SUBTREE; while (( i = getopt( argc, argv, -#ifdef KERBEROS +#ifdef HAVE_KERBEROS "KknuvtRABLD:s:f:h:b:d:p:F:a:w:l:z:S:" #else "nuvtRABLD:s:f:h:b:d:p:F:a:w:l:z:S:" @@ -131,7 +131,7 @@ char **argv; fprintf( stderr, "compile with -DLDAP_DEBUG for debugging\n" ); #endif /* LDAP_DEBUG */ break; -#ifdef KERBEROS +#ifdef HAVE_KERBEROS case 'k': /* use kerberos bind */ kerberos = 2; break; diff --git a/clients/ud/auth.c b/clients/ud/auth.c index a245a05f13..0e48fa6b86 100644 --- a/clients/ud/auth.c +++ b/clients/ud/auth.c @@ -34,7 +34,7 @@ extern char *mygetpass(); /* getpass() passwds are too short */ extern int debug; /* debug flag */ #endif -#ifdef KERBEROS +#ifdef HAVE_KERBEROS static char tktpath[20]; /* ticket file path */ static int kinit(); static int valid_tgt(); diff --git a/clients/ud/globals.c b/clients/ud/globals.c index cbde607652..6c6f74f979 100644 --- a/clients/ud/globals.c +++ b/clients/ud/globals.c @@ -44,7 +44,7 @@ struct attribute attrlist[] = { #ifdef UOFM { "multiLineDescription", "Description", change_field, ATTR_FLAG_PERSON | ATTR_FLAG_GROUP | ATTR_FLAG_READ | ATTR_FLAG_PERSON_MOD | ATTR_FLAG_GROUP_MOD | ATTR_FLAG_IS_MULTILINE }, #endif -#ifdef KERBEROS +#ifdef HAVE_KERBEROS { "krbName", "Kerberos name", NULL, ATTR_FLAG_PERSON | ATTR_FLAG_READ }, #endif { "description", "Brief description", NULL, ATTR_FLAG_PERSON | ATTR_FLAG_GROUP | ATTR_FLAG_READ }, diff --git a/clients/ud/main.c b/clients/ud/main.c index 3bab4f83b9..a089742df2 100644 --- a/clients/ud/main.c +++ b/clients/ud/main.c @@ -270,7 +270,7 @@ do_commands() printf(" Thank you!\n"); ldap_unbind(ld); -#ifdef KERBEROS +#ifdef HAVE_KERBEROS destroy_tickets(); #endif exit(0); @@ -693,9 +693,9 @@ RETSIGTYPE attn() fflush(stderr); fflush(stdout); printf("\n\n INTERRUPTED!\n"); -#if defined(DOS) || defined(SYSV) + (void) signal(SIGINT, attn); -#endif + longjmp(env, 1); } @@ -711,6 +711,7 @@ RETSIGTYPE chwinsz() if (win.ws_col != 0) col_size = win.ws_col; } + (void) signal(SIGWINCH, chwinsz); } #endif diff --git a/clients/ud/print.c b/clients/ud/print.c index 7eafd315b5..d6eb2bdeff 100644 --- a/clients/ud/print.c +++ b/clients/ud/print.c @@ -13,14 +13,14 @@ #include "portable.h" #include -#include #include -#ifndef __STDC__ -#include -#endif -#include + +#include +#include + #include #include + #include "ud.h" #ifdef DEBUG @@ -597,9 +597,7 @@ time2text( char *ldtimestr, int dateonly ) /* gtime.c - inverse gmtime */ -#if !defined( MACOS ) && !defined( _WIN32 ) && !defined( DOS ) -#include -#endif /* !MACOS */ +#include /* gtime(): the inverse of localtime(). This routine was supplied by Mike Accetta at CMU many years ago. diff --git a/clients/ud/ud.h b/clients/ud/ud.h index 40b6ecff7a..9a54cafae3 100644 --- a/clients/ud/ud.h +++ b/clients/ud/ud.h @@ -10,14 +10,13 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #ifdef DOS -#include "protoud.h" -#define strncasecmp(a, b, n) strnicmp(a, b, n) -#define strcasecmp(a, b) stricmp(a, b) #define MAX_VALUES 8 #else #define MAX_VALUES 1000 -#endif /* end of DOS ifdef */ +#endif /* !DOS */ /***************************************************************************** ** @@ -87,7 +86,7 @@ /* * Authentication method we will be using. */ -#ifdef KERBEROS +#ifdef HAVE_KERBEROS #define UD_AUTH_METHOD LDAP_AUTH_KRBV4 #else #define UD_AUTH_METHOD LDAP_AUTH_SIMPLE @@ -136,6 +135,8 @@ #define ATTR_FLAG_IS_A_BOOL 0x4000 #define ATTR_FLAG_IS_MULTILINE 0x8000 +LDAP_BEGIN_DECL + /* * These are the structures we use when parsing an answer we get from the LDAP * server. @@ -156,3 +157,5 @@ struct entry { char *name; struct attribute attrs[MAX_ATTRS]; }; + +LDAP_END_DECL diff --git a/clients/ud/util.c b/clients/ud/util.c index c7fc697dbd..32e686e390 100644 --- a/clients/ud/util.c +++ b/clients/ud/util.c @@ -217,7 +217,7 @@ char *s; { if (errno != 0) perror(s); -#ifdef KERBEROS +#ifdef HAVE_KERBEROS destroy_tickets(); #endif exit(-1);