Commit 5b62482f authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

The world compiles and links....

Need to sort out remaining ifnames and run testsuite.
parent 71b34373
......@@ -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
......
......@@ -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>
......
......@@ -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");
......
......@@ -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>
......
......@@ -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>
......
......@@ -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>
......
......@@ -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
......@@ -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>
......
......@@ -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>
......
#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
......
......@@ -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
......
This diff is collapsed.
......@@ -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
......
......@@ -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)();
......
......@@ -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
......
......@@ -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 ) );
......
......@@ -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 )
......
......@@ -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;
......
......@@ -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 ));
......
......@@ -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 */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment