Commit 58ea169c authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Minor fixes for Linux

parent 92eb657c
This diff is collapsed.
......@@ -38,6 +38,9 @@
/* define if you have Sun LWP (Solaris style) */
#undef HAVE_LWP_THR
/* define if you have -lncurses */
#undef HAVE_NCURSES
/* define if you have NDBM */
#undef HAVE_NDBM
......@@ -50,6 +53,9 @@
/* define if your POSIX Threads implementatin is circa Draft 4 */
#undef HAVE_PTHREADS_D4
/* define if you have -ltermcap */
#undef HAVE_TERMCAP
/* define this for connectionless LDAP support */
#undef LDAP_CONNECTIONLESS
......
......@@ -53,28 +53,16 @@ extern int ldap_debug, lber_debug;
#define T_DELETEOLDRDNSTR "deleteoldrdn"
#ifdef NEEDPROTOS
static int process_ldapmod_rec( char *rbuf );
static int process_ldif_rec( char *rbuf );
static void addmodifyop( LDAPMod ***pmodsp, int modop, char *attr,
char *value, int vlen );
static int domodify( char *dn, LDAPMod **pmods, int newentry );
static int dodelete( char *dn );
static int domodrdn( char *dn, char *newrdn, int deleteoldrdn );
static void freepmods( LDAPMod **pmods );
static int fromfile( char *path, struct berval *bv );
static char *read_one_record( FILE *fp );
#else /* NEEDPROTOS */
static int process_ldapmod_rec();
static int process_ldif_rec();
static void addmodifyop();
static int domodify();
static int dodelete();
static int domodrdn();
static void freepmods();
static int fromfile();
static char *read_one_record();
#endif /* NEEDPROTOS */
static int process_ldapmod_rec LDAP_P(( char *rbuf ));
static int process_ldif_rec LDAP_P(( char *rbuf ));
static void addmodifyop LDAP_P(( LDAPMod ***pmodsp, int modop, char *attr,
char *value, int vlen ));
static int domodify LDAP_P(( char *dn, LDAPMod **pmods, int newentry ));
static int dodelete LDAP_P(( char *dn ));
static int domodrdn LDAP_P(( char *dn, char *newrdn, int deleteoldrdn ));
static void freepmods LDAP_P(( LDAPMod **pmods ));
static int fromfile LDAP_P(( char *path, struct berval *bv ));
static char *read_one_record LDAP_P(( FILE *fp ));
main( argc, argv )
......
......@@ -10,21 +10,29 @@
* is provided ``as is'' without express or implied warranty.
*/
#define DISABLE_BRIDGE
#include "portable.h"
#include <stdio.h>
#include <stdlib.h>
#include <ac/string.h>
#include <signal.h>
#include <string.h>
#ifdef DOS
#include <malloc.h>
#endif
#include <memory.h>
#if defined( NeXT )
#include <stdlib.h>
#endif
#include <ctype.h>
#include <ac/time.h>
#include <errno.h>
#include <lber.h>
#include <ldap.h>
#include <ldapconfig.h>
#if !defined(DOS) && !defined( VMS)
#include <sys/types.h>
#endif
......@@ -34,6 +42,7 @@
#else /* USE_TERMIOS */
#include <sgtty.h>
#endif /* USE_TERMIOS */
#include "ud.h"
#if defined(VMS)
......@@ -80,7 +89,7 @@ char *prompt;
#endif
/*
* Stolen from the getpass() routine. Can't use the plain
* getpass() for two reasons. One is that X.500 passwords
* getpass() for two reasons. One is that LDAP passwords
* can be really, really long - much longer than 8 chars.
* The second is that we like to make this client available
* out of inetd via a Merit asynch port, and we need to be
......@@ -226,8 +235,6 @@ FILE *where;
fatal(s)
char *s;
{
void exit();
if (errno != 0)
perror(s);
#ifdef KERBEROS
......@@ -594,13 +601,15 @@ unsigned int size;
void Free(ptr)
char *ptr;
{
extern int free();
#ifndef STDC_HEADERS
if (free(ptr) < 0) {
perror("free");
exit(-1);
/*NOTREACHED*/
}
#else
free(ptr);
#endif
return;
}
......
This diff is collapsed.
......@@ -661,13 +661,12 @@ fi
# ud needs termcap (should insert check here)
ol_link_termcap=no
AC_CHECK_HEADERS(termcap.h ncurses.h)
if test $ol_link_termcap = no ; then
AC_CHECK_LIB(termcap, tputs, [have_termcap=yes], [have_termcap=no])
if test $have_termcap = yes ; then
dnl AC_DEFINE(HAVE_TERMCAP)
AC_DEFINE(HAVE_TERMCAP)
ol_link_termcap=yes
TERMCAP_LIBS=-ltermcap
fi
......@@ -676,7 +675,7 @@ fi
if test $ol_link_termcap = no ; then
AC_CHECK_LIB(ncurses, initscr, [have_ncurses=yes], [have_ncurses=no])
if test $have_ncurses = yes ; then
dnl AC_DEFINE(HAVE_NCURSES)
AC_DEFINE(HAVE_NCURSES)
ol_link_termcap=yes
TERMCAP_LIBS=-lncurses
fi
......@@ -723,7 +722,7 @@ AC_CHECK_HEADERS( \
sys/ioctl.h \
sys/time.h \
syslog.h \
termio.h \
termios.h \
unistd.h \
)
......
......@@ -189,7 +189,7 @@
/*
* put a cover on the tty-related ioctl calls we need to use
*/
#if !defined( HAVE_TERMIOS )
#if !defined( HAVE_TERMIOS_H )
#define TERMIO_TYPE struct sgttyb
#define TERMFLAG_TYPE int
#define GETATTR( fd, tiop ) ioctl((fd), TIOCGETP, (caddr_t)(tiop))
......
......@@ -3,7 +3,7 @@
#ifndef _LTHREAD_H
#define _LTHREAD_H
#include <portable.h>
#include "portable.h"
LDAP_BEGIN_DECL
......
/* include/portable.h.in. Generated automatically from configure.in by autoheader. */
/*
* Copyright (c) 1994 Regents of the University of Michigan.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that this notice is preserved and that due credit is given
* to the University of Michigan at Ann Arbor. The name of the University
* may not be used to endorse or promote products derived from this
* software without specific prior written permission. This software
* is provided ``as is'' without express or implied warranty.
*/
Copyright 1998 The OpenLDAP Foundation, Redwood City, California, USA
All rights reserved.
Redistribution and use in source and binary forms are permitted only
as authorized by the OpenLDAP Public License. A copy of this
license is available at http://www.OpenLDAP.org/license.html or
in file LICENSE in the top-level directory of the distribution.
This work is derived from the University of Michigan LDAP v3.3
distribution. Information concerning is available at
http://www.umich.edu/~dirsvcs/ldap/ldap.html.
This work also contains materials derived from public sources.
---
Portions Copyright (c) 1992-1996 Regents of the University of Michigan.
All rights reserved.
Redistribution and use in source and binary forms are permitted
provided that this notice is preserved and that due credit is given
to the University of Michigan at Ann Arbor. The name of the University
may not be used to endorse or promote products derived from this
software without specific prior written permission. This software
is provided ``as is'' without express or implied warranty.
*/
#ifndef _LDAP_PORTABLE_H
#define _LDAP_PORTABLE_H
......@@ -117,6 +134,9 @@
/* define if you have Sun LWP (Solaris style) */
#undef HAVE_LWP_THR
/* define if you have -lncurses */
#undef HAVE_NCURSES
/* define if you have NDBM */
#undef HAVE_NDBM
......@@ -129,6 +149,9 @@
/* define if your POSIX Threads implementatin is circa Draft 4 */
#undef HAVE_PTHREADS_D4
/* define if you have -ltermcap */
#undef HAVE_TERMCAP
/* define this for ACL Group support */
#undef SLAPD_ACLGROUPS
......@@ -306,8 +329,8 @@
/* Define if you have the <termcap.h> header file. */
#undef HAVE_TERMCAP_H
/* Define if you have the <termio.h> header file. */
#undef HAVE_TERMIO_H
/* Define if you have the <termios.h> header file. */
#undef HAVE_TERMIOS_H
/* Define if you have the <thread.h> header file. */
#undef HAVE_THREAD_H
......
Supports Markdown
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