Commit 6f0bc8c9 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Update with latest from -devel.

parent bac82ea3
Making and Installing the U-M LDAP Distribution
Making and Installing the OpenLDAP Distribution
** It is recommended that you read or at least skim through ALL of the
** instructions in this file before attempting to build the software.
If you want to build binaries for more than one platform from a single
source tree, skip ahead to the "Building LDAP For More Than One Platform"
section near the end of this file. If you are planning to run slapd,
you should read the "SLAPD and SLURPD Administrator's Guide", found in
the doc/guides/ directory within the distribution.
section near the end of this file.
If you simply want to build LDAP for a single machine platform, follow
these steps:
1. untar the distribution and cd to the top:
% zcat ldap-3.3.tar.Z | tar xf -
% cd ldap-3.3
% tar xfz openldap-VERSION.tgz
% cd ldap
If you are reading this file, you probably have already done this!
2. Type:
% ./configure --help
2. edit the files Make-common and include/ldapconfig.h.edit to configure
the software for your site (the files are well-commented):
to list available configuration options. A description of
these options is provided in the 'CONFIGURE OPTIONS' section
below.
% vi Make-common
% vi include/ldapconfig.h.edit
The configure script uses environmental variables for
determining compiler/linker options. See the HINTS
section for commonly used settings.
Note that you should NOT need to edit the Makefile located at the
top of the distribution.
These environment variables are used:
CC C Compiler (cc, ecgs)
CFLAGS C Flags (-ansi)
CPPFLAGS CPP Flags (-I/path/include -Ddef)
LDFLAGS LDFLAGS (-L/path/lib -llib)
If you just want to see if things will build, you can leave the
configuration alone and change it later.
See the 'USING ENVIRONMENT VARIABLES' section for information
on how to use the variables.
If you have the ISODE package built and want to build the
LDAP-to-X.500 server (ldapd), be sure to uncomment the appropriate
lines near the end of the Make-common file. By default only the
stand-alone server, LDAP libraries and client software are built.
3. edit the file include/ldapconfig.h.edit to configure
the software for your site (the files are well-commented):
3. make the software:
% vi include/ldapconfig.h.edit
% make
4. Configure the build system
If all goes well, then make will figure out what platform you are on,
pick a compiler to use, construct Makefiles, and build everything.
If you see a message like "unknown platform..." LDAP has probably not
been set up to build on your machine. See the file build/PORTS for
hints on what to do in that case.
Note that if your make does not use the Bourne (sh) shell by
default when executing internal scripts (reportedly the case on SGI
machines at least), you will need to run the make explicitly from
within a Bourne shell. If you a syntax error such as "Missing ]"
when you do the make under your usual shell, try this:
% sh
$ make
If you don't like the some of the platform-specific options chosen
by the automatic build process (such as the compiler to use, etc),
you can intervene and edit them before anything is actually compiled
by explicitly doing a "make platform" step, editing the .make-platform
file (actually a link to the file to be edited), and then doing a
regular make:
% make platform
% vi .make-platform
% make
% [env settings] ./configure [options]
If you want to choose the build platform yourself from among those that
the distribution supports, cd to the appropriate directory underneath
build/platforms and make from there. For example, if you are on a
machine running SunOS 4.1.4 and you want to force the use of the cc
compiler, you would do this:
If all goes well, the configure script with auto-detect the
appropriate settings. Use configure enable/with options and/or
environment variables to obtain desired results.
% cd build/platforms/sunos4-cc
% make
5. Build dependencies
If you want to run some simple tests after the build is complete, you
can do this:
% make depend
% make test
6. Build the system
% make
4. install the binaries and man pages. You may need to be superuser to
If all goes well, the system will build as configured. If not,
return to step 4 after reviewing the enable/with options settings.
7. install the binaries and man pages. You may need to be superuser to
do this (depending on where you are installing things):
% su
......@@ -103,34 +83,102 @@ these steps:
Building LDAP For More Than One Platform
It is now possible to build LDAP for more than one platform from the same
source tree. This is accomplished by some rules in the Makefiles that
create a shadow (linked) directory tree where the binaries are placed.
source tree. This is accomplished by using make(1) VPATH support. If
your make(1) program is old and doesn't have VPATH support, install GNU
Make.
Follow these steps for each different platform:
1. move to the directory that matches the platform and compiler you
want to build for and type make. The directories are all located
underneath the build/platforms directory. If your platform is not
there, you may need to do a port - see the build/PORTS file for
more information. For a Sun running SunOS 4.1.4, you might do
this:
1. Create a directory for the platform object files.
% cd build/platforms/sunos4-cc
% make links
% mkdir obj-platform
This will create a linked source area.
2. Change your working directory to the platform object directory.
% cd obj-platform
2. move to the new directory and make as for a single platform. Follow steps
1-4 above to accomplish this. For example:
3. Configure the build system
% cd obj-sunos4-cc
% make
% [env settings] ../configure --src-dir=.. [options]
( replace ".." with the appropriate path )
4. Continue as above (starting at step 6).
Note: make depend in VPATH environment is not yet supported.
CONFIGURE OPTIONS
Regrettably, this section has not been written (yet). See
"./configure --help" for current list of options.
USING ENVIRONMENT VARIABLES
The configure script will also use your environmental
variables for determining compiler/linker options. This can
be used to manual specify features and compilation options.
Supported Environmental Variables
CC C Compiler (cc, ecgs)
CFLAGS C Flags (-ansi)
CPPFLAGS CPP Flags (-I/path/include -Ddef)
LDFLAGS LDFLAGS (-L/path/lib -llib)
PATH command path /usr/local/bin:/usr/bin:/bin
* Including alternative compilers
Use the CC environment variable to tell configure to
use a specific compiler. For example, to use ecgs
instead of the compiler configure choose, use:
[env] CC=ecgs ./configure
You can also use CC use specific flags with the
specified compiler. For example, to require strict
ANSI C using the GNU C Compiler, use:
[env] CC="gcc -ansi -predantic" ./configure
(you can use CFLAGS to specify compiler flags)
* Preprocessor Flags
You may specify additional preprocessor flags by setting
CPPFLAGS. For example, if you would like to use headers
installed in /usr/local/include, use:
[env] CPPFLAGS="-I/usr/local/include" ./configure
You can also use CPPFLAGS to specify preprocessor macros.
[env] CPPFLAGS="-D__SPECIAL_FLAG__" ./configure
* Linker Flags
You may specify additional linker flags by setting LDFLAGS.
For example, if you would like to use libraries installed
in /usr/local/lib, use:
[env] LDFLAGS="-L/usr/local/lib" ./configure
You can also use CPPFLAGS to specify linker flags:
[env] LDFLAGS="-Bstatic" ./configure
* Path
You may alter your path to affect configure ability to
find (or not find) commands. For example, to have configure
additionally look in /usr/css/bin for commands, use:
[env] PATH="/usr/css/bin:$PATH" ./configure
HINTS
That's all there is to it. You can also create the linked source area(s)
by just typing "make links" at the top of the distribution, in which case
the Makefile will try to automatically determine the platform and
compiler.
* use software under installed in /usr/local/{include,lib}
[env] \
CPPFLAGS="-I/usr/local/include" \
LDFLAGS="-L/usr/local/lib" \
./configure
End of LDAP INSTALL file.
End of OpenLDAP INSTALL file.
UM-LDAP 3.3 README file
OpenLDAP 1.1 Alpha README
This is the UM-LDAP version 3.3 distribution. For a description of
what this distribution contains, see the ANNOUNCEMENT file in this
directory. For a description of changes from previous releases,
see the CHANGES file in this directory. For a more detailed
description of how to make and install the distribution, see the
INSTALL file in this directory. For more information on making and
installing slapd, see the "SLAPD and SLURPD Administrator's Guide"
in the doc/guides/ directory.
This is the OpenLDAP version 1.1 Alpha.
For a description of what this distribution contains, see the
ANNOUNCEMENT file in this directory. For a description of
changes from previous releases, see the CHANGES file in this
directory. For a more detailed description of how to make an
install the distribution, see the INSTALL file in this directory.
For more information:
http://www.OpenLDAP.org/
REQUIRED SOFTWARE
Build OpenLDAP requires the following software components:
Base system (libraries and tools):
Standard C compiler, headers, and libraries
POSIX REGEX headers and libraries
SLAPD:
LDBM compatible datastore
(Berkeley DB, Sleepycat DB2, or GDBM)
SLURPD:
LTHREAD compatible thread package
(POSIX pthreads, MIT pthreads, Mach Cthreads or Sun LWP)
LDAPD:
ISODE compatible ldap distribution
CLIENTS/CONTRIBware:
Depends on package. See per package READMEs.
MAKING AND INSTALLING THE DISTRIBUTION
You should be able to make and install the distribution with a pretty
standard default configuration by typing the following commands
You should be able to make and install the distribution with a
default configuration by typing the following commands:
% ./configure --help
This will list the available options.
The configure script will also use your environmental
variables for determining compiler/linker options.
These environment variables are used:
CC C compiler (cc, ecgs)
CFLAGS C Flags (-ansi)
CPPFLAGS CPP Flags (-I -D)
LDFLAGS LDFLAGS (-L -l)
% [env settings] ./configure [options]
this will configure the build system
% make depend
this will create dependency information
% make
this will build the system
% make
% su
# make install
in this directory. This should produce something that basically
works.
works. You can "cd tests; make" to verify the build.
You will probably want to do a little configuration to suit your
site, though. There are two files you might want to edit:
site, though. There are one file you might want to edit:
Make-common This file contains definitions for
where things will be installed, where
to find various things, etc. If you
want to build an ldap server, you'll
definitely need to edit this file
include/ldapconfig.h.edit This file contains #defines used
by many parts of the distribution.
You'll at least want to change
DEFAULT_BASE.
include/ldapconfig.h.edit
This file contains #defines used by many parts of the
distribution. You'll at least want to change DEFAULT_BASE.
See the INSTALL file in this directory for more information.
......@@ -42,18 +76,16 @@ DOCUMENTATION
There are man pages for most programs in the distribution and
routines in the various libraries. See ldap(3) for details.
There is a postscript version of an administrator's guide for
slapd in doc/guides/slapd.ps.
There is an LDAP homepage available that contains the latest
There is an OpenLDAP homepage available that contains the latest
LDAP news, releases announcements, pointers to other LDAP resources,
etc. You can access it at this URL:
http://www.umich.edu/~rsug/ldap/
http://www.OpenLDAP.org/
FEEDBACK / PROBLEM REPORTS
FEEDBACK / PROBLEM REPORTS / DISCUSSIONS
We would appreciate any feedback you can provide. If you have
problems, report them to this address:
ldap-support@umich.edu
OpenLDAP-bugs@OpenLDAP.org
......@@ -5,6 +5,13 @@
Leave the following blank line there!! Autoheader needs it. */
/* define this if needed to get reentrant functions */
#undef _REENTRANT
/* define this if needed to get threadsafe functions */
#undef _THREAD_SAFE
/* define this if toupper() requires tolower() check */
#undef C_UPPER_LOWER
......@@ -56,6 +63,15 @@
/* define if your POSIX Threads implementation is circa Draft 4 */
#undef HAVE_PTHREADS_D4
/* define if you have sched_yield() */
#ifdef __notdef__
/* see second sched_yield define */
#undef HAVE_SCHED_YIELD
#endif
/* define if you have setproctitle() */
#undef HAVE_SETPROCTITLE
/* define if you have -lwrap */
#undef HAVE_TCPD
......@@ -77,6 +93,9 @@
/* define this to remove -lldap cache support */
#undef LDAP_NOCACHE
/* define this for LDAP process title support */
#undef LDAP_PROCTITLE
/* define this for LDAP referrals support */
#undef LDAP_REFERRALS
......
##
## Makefile for gopher clients
##
PROGRAMS= go500gw go500
SRCS= go500.c go500gw.c
XSRCS= gwversion.o goversion.o
GOOBJS = go500.o
GWOBJS = go500gw.o
LDAP_INCDIR= ../../include
LDAP_LIBDIR= ../../libraries
XLIBS = -llutil @LUTIL_LIBS@
go500 : goversion.o
$(CC) $(LDFLAGS) -o $@ $(GOOBJS) goversion.o $(LIBS)
go500gw : gwversion.o
$(CC) $(LDFLAGS) -o $@ $(GWOBJS) gwversion.o $(LIBS)
goversion.c: ${GOOBJS} $(LDAP_LIBDEPEND)
$(RM) $@
(u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \
t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \
-e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \
-e "s|%VERSION%|$${v}|" \
< $(srcdir)/Version.c > $@)
gwversion.c: ${GWOBJS} $(LDAP_LIBDEPEND)
$(RM) $@
(u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \
t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \
-e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \
-e "s|%VERSION%|$${v}|" \
< $(srcdir)/Versiongw.c > $@)
install: $(PROGRAMS) go500gw.help FORCE
-$(MKDIR) -p $(libexecdir) $(sysconfdir)
$(INSTALL) $(INSTALLFLAGS) -m 755 go500 $(libexecdir)
$(INSTALL) $(INSTALLFLAGS) -m 755 go500gw $(libexecdir)
-$(MV) $(sysconfdir)/go500gw.help $(sysconfdir)/go500gw.help-
$(INSTALL) $(INSTALLFLAGS) -m 644 go500gw.help $(sysconfdir)
......@@ -10,32 +10,33 @@
* is provided ``as is'' without express or implied warranty.
*/
#include "portable.h"
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <sys/types.h>
#include <ac/ctype.h>
#include <ac/signal.h>
#include <ac/socket.h>
#include <ac/string.h>
#include <ac/syslog.h>
#include <ac/time.h>
#include <ac/unistd.h>
#include <ac/wait.h>
#include <ac/setproctitle.h>
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <syslog.h>
#endif
#include <sys/resource.h>
#include <sys/wait.h>
#ifdef aix
#include <sys/select.h>
#endif /* aix */
#include <signal.h>
#include "portable.h"
#include "ldapconfig.h"
#include "lber.h"
#include "ldap.h"
#include "disptmpl.h"
#include "lutil.h"
#ifdef USE_SYSCONF
#include <unistd.h>
#endif /* USE_SYSCONF */
#include "disptmpl.h"
int debug;
int dosyslog;
......@@ -52,7 +53,7 @@ char myhost[MAXHOSTNAMELEN];
int myport;
static set_socket();
static SIG_FN wait4child();
static RETSIGTYPE wait4child();
static do_queries();
static do_error();
static do_search();
......@@ -78,14 +79,14 @@ char **argv;
struct hostent *hp;
struct sockaddr_in from;
int fromlen;
SIG_FN wait4child();
RETSIGTYPE wait4child();
extern char *optarg;
extern char **Argv;
extern int Argc;
#if defined( LDAP_PROCTITLE ) && !defined( HAVE_SETPROCTITLE )
/* for setproctitle */
Argv = argv;
Argc = argc;
Argv = argv;
Argc = argc;
#endif
while ( (i = getopt( argc, argv, "b:d:f:lp:c:t:x:I" )) != EOF ) {
switch( i ) {
......@@ -140,15 +141,24 @@ 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) {
dtblsize = FD_SETSIZE;
}
#endif /* FD_SETSIZE*/
/* detach if stderr is redirected or no debugging */
if ( inetd == 0 )
(void) detach( debug );
lutil_detach( debug && !isatty( 1 ), 1 );
if ( (myname = strrchr( argv[0], '/' )) == NULL )
myname = strdup( argv[0] );
......@@ -170,7 +180,7 @@ char **argv;
s = set_socket( port );
/* arrange to reap children */
(void) signal( SIGCHLD, (void *) wait4child );
(void) SIGNAL( SIGCHLD, wait4child );
} else {
myport = GO500_PORT;
......@@ -189,8 +199,10 @@ char **argv;
inet_ntoa( from.sin_addr ) );
}
#ifdef LDAP_PROCTITLE
setproctitle( hp == NULL ? inet_ntoa( from.sin_addr ) :
hp->h_name );
#endif
}
do_queries( 0 );
......@@ -292,20 +304,24 @@ int port;
return( s );
}
static SIG_FN
static RETSIGTYPE
wait4child()
{
#ifndef HAVE_WAITPID
WAITSTATUSTYPE status;
#endif
if ( debug ) printf( "parent: catching child status\n" );
#ifdef USE_WAITPID
#ifdef HAVE_WAITPID
while (waitpid ((pid_t) -1, 0, WAIT_FLAGS) > 0)
#else /* USE_WAITPID */
while ( wait3( &status, WAIT_FLAGS, 0 ) > 0 )
#endif /* USE_WAITPID */
; /* NULL */
; /* NULL */
#else
while ( wait3( &status, WAIT_FLAGS, 0 ) > 0 )
; /* NULL */
#endif
(void) signal( SIGCHLD, (void *) wait4child );
(void) SIGNAL( SIGCHLD, wait4child );
}
static
......@@ -372,7 +388,7 @@ int s;
}
ld->ld_deref = GO500_DEREF;
if ( (rc = ldap_simple_bind_s( ld, GO500_BINDDN, NULL ))
if ( (rc = ldap_simple_bind_s( ld, GO500_BINDDN, GO500_BIND_CRED ))
!= LDAP_SUCCESS ) {
fprintf(fp,
"0An error occurred (explanation)\t@%d\t%s\t%d\r\n",
......
......@@ -10,32 +10,34 @@
* is provided ``as is'' without express or implied warranty.
*/
#include "portable.h"
#include <stdio.h>
#include <ac/ctype.h>
#include <ac/signal.h>
#include <ac/socket.h>
#include <ac/string.h>
#include <ac/syslog.h>
#include <ac/time.h>
#include <ac/unistd.h>
#include <ac/wait.h>
#include <ac/setproctitle.h>
#include <sys/resource.h>
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#include "lber.h"
#include "ldap.h"
#include "lutil.h"