OpenLDAP Change Log
+Changes included in OpenLDAP 1.1-Alpha (from -devel)
+ CVS Tag: OPENLDAP_REL_ENG_1_1
+ Changed LDBM default to sync on writes
+ Added mail500 BOUNCEFROM patch
+ Added dbcachenowsync option
+ Fixed slapd/ldbm id2children bug
+ Fixed slapd/shell newline bug
+ Fixed whois++ get_dn leak
+ Fixed DEC OSF1 (alpha) support
+ Fixed r/w lock initialization on non-final Pthreads
+ Fixed slapd/slurpd file unlock bugs
+ Fixed slurpd string translation bug
+ Fixed slurpd/st mutex unlock bug
+ Moved detach() to -llutil
+ Added lutil_passwd() to -llutil
+ Autoconf:
+ Fixed thread detection
+ Removed gcc -traditional tests
+ Changed --enable-dns to require --enable-referrals
+ Added -lresolv tests for ldapd and LDAP_DNS
+ Added basic ISODE checks
+ Added pwd.h & getpwuid() tests
+ Added sys/resource.h test
+ Updated NT support (now builds ud)
+ Removed lint
+
+
Changes included in OpenLDAP 1.1-Alpha (from -devel)
CVS Tag: OPENLDAP_REL_ENG_1_1_ALPHA2
Added cross compiling detect and warnings
ISODE compatible ldap distribution
CLIENTS/CONTRIBware:
- Depends on package. See per package READMEs.
+ Depends on package. See per package README.
MAKING AND INSTALLING THE DISTRIBUTION
/* define this if needed to get reentrant functions */
#undef _REENTRANT
-/* define this if needed to get threadsafe functions */
+/* define this if needed to get thread safe functions */
#undef _THREAD_SAFE
+/* define this if needed to get thread safe functions */
+#undef _THREADSAFE
+
/* define this if toupper() requires tolower() check */
#undef C_UPPER_LOWER
/* define if you have crypt */
#undef HAVE_CRYPT
-/* define if you have DCE */
-#undef HAVE_DCE
+/* define if you have DSAP */
+#undef HAVE_DSAP
/* define if you have GDBM */
#undef HAVE_GDBM
+/* define if you have ISODE */
+#undef HAVE_ISODE
+
/* define if you have Kerberos */
#undef HAVE_KERBEROS
/* define if you have Mach CThreads */
#undef HAVE_MACH_CTHREADS
+/* define if you have PP */
+#undef HAVE_PP
+
/* define if you have a preemptive POSIX Threads implementation */
#undef HAVE_PREEMPTIVE_PTHREADS
/* define if you have Sun LWP (Solaris style) */
#undef HAVE_THR
+/* define if you have XTPP */
+#undef HAVE_XTPP
+
/* define this for connectionless LDAP support */
#undef LDAP_CONNECTIONLESS
* Routines for parsing the facsimileTelephoneNumber field out of
* an X.500 entry and converting it to a "tpc.int" domain name.
*
- * char *faxtotpc(str)
- * char *str;
+ * char *faxtotpc( char *str, char *userinfo)
*
* faxtotpc() returns a pointer to a string allocated with malloc(3).
*/
+#include "portable.h"
+
#include <stdio.h>
-#include <string.h>
#include <ctype.h>
-#include <sys/types.h>
-
-#ifdef ultrix
-extern char *strdup();
-#endif
+#include <sys/types.h>
+#include <ac/string.h>
#define TPCDOMAIN "tpc.int"
* is provided ``as is'' without express or implied warranty.
*/
+#include "portable.h"
#include <stdio.h>
-#include <string.h>
+#include <stdlib.h>
#include <ctype.h>
-#include <memory.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <syslog.h>
+
+#include <ac/socket.h>
+#include <ac/string.h>
+#include <ac/syslog.h>
+#include <ac/time.h>
+#include <ac/wait.h>
+
+#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
+#endif
+
#include <sys/resource.h>
-#include <sys/wait.h>
-#include <sys/socket.h>
#include <sysexits.h>
-#include <ldapconfig.h>
-#include "portable.h"
#include "lber.h"
#include "ldap.h"
+#include <ldapconfig.h>
#define USER 0
#define GROUP_ERRORS 1
ld->ld_sizelimit = FAX_MAXAMBIGUOUS;
ld->ld_deref = LDAP_DEREF_ALWAYS;
- if ( ldap_simple_bind_s( ld, FAX_BINDDN, NULL ) != LDAP_SUCCESS ) {
+ if ( ldap_simple_bind_s( ld, FAX_BINDDN, FAX_BIND_CRED ) != LDAP_SUCCESS ) {
syslog( LOG_ALERT, "ldap_simple_bind_s failed" );
return( -1 );
}
char **to;
{
int pid;
-#ifndef USE_WAITPID
+#ifndef HAVE_WAITPID
WAITSTATUSTYPE status;
#endif
/* parent */
if ( pid = fork() ) {
-#ifdef USE_WAITPID
+#ifdef HAVE_WAITPID
waitpid( pid, (int *) NULL, 0 );
#else
wait4( pid, &status, WAIT_FLAGS, 0 );
char **argv;
int argc;
char *iargv[7];
-#ifndef USE_WAITPID
+#ifndef HAVE_WAITPID
WAITSTATUSTYPE status;
#endif
/* parent */
if ( pid = fork() ) {
-#ifdef USE_WAITPID
+#ifdef HAVE_WAITPID
waitpid( pid, (int *) NULL, 0 );
#else
wait4( pid, &status, WAIT_FLAGS, 0 );
* is provided ``as is'' without express or implied warranty.
*/
+#include "portable.h"
+
#include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <syslog.h>
-#include <sys/resource.h>
-#include <sys/wait.h>
#include <signal.h>
+
+#include <ac/socket.h>
+#include <ac/string.h>
+#include <ac/syslog.h>
+#include <ac/time.h>
+#include <ac/wait.h>
+
+#include <sys/resource.h>
+
+#include <lber.h>
+#include <ldap.h>
+
#include <ldapconfig.h>
-#include "lber.h"
-#include "ldap.h"
#define DEFAULT_PORT 79
#define DEFAULT_SIZELIMIT 50
int debug;
-char *ldaphost = LDAPHOST;
-char *base = DEFAULT_BASE;
+char *ldaphost = LDAPHOST;
+char *base = RP_BASE;
int deref;
int sizelimit;
LDAPFiltDesc *filtd;
ld->ld_sizelimit = sizelimit ? sizelimit : DEFAULT_SIZELIMIT;
ld->ld_deref = deref;
- if ( ldap_simple_bind_s( ld, RP_BINDDN, NULL ) != LDAP_SUCCESS ) {
+ if ( ldap_simple_bind_s( ld, RP_BINDDN, RP_BIND_CRED ) != LDAP_SUCCESS ) {
fprintf( stderr, "X.500 is temporarily unavailable.\n" );
ldap_perror( ld, "ldap_simple_bind_s" );
exit( -1 );
fprintf( stderr, "Entry \"%s\" has no fax number.\n", dn );
exit( 1 );
}
- faxmail = faxtotpc( fax[0] );
+ faxmail = faxtotpc( fax[0], NULL );
title = ldap_get_values( ld, e, "title" );
phone = ldap_get_values( ld, e, "telephoneNumber" );
mail = ldap_get_values( ld, e, "mail" );
rewind(fp);
- if ( *query != '~' && *query != '@' ) {
+ if ( *query == '~' || *query == '@' ) {
+ ld = NULL;
+ } else {
if ( (ld = ldap_open( ldaphost, LDAP_PORT )) == NULL ) {
fprintf(fp,
"0An error occurred (explanation)\t@%d\t%s\t%d\r\n",
fprintf( fp, ".\r\n" );
rewind(fp);
- ldap_unbind( ld );
+
+ if( ld == NULL ) {
+ ldap_unbind( ld );
+ }
exit( 1 );
/* NOT REACHED */
* is provided ``as is'' without express or implied warranty.
*/
+#include "portable.h"
+
#include <stdio.h>
-#include <string.h>
+#include <stdlib.h>
#include <ctype.h>
-#include <memory.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <syslog.h>
+
+#include <ac/string.h>
+#include <ac/syslog.h>
+#include <ac/time.h>
+#include <ac/wait.h>
+
+#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
+#endif
+
#include <sys/resource.h>
-#include <sys/wait.h>
+
#include <sysexits.h>
-#include "portable.h"
#include "lber.h"
#include "ldap.h"
#include "ldapconfig.h"
+#ifndef MAIL500_BOUNCEFROM
+#define MAIL500_BOUNCEFROM "<>"
+#endif
+
#define USER 0x01
#define GROUP_ERRORS 0x02
#define GROUP_REQUEST 0x04
/* else from the moderator - fall through and deliver it */
}
- if ( has_attributes( e, "rfc822ErrorsTo", "errorsTo" ) ) {
+ if (strcmp(MAIL500_BOUNCEFROM, mailfrom) != 0 &&
+ has_attributes( e, "rfc822ErrorsTo", "errorsTo" ) ) {
add_group( dn, togroups, ngroups );
return( 0 );
char **to;
{
int pid;
-#ifndef USE_WAITPID
+#ifndef HAVE_WAITPID
WAITSTATUSTYPE status;
#endif
/* parent */
if ( pid = fork() ) {
-#ifdef USE_WAITPID
+#ifdef HAVE_WAITPID
waitpid( pid, (int *) NULL, 0 );
#else
wait4( pid, &status, WAIT_FLAGS, 0 );
char **argv;
int argc;
char *iargv[7];
-#ifndef USE_WAITPID
+#ifndef HAVE_WAITPID
WAITSTATUSTYPE status;
#endif
/* parent */
if ( pid = fork() ) {
-#ifdef USE_WAITPID
+#ifdef HAVE_WAITPID
waitpid( pid, (int *) NULL, 0 );
#else
wait4( pid, &status, WAIT_FLAGS, 0 );
int fd[2];
char *argv[8];
char buf[1024];
-#ifndef USE_WAITPID
+#ifndef HAVE_WAITPID
WAITSTATUSTYPE status;
#endif
+ if ( strcmp( MAIL500_BOUNCEFROM, mailfrom ) == 0 ) {
+ mailfrom = errorsfrom;
+ }
+
argv[0] = MAIL500_SENDMAIL;
argv[1] = "-oMrX.500";
argv[2] = "-odi";
argv[3] = "-oi";
argv[4] = "-f";
- argv[5] = errorsfrom;
+ argv[5] = MAIL500_BOUNCEFROM;
argv[6] = mailfrom;
argv[7] = NULL;
}
fclose( fp );
-#ifdef USE_WAITPID
+#ifdef HAVE_WAITPID
waitpid( pid, (int *) NULL, 0 );
#else
wait4( pid, &status, WAIT_FLAGS, 0 );
LDAP *ld,
char *dn));
+int
main( argc, argv )
int argc;
char **argv;
--- /dev/null
+# Microsoft Developer Studio Project File - Name="ldapdelete" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=ldapdelete - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "ldapdelete.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "ldapdelete.mak" CFG="ldapdelete - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "ldapdelete - Win32 Release" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "ldapdelete - Win32 Debug" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "ldapdelete - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release\ldapdelete"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 oldap32.lib olber32.lib olutil32.lib ws2_32.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "ldapdelete - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug\ldapdelete"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 oldap32.lib olber32.lib olutil32.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\libraries\Debug"
+
+!ENDIF
+
+# Begin Target
+
+# Name "ldapdelete - Win32 Release"
+# Name "ldapdelete - Win32 Debug"
+# Begin Source File
+
+SOURCE=.\ldapdelete.c
+# End Source File
+# End Target
+# End Project
--- /dev/null
+# Microsoft Developer Studio Project File - Name="ldapmodify" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=ldapmodify - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "ldapmodify.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "ldapmodify.mak" CFG="ldapmodify - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "ldapmodify - Win32 Release" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "ldapmodify - Win32 Debug" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "ldapmodify - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 oldap32.lib olber32.lib oldif32.lib olutil32.lib ws2_32.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "ldapmodify - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug\ldapmodify"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 oldap32.lib olber32.lib oldif32.lib olutil32.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\libraries\Debug"
+
+!ENDIF
+
+# Begin Target
+
+# Name "ldapmodify - Win32 Release"
+# Name "ldapmodify - Win32 Debug"
+# Begin Source File
+
+SOURCE=.\ldapmodify.c
+# End Source File
+# End Target
+# End Project
char *rdn,
int remove)); /* flag: remove old RDN */
+int
main( argc, argv )
int argc;
char **argv;
--- /dev/null
+# Microsoft Developer Studio Project File - Name="ldapmodrdn" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=ldapmodrdn - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "ldapmodrdn.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "ldapmodrdn.mak" CFG="ldapmodrdn - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "ldapmodrdn - Win32 Release" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "ldapmodrdn - Win32 Debug" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "ldapmodrdn - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 oldap32.lib olber32.lib olutil32.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\libraries\Release"
+
+!ELSEIF "$(CFG)" == "ldapmodrdn - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug\ldapmodrdn"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 oldap32.lib olber32.lib olutil32.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\libraries\Debug"
+
+!ENDIF
+
+# Begin Target
+
+# Name "ldapmodrdn - Win32 Release"
+# Name "ldapmodrdn - Win32 Debug"
+# Begin Source File
+
+SOURCE=.\ldapmodrdn.c
+# End Source File
+# End Target
+# End Project
#include "portable.h"
#include <stdio.h>
-#include <ctype.h>
+#include <stdlib.h>
+#include <ac/ctype.h>
#include <ac/socket.h>
#include <ac/string.h>
#include <ac/time.h>
static int skipsortattr = 0;
static int verbose, not, includeufn, allow_binary, vals2tmp, ldif;
+int
main( argc, argv )
int argc;
char **argv;
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /Ze /W3 /GX /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 libldap.lib liblber.lib liblutil.lib ws2_32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 oldap32.lib olber32.lib oldif32.lib olutil32.lib ws2_32.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "ldapsearch - Win32 Debug"
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 libldap.lib liblber.lib libldif.lib liblutil.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\libraries\Debug"
+# ADD LINK32 oldap32.lib olber32.lib oldif32.lib olutil32.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\libraries\Debug"
!ENDIF
* is provided ``as is'' without express or implied warranty.
*/
+#include "portable.h"
+
#include <stdio.h>
+#include <stdlib.h>
+
+#include <ac/ctype.h>
+#include <ac/krb.h>
+#include <ac/string.h>
+#include <ac/time.h>
+
+#ifdef HAVE_PWD_H
#include <pwd.h>
-#include <string.h>
-#include <ctype.h>
+#endif
+
#include <lber.h>
#include <ldap.h>
#include <ldapconfig.h>
+
#include "ud.h"
-#ifdef KERBEROS
-#include <sys/types.h>
-#include <krb.h>
-#endif
extern LDAP *ld; /* our LDAP descriptor */
extern int verbose; /* verbosity indicator */
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();
#endif
+static void set_bound_dn();
+
auth(who, implicit)
char *who;
int implicit;
char **rdns; /* for fiddling with the DN */
int authmethod;
int name_provided; /* was a name passed in? */
+#ifdef HAVE_GETPWUID
struct passwd *pw; /* for getting user id */
+#else
+ char *user;
+#endif
char uidname[20];
-#ifdef KERBEROS
+#ifdef HAVE_KERBEROS
char **krbnames; /* for kerberos names */
int kinited, ikrb;
char buf[5];
extern void printbase(); /* used to pretty-print a base */
extern int bind_status;
extern void Free();
- static void set_bound_dn();
#ifdef DEBUG
if (debug & D_TRACE)
* The user needs to bind. If <who> is not specified, we
* assume that authenticating as user id is what user wants.
*/
- if (who == NULL && implicit && (pw = getpwuid((uid_t)geteuid()))
- != (struct passwd *) NULL) {
- sprintf(uidname, "uid=%s", pw->pw_name);
- /* who = pw->pw_name; /* */
- who = uidname;
+ if (who == NULL && implicit) {
+ uidname[0] = '\0';
+
+#ifdef HAVE_GETPWUID
+ if ((pw = getpwuid((uid_t)geteuid())) != (struct passwd *) NULL) {
+ sprintf(uidname, "uid=%s", pw->pw_name);
+ }
+#else
+ user = getenv("USER");
+ if(user == NULL) user = getenv("USERNAME");
+ if(user == NULL) user = getenv("LOGNAME");
+
+ if(user != NULL) {
+ sprintf(uidname, "uid=%s", user);
+ }
+#endif
+
+ if(uidname[0] != '\0') {
+ who = uidname;
+ }
}
if ( who == NULL ) {
rdns = ldap_explode_dn(Entry.DN, TRUE);
printf(" Authenticating to the directory as \"%s\"...\n", *rdns );
-#ifdef KERBEROS
+#ifdef HAVE_KERBEROS
/*
* First, if the user has a choice of auth methods, ask which
* one they want to use. if they want kerberos, ask which
if ( hassimple && !kinited ) {
printf(" Which password would you like to use?\n");
- printf(" 1 -> X.500 password\n");
+ printf(" 1 -> LDAP password\n");
#ifdef UOFM
printf(" 2 -> UMICH password (aka Uniqname or Kerberos password)\n");
#else
} else {
#endif
authmethod = LDAP_AUTH_SIMPLE;
- sprintf(prompt, " Enter your X.500 password: ");
+ sprintf(prompt, " Enter your LDAP password: ");
do {
passwd = mygetpass(prompt);
} while (passwd != NULL && *passwd == '\0');
(void) ldap_value_free(rdns);
return(0);
}
-#ifdef KERBEROS
+#ifdef HAVE_KERBEROS
}
(void) ldap_value_free(krbnames);
#endif
if (ld->ld_errno == LDAP_NO_SUCH_ATTRIBUTE)
fprintf(stderr, " Entry has no password\n");
else if (ld->ld_errno == LDAP_INVALID_CREDENTIALS)
-#ifdef KERBEROS
+#ifdef HAVE_KERBEROS
if ( authmethod == LDAP_AUTH_KRBV4 ) {
fprintf(stderr, " The Kerberos credentials are invalid.\n");
} else {
#endif
fprintf(stderr, " The password you provided is incorrect.\n");
-#ifdef KERBEROS
+#ifdef HAVE_KERBEROS
}
#endif
else
ldap_perror(ld, "ldap_bind_s" );
(void) ldap_bind_s(ld, default_bind_object,
- (char *) UD_PASSWD, LDAP_AUTH_SIMPLE);
+ (char *) UD_BIND_CRED, LDAP_AUTH_SIMPLE);
if (default_bind_object == NULL)
set_bound_dn(NULL);
else
return(0);
}
-#ifdef KERBEROS
+#ifdef HAVE_KERBEROS
#define FIVEMINS ( 5 * 60 )
#define TGT "krbtgt"
-str2upper( s )
+static void str2upper( s )
char *s;
{
char *p;
for ( p = s; *p != '\0'; ++p ) {
- if ( islower( *p )) {
- *p = toupper( *p );
- }
+ *p = TOUPPER( *p );
}
}
return( 0 );
}
-#ifdef AFSKERBEROS
+#ifdef HAVE_AFS_KERBEROS
/*
* realm must be uppercase for krb_ routines
*/
str2upper( realm );
-#endif /* AFSKERBEROS */
+#endif /* HAVE_AFS_KERBEROS */
/*
* check ticket file for a valid ticket granting ticket
return(-1);
}
-#ifdef AFSKERBEROS
+#ifdef HAVE_AFS_KERBEROS
strcpy( lcrealm, realm );
for ( p = lcrealm; *p != '\0'; ++p ) {
- if ( isupper( *p )) {
- *p = tolower( *p );
- }
+ *p = TOLOWER( *p );
}
ka_StringToKey( passwd, lcrealm, key );
-#else /* AFSKERBEROS */
+#else /* HAVE_AFS_KERBEROS */
string_to_key( passwd, key );
-#endif /* AFSKERBEROS */
+#endif /* HAVE_AFS_KERBEROS */
return( 0 );
}
return( -1 );
}
-#ifdef AFSKERBEROS
+#ifdef HAVE_AFS_KERBEROS
/*
* realm must be uppercase for krb_ routines
*/
str2upper( realm );
-#endif /* AFSKERBEROS */
+#endif /* HAVE_AFS_KERBEROS */
rc = krb_get_in_tkt( name, inst, realm, TGT, realm,
DEFAULT_TKT_LIFE, krbgetpass, NULL, NULL );
return( 0 );
}
-destroy_tickets()
+void destroy_tickets(void)
{
if ( *tktpath != '\0' ) {
unlink( tktpath );
}
#endif
-static void set_bound_dn(s)
-char *s;
+static void set_bound_dn(char *s)
{
extern void Free();
extern char *bound_dn;
if (bound_dn != NULL)
Free(bound_dn);
- bound_dn = strdup(s);
+ bound_dn = (s == NULL) ? NULL : strdup(s);
}
* is provided ``as is'' without express or implied warranty.
*/
+#include "portable.h"
+
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/time.h>
+
+#include <ac/signal.h>
+#include <ac/string.h>
+#include <ac/time.h>
+#include <ac/wait.h>
+
+#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
-#include <sys/wait.h>
-#include <signal.h>
+#endif
+#ifdef HAVE_PROCESS_H
+#include <process.h>
+#endif
+
#include <lber.h>
#include <ldap.h>
#include <ldapconfig.h>
#include "ud.h"
+extern void *Malloc();
extern struct entry Entry;
extern int verbose;
extern LDAPMessage *find();
+static int load_editor();
+static int modifiable();
+static int print_attrs_and_values();
+static int ovalues();
+static int write_entry();
+
static char *entry_temp_file;
#ifdef DEBUG
char *dn, **rdns; /* distinguished name */
char name[MED_BUF_SIZE]; /* entry to modify */
extern int bind_status;
- static int load_editor();
- static int write_entry();
#ifdef DEBUG
if (debug & D_TRACE)
static char template[MED_BUF_SIZE];
extern char * mktemp();
extern int isgroup(), fatal();
- static int print_attrs_and_values();
int pid;
int status;
int rc;
++p;
}
printf(" Using %s as the editor...\n", p );
+#ifndef HAVE_SPAWNLP
sleep(2);
+#endif
}
+#ifdef HAVE_SPAWNLP
+ rc = _spawnlp( _P_WAIT, editor, editor, entry_temp_file, NULL );
+ if(rc != 0) {
+ fatal("spawnlp");
+ }
+#else
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");
/*NOTREACHED*/
}
+#endif
return(0);
}
struct attribute attrs[];
short flag;
{
- static int modifiable();
register int i, j;
for (i = 0; attrs[i].quipu_name != NULL; i++) {
LDAPMod *mods[MAX_ATTRS + 1];
LDAPMod *modp = NULL;
- static int ovalues();
extern char * code_to_str();
extern void free_mod_struct();
* is provided ``as is'' without express or implied warranty.
*/
+#include "portable.h"
+
#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#ifndef __STDC__
-#include <memory.h>
-#endif
+
+#include <ac/ctype.h>
+#include <ac/string.h>
+#include <ac/time.h>
+
#include <lber.h>
#include <ldap.h>
+
#include "ud.h"
extern char *search_base; /* search base */
ld->ld_deref = savederef;
return(NULL);
} else if (matches == 1) {
- if (ldap_search_s(ld, ldap_get_dn(ld, ldap_first_entry(ld, res)), LDAP_SCOPE_BASE, "objectClass=*", read_attrs, FALSE, &res) != LDAP_SUCCESS) {
+ dn = ldap_get_dn(ld, ldap_first_entry(ld, res));
+ rc = ldap_search_s(ld, dn, LDAP_SCOPE_BASE, "objectClass=*", read_attrs, FALSE, &res);
+ Free(dn);
+ if (rc != LDAP_SUCCESS) {
if (ld->ld_errno == LDAP_UNAVAILABLE)
- printf(" Could not contact the X.500 server to find \"%s\".\n", who);
+ printf(" Could not contact the LDAP server to find \"%s\".\n", who);
else
ldap_perror(ld, "ldap_search_s");
return(NULL);
ld->ld_deref = savederef;
return(res);
} else if (matches > 1 ) {
- return( disambiguate( ld, res, matches, read_attrs,
- who ) );
+ return disambiguate( res, matches, read_attrs, who );
}
ld->ld_deref = savederef;
}
fflush(stdout);
fetch_buffer(response, sizeof(response), stdin);
if ((response[0] == 'n') || (response[0] == 'N'))
+ {
+ Free(dn);
return(NULL);
+ }
}
#ifdef DEBUG
if (debug & D_FIND) {
if (ldap_search_s(ld, dn, LDAP_SCOPE_BASE, "objectClass=*", read_attrs, FALSE, &res) != LDAP_SUCCESS) {
ldap_perror(ld, "ldap_search_s");
ldap_msgfree(res);
- return(NULL);
+ res = NULL;
}
Free(dn);
return(res);
* Simon Fraser University, Academic Computing Services
*/
+#include "portable.h"
+
#include <stdio.h>
-#include <sys/types.h>
-#if defined(NeXT)
#include <stdlib.h>
-#include <sys/file.h>
-#else NeXT
-#include <unistd.h>
-#endif NeXT
-#include <pwd.h>
-#include <string.h>
-#ifndef DOS
-#if defined( NeXT ) || defined( ultrix ) || defined( osf1 ) || (defined(SunOS) && SunOS < 40)
-#include <sgtty.h>
-#else /* defined( NeXT ) || defined( ultrix ) etc. */
-#include <termios.h>
-#endif /* defined( NeXT ) || defined( ultrix ) etc. */
-#endif /* !DOS */
-#if defined( aix ) || defined( __NetBSD__ )
-#include <sys/ioctl.h>
-#endif /* aix || __NetBSD__ */
-#include <ctype.h>
-#include <signal.h>
#include <setjmp.h>
-#include <memory.h>
+
+#ifdef HAVE_PWD_H
+#include <pwd.h>
+#endif
+
+#include <ac/signal.h>
+#include <ac/string.h>
+#include <ac/termios.h>
+#include <ac/time.h>
+#include <ac/unistd.h>
+
+#ifdef HAVE_SYS_FILE_H
+#include <sys/file.h>
+#endif
+
#include <lber.h>
#include <ldap.h>
#include <ldapconfig.h>
-#include "portable.h"
#include "ud.h"
#ifndef lint
char *default_bind_object = UD_BINDDN;
char *bound_dn; /* bound user's Distinguished Name */
-char *group_base; /* place in X.500 tree where groups are */
-char *search_base; /* place in X.500 tree where searches start */
+char *group_base; /* place in LDAP tree where groups are */
+char *search_base; /* place in LDAP tree where searches start */
static jmp_buf env; /* spot to jump to on an interrupt */
int debug; /* debug flag */
#endif
+extern void initialize_client();
+extern void initialize_attribute_strings();
+
main(argc, argv)
int argc;
char *argv[];
extern char *optarg; /* for parsing argv */
register int c; /* for parsing argv */
register char *cp; /* for parsing Version */
- extern void initialize_attribute_strings();
verbose = 1;
printf(" Thank you!\n");
ldap_unbind(ld);
-#ifdef KERBEROS
+#ifdef HAVE_KERBEROS
destroy_tickets();
#endif
exit(0);
}
/*
- * User wants to ascend one level in the X.500 tree.
+ * User wants to ascend one level in the LDAP tree.
* Easy: Just strip off the first element of the
* current search base, unless it's the root, in
* which case we just do nothing.
}
}
-initialize_client()
+void initialize_client()
{
FILE *fp; /* for config file */
static char buffer[MED_BUF_SIZE]; /* for input */
char *term; /* for tty set-up */
char *config; /* config file to use */
static char bp[1024]; /* for tty set-up */
- extern SIG_FN attn(); /* ^C signal handler */
+ extern RETSIGTYPE attn(); /* ^C signal handler */
extern char *getenv();
extern void Free();
* A per-user config file has precedence over any system-wide
* config file, if one exists.
*/
+#ifdef HAVE_GETPWUID_H
if ((pw = getpwuid((uid_t) geteuid())) == (struct passwd *) NULL)
config = config_file;
else {
config = config_file;
}
}
+#endif /* getpwduid() */
#ifdef DEBUG
if (debug & D_INITIALIZE)
printf("Using config file %s\n", config);
* because we want to be sure to use TCP, not UDP.
*/
if ((ld = ldap_open(server, ldap_port)) == NULL) {
- fprintf(stderr, " The X.500 Directory is temporarily unavailable. Please try again later.\n");
+ fprintf(stderr, " The LDAP Directory is temporarily unavailable. Please try again later.\n");
exit(0);
/* NOTREACHED */
}
- if (ldap_bind_s(ld, (char *) default_bind_object, (char *) UD_PASSWD,
+ if (ldap_bind_s(ld, (char *) default_bind_object, (char *) UD_BIND_CRED,
LDAP_AUTH_SIMPLE) != LDAP_SUCCESS) {
- fprintf(stderr, " The X.500 Directory is temporarily unavailable. Please try again later.\n");
+ fprintf(stderr, " The LDAP Directory is temporarily unavailable. Please try again later.\n");
if (ld->ld_errno != LDAP_UNAVAILABLE)
ldap_perror(ld, " ldap_bind_s");
exit(0);
}
/* enabled local caching of ldap results, 15 minute lifetime */
-#ifdef DOS
- ldap_enable_cache( ld, 60 * 15, 100 * 1024 ); /* 100k max memory */
-#else /* DOS */
ldap_enable_cache( ld, 60 * 15, 0 ); /* no memory limit */
-#endif /* DOS */
/* initialize the search filters */
if ((lfdp = ldap_init_getfilter(filter_file)) == NULL) {
lpp = DEFAULT_TTY_HEIGHT;
col_size = DEFAULT_TTY_WIDTH;
- (void) signal(SIGINT, attn);
+ (void) SIGNAL (SIGINT, attn);
-#if !defined(DOS) && !defined(NOTERMCAP)
+#ifndef NO_TERMCAP
{
struct winsize win; /* for tty set-up */
- extern SIG_FN chwinsz(); /* WINSZ signal handler */
+ extern RETSIGTYPE chwinsz(); /* WINSZ signal handler */
if (((term = getenv("TERM")) == NULL) || (tgetent(bp, term) <= 0))
return;
else {
+#ifdef TIOCGWINSZ
if (ioctl(fileno(stdout), TIOCGWINSZ, &win) < 0) {
lpp = tgetnum("li");
col_size = tgetnum("co");
- }
- else {
+ } else
+#endif
+ {
if ((lpp = win.ws_row) == 0)
lpp = tgetnum("li");
if ((col_size = win.ws_col) == 0)
col_size = DEFAULT_TTY_WIDTH;
}
}
- (void) signal(SIGWINCH, chwinsz);
+ (void) SIGNAL (SIGWINCH, chwinsz);
}
#endif
}
-SIG_FN attn()
+RETSIGTYPE attn()
{
fflush(stderr);
fflush(stdout);
printf("\n\n INTERRUPTED!\n");
-#if defined(DOS) || defined(SYSV)
- (void) signal(SIGINT, attn);
-#endif
+
+ (void) SIGNAL (SIGINT, attn);
+
longjmp(env, 1);
}
-#if !defined(DOS) && !defined(NOTERMCAP)
-SIG_FN chwinsz()
+#ifndef NO_TERMCAP
+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;
if (win.ws_col != 0)
col_size = win.ws_col;
}
- (void) signal(SIGWINCH, chwinsz);
+
+ (void) SIGNAL (SIGWINCH, chwinsz);
}
#endif
* is provided ``as is'' without express or implied warranty.
*/
+#include "portable.h"
+
#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
+
+#include <ac/ctype.h>
+#include <ac/string.h>
+#include <ac/time.h>
+
#include <lber.h>
#include <ldap.h>
-#ifndef __STDC__
-#include <memory.h>
-#endif
-#include <sys/types.h>
#include "ud.h"
+extern void Free();
extern struct entry Entry;
extern int verbose;
extern LDAP *ld;
extern LDAPMessage *find();
+extern void * Malloc();
+
+static char * get_URL();
+static int check_URL();
#ifdef DEBUG
extern int debug;
if (verbose && !printed_warning && (ld->ld_errno == LDAP_NO_SUCH_ATTRIBUTE)) {
printed_warning = 1;
printf("\n WARNING!\n");
- printf(" You are about to make a modification to an X.500 entry\n");
+ printf(" You are about to make a modification to an LDAP entry\n");
printf(" that has its \"automatic updates\" field set to ON.\n");
printf(" This means that the entry will be automatically updated\n");
printf(" each month from official University sources like the\n");
static char line[LINE_SIZE]; /* raw line from user */
static char buffer[MAX_DESC_LINES * LINE_SIZE]; /* holds ALL of the
lines we get */
- extern void * Malloc();
- static char * get_URL();
-
#ifdef DEBUG
if (debug & D_TRACE)
printf("->get_value(%s, %s)\n", id, prompt);
if (lmp == (LDAPMessage *) NULL) {
printf(" Could not find \"%s\" in the Directory\n", line);
if (verbose)
- format("Owners of groups must be valid entries in the X.500 Directory. The name you have typed above could not be found in the X.500 Directory.", 72, 2);
+ format("Owners of groups must be valid entries in the LDAP Directory. The name you have typed above could not be found in the LDAP Directory.", 72, 2);
return(NULL);
}
elmp = ldap_first_entry(ld, lmp);
}
tmp = ldap_get_dn(ld, elmp);
strcpy(buffer, tmp);
+ Free(tmp);
(void) ldap_msgfree(lmp);
break;
}
if (verbose) {
printf("\n By default, updates that are received from the Personnel\n");
printf(" Office and the Office of the Registrar are applied to all\n");
- printf(" entries in the X.500 database each month. Sometimes this\n");
+ printf(" entries in the LDAP database each month. Sometimes this\n");
printf(" feature is undesirable. For example, if you maintain your\n");
- printf(" entry in the X.500 database manually, you may not want to\n");
+ printf(" entry in the LDAP database manually, you may not want to\n");
printf(" have these updates applied to your entry, possibly overwriting\n");
printf(" correct information with out-dated information.\n\n");
}
static char * get_URL()
{
char *rvalue, label[MED_BUF_SIZE], url[MED_BUF_SIZE];
- static int check_URL();
- extern void * Malloc();
if (verbose) {
printf(" First, enter the URL. (Example: http://www.us.itd.umich.edu/users/).\n");
--- /dev/null
+# Microsoft Developer Studio Project File - Name="ud" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=ud - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "ud.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "ud.mak" CFG="ud - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "ud - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "ud - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "ud - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 oldap32.lib olber32.lib oldif32.lib olutil32.lib ws2_32.lib hs_regex.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "ud - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 oldap32.lib olber32.lib oldif32.lib olutil32.lib ws2_32.lib hs_regex.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\libraries\Debug"
+
+!ENDIF
+
+# Begin Target
+
+# Name "ud - Win32 Release"
+# Name "ud - Win32 Debug"
+# Begin Source File
+
+SOURCE=.\auth.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\edit.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\find.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\globals.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\group.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\help.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\main.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\mod.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\print.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\string_to_key.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\ud.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\util.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\Version.c
+# End Source File
+# End Target
+# End Project
--- /dev/null
+Microsoft Developer Studio Workspace File, Format Version 5.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "liblber"=..\..\libraries\liblber\liblber.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "libldap"=..\..\libraries\libldap\libldap.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "liblutil"=..\..\libraries\liblutil\liblutil.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "ud"=.\ud.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name liblber
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name libldap
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name liblutil
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
* is provided ``as is'' without express or implied warranty.
*/
-#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 */
/*****************************************************************************
**
/*
* 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
#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.
char *name;
struct attribute attrs[MAX_ATTRS];
};
+
+LDAP_END_DECL
* is provided ``as is'' without express or implied warranty.
*/
+#include "portable.h"
+
#include <stdio.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 <errno.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/unistd.h>
+
#include <lber.h>
#include <ldap.h>
#include <ldapconfig.h>
-#if !defined(DOS) && !defined( VMS)
-#include <sys/types.h>
-#endif
-#include "portable.h"
-#ifdef USE_TERMIOS
-#include <termios.h>
-#else /* USE_TERMIOS */
-#include <sgtty.h>
-#endif /* USE_TERMIOS */
-#include "ud.h"
-#if defined(VMS)
-#define getch getchar
-#endif
+#include "ud.h"
#ifdef DEBUG
extern int debug;
char * mygetpass(prompt)
char *prompt;
{
-#if defined(DOS) || defined(VMS)
+#if !defined(HAVE_TERMIOS) && !defined(HAVE_SGTTY_H)
static char buf[256];
int i, c;
register char *p;
register int c;
FILE *fi;
- SIG_FN (*sig)();
+ RETSIGTYPE (*sig)();
#ifdef DEBUG
if (debug & D_TRACE)
#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
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");
if (SETATTR(fileno(fi), &ttyb) < 0)
perror("SETATTR");
}
- (void) signal(SIGINT, sig);
+ (void) SIGNAL (SIGINT, sig);
if (fi != stdin)
(void) fclose(fi);
else
fatal(s)
char *s;
{
- void exit();
-
if (errno != 0)
perror(s);
-#ifdef KERBEROS
+#ifdef HAVE_KERBEROS
destroy_tickets();
#endif
exit(-1);
return(tmp);
}
-char * code_to_str(i)
+char * code_to_str(int i)
{
switch(i) {
case LDAP_MOD_ADD : return("ADD");
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;
}
fi
# end --enable-slurpd
+# validate options
+if test $ol_enable_referrals = no ; then
+ if test $ol_enable_dns = yes ; then
+ echo "configure: warning: dns disabled, ignoring --enable-dns argument" 1>&2
+ fi
+ ol_enable_dns=no
+fi
+
if test $ol_enable_slapd = no ; then
if test $ol_enable_ldbm = yes ; then
echo "configure: warning: slapd disabled, ignoring --enable_ldbm argument" 1>&2
BUILD_LDBM=no
BUILD_PASSWD=no
BUILD_SHELL=no
+BUILD_THREAD=no
KRB_LIBS=
TERMCAP_LIBS=
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1247: checking whether ln -s works" >&5
+echo "configure:1256: checking whether ln -s works" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1278: checking for a BSD compatible install" >&5
+echo "configure:1287: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1330: checking for $ac_word" >&5
+echo "configure:1339: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:1357: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:1366: checking whether ${MAKE-make} sets \${MAKE}" >&5
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
# Extract the first word of "sendmail", so it can be a program name with args.
set dummy sendmail; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1387: checking for $ac_word" >&5
+echo "configure:1396: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_SENDMAIL'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "vi", so it can be a program name with args.
set dummy vi; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1419: checking for $ac_word" >&5
+echo "configure:1428: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_EDITOR'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "finger", so it can be a program name with args.
set dummy finger; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1451: checking for $ac_word" >&5
+echo "configure:1460: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_FINGER'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1484: checking for $ac_word" >&5
+echo "configure:1493: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1513: checking for $ac_word" >&5
+echo "configure:1522: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1561: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1570: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext <<EOF
-#line 1571 "configure"
+#line 1580 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:1575: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1584: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1595: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1604: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1600: checking whether we are using GNU C" >&5
+echo "configure:1609: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1609: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1618: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1624: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1633: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1665: checking how to run the C preprocessor" >&5
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
- CPP=
-fi
-if test -z "$CPP"; then
-if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- # This must be in double quotes, not single quotes, because CPP may get
- # substituted into the Makefile and "${CC-cc}" will confuse make.
- CPP="${CC-cc} -E"
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp.
- cat > conftest.$ac_ext <<EOF
-#line 1680 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1686: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
-if test -z "$ac_err"; then
- :
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- CPP="${CC-cc} -E -traditional-cpp"
- cat > conftest.$ac_ext <<EOF
-#line 1697 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1703: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
-if test -z "$ac_err"; then
- :
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- CPP=/lib/cpp
-fi
-rm -f conftest*
-fi
-rm -f conftest*
- ac_cv_prog_CPP="$CPP"
-fi
- CPP="$ac_cv_prog_CPP"
-else
- ac_cv_prog_CPP="$CPP"
-fi
-echo "$ac_t""$CPP" 1>&6
-
-if test $ac_cv_prog_gcc = yes; then
- echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
-echo "configure:1727: checking whether ${CC-cc} needs -traditional" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- ac_pattern="Autoconf.*'x'"
- cat > conftest.$ac_ext <<EOF
-#line 1733 "configure"
-#include "confdefs.h"
-#include <sgtty.h>
-Autoconf TIOCGETP
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "$ac_pattern" >/dev/null 2>&1; then
- rm -rf conftest*
- ac_cv_prog_gcc_traditional=yes
-else
- rm -rf conftest*
- ac_cv_prog_gcc_traditional=no
-fi
-rm -f conftest*
-
-
- if test $ac_cv_prog_gcc_traditional = no; then
- cat > conftest.$ac_ext <<EOF
-#line 1751 "configure"
-#include "confdefs.h"
-#include <termio.h>
-Autoconf TCGETA
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "$ac_pattern" >/dev/null 2>&1; then
- rm -rf conftest*
- ac_cv_prog_gcc_traditional=yes
-fi
-rm -f conftest*
-
- fi
-fi
-
-echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6
- if test $ac_cv_prog_gcc_traditional = yes; then
- CC="$CC -traditional"
- fi
-fi
-
-echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1773: checking how to run the C preprocessor" >&5
+echo "configure:1674: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 1788 "configure"
+#line 1689 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1794: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1695: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 1805 "configure"
+#line 1706 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1811: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1712: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
echo $ac_n "checking for AIX""... $ac_c" 1>&6
-echo "configure:1836: checking for AIX" >&5
+echo "configure:1737: checking for AIX" >&5
cat > conftest.$ac_ext <<EOF
-#line 1838 "configure"
+#line 1739 "configure"
#include "confdefs.h"
#ifdef _AIX
yes
echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
-echo "configure:1860: checking for POSIXized ISC" >&5
+echo "configure:1761: checking for POSIXized ISC" >&5
if test -d /etc/conf/kconfig.d &&
grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
then
ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
-echo "configure:1882: checking for minix/config.h" >&5
+echo "configure:1783: checking for minix/config.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1887 "configure"
+#line 1788 "configure"
#include "confdefs.h"
#include <minix/config.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1892: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1793: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
echo $ac_n "checking for socket""... $ac_c" 1>&6
-echo "configure:1933: checking for socket" >&5
+echo "configure:1834: checking for socket" >&5
if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1938 "configure"
+#line 1839 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char socket(); below. */
; return 0; }
EOF
-if { (eval echo configure:1961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_socket=yes"
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
-echo "configure:1980: checking for main in -lsocket" >&5
+echo "configure:1881: checking for main in -lsocket" >&5
ac_lib_var=`echo socket'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lsocket $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1988 "configure"
+#line 1889 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:1995: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1896: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
fi
echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
-echo "configure:2023: checking for main in -lnet" >&5
+echo "configure:1924: checking for main in -lnet" >&5
ac_lib_var=`echo net'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lnet $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2031 "configure"
+#line 1932 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:2038: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
fi
echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
-echo "configure:2066: checking for main in -lnsl_s" >&5
+echo "configure:1967: checking for main in -lnsl_s" >&5
ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lnsl_s $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2074 "configure"
+#line 1975 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:2081: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1982: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
fi
echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
-echo "configure:2109: checking for main in -lnsl" >&5
+echo "configure:2010: checking for main in -lnsl" >&5
ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lnsl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2117 "configure"
+#line 2018 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:2124: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
fi
echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
-echo "configure:2152: checking for socket in -linet" >&5
+echo "configure:2053: checking for socket in -linet" >&5
ac_lib_var=`echo inet'_'socket | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-linet $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2160 "configure"
+#line 2061 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
socket()
; return 0; }
EOF
-if { (eval echo configure:2171: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
fi
echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
-echo "configure:2199: checking for main in -lgen" >&5
+echo "configure:2100: checking for main in -lgen" >&5
ac_lib_var=`echo gen'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lgen $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2207 "configure"
+#line 2108 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:2214: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2115: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
fi
+echo $ac_n "checking for res_search in -lresolv""... $ac_c" 1>&6
+echo "configure:2147: checking for res_search in -lresolv" >&5
+ac_lib_var=`echo resolv'_'res_search | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lresolv $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2155 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char res_search();
+
+int main() {
+res_search()
+; return 0; }
+EOF
+if { (eval echo configure:2166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+ LIBS="-lresolv $LIBS"
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
-echo "configure:2246: checking for sigset in -lV3" >&5
+echo "configure:2195: checking for sigset in -lV3" >&5
ac_lib_var=`echo V3'_'sigset | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lV3 $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2254 "configure"
+#line 2203 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
sigset()
; return 0; }
EOF
-if { (eval echo configure:2265: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2214: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
fi
+# ISODE tests
+ol_link_isode=no
+if test $ol_enable_ldapd != no ; then
+ echo $ac_n "checking for main in -lxtpp""... $ac_c" 1>&6
+echo "configure:2246: checking for main in -lxtpp" >&5
+ac_lib_var=`echo xtpp'_'main | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lxtpp -lxtdsap -lxtisode -losi $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2254 "configure"
+#include "confdefs.h"
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:2261: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+
+ ol_link_isode=yes
+ cat >> confdefs.h <<\EOF
+#define HAVE_XTPP 1
+EOF
+
+ LDAPD_LIBS="$LDAPD_LIBS -lxtpp -lxtdsap -lxtisode -losi"
+
+else
+ echo "$ac_t""no" 1>&6
+:
+fi
+
+ echo $ac_n "checking for main in -ldsap""... $ac_c" 1>&6
+echo "configure:2290: checking for main in -ldsap" >&5
+ac_lib_var=`echo dsap'_'main | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-ldsap -lisode $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2298 "configure"
+#include "confdefs.h"
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:2305: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+
+ ol_link_isode=yes
+ cat >> confdefs.h <<\EOF
+#define HAVE_DSAP 1
+EOF
+
+ LDAPD_LIBS="$LDAPD_LIBS -ldsap"
+
+else
+ echo "$ac_t""no" 1>&6
+:
+fi
+
+ echo $ac_n "checking for main in -lisode""... $ac_c" 1>&6
+echo "configure:2334: checking for main in -lisode" >&5
+ac_lib_var=`echo isode'_'main | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lisode $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2342 "configure"
+#include "confdefs.h"
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:2349: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+
+ ol_link_isode=yes
+ cat >> confdefs.h <<\EOF
+#define HAVE_ISODE 1
+EOF
+
+ LDAPD_LIBS="$LDAPD_LIBS -lisode"
+
+else
+ echo "$ac_t""no" 1>&6
+:
+fi
+
+fi
+
+if test $ol_link_isode != no; then
+ echo $ac_n "checking for main in -lpp""... $ac_c" 1>&6
+echo "configure:2381: checking for main in -lpp" >&5
+ac_lib_var=`echo pp'_'main | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lpp $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2389 "configure"
+#include "confdefs.h"
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:2396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+
+ cat >> confdefs.h <<\EOF
+#define HAVE_PP 1
+EOF
+
+ LDAPD_LIBS="-lpp $LDAPD_LIBS"
+
+else
+ echo "$ac_t""no" 1>&6
+:
+fi
+
+
+ # Extract the first word of "pepsy", so it can be a program name with args.
+set dummy pepsy; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:2427: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_PEPSY'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ case "$PEPSY" in
+ /*)
+ ac_cv_path_PEPSY="$PEPSY" # Let the user override the test with a path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_path_PEPSY="$ac_dir/$ac_word"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac
+fi
+PEPSY="$ac_cv_path_PEPSY"
+if test -n "$PEPSY"; then
+ echo "$ac_t""$PEPSY" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+fi
+
if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 ; then
for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2298: checking for $ac_hdr" >&5
+echo "configure:2462: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2303 "configure"
+#line 2467 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2308: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2472: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
if test $ac_cv_header_kerberosIV_krb_h = yes ; then
echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
-echo "configure:2337: checking for main in -lkrb4" >&5
+echo "configure:2501: checking for main in -lkrb4" >&5
ac_lib_var=`echo krb4'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lkrb4 -lkrb5 -ldes425 $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2345 "configure"
+#line 2509 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:2352: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2516: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2392: checking for $ac_hdr" >&5
+echo "configure:2556: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2397 "configure"
+#line 2561 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2402: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2566: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
if test $ac_cv_header_krb_h = yes ; then
echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
-echo "configure:2431: checking for main in -lkrb" >&5
+echo "configure:2595: checking for main in -lkrb" >&5
ac_lib_var=`echo krb'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lkrb -ldes $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2439 "configure"
+#line 2603 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:2446: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2610: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2489: checking for $ac_hdr" >&5
+echo "configure:2653: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2494 "configure"
+#line 2658 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2499: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2663: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
if test $ac_cv_header_pthread_h = yes ; then
echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
-echo "configure:2528: checking POSIX thread version" >&5
+echo "configure:2692: checking POSIX thread version" >&5
if eval "test \"`echo '$''{'ol_cv_pthread_version'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2534 "configure"
+#line 2698 "configure"
#include "confdefs.h"
# include <pthread.h>
cat > conftest.$ac_ext <<EOF
-#line 2556 "configure"
+#line 2720 "configure"
#include "confdefs.h"
# include <pthread.h>
echo $ac_n "checking for LinuxThreads""... $ac_c" 1>&6
-echo "configure:2609: checking for LinuxThreads" >&5
+echo "configure:2773: checking for LinuxThreads" >&5
if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo $ac_n "checking for pthread_create""... $ac_c" 1>&6
-echo "configure:2635: checking for pthread_create" >&5
+echo "configure:2799: checking for pthread_create" >&5
if eval "test \"`echo '$''{'ac_cv_func_pthread_create'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2640 "configure"
+#line 2804 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char pthread_create(); below. */
; return 0; }
EOF
-if { (eval echo configure:2663: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2827: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_pthread_create=yes"
else
if test $ol_link_threads = no ; then
echo $ac_n "checking for pthread_create with -pthread""... $ac_c" 1>&6
-echo "configure:2685: checking for pthread_create with -pthread" >&5
+echo "configure:2849: checking for pthread_create with -pthread" >&5
if eval "test \"`echo '$''{'ol_cv_pthread_flag'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
save_LIBS="$LIBS"
LIBS="-pthread $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2693 "configure"
+#line 2857 "configure"
#include "confdefs.h"
-#include <pthread.h>
+char pthread();
int main() {
- pthread_create((pthread_t*) 0,
- (pthread_attr_t*) 0, 0, 0);
+ pthread_create();
; return 0; }
EOF
-if { (eval echo configure:2703: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
ol_cv_pthread_flag=yes
else
fi
fi
+ if test $ol_link_threads = no ; then
+ echo $ac_n "checking for pthread_create with -thread""... $ac_c" 1>&6
+echo "configure:2890: checking for pthread_create with -thread" >&5
+if eval "test \"`echo '$''{'ol_cv_thread_flag'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+ save_LIBS="$LIBS"
+ LIBS="-thread $LIBS"
+ cat > conftest.$ac_ext <<EOF
+#line 2898 "configure"
+#include "confdefs.h"
+char pthread();
+int main() {
+
+ pthread_create();
+
+; return 0; }
+EOF
+if { (eval echo configure:2907: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ rm -rf conftest*
+ ol_cv_thread_flag=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ol_cv_thread_flag=no
+fi
+rm -f conftest*
+ LIBS="$save_LIBS"
+
+fi
+
+echo "$ac_t""$ol_cv_thread_flag" 1>&6
+
+ if test $ol_cv_thread_flag = yes ; then
+ LTHREAD_LIBS="$LTHREAD_LIBS -thread"
+ ol_link_threads=posix
+ fi
+ fi
+
if test $ol_link_threads = no ; then
save_LIBS="$LIBS"
- echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
-echo "configure:2728: checking for pthread_create in -lpthread" >&5
-ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
+ echo $ac_n "checking for pthread_join in -lpthread""... $ac_c" 1>&6
+echo "configure:2932: checking for pthread_join in -lpthread" >&5
+ac_lib_var=`echo pthread'_'pthread_join | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
-LIBS="-lpthread $LIBS"
+LIBS="-lpthread -lexc $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2736 "configure"
+#line 2940 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
-char pthread_create();
+char pthread_join();
int main() {
-pthread_create()
+pthread_join()
; return 0; }
EOF
-if { (eval echo configure:2747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2951: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "$ac_t""yes" 1>&6
ol_link_threads=posix
- LTHREAD_LIBS="$LTHREAD_LIBS -lpthread"
+ LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lexc"
+ if test $ol_with_preemptive = auto ; then
+ ol_with_preemptive=yes
+ fi
+
else
echo "$ac_t""no" 1>&6
fi
if test $ol_link_threads = no ; then
save_LIBS="$LIBS"
- echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
-echo "configure:2775: checking for pthread_create in -lc_r" >&5
-ac_lib_var=`echo c_r'_'pthread_create | sed 'y%./+-%__p_%'`
+ echo $ac_n "checking for pthread_join in -lpthreads""... $ac_c" 1>&6
+echo "configure:2983: checking for pthread_join in -lpthreads" >&5
+ac_lib_var=`echo pthreads'_'pthread_join | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
-LIBS="-lc_r $LIBS"
+LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2783 "configure"
+#line 2991 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
-char pthread_create();
+char pthread_join();
int main() {
-pthread_create()
+pthread_join()
; return 0; }
EOF
-if { (eval echo configure:2794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "$ac_t""yes" 1>&6
ol_link_threads=posix
- LTHREAD_LIBS="$LTHREAD_LIBS -lc_r"
+ LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads -lmach -lexc -lc_r"
+ if test $ol_with_preemptive = auto ; then
+ ol_with_preemptive=yes
+ fi
+
else
echo "$ac_t""no" 1>&6
fi
if test $ol_link_threads = no ; then
save_LIBS="$LIBS"
echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
-echo "configure:2822: checking for pthread_create in -lpthread" >&5
+echo "configure:3034: checking for pthread_create in -lpthread" >&5
ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
-LIBS="-lpthread -lmach -lexc -lc $LIBS"
+LIBS="-lpthread $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2830 "configure"
+#line 3042 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
pthread_create()
; return 0; }
EOF
-if { (eval echo configure:2841: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3053: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<\EOF
-#define HAVE_DCE 1
+ ol_link_threads=posix
+ LTHREAD_LIBS="$LTHREAD_LIBS -lpthread"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ LIBS="$save_LIBS"
+ fi
+
+ if test $ol_link_threads = no ; then
+ save_LIBS="$LIBS"
+ echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
+echo "configure:3081: checking for pthread_create in -lc_r" >&5
+ac_lib_var=`echo c_r'_'pthread_create | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lc_r $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 3089 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char pthread_create();
+
+int main() {
+pthread_create()
+; return 0; }
EOF
+if { (eval echo configure:3100: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+
ol_link_threads=posix
- LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lmach -lexc -lc"
- if test $ol_with_preemptive = auto ; then
- ol_with_preemptive=yes
- fi
-
+ LTHREAD_LIBS="$LTHREAD_LIBS -lc_r"
else
echo "$ac_t""no" 1>&6
fi
for ac_func in sched_yield pthread_yield
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2887: checking for $ac_func" >&5
+echo "configure:3138: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2892 "configure"
+#line 3143 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:2915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
if test $ac_cv_func_sched_yield = no -a \
$ac_cv_func_pthread_yield = no ; then
echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
-echo "configure:2943: checking for sched_yield in -lrt" >&5
+echo "configure:3194: checking for sched_yield in -lrt" >&5
ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lrt $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2951 "configure"
+#line 3202 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
sched_yield()
; return 0; }
EOF
-if { (eval echo configure:2962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3213: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
if test $ac_cv_func_sched_yield = no -a \
$ac_cv_func_pthread_yield = no ; then
echo $ac_n "checking for sched_yield in -lposix4""... $ac_c" 1>&6
-echo "configure:2992: checking for sched_yield in -lposix4" >&5
+echo "configure:3243: checking for sched_yield in -lposix4" >&5
ac_lib_var=`echo posix4'_'sched_yield | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lposix4 $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3000 "configure"
+#line 3251 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
sched_yield()
; return 0; }
EOF
-if { (eval echo configure:3011: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3262: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
for ac_func in pthread_kill
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3047: checking for $ac_func" >&5
+echo "configure:3298: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3052 "configure"
+#line 3303 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:3075: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+ for ac_func in \
+ pthread_attr_create pthread_attr_init \
+ pthread_attr_destroy pthread_attr_delete \
+ pthread_attr_setdetachstate pthread_attr_setdetach_np \
+
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:3357: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 3362 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:3385: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3106: checking for $ac_func" >&5
+echo "configure:3416: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3111 "configure"
+#line 3421 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:3134: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3444: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
if test $ol_with_preemptive = auto ; then
echo $ac_n "checking for preemptive Pthread implementation""... $ac_c" 1>&6
-echo "configure:3161: checking for preemptive Pthread implementation" >&5
+echo "configure:3471: checking for preemptive Pthread implementation" >&5
if test "$cross_compiling" = yes; then
{ echo "configure: error: crossing compiling: use --with-preemptive=yes|no|manual" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 3167 "configure"
+#line 3477 "configure"
#include "confdefs.h"
#include <sys/types.h>
#ifdef HAVE_PTHREAD_SETCONCURRENCY
(void) pthread_setconcurrency(2);
-#elif HAVE_THR_SETCONCURRENCY
+#else
+#ifdef HAVE_THR_SETCONCURRENCY
/* Set Solaris LWP concurrency to 2 */
thr_setconcurrency(2);
+#endif
#endif
pthread_create(&t, NULL, (void *) task, NULL);
#if HAVE_SCHED_YIELD
sched_yield(); /* make sure task runs first */
#else
-#if defined(HAVE_PTHREAD_YIELD)
+#ifdef HAVE_PTHREAD_YIELD
pthread_yield(); /* make sure task runs first */
#endif
#endif
}
EOF
-if { (eval echo configure:3219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3531: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ol_pthread_preemptive=yes
else
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3260: checking for $ac_hdr" >&5
+echo "configure:3572: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3265 "configure"
+#line 3577 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3270: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3582: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
ol_with_threads=found
echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
-echo "configure:3300: checking for cthread_fork" >&5
+echo "configure:3612: checking for cthread_fork" >&5
if eval "test \"`echo '$''{'ac_cv_func_cthread_fork'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3305 "configure"
+#line 3617 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char cthread_fork(); below. */
; return 0; }
EOF
-if { (eval echo configure:3328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_cthread_fork=yes"
else
if test $ol_link_threads = no ; then
echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
-echo "configure:3350: checking for cthread_fork with -all_load" >&5
+echo "configure:3662: checking for cthread_fork with -all_load" >&5
if eval "test \"`echo '$''{'ol_cv_cthread_all_load'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
save_LIBS="$LIBS"
LIBS="-all_load $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3358 "configure"
+#line 3670 "configure"
#include "confdefs.h"
#include <mach/cthreads.h>
int main() {
; return 0; }
EOF
-if { (eval echo configure:3367: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
ol_cv_cthread_all_load=yes
else
if test $ol_link_threads != no ; then
: check for cthread specific functionality here
+ cat >> confdefs.h <<\EOF
+#define HAVE_MACH_CTHREADS 1
+EOF
+
else
{ echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
fi
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3406: checking for $ac_hdr" >&5
+echo "configure:3722: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3411 "configure"
+#line 3727 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3416: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3732: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
-echo "configure:3444: checking for thr_create in -lthread" >&5
+echo "configure:3760: checking for thr_create in -lthread" >&5
ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lthread $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3452 "configure"
+#line 3768 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
thr_create()
; return 0; }
EOF
-if { (eval echo configure:3463: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3779: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3502: checking for $ac_hdr" >&5
+echo "configure:3818: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3507 "configure"
+#line 3823 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3512: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3828: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
if test $ac_cv_header_lwp_lwp_h = yes ; then
echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
-echo "configure:3540: checking for lwp_create in -llwp" >&5
+echo "configure:3856: checking for lwp_create in -llwp" >&5
ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-llwp $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3548 "configure"
+#line 3864 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
lwp_create()
; return 0; }
EOF
-if { (eval echo configure:3559: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3875: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3611: checking for $ac_hdr" >&5
+echo "configure:3927: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3616 "configure"
+#line 3932 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3621: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3937: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
for ac_func in sched_yield pthread_yield
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3650: checking for $ac_func" >&5
+echo "configure:3966: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3655 "configure"
+#line 3971 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:3678: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3994: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
echo $ac_n "checking for LinuxThreads""... $ac_c" 1>&6
-echo "configure:3704: checking for LinuxThreads" >&5
+echo "configure:4020: checking for LinuxThreads" >&5
if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3725: checking for $ac_hdr" >&5
+echo "configure:4041: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3730 "configure"
+#line 4046 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3735: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4051: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3765: checking for $ac_hdr" >&5
+echo "configure:4081: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3770 "configure"
+#line 4086 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3775: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4091: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3805: checking for $ac_hdr" >&5
+echo "configure:4121: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3810 "configure"
+#line 4126 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3815: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4131: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
fi
-if test $ol_with_threads = yes ; then
+if test $ol_with_threads != no ; then
cat >> confdefs.h <<\EOF
#define _REENTRANT 1
EOF
cat >> confdefs.h <<\EOF
#define _THREAD_SAFE 1
+EOF
+
+ cat >> confdefs.h <<\EOF
+#define _THREADSAFE 1
EOF
fi
ol_link_ldbm=no
if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then
echo $ac_n "checking for DB2 library""... $ac_c" 1>&6
-echo "configure:3879: checking for DB2 library" >&5
+echo "configure:4199: checking for DB2 library" >&5
if eval "test \"`echo '$''{'ol_cv_lib_db2'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ol_LIBS="$LIBS"
echo $ac_n "checking for db_open in -ldb""... $ac_c" 1>&6
-echo "configure:3885: checking for db_open in -ldb" >&5
+echo "configure:4205: checking for db_open in -ldb" >&5
ac_lib_var=`echo db'_'db_open | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-ldb $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3893 "configure"
+#line 4213 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
db_open()
; return 0; }
EOF
-if { (eval echo configure:3904: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4224: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3935: checking for $ac_hdr" >&5
+echo "configure:4255: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3940 "configure"
+#line 4260 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3945: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4265: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
if test $ac_cv_header_db_h = yes ; then
echo $ac_n "checking if db.h is DB2""... $ac_c" 1>&6
-echo "configure:3973: checking if db.h is DB2" >&5
+echo "configure:4293: checking if db.h is DB2" >&5
if eval "test \"`echo '$''{'ol_cv_header_db2'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3979 "configure"
+#line 4299 "configure"
#include "confdefs.h"
# include <db.h>
echo $ac_n "checking for Berkeley DB2""... $ac_c" 1>&6
-echo "configure:4011: checking for Berkeley DB2" >&5
+echo "configure:4331: checking for Berkeley DB2" >&5
if eval "test \"`echo '$''{'ol_cv_berkeley_db2'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db ; then
echo $ac_n "checking for Berkeley DB library""... $ac_c" 1>&6
-echo "configure:4057: checking for Berkeley DB library" >&5
+echo "configure:4377: checking for Berkeley DB library" >&5
if eval "test \"`echo '$''{'ol_cv_lib_db'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ol_LIBS="$LIBS"
echo $ac_n "checking for dbopen""... $ac_c" 1>&6
-echo "configure:4063: checking for dbopen" >&5
+echo "configure:4383: checking for dbopen" >&5
if eval "test \"`echo '$''{'ac_cv_func_dbopen'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4068 "configure"
+#line 4388 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char dbopen(); below. */
; return 0; }
EOF
-if { (eval echo configure:4091: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_dbopen=yes"
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6
-echo "configure:4110: checking for dbopen in -ldb" >&5
+echo "configure:4430: checking for dbopen in -ldb" >&5
ac_lib_var=`echo db'_'dbopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-ldb $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4118 "configure"
+#line 4438 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
dbopen()
; return 0; }
EOF
-if { (eval echo configure:4129: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4449: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4164: checking for $ac_hdr" >&5
+echo "configure:4484: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4169 "configure"
+#line 4489 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4174: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4494: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
echo $ac_n "checking for Berkeley DB""... $ac_c" 1>&6
-echo "configure:4210: checking for Berkeley DB" >&5
+echo "configure:4530: checking for Berkeley DB" >&5
if eval "test \"`echo '$''{'ol_cv_berkeley_db'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4263: checking for $ac_hdr" >&5
+echo "configure:4583: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4268 "configure"
+#line 4588 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4273: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4593: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
-echo "configure:4308: checking for GDBM library" >&5
+echo "configure:4628: checking for GDBM library" >&5
if eval "test \"`echo '$''{'ol_cv_lib_gdbm'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ol_LIBS="$LIBS"
echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
-echo "configure:4314: checking for gdbm_open" >&5
+echo "configure:4634: checking for gdbm_open" >&5
if eval "test \"`echo '$''{'ac_cv_func_gdbm_open'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4319 "configure"
+#line 4639 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char gdbm_open(); below. */
; return 0; }
EOF
-if { (eval echo configure:4342: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4662: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_gdbm_open=yes"
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
-echo "configure:4361: checking for gdbm_open in -lgdbm" >&5
+echo "configure:4681: checking for gdbm_open in -lgdbm" >&5
ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lgdbm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4369 "configure"
+#line 4689 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
gdbm_open()
; return 0; }
EOF
-if { (eval echo configure:4380: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4700: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4415: checking for $ac_hdr" >&5
+echo "configure:4735: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4420 "configure"
+#line 4740 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4425: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4745: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
done
echo $ac_n "checking for db""... $ac_c" 1>&6
-echo "configure:4452: checking for db" >&5
+echo "configure:4772: checking for db" >&5
if eval "test \"`echo '$''{'ol_cv_gdbm'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = ndbm ; then
echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
-echo "configure:4486: checking for NDBM library" >&5
+echo "configure:4806: checking for NDBM library" >&5
if eval "test \"`echo '$''{'ol_cv_lib_ndbm'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ol_LIBS="$LIBS"
echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
-echo "configure:4492: checking for dbm_open" >&5
+echo "configure:4812: checking for dbm_open" >&5
if eval "test \"`echo '$''{'ac_cv_func_dbm_open'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4497 "configure"
+#line 4817 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char dbm_open(); below. */
; return 0; }
EOF
-if { (eval echo configure:4520: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4840: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_dbm_open=yes"
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
-echo "configure:4539: checking for dbm_open in -lndbm" >&5
+echo "configure:4859: checking for dbm_open in -lndbm" >&5
ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lndbm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4547 "configure"
+#line 4867 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
dbm_open()
; return 0; }
EOF
-if { (eval echo configure:4558: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4878: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
-echo "configure:4578: checking for dbm_open in -ldbm" >&5
+echo "configure:4898: checking for dbm_open in -ldbm" >&5
ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-ldbm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4586 "configure"
+#line 4906 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
dbm_open()
; return 0; }
EOF
-if { (eval echo configure:4597: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4917: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4634: checking for $ac_hdr" >&5
+echo "configure:4954: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4639 "configure"
+#line 4959 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4644: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4964: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
done
echo $ac_n "checking for db""... $ac_c" 1>&6
-echo "configure:4671: checking for db" >&5
+echo "configure:4991: checking for db" >&5
if eval "test \"`echo '$''{'ol_cv_ndbm'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test $ol_enable_wrappers = yes ; then
echo $ac_n "checking for hosts_access in -lwrap""... $ac_c" 1>&6
-echo "configure:4719: checking for hosts_access in -lwrap" >&5
+echo "configure:5039: checking for hosts_access in -lwrap" >&5
ac_lib_var=`echo wrap'_'hosts_access | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lwrap $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4727 "configure"
+#line 5047 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
hosts_access()
; return 0; }
EOF
-if { (eval echo configure:4738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5058: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4784: checking for $ac_hdr" >&5
+echo "configure:5104: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4789 "configure"
+#line 5109 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4794: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5114: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
if test $ol_link_termcap = no ; then
echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
-echo "configure:4823: checking for tputs in -ltermcap" >&5
+echo "configure:5143: checking for tputs in -ltermcap" >&5
ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-ltermcap $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4831 "configure"
+#line 5151 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
tputs()
; return 0; }
EOF
-if { (eval echo configure:4842: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
if test $ol_link_termcap = no ; then
echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
-echo "configure:4875: checking for initscr in -lncurses" >&5
+echo "configure:5195: checking for initscr in -lncurses" >&5
ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lncurses $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4883 "configure"
+#line 5203 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
initscr()
; return 0; }
EOF
-if { (eval echo configure:4894: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5214: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
# FreeBSD (and others) have crypt(3) in -lcrypt
if test $ol_enable_crypt != no ; then
echo $ac_n "checking for crypt""... $ac_c" 1>&6
-echo "configure:4936: checking for crypt" >&5
+echo "configure:5256: checking for crypt" >&5
if eval "test \"`echo '$''{'ac_cv_func_crypt'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4941 "configure"
+#line 5261 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char crypt(); below. */
; return 0; }
EOF
-if { (eval echo configure:4964: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5284: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_crypt=yes"
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
-echo "configure:4983: checking for crypt in -lcrypt" >&5
+echo "configure:5303: checking for crypt in -lcrypt" >&5
ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lcrypt $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4991 "configure"
+#line 5311 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
crypt()
; return 0; }
EOF
-if { (eval echo configure:5002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5322: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
# FreeBSD (and others) have setproctitle(3) in -lutil
if test $ol_enable_proctitle != no ; then
echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
-echo "configure:5046: checking for setproctitle" >&5
+echo "configure:5366: checking for setproctitle" >&5
if eval "test \"`echo '$''{'ac_cv_func_setproctitle'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5051 "configure"
+#line 5371 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char setproctitle(); below. */
; return 0; }
EOF
-if { (eval echo configure:5074: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5394: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_setproctitle=yes"
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
-echo "configure:5093: checking for setproctitle in -lutil" >&5
+echo "configure:5413: checking for setproctitle in -lutil" >&5
ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lutil $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5101 "configure"
+#line 5421 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
setproctitle()
; return 0; }
EOF
-if { (eval echo configure:5112: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5432: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:5147: checking for ANSI C header files" >&5
+echo "configure:5467: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5152 "configure"
+#line 5472 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5160: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5480: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 5177 "configure"
+#line 5497 "configure"
#include "confdefs.h"
#include <string.h>
EOF
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 5195 "configure"
+#line 5515 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
:
else
cat > conftest.$ac_ext <<EOF
-#line 5216 "configure"
+#line 5536 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
exit (0); }
EOF
-if { (eval echo configure:5227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
:
else
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
-echo "configure:5260: checking for $ac_hdr that defines DIR" >&5
+echo "configure:5580: checking for $ac_hdr that defines DIR" >&5
if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5265 "configure"
+#line 5585 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_hdr>
DIR *dirp = 0;
; return 0; }
EOF
-if { (eval echo configure:5273: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5593: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "ac_cv_header_dirent_$ac_safe=yes"
else
# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
if test $ac_header_dirent = dirent.h; then
echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
-echo "configure:5298: checking for opendir in -ldir" >&5
+echo "configure:5618: checking for opendir in -ldir" >&5
ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-ldir $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5306 "configure"
+#line 5626 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
opendir()
; return 0; }
EOF
-if { (eval echo configure:5317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
else
echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:5339: checking for opendir in -lx" >&5
+echo "configure:5659: checking for opendir in -lx" >&5
ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lx $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5347 "configure"
+#line 5667 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
opendir()
; return 0; }
EOF
-if { (eval echo configure:5358: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5678: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
fi
echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:5381: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:5701: checking for sys/wait.h that is POSIX.1 compatible" >&5
if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5386 "configure"
+#line 5706 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/wait.h>
s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
; return 0; }
EOF
-if { (eval echo configure:5402: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5722: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_sys_wait_h=yes
else
limits.h \
malloc.h \
regex.h \
+ pwd.h \
sgtty.h \
sys/file.h \
sys/filio.h \
sys/errno.h \
sys/ioctl.h \
sys/param.h \
+ sys/resource.h \
sys/socket.h \
sys/syslog.h \
sys/time.h \
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5450: checking for $ac_hdr" >&5
+echo "configure:5772: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5455 "configure"
+#line 5777 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5460: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5782: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:5488: checking for uid_t in sys/types.h" >&5
+echo "configure:5810: checking for uid_t in sys/types.h" >&5
if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5493 "configure"
+#line 5815 "configure"
#include "confdefs.h"
#include <sys/types.h>
EOF
fi
echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
-echo "configure:5522: checking type of array argument to getgroups" >&5
+echo "configure:5844: checking type of array argument to getgroups" >&5
if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_type_getgroups=cross
else
cat > conftest.$ac_ext <<EOF
-#line 5530 "configure"
+#line 5852 "configure"
#include "confdefs.h"
/* Thanks to Mike Rendell for this test. */
}
EOF
-if { (eval echo configure:5555: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5877: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_type_getgroups=gid_t
else
if test $ac_cv_type_getgroups = cross; then
cat > conftest.$ac_ext <<EOF
-#line 5569 "configure"
+#line 5891 "configure"
#include "confdefs.h"
#include <unistd.h>
EOF
echo $ac_n "checking for mode_t""... $ac_c" 1>&6
-echo "configure:5593: checking for mode_t" >&5
+echo "configure:5915: checking for mode_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5598 "configure"
+#line 5920 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
fi
echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:5626: checking for off_t" >&5
+echo "configure:5948: checking for off_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5631 "configure"
+#line 5953 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
fi
echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:5659: checking for pid_t" >&5
+echo "configure:5981: checking for pid_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5664 "configure"
+#line 5986 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
fi
echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:5692: checking return type of signal handlers" >&5
+echo "configure:6014: checking return type of signal handlers" >&5
if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5697 "configure"
+#line 6019 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
int i;
; return 0; }
EOF
-if { (eval echo configure:5714: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6036: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_type_signal=void
else
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:5733: checking for size_t" >&5
+echo "configure:6055: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5738 "configure"
+#line 6060 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
fi
echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:5766: checking for uid_t in sys/types.h" >&5
+echo "configure:6088: checking for uid_t in sys/types.h" >&5
if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5771 "configure"
+#line 6093 "configure"
#include "confdefs.h"
#include <sys/types.h>
EOF
fi
echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
-echo "configure:5800: checking for st_blksize in struct stat" >&5
+echo "configure:6122: checking for st_blksize in struct stat" >&5
if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5805 "configure"
+#line 6127 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
struct stat s; s.st_blksize;
; return 0; }
EOF
-if { (eval echo configure:5813: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6135: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_st_blksize=yes
else
fi
echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:5834: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:6156: checking whether time.h and sys/time.h may both be included" >&5
if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5839 "configure"
+#line 6161 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
struct tm *tp;
; return 0; }
EOF
-if { (eval echo configure:5848: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6170: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_time=yes
else
fi
echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:5869: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:6191: checking whether struct tm is in sys/time.h or time.h" >&5
if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5874 "configure"
+#line 6196 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <time.h>
struct tm *tp; tp->tm_sec;
; return 0; }
EOF
-if { (eval echo configure:5882: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6204: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_tm=time.h
else
echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
-echo "configure:5905: checking if toupper() requires islower()" >&5
+echo "configure:6227: checking if toupper() requires islower()" >&5
if eval "test \"`echo '$''{'ol_cv_c_upper_lower'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ol_cv_c_upper_lower=safe
else
cat > conftest.$ac_ext <<EOF
-#line 5914 "configure"
+#line 6236 "configure"
#include "confdefs.h"
#include <ctype.h>
exit(1);
}
EOF
-if { (eval echo configure:5926: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6248: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ol_cv_c_upper_lower=no
else
fi
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:5949: checking for working const" >&5
+echo "configure:6271: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5954 "configure"
+#line 6276 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:6003: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6325: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
-echo "configure:6026: checking for 8-bit clean memcmp" >&5
+echo "configure:6348: checking for 8-bit clean memcmp" >&5
if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_func_memcmp_clean=no
else
cat > conftest.$ac_ext <<EOF
-#line 6034 "configure"
+#line 6356 "configure"
#include "confdefs.h"
main()
}
EOF
-if { (eval echo configure:6044: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6366: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_func_memcmp_clean=yes
else
test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.o"
echo $ac_n "checking for strftime""... $ac_c" 1>&6
-echo "configure:6062: checking for strftime" >&5
+echo "configure:6384: checking for strftime" >&5
if eval "test \"`echo '$''{'ac_cv_func_strftime'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6067 "configure"
+#line 6389 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char strftime(); below. */
; return 0; }
EOF
-if { (eval echo configure:6090: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6412: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_strftime=yes"
else
echo "$ac_t""no" 1>&6
# strftime is in -lintl on SCO UNIX.
echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
-echo "configure:6112: checking for strftime in -lintl" >&5
+echo "configure:6434: checking for strftime in -lintl" >&5
ac_lib_var=`echo intl'_'strftime | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lintl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6120 "configure"
+#line 6442 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
strftime()
; return 0; }
EOF
-if { (eval echo configure:6131: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6453: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
fi
echo $ac_n "checking for vprintf""... $ac_c" 1>&6
-echo "configure:6158: checking for vprintf" >&5
+echo "configure:6480: checking for vprintf" >&5
if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6163 "configure"
+#line 6485 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char vprintf(); below. */
; return 0; }
EOF
-if { (eval echo configure:6186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6508: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_vprintf=yes"
else
if test "$ac_cv_func_vprintf" != yes; then
echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
-echo "configure:6210: checking for _doprnt" >&5
+echo "configure:6532: checking for _doprnt" >&5
if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6215 "configure"
+#line 6537 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char _doprnt(); below. */
; return 0; }
EOF
-if { (eval echo configure:6238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func__doprnt=yes"
else
for ac_func in vsnprintf
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6267: checking for $ac_func" >&5
+echo "configure:6589: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6272 "configure"
+#line 6594 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:6295: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6617: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
fi
echo $ac_n "checking for wait3 that fills in rusage""... $ac_c" 1>&6
-echo "configure:6322: checking for wait3 that fills in rusage" >&5
+echo "configure:6644: checking for wait3 that fills in rusage" >&5
if eval "test \"`echo '$''{'ac_cv_func_wait3_rusage'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_func_wait3_rusage=no
else
cat > conftest.$ac_ext <<EOF
-#line 6330 "configure"
+#line 6652 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
}
}
EOF
-if { (eval echo configure:6361: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6683: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_func_wait3_rusage=yes
else
gethostname \
gettimeofday \
getdtablesize \
+ getpwuid \
lockf \
memcpy \
memmove \
mkstemp \
mktime \
+ res_search \
select \
setpwfile \
setsid \
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6416: checking for $ac_func" >&5
+echo "configure:6740: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6421 "configure"
+#line 6745 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:6444: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6768: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
for ac_func in getopt strdup tempnam
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6472: checking for $ac_func" >&5
+echo "configure:6796: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6477 "configure"
+#line 6801 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:6500: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6824: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
# Check Configuration
echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
-echo "configure:6530: checking declaration of sys_errlist" >&5
+echo "configure:6854: checking declaration of sys_errlist" >&5
if eval "test \"`echo '$''{'ol_cv_dcl_sys_errlist'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6536 "configure"
+#line 6860 "configure"
#include "confdefs.h"
#include <stdio.h>
char *c = (char *) *sys_errlist
; return 0; }
EOF
-if { (eval echo configure:6546: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6870: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ol_cv_dcl_sys_errlist=yes
else
EOF
echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
-echo "configure:6567: checking existence of sys_errlist" >&5
+echo "configure:6891: checking existence of sys_errlist" >&5
if eval "test \"`echo '$''{'ol_cv_have_sys_errlist'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6573 "configure"
+#line 6897 "configure"
#include "confdefs.h"
#include <errno.h>
int main() {
char *c = (char *) *sys_errlist
; return 0; }
EOF
-if { (eval echo configure:6580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6904: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
ol_cv_have_sys_errlist=yes
else
BUILD_SLURPD=yes
fi
-if test $ol_enable_ldapd != no ; then
+if test $ol_link_isode != no ; then
BUILD_LDAPD=yes
fi
-
trap '' 1 2 15
s%@FINGER@%$FINGER%g
s%@CC@%$CC%g
s%@CPP@%$CPP%g
+s%@PEPSY@%$PEPSY%g
s%@LIBOBJS@%$LIBOBJS%g
s%@BUILD_LDAPD@%$BUILD_LDAPD%g
s%@BUILD_SLAPD@%$BUILD_SLAPD%g
dnl SLURPD OPTIONS
OL_ARG_ENABLE(slurpd,[ --enable-slurpd enable building slurpd], auto)dnl
+# validate options
+if test $ol_enable_referrals = no ; then
+ if test $ol_enable_dns = yes ; then
+ AC_MSG_WARN([dns disabled, ignoring --enable-dns argument])
+ fi
+ ol_enable_dns=no
+fi
+
if test $ol_enable_slapd = no ; then
dnl SLAPD was specificallly disabled
if test $ol_enable_ldbm = yes ; then
BUILD_LDBM=no
BUILD_PASSWD=no
BUILD_SHELL=no
+BUILD_THREAD=no
KRB_LIBS=
TERMCAP_LIBS=
AC_ERROR([ if cross compiling, add --enable-x-compile.])
fi
-AC_PROG_GCC_TRADITIONAL
+dnl OpenLDAP requires STDC features
+dnl AC_PROG_GCC_TRADITIONAL
AC_PROG_CPP
AC_CHECK_LIB(gen, main)
])
+dnl Check for resolv
+AC_CHECK_LIB(resolv, res_search)
+
dnl HP-UX requires -lV3
AC_CHECK_LIB(V3, sigset)
+# ISODE tests
+ol_link_isode=no
+if test $ol_enable_ldapd != no ; then
+ dnl look for ISODE libraries
+ AC_CHECK_LIB(xtpp, main, [
+ ol_link_isode=yes
+ AC_DEFINE(HAVE_XTPP,1)
+ LDAPD_LIBS="$LDAPD_LIBS -lxtpp -lxtdsap -lxtisode -losi"
+ ],:,[-lxtdsap -lxtisode -losi])
+ AC_CHECK_LIB(dsap, main, [
+ ol_link_isode=yes
+ AC_DEFINE(HAVE_DSAP,1)
+ LDAPD_LIBS="$LDAPD_LIBS -ldsap"
+ ],:,[-lisode])
+ AC_CHECK_LIB(isode, main, [
+ ol_link_isode=yes
+ AC_DEFINE(HAVE_ISODE,1)
+ LDAPD_LIBS="$LDAPD_LIBS -lisode"
+ ],:)
+fi
+
+if test $ol_link_isode != no; then
+ AC_CHECK_LIB(pp, main, [
+ AC_DEFINE(HAVE_PP,1)
+ LDAPD_LIBS="-lpp $LDAPD_LIBS"
+ ],:)
+
+ AC_PATH_PROG(PEPSY, pepsy)
+fi
+
if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 ; then
AC_CHECK_HEADERS(kerberosIV/krb.h kerberosIV/des.h)
dnl try -pthread
AC_CACHE_CHECK([for pthread_create with -pthread],
[ol_cv_pthread_flag], [
- dnl save the CPPFLAGS
+ dnl save the flags
save_LIBS="$LIBS"
LIBS="-pthread $LIBS"
- AC_TRY_LINK([#include <pthread.h>],[
- pthread_create((pthread_t*) 0,
- (pthread_attr_t*) 0, 0, 0);
+ AC_TRY_LINK([char pthread();],[
+ pthread_create();
], ol_cv_pthread_flag=yes, ol_cv_pthread_flag=no)
dnl restore the LIBS
LIBS="$save_LIBS"
fi
if test $ol_link_threads = no ; then
- dnl try -lpthread
- save_LIBS="$LIBS"
- AC_CHECK_LIB(pthread, pthread_create, [
+ dnl try -thread
+ AC_CACHE_CHECK([for pthread_create with -thread],
+ [ol_cv_thread_flag], [
+ dnl save the flags
+ save_LIBS="$LIBS"
+ LIBS="-thread $LIBS"
+ AC_TRY_LINK([char pthread();],[
+ pthread_create();
+ ], ol_cv_thread_flag=yes, ol_cv_thread_flag=no)
+ dnl restore the LIBS
+ LIBS="$save_LIBS"
+ ])
+
+ if test $ol_cv_thread_flag = yes ; then
+ LTHREAD_LIBS="$LTHREAD_LIBS -thread"
ol_link_threads=posix
- LTHREAD_LIBS="$LTHREAD_LIBS -lpthread"])
- LIBS="$save_LIBS"
+ fi
fi
if test $ol_link_threads = no ; then
- dnl try -lc_r
+ dnl try DEC Threads -lpthread -lexc
save_LIBS="$LIBS"
- AC_CHECK_LIB(c_r, pthread_create, [
+ AC_CHECK_LIB(pthread, pthread_join, [
ol_link_threads=posix
- LTHREAD_LIBS="$LTHREAD_LIBS -lc_r"])
+ LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lexc"
+ if test $ol_with_preemptive = auto ; then
+ ol_with_preemptive=yes
+ fi
+ ],,[-lexc])
LIBS="$save_LIBS"
fi
if test $ol_link_threads = no ; then
- dnl try DEC Threads
+ dnl try DEC Threads -lpthreads -lmach -lexc -lc_r
save_LIBS="$LIBS"
- AC_CHECK_LIB(pthread, pthread_create, [
- AC_DEFINE(HAVE_DCE)
+ AC_CHECK_LIB(pthreads, pthread_join, [
ol_link_threads=posix
- LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lmach -lexc -lc"
+ LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads -lmach -lexc -lc_r"
if test $ol_with_preemptive = auto ; then
ol_with_preemptive=yes
fi
- ],,[-lmach -lexc -lc])
+ ],,[-lmach -lexc -lc_r])
+ LIBS="$save_LIBS"
+ fi
+
+ if test $ol_link_threads = no ; then
+ dnl try -lpthread
+ save_LIBS="$LIBS"
+ AC_CHECK_LIB(pthread, pthread_create, [
+ ol_link_threads=posix
+ LTHREAD_LIBS="$LTHREAD_LIBS -lpthread"])
+ LIBS="$save_LIBS"
+ fi
+
+ if test $ol_link_threads = no ; then
+ dnl try -lc_r
+ save_LIBS="$LIBS"
+ AC_CHECK_LIB(c_r, pthread_create, [
+ ol_link_threads=posix
+ LTHREAD_LIBS="$LTHREAD_LIBS -lc_r"])
LIBS="$save_LIBS"
fi
if test $ol_link_threads != no ; then
AC_DEFINE(HAVE_PTHREADS)
- dnl save DEFS/LIBS
+ dnl save flags
save_CPPFLAGS="$CPPFLAGS"
save_LIBS="$LIBS"
LIBS="$LTHREAD_LIBS $LIBS"
dnl Check functions for compatibility
AC_CHECK_FUNCS(pthread_kill)
-dnl AC_CHECK_FUNCS( \
-dnl pthread_attr_create pthread_attr_init \
-dnl pthread_attr_destroy pthread_attr_delete \
-dnl pthread_attr_setdetachstate pthread_attr_setdetach_np \
-dnl )
+ AC_CHECK_FUNCS( \
+ pthread_attr_create pthread_attr_init \
+ pthread_attr_destroy pthread_attr_delete \
+ pthread_attr_setdetachstate pthread_attr_setdetach_np \
+ )
dnl Check for setconcurreny functions
AC_CHECK_FUNCS( \
#ifdef HAVE_PTHREAD_SETCONCURRENCY
(void) pthread_setconcurrency(2);
-#elif HAVE_THR_SETCONCURRENCY
+#else
+#ifdef HAVE_THR_SETCONCURRENCY
/* Set Solaris LWP concurrency to 2 */
thr_setconcurrency(2);
+#endif
#endif
pthread_create(&t, NULL, (void *) task, NULL);
#if HAVE_SCHED_YIELD
sched_yield(); /* make sure task runs first */
#else
-#if defined(HAVE_PTHREAD_YIELD)
+#ifdef HAVE_PTHREAD_YIELD
pthread_yield(); /* make sure task runs first */
#endif
#endif
dnl strtok_r \
dnl )
- dnl restore DEFS/LIBS
+ dnl restore flags
CPPFLAGS="$save_CPPFLAGS"
LIBS="$save_LIBS"
else
dnl this test needs work
AC_CACHE_CHECK([for cthread_fork with -all_load],
[ol_cv_cthread_all_load], [
- dnl save the CPPFLAGS
+ dnl save the flags
save_LIBS="$LIBS"
LIBS="-all_load $LIBS"
AC_TRY_LINK([#include <mach/cthreads.h>],[
if test $ol_link_threads != no ; then
: check for cthread specific functionality here
+ AC_DEFINE(HAVE_MACH_CTHREADS,1)
else
AC_MSG_ERROR([could not link with Mach CThreads])
fi
AC_CHECK_HEADERS(thread.h synch.h)
fi
-if test $ol_with_threads = yes ; then
+if test $ol_with_threads != no ; then
dnl needed to get reentrant/threadsafe versions
dnl
dnl hopefully this will not cause problems with
dnl
AC_DEFINE(_REENTRANT,1)
AC_DEFINE(_THREAD_SAFE,1)
+ AC_DEFINE(_THREADSAFE,1)
fi
dnl ----------------------------------------------------------------
limits.h \
malloc.h \
regex.h \
+ pwd.h \
sgtty.h \
sys/file.h \
sys/filio.h \
sys/errno.h \
sys/ioctl.h \
sys/param.h \
+ sys/resource.h \
sys/socket.h \
sys/syslog.h \
sys/time.h \
gethostname \
gettimeofday \
getdtablesize \
+ getpwuid \
lockf \
memcpy \
memmove \
mkstemp \
mktime \
+ res_search \
select \
setpwfile \
setsid \
BUILD_SLURPD=yes
fi
-if test $ol_enable_ldapd != no ; then
+if test $ol_link_isode != no ; then
BUILD_LDAPD=yes
fi
dnl final output
dnl
-dnl AC_OUTPUT( \
-dnl contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
-dnl contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
-dnl contrib/whois++/Makefile:build/top.mk:contrib/whois++/Makefile.in:build/rules.mk \
-dnl [date > stamp-h])
-
AC_OUTPUT( \
Makefile:build/top.mk:Makefile.in:build/dir.mk \
doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
ldap_value_free( values );
} else {
#endif
- value = strdup( ldap_dn2ufn( ldap_get_dn( ld, result ) ) );
+ value = ldap_dn2ufn( ptr = ldap_get_dn( ld, result ) );
+ free( ptr );
if ( (ptr = index( value, ',' )) != NULL )
*ptr = '\0';
printFormatted( lineLength, FALSE, stdout, "%-19s %s",
"Contact:", value );
+ free( value );
#if defined(UOFA)
}
#endif
-.TH LDAP 3 "13 November 1995" "U-M LDAP LDVERSION"
+.TH LDAP 3 "10 November 1998" "OpenLDAP LDVERSION"
.SH NAME
ldap - Lightweight Directory Access Protocol package
.SH SYNOPSIS
.LP
The Lightweight Directory Access Protocol provides TCP/IP access to
the X.500 Directory or to a stand-alone LDAP server.
-The University of Michigan LDAP package includes a stand-alone server in
+The OpenLDAP LDAP package includes a stand-alone server in
.BR slapd (8),
an LDAP to X.500 gateway in
.BR ldapd (8),
.SH AUTHORS
Tim Howes, Mark Smith, Gordon Good, Lance Sloan, and Steve Rothwell from
the University of Michigan, along with help from lots of others.
+.SH ACKNOWLEDGEMENTS
+.B OpenLDAP
+is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
+.B OpenLDAP
+is derived from University of Michigan LDAP 3.3 Release.
-.TH SLAPD.CONF 5 "13 November 1995" "U-M LDAP LDVERSION"
+.TH SLAPD.CONF 5 "22 September 1998" "OpenLDAP LDVERSION"
.SH NAME
slapd.conf \- configuration file for slapd, the stand-alone LDAP daemon
.SH SYNOPSIS
Specify the size in bytes of the in-memory cache associated
with each open index file. If not supported by the underlying database
method, this option is ignored without comment. The default is 100000 bytes.
+.B dbcachenowsync
+Specify that database writes should not be immediately synchronized
+with in memory changes. Enabling this option may improving performance
+at the expense of data security.
.TP
.B directory <directory>
Specify the directory where the LDBM files containing the database and
.BR slurpd (8),
.LP
"The SLAPD and SLURPD Administrator's Guide"
+.SH ACKNOWLEDGEMENTS
+.B OpenLDAP
+is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
+.B OpenLDAP
+is derived from University of Michigan LDAP 3.3 Release.
#ifndef _AVL
#define _AVL
+#include <ldap_cdefs.h>
+
/*
* this structure represents a generic avl tree node.
*/
+LDAP_BEGIN_DECL
+
typedef struct avlnode {
caddr_t avl_data;
- char avl_bf;
+ signed char avl_bf;
struct avlnode *avl_left;
struct avlnode *avl_right;
} Avlnode;
#define NULLAVL ((Avlnode *) NULL)
/* balance factor values */
-#define LH -1
+#define LH (-1)
#define EH 0
#define RH 1
/* avl routines */
-#define avl_getone(x) (x == 0 ? 0 : (x)->avl_data)
-#define avl_onenode(x) (x == 0 || ((x)->avl_left == 0 && (x)->avl_right == 0))
-extern int avl_insert();
-extern caddr_t avl_delete();
-extern caddr_t avl_find();
-extern caddr_t avl_getfirst();
-extern caddr_t avl_getnext();
-extern int avl_dup_error();
-extern int avl_apply();
+#define avl_getone(x) ((x) == 0 ? 0 : (x)->avl_data)
+#define avl_onenode(x) ((x) == 0 || ((x)->avl_left == 0 && (x)->avl_right == 0))
+
+/* looks like this function pointer is not used consistently */
+/* typedef int (*IFP)LDAP_P((caddr_t, caddr_t)); */
+typedef int (*IFP)();
+
+LDAP_F int
+avl_free LDAP_P(( Avlnode *root, IFP dfree ));
+
+LDAP_F int
+avl_insert LDAP_P((Avlnode **, caddr_t, IFP, IFP));
+
+LDAP_F caddr_t
+avl_delete LDAP_P((Avlnode **, caddr_t, IFP));
+
+LDAP_F caddr_t
+avl_find LDAP_P((Avlnode *, caddr_t, IFP));
+
+LDAP_F caddr_t
+avl_find_lin LDAP_P((Avlnode *, caddr_t, IFP));
+
+LDAP_F caddr_t
+avl_getfirst LDAP_P((Avlnode *));
+
+#ifdef AVL_REENTRANT
+LDAP_F caddr_t
+avl_getnext LDAP_P((Avlnode *, caddr_t ));
+#else
+LDAP_F caddr_t
+avl_getnext LDAP_P((void));
+#endif
+
+LDAP_F int
+avl_dup_error LDAP_P((void));
+
+LDAP_F int
+avl_apply LDAP_P((Avlnode *, IFP, caddr_t, int, int));
/* apply traversal types */
#define AVL_PREORDER 1
#define AVL_INORDER 2
#define AVL_POSTORDER 3
/* what apply returns if it ran out of nodes */
-#define AVL_NOMORE -6
+#define AVL_NOMORE (-6)
-typedef int (*IFP)();
+LDAP_END_DECL
#endif /* _AVL */
#ifndef _LDAP_H
#define _LDAP_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
+#include <ldap_cdefs.h>
-#ifdef WINSOCK
-#include "msdos.h"
-#include <winsock.h>
-#endif
-
-#if !defined( NEEDPROTOS ) && defined(__STDC__)
-#define NEEDPROTOS 1
-#endif
+LDAP_BEGIN_DECL
#define LDAP_PORT 389
#define LDAP_VERSION1 1
#define LDAP_VERSION2 2
+#define LDAP_VERSION3 3
#define LDAP_VERSION LDAP_VERSION2
-#define COMPAT20
-#define COMPAT30
-#if defined(COMPAT20) || defined(COMPAT30)
-#define COMPAT
+#define LDAP_COMPAT20
+#define LDAP_COMPAT30
+#if defined(LDAP_COMPAT20) || defined(LDAP_COMPAT30)
+#define LDAP_COMPAT
#endif
#define LDAP_MAX_ATTR_LEN 100
#ifdef LDAP_SYSLOG
extern int ldap_syslog;
extern int ldap_syslog_level;
-#endif
+#endif /* LDAP_SYSLOG */
+
#define LDAP_DEBUG_TRACE 0x001
#define LDAP_DEBUG_PACKETS 0x002
#define LDAP_DEBUG_ARGS 0x004
#define LDAP_DEBUG_PARSE 0x800
#define LDAP_DEBUG_ANY 0xffff
+/* this doesn't below as part of ldap.h */
#ifdef LDAP_SYSLOG
#define Debug( level, fmt, arg1, arg2, arg3 ) \
{ \
- if ( ldap_debug & level ) \
- fprintf( stderr, fmt, arg1, arg2, arg3 ); \
+ if ( ldap_debug & (level) ) \
+ fprintf( stderr, (fmt), (arg1), (arg2), (arg3) ); \
if ( ldap_syslog & level ) \
- syslog( ldap_syslog_level, fmt, arg1, arg2, arg3 ); \
+ syslog( ldap_syslog_level, (fmt), (arg1), (arg2), (arg3) ); \
}
#else /* LDAP_SYSLOG */
#ifndef WINSOCK
#define Debug( level, fmt, arg1, arg2, arg3 ) \
- if ( ldap_debug & level ) \
- fprintf( stderr, fmt, arg1, arg2, arg3 );
+ if ( ldap_debug & (level) ) \
+ fprintf( stderr, (fmt), (arg1), (arg2), (arg3) );
#else /* !WINSOCK */
extern void Debug( int level, char* fmt, ... );
#endif /* !WINSOCK */
BerElement *lm_ber; /* the ber encoded message contents */
struct ldapmsg *lm_chain; /* for search - next msg in the resp */
struct ldapmsg *lm_next; /* next response */
- unsigned long lm_time; /* used to maintain cache */
+ unsigned int lm_time; /* used to maintain cache */
} LDAPMessage;
#define NULLMSG ((LDAPMessage *) NULL)
typedef struct ldap_conn {
Sockbuf *lconn_sb;
int lconn_refcnt;
- unsigned long lconn_lastused; /* time */
+ time_t lconn_lastused; /* time */
int lconn_status;
#define LDAP_CONNST_NEEDSOCKET 1
#define LDAP_CONNST_CONNECTING 2
int ld_cldaptimeout;/* time between retries */
int ld_refhoplimit; /* limit on referral nesting */
unsigned long ld_options; /* boolean options */
-#ifdef LDAP_DNS
#define LDAP_OPT_DNS 0x00000001 /* use DN & DNS */
-#endif /* LDAP_DNS */
-#ifdef LDAP_REFERRALS
#define LDAP_OPT_REFERRALS 0x00000002 /* chase referrals */
-#endif /* LDAP_REFERRALS */
#define LDAP_OPT_RESTART 0x00000004 /* restart if EINTR occurs */
/* do not mess with the rest though */
/*
* handy macro to check whether LDAP struct is set up for CLDAP or not
*/
-#define LDAP_IS_CLDAP( ld ) ( ld->ld_sb.sb_naddr > 0 )
+#define LDAP_IS_CLDAP( ld ) ( (ld)->ld_sb.sb_naddr > 0 )
/*
#define LDAP_URL_ERR_BADSCOPE 3 /* URL scope string is invalid */
#define LDAP_URL_ERR_MEM 4 /* can't allocate memory space */
+/* this typedef is never used, only exists to rid of declaration
+ in function param list warning */
+typedef struct timeval LDAPtv;
-#ifndef NEEDPROTOS
-extern LDAP *ldap_open();
-extern LDAP *ldap_init();
-#ifdef STR_TRANSLATION
-extern void ldap_set_string_translators();
-#ifdef LDAP_CHARSET_8859
-extern int ldap_t61_to_8859();
-extern int ldap_8859_to_t61();
-#endif /* LDAP_CHARSET_8859 */
-#endif /* STR_TRANSLATION */
-extern LDAPMessage *ldap_first_entry();
-extern LDAPMessage *ldap_next_entry();
-extern char *ldap_get_dn();
-extern char *ldap_dn2ufn();
-extern char **ldap_explode_dn();
-extern char *ldap_first_attribute();
-extern char *ldap_next_attribute();
-extern char **ldap_get_values();
-extern struct berval **ldap_get_values_len();
-extern void ldap_value_free();
-extern void ldap_value_free_len();
-extern int ldap_count_values();
-extern int ldap_count_values_len();
-extern char *ldap_err2string();
-extern void ldap_getfilter_free();
-extern LDAPFiltDesc *ldap_init_getfilter();
-extern LDAPFiltDesc *ldap_init_getfilter_buf();
-extern LDAPFiltInfo *ldap_getfirstfilter();
-extern LDAPFiltInfo *ldap_getnextfilter();
-extern void ldap_setfilteraffixes();
-extern void ldap_build_filter();
-extern void ldap_flush_cache();
-extern void ldap_set_cache_options();
-extern void ldap_uncache_entry();
-extern void ldap_uncache_request();
-extern char *ldap_friendly_name();
-extern void ldap_free_friendlymap();
-extern LDAP *cldap_open();
-extern void cldap_setretryinfo();
-extern void cldap_close();
-extern LDAPFiltDesc *ldap_ufn_setfilter();
-extern int ldap_ufn_timeout();
-extern int ldap_sort_entries();
-extern int ldap_sort_values();
-extern int ldap_sort_strcasecmp();
-void ldap_free_urldesc();
-void ldap_set_rebind_proc();
-void ldap_enable_translation();
-
-
-#if defined(ultrix) || defined(VMS) || defined( nextstep )
-extern char *strdup();
-#endif
+/*
+ * in abandon.c:
+ */
+LDAP_F int ldap_abandon LDAP_P(( LDAP *ld, int msgid ));
-#else /* NEEDPROTOS */
-#if !defined(MACOS) && !defined(DOS) && !defined(_WIN32) && !defined(WINSOCK)
-#include <sys/time.h>
-#endif
-#if defined(WINSOCK)
-#include "proto-ld.h"
-#else
-#include "proto-ldap.h"
-#endif
+/*
+ * in add.c:
+ */
+LDAP_F int ldap_add LDAP_P(( LDAP *ld, char *dn, LDAPMod **attrs ));
+LDAP_F int ldap_add_s LDAP_P(( LDAP *ld, char *dn, LDAPMod **attrs ));
-#ifdef VMS
-extern char *strdup( const char *s );
-#endif
-#if defined(ultrix) || defined( nextstep )
-extern char *strdup();
-#endif
+/*
+ * in bind.c:
+ */
+LDAP_F int ldap_bind LDAP_P(( LDAP *ld, char *who, char *passwd, int authmethod ));
+LDAP_F int ldap_bind_s LDAP_P(( LDAP *ld, char *who, char *cred, int method ));
+LDAP_F void ldap_set_rebind_proc LDAP_P(( LDAP *ld,
+ int (*rebindproc) LDAP_P(( LDAP *ld, char **dnp, char **passwdp, int *authmethodp, int freeit ))
+));
-#endif /* NEEDPROTOS */
+/*
+ * in sbind.c:
+ */
+LDAP_F int ldap_simple_bind LDAP_P(( LDAP *ld, char *who, char *passwd ));
+LDAP_F int ldap_simple_bind_s LDAP_P(( LDAP *ld, char *who, char *passwd ));
+
+/*
+ * in kbind.c:
+ */
+LDAP_F int ldap_kerberos_bind_s LDAP_P(( LDAP *ld, char *who ));
+LDAP_F int ldap_kerberos_bind1 LDAP_P(( LDAP *ld, char *who ));
+LDAP_F int ldap_kerberos_bind1_s LDAP_P(( LDAP *ld, char *who ));
+LDAP_F int ldap_kerberos_bind2 LDAP_P(( LDAP *ld, char *who ));
+LDAP_F int ldap_kerberos_bind2_s LDAP_P(( LDAP *ld, char *who ));
+
+
+/*
+ * in cache.c
+ */
+LDAP_F int ldap_enable_cache LDAP_P(( LDAP *ld, long timeout, long maxmem ));
+LDAP_F void ldap_disable_cache LDAP_P(( LDAP *ld ));
+LDAP_F void ldap_set_cache_options LDAP_P(( LDAP *ld, unsigned long opts ));
+LDAP_F void ldap_destroy_cache LDAP_P(( LDAP *ld ));
+LDAP_F void ldap_flush_cache LDAP_P(( LDAP *ld ));
+LDAP_F void ldap_uncache_entry LDAP_P(( LDAP *ld, char *dn ));
+LDAP_F void ldap_uncache_request LDAP_P(( LDAP *ld, int msgid ));
+
+/*
+ * in compare.c:
+ */
+LDAP_F int ldap_compare LDAP_P(( LDAP *ld, char *dn, char *attr, char *value ));
+LDAP_F int ldap_compare_s LDAP_P(( LDAP *ld, char *dn, char *attr, char *value ));
+
+/*
+ * in delete.c:
+ */
+LDAP_F int ldap_delete LDAP_P(( LDAP *ld, char *dn ));
+LDAP_F int ldap_delete_s LDAP_P(( LDAP *ld, char *dn ));
+
+/*
+ * in error.c:
+ */
+LDAP_F int ldap_result2error LDAP_P(( LDAP *ld, LDAPMessage *r, int freeit ));
+LDAP_F char *ldap_err2string LDAP_P(( int err ));
+LDAP_F void ldap_perror LDAP_P(( LDAP *ld, char *s ));
+
+/*
+ * in modify.c:
+ */
+LDAP_F int ldap_modify LDAP_P(( LDAP *ld, char *dn, LDAPMod **mods ));
+LDAP_F int ldap_modify_s LDAP_P(( LDAP *ld, char *dn, LDAPMod **mods ));
+
+/*
+ * in modrdn.c:
+ */
+LDAP_F int ldap_modrdn LDAP_P(( LDAP *ld, char *dn, char *newrdn ));
+LDAP_F int ldap_modrdn_s LDAP_P(( LDAP *ld, char *dn, char *newrdn ));
+LDAP_F int ldap_modrdn2 LDAP_P(( LDAP *ld, char *dn, char *newrdn,
+ int deleteoldrdn ));
+LDAP_F int ldap_modrdn2_s LDAP_P(( LDAP *ld, char *dn, char *newrdn,
+ int deleteoldrdn));
+
+/*
+ * in open.c:
+ */
+LDAP_F LDAP *ldap_open LDAP_P(( char *host, int port ));
+LDAP_F LDAP *ldap_init LDAP_P(( char *defhost, int defport ));
+
+/*
+ * in getentry.c:
+ */
+LDAP_F LDAPMessage *ldap_first_entry LDAP_P(( LDAP *ld, LDAPMessage *chain ));
+LDAP_F LDAPMessage *ldap_next_entry LDAP_P(( LDAP *ld, LDAPMessage *entry ));
+LDAP_F int ldap_count_entries LDAP_P(( LDAP *ld, LDAPMessage *chain ));
+
+/*
+ * in addentry.c
+ */
+LDAP_F LDAPMessage *ldap_delete_result_entry LDAP_P(( LDAPMessage **list,
+ LDAPMessage *e ));
+LDAP_F void ldap_add_result_entry LDAP_P(( LDAPMessage **list, LDAPMessage *e ));
+
+/*
+ * in getdn.c
+ */
+LDAP_F char *ldap_get_dn LDAP_P(( LDAP *ld, LDAPMessage *entry ));
+LDAP_F char *ldap_dn2ufn LDAP_P(( char *dn ));
+LDAP_F char **ldap_explode_dn LDAP_P(( char *dn, int notypes ));
+LDAP_F char **ldap_explode_dns LDAP_P(( char *dn ));
+LDAP_F int ldap_is_dns_dn LDAP_P(( char *dn ));
+
+/*
+ * in getattr.c
+ */
+LDAP_F char *ldap_first_attribute LDAP_P(( LDAP *ld, LDAPMessage *entry,
+ BerElement **ber ));
+LDAP_F char *ldap_next_attribute LDAP_P(( LDAP *ld, LDAPMessage *entry,
+ BerElement *ber ));
+
+/*
+ * in getvalues.c
+ */
+LDAP_F char **ldap_get_values LDAP_P(( LDAP *ld, LDAPMessage *entry, char *target ));
+LDAP_F struct berval **ldap_get_values_len LDAP_P(( LDAP *ld, LDAPMessage *entry,
+ char *target ));
+LDAP_F int ldap_count_values LDAP_P(( char **vals ));
+LDAP_F int ldap_count_values_len LDAP_P(( struct berval **vals ));
+LDAP_F void ldap_value_free LDAP_P(( char **vals ));
+LDAP_F void ldap_value_free_len LDAP_P(( struct berval **vals ));
+
+/*
+ * in result.c:
+ */
+LDAP_F int ldap_result LDAP_P(( LDAP *ld, int msgid, int all,
+ struct timeval *timeout, LDAPMessage **result ));
+LDAP_F int ldap_msgfree LDAP_P(( LDAPMessage *lm ));
+LDAP_F int ldap_msgdelete LDAP_P(( LDAP *ld, int msgid ));
+
+/*
+ * in search.c:
+ */
+LDAP_F int ldap_search LDAP_P(( LDAP *ld, char *base, int scope, char *filter,
+ char **attrs, int attrsonly ));
+LDAP_F int ldap_search_s LDAP_P(( LDAP *ld, char *base, int scope, char *filter,
+ char **attrs, int attrsonly, LDAPMessage **res ));
+LDAP_F int ldap_search_st LDAP_P(( LDAP *ld, char *base, int scope, char *filter,
+ char **attrs, int attrsonly, struct timeval *timeout, LDAPMessage **res ));
+
+/*
+ * in ufn.c
+ */
+LDAP_F int ldap_ufn_search_c LDAP_P(( LDAP *ld, char *ufn, char **attrs,
+ int attrsonly, LDAPMessage **res, int (*cancelproc)( void *cl ),
+ void *cancelparm ));
+LDAP_F int ldap_ufn_search_ct LDAP_P(( LDAP *ld, char *ufn, char **attrs,
+ int attrsonly, LDAPMessage **res, int (*cancelproc)( void *cl ),
+ void *cancelparm, char *tag1, char *tag2, char *tag3 ));
+LDAP_F int ldap_ufn_search_s LDAP_P(( LDAP *ld, char *ufn, char **attrs,
+ int attrsonly, LDAPMessage **res ));
+LDAP_F LDAPFiltDesc *ldap_ufn_setfilter LDAP_P(( LDAP *ld, char *fname ));
+LDAP_F void ldap_ufn_setprefix LDAP_P(( LDAP *ld, char *prefix ));
+LDAP_F int ldap_ufn_timeout LDAP_P(( void *tvparam ));
+
+
+/*
+ * in unbind.c
+ */
+LDAP_F int ldap_unbind LDAP_P(( LDAP *ld ));
+LDAP_F int ldap_unbind_s LDAP_P(( LDAP *ld ));
+
+
+/*
+ * in getfilter.c
+ */
+LDAP_F LDAPFiltDesc *ldap_init_getfilter LDAP_P(( char *fname ));
+LDAP_F LDAPFiltDesc *ldap_init_getfilter_buf LDAP_P(( char *buf, long buflen ));
+LDAP_F LDAPFiltInfo *ldap_getfirstfilter LDAP_P(( LDAPFiltDesc *lfdp, char *tagpat,
+ char *value ));
+LDAP_F LDAPFiltInfo *ldap_getnextfilter LDAP_P(( LDAPFiltDesc *lfdp ));
+LDAP_F void ldap_setfilteraffixes LDAP_P(( LDAPFiltDesc *lfdp, char *prefix, char *suffix ));
+LDAP_F void ldap_build_filter LDAP_P(( char *buf, unsigned long buflen,
+ char *pattern, char *prefix, char *suffix, char *attr,
+ char *value, char **valwords ));
+
+/*
+ * in free.c
+ */
+LDAP_F void ldap_getfilter_free LDAP_P(( LDAPFiltDesc *lfdp ));
+LDAP_F void ldap_mods_free LDAP_P(( LDAPMod **mods, int freemods ));
+
+/*
+ * in friendly.c
+ */
+LDAP_F char *ldap_friendly_name LDAP_P(( char *filename, char *uname,
+ FriendlyMap **map ));
+LDAP_F void ldap_free_friendlymap LDAP_P(( FriendlyMap **map ));
+
+
+/*
+ * in cldap.c
+ */
+LDAP_F LDAP *cldap_open LDAP_P(( char *host, int port ));
+LDAP_F void cldap_close LDAP_P(( LDAP *ld ));
+LDAP_F int cldap_search_s LDAP_P(( LDAP *ld, char *base, int scope, char *filter,
+ char **attrs, int attrsonly, LDAPMessage **res, char *logdn ));
+LDAP_F void cldap_setretryinfo LDAP_P(( LDAP *ld, int tries, int timeout ));
+
+
+/*
+ * in sort.c
+ */
+LDAP_F int ldap_sort_entries LDAP_P(( LDAP *ld,
+ LDAPMessage **chain, char *attr,
+ int (*cmp) LDAP_P((const char *, const char *)) ));
+LDAP_F int ldap_sort_values LDAP_P(( LDAP *ld,
+ char **vals, int (*cmp) LDAP_P((const void *, const void *)) ));
+LDAP_F int ldap_sort_strcasecmp LDAP_P(( char **a, char **b ));
+
+
+/*
+ * in url.c
+ */
+LDAP_F int ldap_is_ldap_url LDAP_P(( char *url ));
+LDAP_F int ldap_url_parse LDAP_P(( char *url, LDAPURLDesc **ludpp ));
+LDAP_F void ldap_free_urldesc LDAP_P(( LDAPURLDesc *ludp ));
+LDAP_F int ldap_url_search LDAP_P(( LDAP *ld, char *url, int attrsonly ));
+LDAP_F int ldap_url_search_s LDAP_P(( LDAP *ld, char *url, int attrsonly,
+ LDAPMessage **res ));
+LDAP_F int ldap_url_search_st LDAP_P(( LDAP *ld, char *url, int attrsonly,
+ struct timeval *timeout, LDAPMessage **res ));
+
+
+/*
+ * in charset.c
+ */
+LDAP_F void ldap_set_string_translators LDAP_P(( LDAP *ld,
+ BERTranslateProc encode_proc, BERTranslateProc decode_proc ));
+LDAP_F int ldap_translate_from_t61 LDAP_P(( LDAP *ld, char **bufp,
+ unsigned long *lenp, int free_input ));
+LDAP_F int ldap_translate_to_t61 LDAP_P(( LDAP *ld, char **bufp,
+ unsigned long *lenp, int free_input ));
+LDAP_F void ldap_enable_translation LDAP_P(( LDAP *ld, LDAPMessage *entry,
+ int enable ));
+
+LDAP_F int ldap_t61_to_8859 LDAP_P(( char **bufp, unsigned long *buflenp,
+ int free_input ));
+LDAP_F int ldap_8859_to_t61 LDAP_P(( char **bufp, unsigned long *buflenp,
+ int free_input ));
+
+
+/*
+ * in msdos/winsock/wsa.c
+ */
+LDAP_F void ldap_memfree LDAP_P(( void *p ));
+
+LDAP_END_DECL
-#ifdef __cplusplus
-}
-#endif
#endif /* _LDAP_H */
--- /dev/null
+/* LDAP C Defines */
+
+#ifndef _LDAP_CDEFS_H
+#define _LDAP_CDEFS_H
+
+#if defined(__cplusplus)
+# define LDAP_BEGIN_DECL extern "C" {
+# define LDAP_END_DECL }
+#else
+# define LDAP_BEGIN_DECL /* empty */
+# define LDAP_END_DECL /* empty */
+#endif
+
+#if !defined(__NO_PROTOTYPES) && ( \
+ defined(__STDC__) || defined(__cplusplus) || \
+ defined(__NEED_PROTOTYPES) )
+
+ /* ANSI C or C++ */
+# define LDAP_P(protos) protos
+# define LDAP_CONCAT1(x,y) x ## y
+# define LDAP_CONCAT(x,y) LDAP_CONCAT1(x,y)
+# define LDAP_STRING(x) #x /* stringify without expanding x */
+# define LDAP_XSTRING(x) LDAP_STRING(x) /* expand x, then stringify */
+
+#else /* no prototypes */
+
+ /* traditional C */
+# define LDAP_P(protos) ()
+# define LDAP_CONCAT(x,y) x/**/y
+# define LDAP_STRING(x) "x"
+
+#endif /* no prototypes */
+
+
+#ifndef LDAP_F
+# ifdef _WIN32
+# define LDAP_F __declspec( dllexport )
+# else /* ! _WIN32 */
+# define LDAP_F extern
+# endif /* _WIN32 */
+#endif /* LDAP_FDECL */
+
+#endif /* _LDAP_CDEFS_H */
#ifndef _LTHREAD_H
#define _LTHREAD_H
-#if defined( THREAD_SUNOS4_LWP )
-/***********************************
- * *
- * thread definitions for sunos4 *
- * *
- ***********************************/
+#include "portable.h"
-#define _THREAD
+#if defined( HAVE_PTHREADS )
+/**********************************
+ * *
+ * definitions for POSIX Threads *
+ * *
+ **********************************/
-#include <lwp/lwp.h>
-#include <lwp/stackdep.h>
+#include <pthread.h>
+#ifdef HAVE_SCHED_H
+#include <sched.h>
+#endif
-typedef void *(*VFP)();
+LDAP_BEGIN_DECL
-/* thread attributes and thread type */
+#if !defined( HAVE_PTHREAD_ATTR_INIT ) && \
+ defined( HAVE_PTHREAD_ATTR_CREATE )
+#define pthread_attr_init( a ) pthread_attr_create( a )
+#endif
+
+#if !defined( HAVE_PTHREAD_ATTR_DESTROY ) && \
+ defined( HAVE_PTHREAD_ATTR_DELETE )
+#define pthread_attr_destroy( a ) pthread_attr_delete( a )
+#endif
+
+#if !defined( HAVE_PTHREAD_ATTR_SETDETACHSTATE ) && \
+ defined( HAVE_PTHREAD_ATTR_SETDETACH_NP )
+#define pthread_attr_setdetachstate( a, b ) \
+ pthread_attr_setdetach_np( a, b )
+#endif
+
+#ifndef HAVE_PTHREAD_KILL
+/* missing pthread_kill(), define prototype */
+LDAP_F void pthread_kill LDAP_P(( pthread_t tid, int sig ));
+#endif
+
+#ifndef HAVE_PTHREADS_D4
+#define pthread_mutexattr_default NULL
+#define pthread_condattr_default NULL
+
+#ifdef HAVE_SCHED_YIELD
+#define pthread_yield sched_yield
+#endif
+#endif
+
+LDAP_END_DECL
+
+#elif defined ( HAVE_MACH_CTHREADS )
+/**********************************
+ * *
+ * definitions for Mach CThreads *
+ * *
+ **********************************/
+
+#include <mach/cthreads.h>
+
+LDAP_BEGIN_DECL
+
+typedef cthread_fn_t VFP;
typedef int pthread_attr_t;
-typedef thread_t pthread_t;
+typedef cthread_t pthread_t;
/* default attr states */
#define pthread_mutexattr_default NULL
/* mutex attributes and mutex type */
typedef int pthread_mutexattr_t;
-typedef mon_t pthread_mutex_t;
+typedef struct mutex pthread_mutex_t;
/* mutex and condition variable scope - process or system */
#define PTHREAD_SHARE_PRIVATE 0
/* condition variable attributes and condition variable type */
typedef int pthread_condattr_t;
-typedef struct lwpcv {
- int lcv_created;
- cv_t lcv_cv;
-} pthread_cond_t;
+typedef struct condition pthread_cond_t;
-#else /* end sunos4 */
+LDAP_END_DECL
-#if defined( THREAD_SUNOS5_LWP )
-/***********************************
- * *
- * thread definitions for sunos5 *
- * *
- ***********************************/
-
-#define _THREAD
+#elif defined( HAVE_THR )
+/**************************************
+ * *
+ * thread definitions for Solaris LWP *
+ * *
+ **************************************/
#include <thread.h>
#include <synch.h>
-typedef void *(*VFP)();
-
-/* sunos5 threads are preemptive */
-#define PTHREAD_PREEMPTIVE 1
+LDAP_BEGIN_DECL
-/* thread attributes and thread type */
-typedef int pthread_attr_t;
-typedef thread_t pthread_t;
+typedef void *(*VFP)();
/* default attr states */
#define pthread_mutexattr_default NULL
/* thread scope - who is in scheduling pool */
#define PTHREAD_SCOPE_PROCESS 0
#define PTHREAD_SCOPE_SYSTEM THR_BOUND
+/* mutex and condition variable scope - process or system */
+#define PTHREAD_SHARE_PRIVATE USYNC_THREAD
+#define PTHREAD_SHARE_PROCESS USYNC_PROCESS
+
+
+#if !defined(__SunOS_5_6)
+/* thread attributes and thread type */
+typedef int pthread_attr_t;
+typedef thread_t pthread_t;
/* mutex attributes and mutex type */
typedef int pthread_mutexattr_t;
typedef mutex_t pthread_mutex_t;
-/* mutex and condition variable scope - process or system */
-#define PTHREAD_SHARE_PRIVATE USYNC_THREAD
-#define PTHREAD_SHARE_PROCESS USYNC_PROCESS
-
/* condition variable attributes and condition variable type */
typedef int pthread_condattr_t;
typedef cond_t pthread_cond_t;
+#endif /* ! sunos56 */
-#else /* end sunos5 */
+LDAP_END_DECL
-#if defined( THREAD_MIT_PTHREADS )
-/***********************************
- * *
- * definitions for mit pthreads *
- * *
- ***********************************/
+#elif defined( HAVE_LWP )
+/*************************************
+ * *
+ * thread definitions for SunOS LWP *
+ * *
+ *************************************/
-#define _THREAD
+#include <lwp/lwp.h>
+#include <lwp/stackdep.h>
-#include <pthread.h>
+LDAP_BEGIN_DECL
-#else /* end mit pthreads */
+typedef void *(*VFP)();
-#if defined( THREAD_DCE_PTHREADS )
-/***********************************
- * *
- * definitions for mit pthreads *
- * *
- ***********************************/
+/* thread attributes and thread type */
+typedef int pthread_attr_t;
+typedef thread_t pthread_t;
-#define _THREAD
+/* default attr states */
+#define pthread_mutexattr_default NULL
+#define pthread_condattr_default NULL
-#include <pthread.h>
+/* thread state - joinable or not */
+#define PTHREAD_CREATE_JOINABLE 0
+#define PTHREAD_CREATE_DETACHED 1
+/* thread scope - who is in scheduling pool */
+#define PTHREAD_SCOPE_PROCESS 0
+#define PTHREAD_SCOPE_SYSTEM 1
-/* dce threads are preemptive */
-#define PTHREAD_PREEMPTIVE 1
+/* mutex attributes and mutex type */
+typedef int pthread_mutexattr_t;
+typedef mon_t pthread_mutex_t;
-#define pthread_attr_init( a ) pthread_attr_create( a )
-#define pthread_attr_destroy( a ) pthread_attr_delete( a )
-#define pthread_attr_setdetachstate( a, b ) \
- pthread_attr_setdetach_np( a, b )
+/* mutex and condition variable scope - process or system */
+#define PTHREAD_SHARE_PRIVATE 0
+#define PTHREAD_SHARE_PROCESS 1
+
+/* condition variable attributes and condition variable type */
+typedef int pthread_condattr_t;
+typedef struct lwpcv {
+ int lcv_created;
+ cv_t lcv_cv;
+} pthread_cond_t;
-#endif /* dce pthreads */
-#endif /* mit pthreads */
-#endif /* sunos5 */
-#endif /* sunos4 */
+LDAP_END_DECL
-#ifndef _THREAD
+#else
/***********************************
* *
* *
***********************************/
+LDAP_BEGIN_DECL
+
+#ifndef NO_THREADS
+#define NO_THREADS 1
+#endif
+
+#ifndef PREEMPTIVE_THREADS
+/* treat no threads as preemptive */
+#define PREEMPTIVE_THREADS 1
+#endif
+
typedef void *(*VFP)();
/* thread attributes and thread type */
typedef int pthread_condattr_t;
typedef int pthread_cond_t;
+LDAP_END_DECL
+
#endif /* no threads support */
#endif /* _LTHREAD_H */
LDAP_F int b64_ntop LDAP_P((u_char const *, size_t, char *, size_t));
LDAP_F int b64_pton LDAP_P((char const *, u_char *, size_t));
LDAP_F void lutil_detach LDAP_P((int debug, int do_close));
+LDAP_F int lutil_passwd LDAP_P((const char *cred, const char *passwd));
LDAP_END_DECL
/* define this if needed to get reentrant functions */
#undef _REENTRANT
-/* define this if needed to get threadsafe functions */
+/* define this if needed to get thread safe functions */
#undef _THREAD_SAFE
+/* define this if needed to get thread safe functions */
+#undef _THREADSAFE
+
/* define this if toupper() requires tolower() check */
#undef C_UPPER_LOWER
/* define if you have crypt */
#undef HAVE_CRYPT
-/* define if you have DCE */
-#undef HAVE_DCE
+/* define if you have DSAP */
+#undef HAVE_DSAP
/* define if you have GDBM */
#undef HAVE_GDBM
+/* define if you have ISODE */
+#undef HAVE_ISODE
+
/* define if you have Kerberos */
#undef HAVE_KERBEROS
/* define if you have NDBM */
#undef HAVE_NDBM
+/* define if you have Mach CThreads */
+#undef HAVE_MACH_CTHREADS
+
+/* define if you have PP */
+#undef HAVE_PP
+
/* define if you have a preemptive POSIX Threads implementation */
#undef HAVE_PREEMPTIVE_PTHREADS
/* define if you have Sun LWP (Solaris style) */
#undef HAVE_THR
+/* define if you have XTPP */
+#undef HAVE_XTPP
+
/* define this for connectionless LDAP support */
#undef LDAP_CONNECTIONLESS
/* Define if you have the getopt function. */
#undef HAVE_GETOPT
+/* Define if you have the getpwuid function. */
+#undef HAVE_GETPWUID
+
/* Define if you have the gettimeofday function. */
#undef HAVE_GETTIMEOFDAY
/* Define if you have the mktime function. */
#undef HAVE_MKTIME
+/* Define if you have the pthread_attr_create function. */
+#undef HAVE_PTHREAD_ATTR_CREATE
+
+/* Define if you have the pthread_attr_delete function. */
+#undef HAVE_PTHREAD_ATTR_DELETE
+
+/* Define if you have the pthread_attr_destroy function. */
+#undef HAVE_PTHREAD_ATTR_DESTROY
+
+/* Define if you have the pthread_attr_init function. */
+#undef HAVE_PTHREAD_ATTR_INIT
+
+/* Define if you have the pthread_attr_setdetach_np function. */
+#undef HAVE_PTHREAD_ATTR_SETDETACH_NP
+
+/* Define if you have the pthread_attr_setdetachstate function. */
+#undef HAVE_PTHREAD_ATTR_SETDETACHSTATE
+
/* Define if you have the pthread_kill function. */
#undef HAVE_PTHREAD_KILL
/* Define if you have the pthread_yield function. */
#undef HAVE_PTHREAD_YIELD
+/* Define if you have the res_search function. */
+#undef HAVE_RES_SEARCH
+
/* Define if you have the sched_yield function. */
#undef HAVE_SCHED_YIELD
/* Define if you have the <pthread.h> header file. */
#undef HAVE_PTHREAD_H
+/* Define if you have the <pwd.h> header file. */
+#undef HAVE_PWD_H
+
/* Define if you have the <regex.h> header file. */
#undef HAVE_REGEX_H
/* Define if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H
+/* Define if you have the <sys/resource.h> header file. */
+#undef HAVE_SYS_RESOURCE_H
+
/* Define if you have the <sys/socket.h> header file. */
#undef HAVE_SYS_SOCKET_H
/* Define if you have the nsl_s library (-lnsl_s). */
#undef HAVE_LIBNSL_S
+/* Define if you have the resolv library (-lresolv). */
+#undef HAVE_LIBRESOLV
+
/* Define if you have the socket library (-lsocket). */
#undef HAVE_LIBSOCKET
/* portable.h.bot begin */
/* include/portable.h.nt -- manually updated of MS NT (MS VC5) */
-/* synced with portable.h.in 1.8 */
+/* synced with portable.h.in 1.11 */
/*
Copyright 1998 The OpenLDAP Foundation, Redwood City, California, USA
All rights reserved.
#ifndef _LDAP_PORTABLE_H
#define _LDAP_PORTABLE_H
+/* MSVC5 doesn't define _STDC_, but requires prototypes */
+#define __NEED_PROTOTYPES 1
+
/* we installed Henry Spencer's REGEX */
#define HAVE_REGEX_H 1
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
/* #undef HAVE_SYS_WAIT_H */
-/* Define if you have the tempnam function. */
-/* #undef HAVE_TEMPNAM */
-
-/* Define if you have the thr_setconcurrency function. */
-/* #undef HAVE_THR_SETCONCURRENCY */
-
/* Define if you have the vprintf function. */
#define HAVE_VPRINTF 1
-/* Define if you have the vsnprintf function. */
-/* #undef HAVE_VSNPRINTF */
-
/* Define if you have the wait3 system call. */
/* #undef HAVE_WAIT3 */
/* Define if your <sys/time.h> declares struct tm. */
/* #undef TM_IN_SYS_TIME */
+/* Define to `int' if <sys/types.h> doesn't define. */
+#define uid_t long
+
/* define this if needed to get reentrant functions */
#undef _REENTRANT
/* define this if needed to get threadsafe functions */
#undef _THREAD_SAFE
-/* Define to `int' if <sys/types.h> doesn't define. */
-#define uid_t long
-
/* define this if toupper() requires tolower() */
#define C_UPPER_LOWER
/* define if you have DCE */
/* #undef HAVE_DCE */
+/* define if you have DSAP */
+/* #undef HAVE_DSAP */
+
/* define if you have GDBM */
/* #undef HAVE_GDBM */
+/* define if you have ISODE */
+/* #undef HAVE_ISODE */
+
/* define if you have Kerberos */
/* #undef HAVE_KERBEROS */
/* define if you have Mach CThreads */
/* #undef HAVE_MACH_CTHREADS */
+/* define if you have PP */
+/* #undef HAVE_PP */
+
/* define if you have a preemptive POSIX Threads implementation */
/* #undef HAVE_PREEMPTIVE_PTHREADS */
/* define if you have POSIX Threads */
/* #undef HAVE_PTHREADS */
+/* define if your POSIX Threads implementatin is circa Final Draft */
+/* #undef HAVE_PTHREADS_FINAL */
+
/* define if your POSIX Threads implementatin is circa Draft 4 */
/* #undef HAVE_PTHREADS_D4 */
/* define if you have Solaris LWP Threads */
/* #undef HAVE_THR */
+/* define if you have XTPP */
+/* #undef HAVE_XTPP */
+
/* define this for connectionless LDAP support */
/* #undef LDAP_CONNECTIONLESS */
/* Define if you have the pthread_yield function. */
/* #undef HAVE_PTHREAD_YIELD */
+/* Define if you have the res_search function. */
+/* #undef HAVE_RES_SEARCH */
+
/* Define if you have the sched_yield function. */
/* #undef HAVE_SCHED_YIELD */
/* 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 thr_setconcurrency function. */
+/* #undef HAVE_THR_SETCONCURRENCY */
+
+/* Define if you have the vsnprintf function. */
+/* #undef HAVE_VSNPRINTF */
+
/* Define if you have the waitpid function. */
#define HAVE_WAITPID 1
/* Define if you have the nsl_s library (-lnsl_s). */
/* #undef HAVE_LIBNSL_S */
+/* Define if you have the resolv library (-lresolv). */
+/* #undef HAVE_LIBRESOLV */
+
/* Define if you have the socket library (-lsocket). */
/* #undef HAVE_LIBSOCKET */
* is provided ``as is'' without express or implied warranty.
*/
+#include "portable.h"
+
#include <stdio.h>
-#include <string.h>
-#ifdef MACOS
#include <stdlib.h>
+
+#include <ac/string.h>
+#include <ac/socket.h>
+
+#ifdef HAVE_CONSOLE_H
#include <console.h>
-#else /* MACOS */
-#include <sys/types.h>
-#include <sys/socket.h>
#endif /* MACOS */
-#include "lber.h"
-static usage( char *name )
+#include "lber-int.h"
+
+static void usage( char *name )
{
fprintf( stderr, "usage: %s fmt\n", name );
}
+int
main( int argc, char **argv )
{
- long i, i2, num;
+ long i;
unsigned long len;
int tag;
- char *str, *s1, *s2;
BerElement ber;
Sockbuf sb;
extern char *optarg;
-#ifdef MACOS
+#ifdef HAVE_CONSOLE_H
ccommand( &argv );
cshow( stdout );
#endif /* MACOS */
- bzero( &sb, sizeof(sb) );
+ memset( &sb, 0, sizeof(sb) );
sb.sb_sd = 0;
sb.sb_ber.ber_buf = NULL;
+
if ( (tag = ber_get_next( &sb, &len, &ber )) == -1 ) {
perror( "ber_get_next" );
exit( 1 );
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
+# PROP Output_Dir "..\Release"
+# PROP Intermediate_Dir "Release\liblber"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo
+# ADD LIB32 /nologo /out:"..\Release\olber32.lib"
!ELSEIF "$(CFG)" == "liblber - Win32 Debug"
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo
+# ADD LIB32 /nologo /out:"..\Debug\olber32.lib"
!ENDIF
# End Source File
# Begin Source File
+SOURCE=".\lber-int.h"
+# End Source File
+# Begin Source File
+
SOURCE=..\..\include\lber.h
# End Source File
# End Target
}
}
- if ( (address = inet_addr( host )) == (unsigned long) -1L ) {
+ address = inet_addr( host );
+ /* This was just a test for -1 until OSF1 let inet_addr return
+ unsigned int, which is narrower than 'unsigned long address' */
+ if ( address == 0xffffffff || address == (unsigned long) -1 ) {
if ( (hp = gethostbyname( host )) == NULL ) {
errno = EHOSTUNREACH;
continue;
* 7 March 1994 by Mark C Smith
*/
+#include "portable.h"
+
#include <stdio.h>
-#include <ctype.h>
-#include <string.h>
#include <stdlib.h>
-#ifdef MACOS
-#include "macos.h"
-#else /* MACOS */
-#ifdef DOS
-#include <malloc.h>
-#include "msdos.h"
-#else /* DOS */
-#include <sys/types.h>
+
+#include <ac/ctype.h>
+#include <ac/string.h>
+#include <ac/time.h>
+#include <ac/unistd.h>
+
+#ifdef HAVE_SYS_FILE_H
#include <sys/file.h>
-#ifndef VMS
-#include <unistd.h>
-#endif /* VMS */
-#endif /* DOS */
-#endif /* MACOS */
+#endif
#include "lber.h"
#include "ldap.h"
#include "disptmpl.h"
-#ifndef NEEDPROTOS
-static void free_disptmpl();
-static int read_next_tmpl();
-int next_line_tokens();
-void free_strarray();
-#else /* !NEEDPROTOS */
-static void free_disptmpl( struct ldap_disptmpl *tmpl );
-static int read_next_tmpl( char **bufp, long *blenp,
- struct ldap_disptmpl **tmplp, int dtversion );
-int next_line_tokens( char **bufp, long *blenp, char ***toksp );
-void free_strarray( char **sap );
-#endif /* !NEEDPROTOS */
+static void free_disptmpl LDAP_P(( struct ldap_disptmpl *tmpl ));
+static int read_next_tmpl LDAP_P(( char **bufp, long *blenp,
+ struct ldap_disptmpl **tmplp, int dtversion ));
static char *tmploptions[] = {
"addable", "modrdn",
ldap_init_templates_buf( char *buf, long buflen,
struct ldap_disptmpl **tmpllistp )
{
- int rc, version;
+ int rc=-1, version;
char **toks;
struct ldap_disptmpl *prevtmpl, *tmpl;
int i, j, tokcnt, samerow, adsource;
char **toks, *itemopts;
struct ldap_disptmpl *tmpl;
- struct ldap_oclist *ocp, *prevocp;
- struct ldap_adddeflist *adp, *prevadp;
- struct ldap_tmplitem *rowp, *ip, *previp;
+ struct ldap_oclist *ocp, *prevocp = NULL;
+ struct ldap_adddeflist *adp, *prevadp = NULL;
+ struct ldap_tmplitem *rowp = NULL, *ip, *previp = NULL;
*tmplp = NULL;
* 7 March 1994 by Mark C Smith
*/
+#include "portable.h"
+
#include <stdio.h>
-#include <ctype.h>
-#include <string.h>
-#ifdef MACOS
#include <stdlib.h>
-#include "macos.h"
-#else /* MACOS */
-#ifdef DOS
-#include <malloc.h>
-#include "msdos.h"
-#else /* DOS */
-#include <sys/types.h>
+
+#include <ac/ctype.h>
+#include <ac/string.h>
+#include <ac/time.h>
+
+#ifdef HAVE_SYS_FILE_H
#include <sys/file.h>
-#include <stdlib.h>
-#endif /* DOS */
-#endif /* MACOS */
+#endif
#include "lber.h"
#include "ldap.h"
-#ifndef NEEDPROTOS
-int next_line_tokens();
-void free_strarray();
-static int next_line();
-static char *next_token();
-#else /* !NEEDPROTOS */
-int next_line_tokens( char **bufp, long *blenp, char ***toksp );
-void free_strarray( char **sap );
-static int next_line( char **bufp, long *blenp, char **linep );
-static char *next_token( char ** sp );
-#endif /* !NEEDPROTOS */
+#include "ldap-int.h"
+static int next_line LDAP_P(( char **bufp, long *blenp, char **linep ));
+static char *next_token LDAP_P(( char ** sp ));
int
return( "Unknown error" );
}
-#ifdef LDAP_LIBUI
void
ldap_perror( LDAP *ld, char *s )
{
+#ifdef LDAP_LIBUI
int i;
Debug( LDAP_DEBUG_TRACE, "ldap_perror\n", 0, 0, 0 );
fprintf( stderr, "%s: Not an LDAP errno %d\n", s, ld->ld_errno );
fflush( stderr );
-}
-
-#else
-
-void
-ldap_perror( LDAP *ld, char *s )
-{
-}
-
#endif /* !LDAP_LIBUI */
-
+}
int
ldap_result2error( LDAP *ld, LDAPMessage *r, int freeit )
* getfilter.c -- optional add-on to libldap
*/
+#include "portable.h"
+
#ifndef lint
static char copyright[] = "@(#) Copyright (c) 1993 Regents of the University of Michigan.\nAll rights reserved.\n";
#endif
#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#if defined(NeXT)
-#include <regex.h>
-#endif
-#ifdef MACOS
#include <stdlib.h>
-#include "macos.h"
-#else /* MACOS */
-#ifdef DOS
-#include <malloc.h>
-#include "msdos.h"
-#else /* DOS */
-#include <sys/types.h>
+
+#include <ac/ctype.h>
+#include <ac/errno.h>
+#include <ac/regex.h>
+#include <ac/string.h>
+#include <ac/time.h>
+#include <ac/unistd.h>
+
+#ifdef HAVE_SYS_FILE_H
#include <sys/file.h>
-#include <stdlib.h>
-#include <sys/errno.h>
-#ifndef VMS
-#include <unistd.h>
-#endif /* VMS */
-#endif /* DOS */
-#endif /* MACOS */
+#endif
#include "lber.h"
#include "ldap.h"
-#include "regex.h"
-
-#ifdef NEEDPROTOS
-static int break_into_words( char *str, char *delims, char ***wordsp );
-int next_line_tokens( char **bufp, long *blenp, char ***toksp );
-void free_strarray( char **sap );
-#else /* NEEDPROTOS */
-static int break_into_words();
-int next_line_tokens();
-void free_strarray();
-#endif /* NEEDPROTOS */
-
-#if !defined( MACOS ) && !defined( DOS )
-extern int errno;
-extern char *re_comp();
-#endif
+
+static int break_into_words LDAP_P(( char *str, char *delims, char ***wordsp ));
#define FILT_MAX_LINE_LEN 1024
LDAPFiltDesc *lfdp;
LDAPFiltList *flp, *nextflp;
LDAPFiltInfo *fip, *nextfip;
- char *tag, **tok;
- int tokcnt, i;
+ char *tag, **tok;
+ int tokcnt, i;
+ int rc;
+ regex_t re;
if (( lfdp = (LDAPFiltDesc *)calloc( 1, sizeof( LDAPFiltDesc))) == NULL ) {
return( NULL );
}
nextflp->lfl_tag = strdup( tag );
nextflp->lfl_pattern = tok[ 0 ];
- if ( re_comp( nextflp->lfl_pattern ) != NULL ) {
-#ifndef NO_USERINTERFACE
+ if ( (rc = regcomp( &re, nextflp->lfl_pattern, 0 )) != 0 ) {
+#ifdef LDAP_LIBUI
+ char error[512];
+ regerror(rc, &re, error, sizeof(error));
ldap_getfilter_free( lfdp );
- fprintf( stderr, "bad regular expresssion %s\n",
- nextflp->lfl_pattern );
-#if !defined( MACOS ) && !defined( DOS )
+ fprintf( stderr, "bad regular expresssion %s, %s\n",
+ nextflp->lfl_pattern, error );
errno = EINVAL;
-#endif
-#endif /* NO_USERINTERFACE */
+#endif /* LDAP_LIBUI */
free_strarray( tok );
return( NULL );
}
+ regfree(&re);
nextflp->lfl_delims = tok[ 1 ];
nextflp->lfl_ilist = NULL;
} else {
free_strarray( tok );
ldap_getfilter_free( lfdp );
-#if !defined( MACOS ) && !defined( DOS )
errno = EINVAL;
-#endif
return( NULL );
}
free( tok[ 2 ] );
default:
free_strarray( tok );
ldap_getfilter_free( lfdp );
-#if !defined( MACOS ) && !defined( DOS )
errno = EINVAL;
-#endif
return( NULL );
}
}
ldap_getfirstfilter( LDAPFiltDesc *lfdp, char *tagpat, char *value )
{
LDAPFiltList *flp;
+ int rc;
+ regex_t re;
if ( lfdp->lfd_curvalcopy != NULL ) {
free( lfdp->lfd_curvalcopy );
lfdp->lfd_curval = value;
lfdp->lfd_curfip = NULL;
- for ( flp = lfdp->lfd_filtlist; flp != NULL; flp = flp->lfl_next ) {
- if ( re_comp( tagpat ) == NULL && re_exec( flp->lfl_tag ) == 1
- && re_comp( flp->lfl_pattern ) == NULL
- && re_exec( lfdp->lfd_curval ) == 1 ) {
- lfdp->lfd_curfip = flp->lfl_ilist;
- break;
- }
+ for ( flp = lfdp->lfd_filtlist; flp != NULL; flp = flp->lfl_next ) {
+ /* compile tagpat, continue if we fail */
+ if (regcomp(&re, tagpat, 0) != 0)
+ continue;
+
+ /* match tagpatern and tag, continue if we fail */
+ rc = regexec(&re, flp->lfl_tag, 0, NULL, 0);
+ regfree(&re);
+ if (rc != 0)
+ continue;
+
+ /* compile flp->ifl_pattern, continue if we fail */
+ if (regcomp(&re, flp->lfl_pattern, 0) != 0)
+ continue;
+
+ /* match ifl_pattern and lfd_curval, continue if we fail */
+ rc = regexec(&re, lfdp->lfd_curval, 0, NULL, 0);
+ regfree(&re);
+ if (rc != 0)
+ continue;
+
+ /* we successfully compiled both patterns and matched both values */
+ lfdp->lfd_curfip = flp->lfl_ilist;
+ break;
}
if ( lfdp->lfd_curfip == NULL ) {
*f++ = *p;
}
- if ( f - filtbuf > buflen ) {
+ if ( (unsigned long) (f - filtbuf) > buflen ) {
/* sanity check */
--f;
break;
}
}
- if ( suffix != NULL && ( f - filtbuf ) < buflen ) {
+ if ( suffix != NULL && (
+ (unsigned long) ( f - filtbuf ) < buflen ) )
+ {
strcpy( f, suffix );
} else {
*f = '\0';
* kbind.c
*/
+#include "portable.h"
+
#ifndef lint
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 <string.h>
-
-#ifdef MACOS
#include <stdlib.h>
-#include "macos.h"
-#else /* MACOS */
-#ifdef DOS
-#include "msdos.h"
-#endif /* DOS */
-#include <krb.h>
-#include <stdlib.h>
-#if !defined(DOS) && !defined( _WIN32 )
-#include <sys/types.h>
-#endif /* !DOS && !_WIN32 */
-#include <sys/time.h>
-#include <sys/socket.h>
-#endif /* MACOS */
+
+#include <ac/krb.h>
+#include <ac/socket.h>
+#include <ac/string.h>
+#include <ac/time.h>
#include "lber.h"
#include "ldap.h"
BerElement *ber;
char *cred;
int rc, credlen;
- char *get_kerberosv4_credentials();
#ifdef STR_TRANSLATION
int str_translation_on;
#endif /* STR_TRANSLATION */
if ( dn == NULL )
dn = "";
- if ( (cred = get_kerberosv4_credentials( ld, dn, "ldapserver",
+ if ( (cred = ldap_get_kerberosv4_credentials( ld, dn, "ldapserver",
&credlen )) == NULL ) {
return( -1 ); /* ld_errno should already be set */
}
/* create a message to send */
- if ( (ber = alloc_ber_with_options( ld )) == NULLBER ) {
+ if ( (ber = ldap_alloc_ber_with_options( ld )) == NULLBER ) {
free( cred );
return( -1 );
}
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 ( send_initial_request( ld, LDAP_REQ_BIND, dn, ber ));
+ return ( ldap_send_initial_request( ld, LDAP_REQ_BIND, dn, ber ));
}
int
BerElement *ber;
char *cred;
int rc, credlen;
- char *get_kerberosv4_credentials();
#ifdef STR_TRANSLATION
int str_translation_on;
#endif /* STR_TRANSLATION */
if ( dn == NULL )
dn = "";
- if ( (cred = get_kerberosv4_credentials( ld, dn, "x500dsa", &credlen ))
+ if ( (cred = ldap_get_kerberosv4_credentials( ld, dn, "x500dsa", &credlen ))
== NULL ) {
return( -1 ); /* ld_errno should already be set */
}
/* create a message to send */
- if ( (ber = alloc_ber_with_options( ld )) == NULLBER ) {
+ if ( (ber = ldap_alloc_ber_with_options( ld )) == NULLBER ) {
free( cred );
return( -1 );
}
}
/* send the message */
- return ( send_initial_request( ld, LDAP_REQ_BIND, dn, ber ));
+ return ( ldap_send_initial_request( ld, LDAP_REQ_BIND, dn, ber ));
}
/* synchronous bind to DSA using kerberos */
#ifndef AUTHMAN
/*
- * get_kerberosv4_credentials - obtain kerberos v4 credentials for ldap.
+ * ldap_get_kerberosv4_credentials - obtain kerberos v4 credentials for ldap.
* The dn of the entry to which to bind is supplied. It's assumed the
* user already has a tgt.
*/
char *
-get_kerberosv4_credentials( LDAP *ld, char *who, char *service, int *len )
+ldap_get_kerberosv4_credentials( LDAP *ld, char *who, char *service, int *len )
{
KTEXT_ST ktxt;
int err;
char realm[REALM_SZ], *cred, *krbinstance;
- Debug( LDAP_DEBUG_TRACE, "get_kerberosv4_credentials\n", 0, 0, 0 );
+ Debug( LDAP_DEBUG_TRACE, "ldap_get_kerberosv4_credentials\n", 0, 0, 0 );
if ( (err = krb_get_tf_realm( tkt_string(), realm )) != KSUCCESS ) {
-#ifndef NO_USERINTERFACE
+#ifdef LDAP_LIBUI
fprintf( stderr, "krb_get_tf_realm failed (%s)\n",
krb_err_txt[err] );
-#endif /* NO_USERINTERFACE */
+#endif /* LDAP_LIBUI */
ld->ld_errno = LDAP_INVALID_CREDENTIALS;
return( NULL );
}
if ( (err = krb_mk_req( &ktxt, service, krbinstance, realm, 0 ))
!= KSUCCESS ) {
-#ifndef NO_USERINTERFACE
+#ifdef LDAP_LIBUI
fprintf( stderr, "krb_mk_req failed (%s)\n", krb_err_txt[err] );
-#endif /* NO_USERINTERFACE */
+#endif /* LDAP_LIBUI */
ld->ld_errno = LDAP_INVALID_CREDENTIALS;
return( NULL );
}
}
#endif /* !AUTHMAN */
-#endif /* KERBEROS */
+#endif /* HAVE_KERBEROS */
* ldap-int.h - defines & prototypes internal to the LDAP library
*/
+#ifndef _LDAP_INT_H
+#define _LDAP_INT_H
#define LDAP_URL_PREFIX "ldap://"
#define LDAP_URL_PREFIX_LEN 7
#endif /* LDAP_DNS */
#endif /* LDAP_REFERRALS */
-
+LDAP_BEGIN_DECL
/*
* in cache.c
*/
-#ifdef NEEDPROTOS
-void add_request_to_cache( LDAP *ld, unsigned long msgtype,
- BerElement *request );
-void add_result_to_cache( LDAP *ld, LDAPMessage *result );
-int check_cache( LDAP *ld, unsigned long msgtype, BerElement *request );
-#else /* NEEDPROTOS */
-void add_request_to_cache();
-void add_result_to_cache();
-int check_cache();
-#endif /* NEEDPROTOS */
-
-
-#ifdef KERBEROS
+void ldap_add_request_to_cache LDAP_P(( LDAP *ld, unsigned long msgtype,
+ BerElement *request ));
+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 ));
+
+/*
+ * in dparse.c
+ */
+int next_line_tokens LDAP_P(( char **bufp, long *blenp, char ***toksp ));
+void free_strarray LDAP_P(( char **sap ));
+
+#ifdef HAVE_KERBEROS
/*
* in kerberos.c
*/
-#ifdef NEEDPROTOS
-char *get_kerberosv4_credentials( LDAP *ld, char *who, char *service,
- int *len );
-#else /* NEEDPROTOS */
-char *get_kerberosv4_credentials();
-#endif /* NEEDPROTOS */
+char *ldap_get_kerberosv4_credentials LDAP_P(( LDAP *ld, char *who, char *service,
+ int *len ));
-#endif /* KERBEROS */
+#endif /* HAVE_KERBEROS */
/*
* in open.c
*/
-#ifdef NEEDPROTOS
int open_ldap_connection( LDAP *ld, Sockbuf *sb, char *host, int defport,
char **krbinstancep, int async );
-#else /* NEEDPROTOS */
-int open_ldap_connection();
-#endif /* NEEDPROTOS */
/*
* in os-ip.c
*/
-#ifdef NEEDPROTOS
-int connect_to_host( Sockbuf *sb, char *host, unsigned long address, int port,
+int ldap_connect_to_host( Sockbuf *sb, char *host, unsigned long address, int port,
int async );
-void close_connection( Sockbuf *sb );
-#else /* NEEDPROTOS */
-int connect_to_host();
-void close_connection();
-#endif /* NEEDPROTOS */
-
-#ifdef KERBEROS
-#ifdef NEEDPROTOS
-char *host_connected_to( Sockbuf *sb );
-#else /* NEEDPROTOS */
-char *host_connected_to();
-#endif /* NEEDPROTOS */
-#endif /* KERBEROS */
+void ldap_close_connection( Sockbuf *sb );
+
+#ifdef HAVE_KERBEROS
+char *ldap_host_connected_to( Sockbuf *sb );
+#endif /* HAVE_KERBEROS */
#ifdef LDAP_REFERRALS
-#ifdef NEEDPROTOS
int do_ldap_select( LDAP *ld, struct timeval *timeout );
-void *new_select_info( void );
-void free_select_info( void *sip );
-void mark_select_write( LDAP *ld, Sockbuf *sb );
-void mark_select_read( LDAP *ld, Sockbuf *sb );
-void mark_select_clear( LDAP *ld, Sockbuf *sb );
-int is_read_ready( LDAP *ld, Sockbuf *sb );
-int is_write_ready( LDAP *ld, Sockbuf *sb );
-#else /* NEEDPROTOS */
-int do_ldap_select();
-void *new_select_info();
-void free_select_info();
-void mark_select_write();
-void mark_select_read();
-void mark_select_clear();
-int is_read_ready();
-int is_write_ready();
-#endif /* NEEDPROTOS */
+void *ldap_new_select_info( void );
+void ldap_free_select_info( void *sip );
+void ldap_mark_select_write( LDAP *ld, Sockbuf *sb );
+void ldap_mark_select_read( LDAP *ld, Sockbuf *sb );
+void ldap_mark_select_clear( LDAP *ld, Sockbuf *sb );
+int ldap_is_read_ready( LDAP *ld, Sockbuf *sb );
+int ldap_is_write_ready( LDAP *ld, Sockbuf *sb );
#endif /* LDAP_REFERRALS */
/*
* in request.c
*/
-#ifdef NEEDPROTOS
-int send_initial_request( LDAP *ld, unsigned long msgtype,
+int ldap_send_initial_request( LDAP *ld, unsigned long msgtype,
char *dn, BerElement *ber );
-BerElement *alloc_ber_with_options( LDAP *ld );
-void set_ber_options( LDAP *ld, BerElement *ber );
-#else /* NEEDPROTOS */
-int send_initial_request();
-BerElement *alloc_ber_with_options();
-void set_ber_options();
-#endif /* NEEDPROTOS */
+BerElement *ldap_alloc_ber_with_options( LDAP *ld );
+void ldap_set_ber_options( LDAP *ld, BerElement *ber );
#if defined( LDAP_REFERRALS ) || defined( LDAP_DNS )
-#ifdef NEEDPROTOS
-int send_server_request( LDAP *ld, BerElement *ber, int msgid,
+int ldap_send_server_request( LDAP *ld, BerElement *ber, int msgid,
LDAPRequest *parentreq, LDAPServer *srvlist, LDAPConn *lc,
int bind );
-LDAPConn *new_connection( LDAP *ld, LDAPServer **srvlistp, int use_ldsb,
+LDAPConn *ldap_new_connection( LDAP *ld, LDAPServer **srvlistp, int use_ldsb,
int connect, int bind );
-LDAPRequest *find_request_by_msgid( LDAP *ld, int msgid );
-void free_request( LDAP *ld, LDAPRequest *lr );
-void free_connection( LDAP *ld, LDAPConn *lc, int force, int unbind );
-void dump_connection( LDAP *ld, LDAPConn *lconns, int all );
-void dump_requests_and_responses( LDAP *ld );
-#else /* NEEDPROTOS */
-int send_server_request();
-LDAPConn *new_connection();
-LDAPRequest *find_request_by_msgid();
-void free_request();
-void free_connection();
-void dump_connection();
-void dump_requests_and_responses();
-#endif /* NEEDPROTOS */
+LDAPRequest *ldap_find_request_by_msgid( LDAP *ld, int msgid );
+void ldap_free_request( LDAP *ld, LDAPRequest *lr );
+void ldap_free_connection( LDAP *ld, LDAPConn *lc, int force, int unbind );
+void ldap_dump_connection( LDAP *ld, LDAPConn *lconns, int all );
+void ldap_dump_requests_and_responses( LDAP *ld );
#endif /* LDAP_REFERRALS || LDAP_DNS */
#ifdef LDAP_REFERRALS
-#ifdef NEEDPROTOS
-int chase_referrals( LDAP *ld, LDAPRequest *lr, char **errstrp, int *hadrefp );
-int append_referral( LDAP *ld, char **referralsp, char *s );
-#else /* NEEDPROTOS */
-int chase_referrals();
-int append_referral();
-#endif /* NEEDPROTOS */
+int ldap_chase_referrals( LDAP *ld, LDAPRequest *lr, char **errstrp, int *hadrefp );
+int ldap_append_referral( LDAP *ld, char **referralsp, char *s );
#endif /* LDAP_REFERRALS */
/*
* in search.c
*/
-#ifdef NEEDPROTOS
BerElement *ldap_build_search_req( LDAP *ld, char *base, int scope,
char *filter, char **attrs, int attrsonly );
-#else /* NEEDPROTOS */
-BerElement *ldap_build_search_req();
-#endif /* NEEDPROTOS */
/*
* in unbind.c
*/
-#ifdef NEEDPROTOS
int ldap_ld_free( LDAP *ld, int close );
-int send_unbind( LDAP *ld, Sockbuf *sb );
-#else /* NEEDPROTOS */
-int ldap_ld_free();
-int send_unbind();
-#endif /* NEEDPROTOS */
-
+int ldap_send_unbind( LDAP *ld, Sockbuf *sb );
#ifdef LDAP_DNS
/*
* in getdxbyname.c
*/
-#ifdef NEEDPROTOS
-char **getdxbyname( char *domain );
-#else /* NEEDPROTOS */
-char **getdxbyname();
-#endif /* NEEDPROTOS */
+char **ldap_getdxbyname( char *domain );
#endif /* LDAP_DNS */
+
+#if defined( STR_TRANSLATION ) && defined( LDAP_DEFAULT_CHARSET )
+/*
+ * in charset.c
+ *
+ * added-in this stuff so that libldap.a would build, i.e. refs to
+ * these routines from open.c would resolve.
+ * hodges@stanford.edu 5-Feb-96
+ */
+#if LDAP_CHARSET_8859 == LDAP_DEFAULT_CHARSET
+extern
+int ldap_t61_to_8859( char **bufp, unsigned long *buflenp, int free_input );
+extern
+int ldap_8859_to_t61( char **bufp, unsigned long *buflenp, int free_input );
+#endif /* LDAP_CHARSET_8859 == LDAP_DEFAULT_CHARSET */
+#endif /* STR_TRANSLATION && LDAP_DEFAULT_CHARSET */
+
+#endif /* _LDAP_INT_H */
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
+# PROP Output_Dir "..\Release"
+# PROP Intermediate_Dir "Release\libldap"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo
+# ADD LIB32 /nologo /out:"..\Release\oldap32.lib"
!ELSEIF "$(CFG)" == "libldap - Win32 Debug"
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo
+# ADD LIB32 /nologo /out:"..\Debug\oldap32.lib"
!ENDIF
LDAP *ld,
LDAPMessage **chain,
char *attr, /* NULL => sort by DN */
- int (*cmp) LDAP_P((char *, char *))
+ int (*cmp) LDAP_P((const char *, const char *))
)
{
int i, count;
* 17 May 1994 by Gordon Good
*/
+#include "portable.h"
+
#include <stdio.h>
-#include <ctype.h>
-#include <string.h>
#include <stdlib.h>
-#ifdef MACOS
-#include "macos.h"
-#else /* MACOS */
-#ifdef DOS
-#include <malloc.h>
-#include "msdos.h"
-#else /* DOS */
-#include <sys/types.h>
+
+#include <ac/ctype.h>
+#include <ac/string.h>
+#include <ac/time.h>
+#include <ac/unistd.h>
+
+#ifdef HAVE_SYS_FILE_H
#include <sys/file.h>
-#ifndef VMS
-#include <unistd.h>
-#endif /* VMS */
-#endif /* DOS */
-#endif /* MACOS */
+#endif
#include "lber.h"
#include "ldap.h"
#include "srchpref.h"
-#ifndef NEEDPROTOS
-int next_line_tokens();
-void free_strarray();
-static void free_searchobj();
-static int read_next_searchobj();
-#else /* !NEEDPROTOS */
-int next_line_tokens( char **bufp, long *blenp, char ***toksp );
-void free_strarray( char **sap );
-static void free_searchobj( struct ldap_searchobj *so );
-static int read_next_searchobj( char **bufp, long *blenp,
- struct ldap_searchobj **sop, int soversion );
-#endif /* !NEEDPROTOS */
+static void free_searchobj LDAP_P(( struct ldap_searchobj *so ));
+static int read_next_searchobj LDAP_P(( char **bufp, long *blenp,
+ struct ldap_searchobj **sop, int soversion ));
static char *sobjoptions[] = {
ldap_init_searchprefs_buf( char *buf, long buflen,
struct ldap_searchobj **solistp )
{
- int rc, version;
+ int rc = -1, version;
char **toks;
struct ldap_searchobj *prevso, *so;
* ufn.c
*/
+#include "portable.h"
+
#ifndef lint
static char copyright[] = "@(#) Copyright (c) 1993 Regents of the University of Michigan.\nAll rights reserved.\n";
#endif
#include <stdio.h>
-#include <string.h>
+#include <ac/string.h>
#include <ctype.h>
-
-#ifdef MACOS
#include <stdlib.h>
-#include "macos.h"
-#else /* MACOS */
-#if defined( DOS ) || defined( _WIN32 )
-#include "msdos.h"
-#else /* DOS */
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#endif /* DOS */
-#endif /* MACOS */
+
+#include <ac/socket.h>
+#include <ac/time.h>
#include "lber.h"
#include "ldap.h"
-#ifdef NEEDPROTOS
-typedef int (*cancelptype)( void *cancelparm );
-#else /* NEEDPROTOS */
-typedef int (*cancelptype)();
-#endif /* NEEDPROTOS */
+#include "ldapconfig.h"
+
+typedef int (*cancelptype) LDAP_P(( void *cancelparm ));
-#ifdef NEEDPROTOS
-static int ldap_ufn_search_ctx( LDAP *ld, char **ufncomp, int ncomp,
+static int ldap_ufn_search_ctx LDAP_P(( LDAP *ld, char **ufncomp, int ncomp,
char *prefix, char **attrs, int attrsonly, LDAPMessage **res,
cancelptype cancelproc, void *cancelparm, char *tag1, char *tag2,
- char *tag3 );
-static LDAPMessage *ldap_msg_merge( LDAP *ld, LDAPMessage *a, LDAPMessage *b );
-static LDAPMessage *ldap_ufn_expand( LDAP *ld, cancelptype cancelproc,
+ char *tag3 ));
+static LDAPMessage *ldap_msg_merge LDAP_P(( LDAP *ld, LDAPMessage *a, LDAPMessage *b ));
+static LDAPMessage *ldap_ufn_expand LDAP_P(( LDAP *ld, cancelptype cancelproc,
void *cancelparm, char **dns, char *filter, int scope,
- char **attrs, int aonly, int *err );
-LDAPFiltDesc *ldap_ufn_setfilter( LDAP *ld, char *fname );
-#else /* NEEDPROTOS */
-static LDAPMessage *ldap_msg_merge();
-static LDAPMessage *ldap_ufn_expand();
-LDAPFiltDesc *ldap_ufn_setfilter();
-#endif /* NEEDPROTOS */
+ char **attrs, int aonly, int *err ));
/*
* ldap_ufn_search_ctx - do user friendly searching; provide cancel feature;
char **attrs, int attrsonly, LDAPMessage **res, cancelptype cancelproc,
void *cancelparm, char *tag1, char *tag2, char *tag3 )
{
- char *dn, *ftag;
- char **dns;
- int max, i, err, scope, phase, tries;
+ char *dn, *ftag = NULL;
+ char **dns = NULL;
+ int max, i, err, scope = 0, phase, tries;
LDAPFiltInfo *fi;
LDAPMessage *tmpcand;
LDAPMessage *candidates;
{
char **ufncomp, **prefixcomp;
char *pbuf;
- int ncomp, pcomp, i, err;
+ int ncomp, pcomp, i, err = 0;
/* initialize the getfilter stuff if it's not already */
if ( ld->ld_filtd == NULL && ldap_ufn_setfilter( ld, FILTERFILE )
* We also tolerate URLs that look like: <ldapurl> and <URL:ldapurl>
*/
+#include "portable.h"
+
#ifndef lint
static char copyright[] = "@(#) Copyright (c) 1996 Regents of the University of Michigan.\nAll rights reserved.\n";
#endif
#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-
-#ifdef MACOS
-#include <stdlib.h>
-#include "macos.h"
-#endif /* MACOS */
-
-#if defined( DOS ) || defined( _WIN32 )
#include <stdlib.h>
-#include <malloc.h>
-#include "msdos.h"
-#endif /* DOS || _WIN32 */
-#if !defined(MACOS) && !defined(DOS) && !defined( _WIN32 )
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#endif /* !MACOS && !DOS && !_WIN32 */
+#include <ac/ctype.h>
+#include <ac/socket.h>
+#include <ac/string.h>
+#include <ac/time.h>
#include "lber.h"
#include "ldap.h"
#include "ldap-int.h"
-#ifdef NEEDPROTOS
-static int skip_url_prefix( char **urlp, int *enclosedp );
-static void hex_unescape( char *s );
+static int skip_url_prefix LDAP_P(( char **urlp, int *enclosedp ));
+static void hex_unescape LDAP_P(( char *s ));
static int unhex( char c );
-#else /* NEEDPROTOS */
-static int skip_url_prefix();
-static void hex_unescape();
-static int unhex();
-#endif /* NEEDPROTOS */
int
ber_free( ber, 1 );
} else {
#ifdef LDAP_REFERRALS
- err = send_server_request( ld, ber, ld->ld_msgid, NULL, srv,
+ err = ldap_send_server_request( ld, ber, ld->ld_msgid, NULL, srv,
NULL, 1 );
#else /* LDAP_REFERRALS */
- err = send_initial_request( ld, LDAP_REQ_SEARCH,
+ err = ldap_send_initial_request( ld, LDAP_REQ_SEARCH,
ludp->lud_dn, ber );
#endif /* LDAP_REFERRALS */
}
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
+# PROP Output_Dir "..\Release"
+# PROP Intermediate_Dir "Release\libldif"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
+# PROP Output_Dir "..\Debug"
+# PROP Intermediate_Dir "Debug\libldif"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /W3 /GX /Z7 /Od /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo /out:"..\Debug\libldif.lib"
+# ADD LIB32 /nologo /out:"..\Debug\oldif32.lib"
!ENDIF
#include "portable.h"
#include <stdio.h>
+#include <stdlib.h>
#include <ctype.h>
#include <ac/string.h>
--- /dev/null
+/*
+** This basic implementation of Reader/Writer locks does not
+** protect writers from starvation. That is, if a writer is
+** currently waiting on a reader, any new reader will get
+** the lock before the writer.
+*/
+
+/********************************************************
+ * An example source module to accompany...
+ *
+ * "Using POSIX Threads: Programming with Pthreads"
+ * by Brad nichols, Dick Buttlar, Jackie Farrell
+ * O'Reilly & Associates, Inc.
+ *
+ ********************************************************
+ * rdwr.c --
+ *
+ * Library of functions implementing reader/writer locks
+ */
+
+#include <portable.h>
+
+#include <stdlib.h>
+#include <lthread.h>
+#include <lthread_rdwr.h>
+
+int pthread_rdwr_init_np(pthread_rdwr_t *rdwrp, pthread_rdwrattr_t *attrp)
+{
+ rdwrp->readers_reading = 0;
+ rdwrp->writer_writing = 0;
+ pthread_mutex_init(&(rdwrp->mutex), pthread_mutexattr_default);
+ pthread_cond_init(&(rdwrp->lock_free), pthread_condattr_default);
+ return 0;
+}
+
+int pthread_rdwr_rlock_np(pthread_rdwr_t *rdwrp){
+ pthread_mutex_lock(&(rdwrp->mutex));
+ while(rdwrp->writer_writing) {
+ pthread_cond_wait(&(rdwrp->lock_free), &(rdwrp->mutex));
+ }
+ rdwrp->readers_reading++;
+ pthread_mutex_unlock(&(rdwrp->mutex));
+ return 0;
+}
+
+int pthread_rdwr_runlock_np(pthread_rdwr_t *rdwrp)
+{
+ pthread_mutex_lock(&(rdwrp->mutex));
+ if (rdwrp->readers_reading == 0) {
+ pthread_mutex_unlock(&(rdwrp->mutex));
+ return -1;
+ }
+ else {
+ rdwrp->readers_reading--;
+ if (rdwrp->readers_reading == 0) {
+ pthread_cond_signal(&(rdwrp->lock_free));
+ }
+ pthread_mutex_unlock(&(rdwrp->mutex));
+ return 0;
+ }
+}
+
+int pthread_rdwr_wlock_np(pthread_rdwr_t *rdwrp)
+{
+ pthread_mutex_lock(&(rdwrp->mutex));
+ while(rdwrp->writer_writing || rdwrp->readers_reading) {
+ pthread_cond_wait(&(rdwrp->lock_free), &(rdwrp->mutex));
+ }
+ rdwrp->writer_writing++;
+ pthread_mutex_unlock(&(rdwrp->mutex));
+ return 0;
+}
+
+int pthread_rdwr_wunlock_np(pthread_rdwr_t *rdwrp)
+{
+ pthread_mutex_lock(&(rdwrp->mutex));
+ if (rdwrp->writer_writing == 0) {
+ pthread_mutex_unlock(&(rdwrp->mutex));
+ return -1;
+ }
+ else {
+ rdwrp->writer_writing = 0;
+ pthread_cond_broadcast(&(rdwrp->lock_free));
+ pthread_mutex_unlock(&(rdwrp->mutex));
+ return 0;
+ }
+}
+
+#ifdef LDAP_DEBUG
+
+/* just for testing,
+ * return 0 if false, suitable for assert(pthread_rdwr_Xchk(rdwr))
+ *
+ * Currently they don't check if the calling thread is the one
+ * that has the lock, just that there is a reader or writer.
+ *
+ * Basically sufficent for testing that places that should have
+ * a lock are caught.
+ */
+
+int pthread_rdwr_rchk_np(pthread_rdwr_t *rdwrp)
+{
+ return(rdwrp->readers_reading!=0);
+}
+
+int pthread_rdwr_wchk_np(pthread_rdwr_t *rdwrp)
+{
+ return(rdwrp->writer_writing!=0);
+}
+int pthread_rdwr_rwchk_np(pthread_rdwr_t *rdwrp)
+{
+ return(pthread_rdwr_rchk_np(rdwrp) || pthread_rdwr_wchk_np(rdwrp));
+}
+
+#endif /* LDAP_DEBUG */
/* thread.c - glue routines to provide a consistent thread interface */
-#include <stdio.h>
-#include "lthread.h"
-#if defined( THREAD_SUNOS4_LWP )
+#include "portable.h"
+#include <lthread.h>
+
+#if defined( HAVE_PTHREADS )
+
+#ifndef HAVE_PTHREAD_KILL
/***********************************************************************
* *
- * under sunos 4 - use the built in non-preemptive lwp threads package *
+ * pthreads package with DCE - no mapping to do (except to create a *
+ * pthread_kill() routine) *
* *
***********************************************************************/
-extern stkalign_t *get_stack();
-static void lwp_create_stack();
+/* ARGSUSED */
+void
+pthread_kill( pthread_t tid, int sig )
+{
+ kill( getpid(), sig );
+}
+#endif /* HAVE_PTHREAD_KILL */
+
+#elif defined( HAVE_MACH_CTHREADS )
+
+/***********************************************************************
+ * *
+ * under NEXTSTEP or OPENSTEP use CThreads *
+ * lukeh@xedoc.com.au *
+ * *
+ ***********************************************************************/
int
pthread_attr_init( pthread_attr_t *attr )
int
pthread_create(
pthread_t *tid,
- pthread_attr_t attr,
+ pthread_attr_t *attr,
VFP func,
void *arg
)
{
- stkalign_t *stack;
- int stackno;
-
- if ( (stack = get_stack( &stackno )) == NULL ) {
- return( -1 );
- }
- return( lwp_create( tid, lwp_create_stack, MINPRIO, 0, stack, 3, func,
- arg, stackno ) );
-}
-
-static void
-lwp_create_stack( VFP func, void *arg, int stackno )
-{
- (*func)( arg );
-
- free_stack( stackno );
+ *tid = cthread_fork(func, arg);
+ return ( *tid == NULL ? -1 : 0 );
}
void
pthread_yield()
{
- lwp_yield( SELF );
+ cthread_yield();
}
void
-pthread_exit()
+pthread_exit( any_t a )
{
- lwp_destroy( SELF );
+ cthread_exit( a );
}
void
-pthread_join( pthread_t tid, int *status )
+pthread_join( pthread_t tid, int *pStatus )
{
- lwp_join( tid );
+ int status;
+ status = (int) cthread_join ( tid );
+ if (pStatus != NULL)
+ {
+ *pStatus = status;
+ }
}
/* ARGSUSED */
int
pthread_mutex_init( pthread_mutex_t *mp, pthread_mutexattr_t *attr )
{
- return( mon_create( mp ) );
+ mutex_init( mp );
+ mp->name = NULL;
+ return ( 0 );
}
int
pthread_mutex_destroy( pthread_mutex_t *mp )
{
- return( mon_destroy( *mp ) );
+ mutex_clear( mp );
+ return ( 0 );
}
int
pthread_mutex_lock( pthread_mutex_t *mp )
{
- return( mon_enter( *mp ) );
+ mutex_lock( mp );
+ return ( 0 );
}
int
pthread_mutex_unlock( pthread_mutex_t *mp )
{
- return( mon_exit( *mp ) );
+ mutex_unlock( mp );
+ return ( 0 );
}
int
pthread_mutex_trylock( pthread_mutex_t *mp )
{
- return( mon_cond_enter( *mp ) );
+ return mutex_try_lock( mp );
}
int
pthread_cond_init( pthread_cond_t *cv, pthread_condattr_t *attr )
{
- /*
- * lwp cv_create requires the monitor id be passed in
- * when the cv is created, pthreads passes it when the
- * condition is waited for. so, we fake the creation
- * here and actually do it when the cv is waited for
- * later.
- */
-
- cv->lcv_created = 0;
-
+ condition_init( cv );
return( 0 );
}
int
pthread_cond_destroy( pthread_cond_t *cv )
{
- return( cv->lcv_created ? cv_destroy( cv->lcv_cv ) : 0 );
+ condition_clear( cv );
+ return( 0 );
}
int
pthread_cond_wait( pthread_cond_t *cv, pthread_mutex_t *mp )
{
- if ( ! cv->lcv_created ) {
- cv_create( &cv->lcv_cv, *mp );
- cv->lcv_created = 1;
- }
-
- return( cv_wait( cv->lcv_cv ) );
+ condition_wait( cv, mp );
+ return( 0 );
}
int
pthread_cond_signal( pthread_cond_t *cv )
{
- return( cv->lcv_created ? cv_notify( cv->lcv_cv ) : 0 );
+ condition_signal( cv );
+ return( 0 );
}
int
pthread_cond_broadcast( pthread_cond_t *cv )
{
- return( cv->lcv_created ? cv_broadcast( cv->lcv_cv ) : 0 );
+ condition_broadcast( cv );
+ return( 0 );
}
-#else /* end sunos4 */
+#elif defined( HAVE_THR )
-# if defined( THREAD_SUNOS5_LWP )
-
-/***********************************************************************
- * *
- * under sunos 5 - use the built in preemptive solaris threads package *
- * *
- ***********************************************************************/
+/*******************
+ * *
+ * Solaris Threads *
+ * *
+ *******************/
+#if !defined(__SunOS_5_6)
int
pthread_attr_init( pthread_attr_t *attr )
{
int
pthread_create(
pthread_t *tid,
- pthread_attr_t attr,
+ pthread_attr_t *attr,
VFP func,
void *arg
)
{
- return( thr_create( NULL, 0, func, arg, attr, tid ) );
+ return( thr_create( NULL, 0, func, arg, *attr, tid ) );
}
+#endif /* ! sunos56 */
void
pthread_yield()
thr_yield();
}
+#if !defined(__SunOS_5_6)
void
pthread_exit()
{
{
return( cond_broadcast( cv ) );
}
+#endif /* ! sunos56 */
+#elif defined( HAVE_LWP )
-#else /* end sunos5 threads */
+/*************
+ * *
+ * SunOS LWP *
+ * *
+ *************/
-#if defined( THREAD_MIT_PTHREADS )
+extern stkalign_t *get_stack();
+static void lwp_create_stack();
-/***********************************************************************
- * *
- * pthreads package by Chris Provenzano of MIT - provides all the *
- * pthreads calls already, so no mapping to do *
- * *
- ***********************************************************************/
+int
+pthread_attr_init( pthread_attr_t *attr )
+{
+ *attr = 0;
+ return( 0 );
+}
-#else /* end mit pthreads */
+int
+pthread_attr_destroy( pthread_attr_t *attr )
+{
+ return( 0 );
+}
-#if defined( THREAD_DCE_PTHREADS )
+int
+pthread_attr_getdetachstate( pthread_attr_t *attr, int *detachstate )
+{
+ *detachstate = *attr;
+ return( 0 );
+}
-/***********************************************************************
- * *
- * pthreads package with DCE - no mapping to do (except to create a *
- * pthread_kill() routine) *
- * *
- ***********************************************************************/
+int
+pthread_attr_setdetachstate( pthread_attr_t *attr, int detachstate )
+{
+ *attr = detachstate;
+ return( 0 );
+}
+
+/* ARGSUSED */
+int
+pthread_create(
+ pthread_t *tid,
+ pthread_attr_t *attr,
+ VFP func,
+ void *arg
+)
+{
+ stkalign_t *stack;
+ int stackno;
+
+ if ( (stack = get_stack( &stackno )) == NULL ) {
+ return( -1 );
+ }
+ return( lwp_create( tid, lwp_create_stack, MINPRIO, 0, stack, 3, func,
+ arg, stackno ) );
+}
+
+static void
+lwp_create_stack( VFP func, void *arg, int stackno )
+{
+ (*func)( arg );
+
+ free_stack( stackno );
+}
+
+void
+pthread_yield()
+{
+ lwp_yield( SELF );
+}
+
+void
+pthread_exit()
+{
+ lwp_destroy( SELF );
+}
+
+void
+pthread_join( pthread_t tid, int *status )
+{
+ lwp_join( tid );
+}
/* ARGSUSED */
void
pthread_kill( pthread_t tid, int sig )
{
- kill( getpid(), sig );
+ return;
+}
+
+/* ARGSUSED */
+int
+pthread_mutex_init( pthread_mutex_t *mp, pthread_mutexattr_t *attr )
+{
+ return( mon_create( mp ) );
+}
+
+int
+pthread_mutex_destroy( pthread_mutex_t *mp )
+{
+ return( mon_destroy( *mp ) );
+}
+
+int
+pthread_mutex_lock( pthread_mutex_t *mp )
+{
+ return( mon_enter( *mp ) );
+}
+
+int
+pthread_mutex_unlock( pthread_mutex_t *mp )
+{
+ return( mon_exit( *mp ) );
+}
+
+int
+pthread_mutex_trylock( pthread_mutex_t *mp )
+{
+ return( mon_cond_enter( *mp ) );
+}
+
+int
+pthread_cond_init( pthread_cond_t *cv, pthread_condattr_t *attr )
+{
+ /*
+ * lwp cv_create requires the monitor id be passed in
+ * when the cv is created, pthreads passes it when the
+ * condition is waited for. so, we fake the creation
+ * here and actually do it when the cv is waited for
+ * later.
+ */
+
+ cv->lcv_created = 0;
+
+ return( 0 );
+}
+
+int
+pthread_cond_destroy( pthread_cond_t *cv )
+{
+ return( cv->lcv_created ? cv_destroy( cv->lcv_cv ) : 0 );
+}
+
+int
+pthread_cond_wait( pthread_cond_t *cv, pthread_mutex_t *mp )
+{
+ if ( ! cv->lcv_created ) {
+ cv_create( &cv->lcv_cv, *mp );
+ cv->lcv_created = 1;
+ }
+
+ return( cv_wait( cv->lcv_cv ) );
+}
+
+int
+pthread_cond_signal( pthread_cond_t *cv )
+{
+ return( cv->lcv_created ? cv_notify( cv->lcv_cv ) : 0 );
+}
+
+int
+pthread_cond_broadcast( pthread_cond_t *cv )
+{
+ return( cv->lcv_created ? cv_broadcast( cv->lcv_cv ) : 0 );
}
-#endif /* dce pthreads */
-#endif /* mit pthreads */
-#endif /* sunos5 lwp */
-#endif /* sunos4 lwp */
-#ifndef _THREAD
+#else
/***********************************************************************
* *
int
pthread_create(
pthread_t *tid,
- pthread_attr_t attr,
+ pthread_attr_t *attr,
VFP func,
void *arg
)
##
LIBRARY = liblutil.a
-SRCS = base64.c md5.c sha1.c detach.c
-OBJS = base64.o md5.o sha1.o detach.o @LIBOBJS@
+SRCS = base64.c detach.c md5.c passwd.c sha1.c
+OBJS = base64.o detach.o md5.o passwd.c sha1.o @LIBOBJS@
LDAP_INCDIR= ../../include
LDAP_LIBDIR= ../../libraries
#include <sys/file.h>
#include <sys/ioctl.h>
-#include "portable.h"
-
+#include "lutil.h"
/* I'd really like to make do_close an fd_set, but that isn't portable. */
void
--- /dev/null
+/*
+ getopt.c
+
+ modified public-domain AT&T getopt(3)
+ modified by Kurt Zeilenga for inclusion into OpenLDAP
+*/
+
+#include "portable.h"
+
+#ifndef HAVE_GETOPT
+
+#include <stdio.h>
+
+#include <ac/string.h>
+#include <ac/unistd.h>
+
+#ifdef HAVE_IO_H
+#include <io.h>
+#endif
+
+#ifndef STDERR_FILENO
+#define STDERR_FILENO 2
+#endif
+
+int opterr = 1;
+int optind = 1;
+int optopt;
+char * optarg;
+
+static void ERR (char * const argv[], const char * s, char c)
+{
+ char errbuf[2];
+
+#ifdef DF_TRACE_DEBUG
+printf("DF_TRACE_DEBUG: static void ERR () in getopt.c\n");
+#endif
+ if (opterr)
+ {
+ errbuf[0] = c;
+ errbuf[1] = '\n';
+ (void) write(STDERR_FILENO,argv[0],strlen(argv[0]));
+ (void) write(STDERR_FILENO,s,strlen(s));
+ (void) write(STDERR_FILENO,errbuf,sizeof errbuf);
+ }
+}
+
+int getopt (int argc, char * const argv [], const char * opts)
+{
+ static int sp = 1, error = (int) '?';
+ static char sw = '-', eos = '\0', arg = ':';
+ register char c, * cp;
+
+#ifdef DF_TRACE_DEBUG
+printf("DF_TRACE_DEBUG: int getopt () in getopt.c\n");
+#endif
+ if (sp == 1)
+ if (optind >= argc || argv[optind][0] != sw
+ || argv[optind][1] == eos)
+ return EOF;
+ else if (strcmp(argv[optind],"--") == 0)
+ {
+ optind++;
+ return EOF;
+ }
+ c = argv[optind][sp];
+ optopt = (int) c;
+ if (c == arg || (cp = strchr(opts,c)) == NULL)
+ {
+ ERR(argv,": illegal option--",c);
+ if (argv[optind][++sp] == eos)
+ {
+ optind++;
+ sp = 1;
+ }
+ return error;
+ }
+ else if (*++cp == arg)
+ {
+ if (argv[optind][sp + 1] != eos)
+ optarg = &argv[optind++][sp + 1];
+ else if (++optind >= argc)
+ {
+ ERR(argv,": option requires an argument--",c);
+ sp = 1;
+ return error;
+ }
+ else
+ optarg = argv[optind++];
+ sp = 1;
+ }
+ else
+ {
+ if (argv[optind][++sp] == eos)
+ {
+ sp = 1;
+ optind++;
+ }
+ optarg = NULL;
+ }
+ return (int) c;
+}
+#endif /* HAVE_GETOPT */
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
+# PROP Output_Dir "..\Release"
+# PROP Intermediate_Dir "Release\liblutil"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "..\Debug"
-# PROP Intermediate_Dir "Debug"
+# PROP Intermediate_Dir "Debug\liblutil"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /W3 /GX /Z7 /Od /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo
+# ADD LIB32 /nologo /out:"..\Debug\olutil32.lib"
!ENDIF
# End Source File
# Begin Source File
+SOURCE="..\..\include\getopt-compat.h"
+# End Source File
+# Begin Source File
+
SOURCE=.\getopt.c
# End Source File
# Begin Source File
--- /dev/null
+/*
+ * lutil_password(credentials, password)
+ *
+ * Returns true if user supplied credentials matches
+ * the stored password.
+ *
+ * Due to the use of the crypt(3) function
+ * this routine is NOT thread-safe.
+ */
+
+#include "portable.h"
+
+#include <ac/string.h>
+#include <ac/unistd.h>
+
+#include "lutil_md5.h"
+#include "lutil_sha1.h"
+#include "lutil.h"
+
+/*
+ */
+
+int
+lutil_passwd(
+ const char *cred,
+ const char *passwd)
+{
+
+ if (cred == NULL || passwd == NULL) {
+ return 0;
+ }
+
+ if (strncasecmp(passwd, "{CRYPT}", sizeof("{CRYPT}") - 1) == 0 ) {
+ const char *p = passwd + (sizeof("{CRYPT}") - 1);
+
+ return( strcmp(p, crypt(cred, p)) != 0 );
+
+ } else if (strncasecmp(passwd, "{MD5}", sizeof("{MD5}") - 1) == 0 ) {
+ ldap_MD5_CTX MD5context;
+ unsigned char MD5digest[20];
+ char base64digest[29]; /* ceiling(sizeof(input)/3) * 4 + 1 */
+
+ const char *p = passwd + (sizeof("{MD5}") - 1);
+
+ ldap_MD5Init(&MD5context);
+ ldap_MD5Update(&MD5context,
+ cred, strlen(cred));
+ ldap_MD5Final(MD5digest, &MD5context);
+
+ if ( b64_ntop(MD5digest, sizeof(MD5digest),
+ base64digest, sizeof(base64digest)) < 0)
+ {
+ return ( 1 );
+ }
+
+ return (strcmp(p, base64digest) != 0);
+
+ } else if (strncasecmp(passwd, "{SHA}",sizeof("{SHA}") - 1) == 0 ) {
+ ldap_SHA1_CTX SHA1context;
+ unsigned char SHA1digest[20];
+ char base64digest[29]; /* ceiling(sizeof(input)/3) * 4 + 1 */
+ const char *p = passwd + (sizeof("{SHA}") - 1);
+
+ ldap_SHA1Init(&SHA1context);
+ ldap_SHA1Update(&SHA1context,
+ (unsigned char *) cred, strlen(cred));
+ ldap_SHA1Final(SHA1digest, &SHA1context);
+
+ if (b64_ntop(SHA1digest, sizeof(SHA1digest),
+ base64digest, sizeof(base64digest)) < 0)
+ {
+ return ( 0 );
+ }
+
+ return( strcmp(p, base64digest) != 0 );
+ }
+
+ return( strcmp(passwd, cred) != 0 );
+}
#ifndef HAVE_SETPROCTITLE
#include <stdlib.h>
+#include <ac/string.h>
#if defined( HAVE_STDARG_H ) && __STDC__
#include <stdarg.h>
/* attr.c - routines for dealing with attributes */
+#include "portable.h"
+
#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
+
+#ifdef HAVE_FCNTL_H
#include <fcntl.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/socket.h>
+#endif
+
+#include <ac/ctype.h>
+#include <ac/socket.h>
+#include <ac/string.h>
+#include <ac/time.h>
+
+#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
+#endif
+
#include <sys/stat.h>
-#include "portable.h"
+
#include "slap.h"
extern char **charray_dup();
-extern char *ch_malloc();
extern int errno;
void
a->asi_names = charray_dup( argv );
argv[lasti] = save;
- switch ( avl_insert( &attr_syntaxes, a, attr_syntax_cmp,
+ switch ( avl_insert( &attr_syntaxes, (caddr_t) a, attr_syntax_cmp,
attr_syntax_dup ) ) {
case -1: /* duplicate - different syntaxes */
Debug( LDAP_DEBUG_ARGS, "%s: line %d: duplicate attribute\n",
#include "ldbm.h"
+LDAP_BEGIN_DECL
+
#define DEFAULT_CACHE_SIZE 1000
-#define DEFAULT_DBCACHE_SIZE 100000
+
+#ifdef HAVE_BERKELEY_DB2
+# define DEFAULT_DBCACHE_SIZE (100 * DEFAULT_DB_PAGE_SIZE)
+#else
+# define DEFAULT_DBCACHE_SIZE 100000
+#endif
+
#define DEFAULT_DB_DIRECTORY "/usr/tmp"
#define DEFAULT_MODE 0600
struct cache li_cache;
Avlnode *li_attrs;
int li_dbcachesize;
+ int li_dbcachewsync;
struct dbcache li_dbcache[MAXDBCACHE];
pthread_mutex_t li_dbcache_mutex;
pthread_cond_t li_dbcache_cv;
};
-#ifdef NEEDPROTOS
#include "proto-back-ldbm.h"
-#endif
+
+LDAP_END_DECL
#endif /* _back_ldbm_h_ */
/* config.c - ldbm backend configuration file routine */
+#include "portable.h"
+
#include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/socket.h>
+
+#include <ac/socket.h>
+#include <ac/string.h>
+
#include "slap.h"
#include "back-ldbm.h"
}
li->li_dbcachesize = atoi( argv[1] );
+ /* no write sync */
+ } else if ( strcasecmp( argv[0], "dbcachenowsync" ) == 0 ) {
+ li->li_dbcachewsync = 0;
+
/* anything else */
} else {
fprintf( stderr,
/* delete.c - ldbm backend delete routine */
+#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 "slap.h"
#include "back-ldbm.h"
+#include "proto-back-ldbm.h"
-extern Entry *dn2entry();
extern Attribute *attr_find();
int
{
struct ldbminfo *li = (struct ldbminfo *) be->be_private;
char *matched = NULL;
- Entry *e;
+ char *pdn = NULL;
+ Entry *e, *p;
+
+ Debug(LDAP_DEBUG_ARGS, "==> ldbm_back_delete: %s\n", dn, 0, 0);
- if ( (e = dn2entry( be, dn, &matched )) == NULL ) {
+ /* get entry with writer lock */
+ if ( (e = dn2entry_w( be, dn, &matched )) == NULL ) {
+ Debug(LDAP_DEBUG_ARGS, "<=- ldbm_back_delete: no such object %s\n",
+ dn, 0, 0);
send_ldap_result( conn, op, LDAP_NO_SUCH_OBJECT, matched, "" );
if ( matched != NULL ) {
free( matched );
return( -1 );
}
+ Debug (LDAP_DEBUG_TRACE,
+ "rdwr_Xchk: readers_reading: %d writer_writing: %d\n",
+ e->e_rdwr.readers_reading, e->e_rdwr.writer_writing, 0);
+
+ /* check for deleted */
+
if ( has_children( be, e ) ) {
+ Debug(LDAP_DEBUG_ARGS, "<=- ldbm_back_delete: non leaf %s\n",
+ dn, 0, 0);
send_ldap_result( conn, op, LDAP_NOT_ALLOWED_ON_NONLEAF, "",
"" );
- cache_return_entry( &li->li_cache, e );
- return( -1 );
+ goto error_return;
}
if ( ! access_allowed( be, conn, op, e, "entry", NULL, op->o_dn,
ACL_WRITE ) ) {
+ Debug(LDAP_DEBUG_ARGS,
+ "<=- ldbm_back_delete: insufficient access %s\n",
+ dn, 0, 0);
send_ldap_result( conn, op, LDAP_INSUFFICIENT_ACCESS, "", "" );
- cache_return_entry( &li->li_cache, e );
- return( -1 );
+ goto error_return;
}
+ Debug (LDAP_DEBUG_TRACE,
+ "rdwr_Xchk: readers_reading: %d writer_writing: %d\n",
+ e->e_rdwr.readers_reading, e->e_rdwr.writer_writing, 0);
+
/* XXX delete from parent's id2children entry XXX */
+ pdn = dn_parent( be, dn );
+ matched = NULL;
+ p = dn2entry_r( be, pdn, &matched );
+ if ( id2children_remove( be, p, e ) != 0 ) {
+ send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR, "","" );
+ goto error_return;
+ }
/* delete from dn2id mapping */
if ( dn2id_delete( be, e->e_dn ) != 0 ) {
+ Debug(LDAP_DEBUG_ARGS,
+ "<=- ldbm_back_delete: operations error %s\n",
+ dn, 0, 0);
send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR, "", "" );
- cache_return_entry( &li->li_cache, e );
- return( -1 );
+ goto error_return;
}
/* delete from disk and cache */
if ( id2entry_delete( be, e ) != 0 ) {
+ Debug(LDAP_DEBUG_ARGS,
+ "<=- ldbm_back_delete: operations error %s\n",
+ dn, 0, 0);
send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR, "", "" );
- cache_return_entry( &li->li_cache, e );
- return( -1 );
+ goto error_return;
}
- cache_return_entry( &li->li_cache, e );
+
+ /* free entry and writer lock */
+ cache_return_entry_w( &li->li_cache, e );
send_ldap_result( conn, op, LDAP_SUCCESS, "", "" );
return( 0 );
+
+error_return:;
+ /* free entry and writer lock */
+ cache_return_entry_w( &li->li_cache, e );
+
+ if( p )
+ cache_return_entry_r( &li->li_cache, p );
+
+ return( -1 );
}
/* dn2id.c - routines to deal with the dn2id index */
+#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 "slap.h"
#include "back-ldbm.h"
+#include "proto-back-ldbm.h"
extern struct dbcache *ldbm_cache_open();
-extern Entry *cache_find_entry_dn();
-extern Entry *id2entry();
extern char *dn_parent();
extern Datum ldbm_cache_fetch();
ID id
)
{
- int rc;
+ int rc, flags;
struct dbcache *db;
Datum key, data;
+ struct ldbminfo *li = (struct ldbminfo *) be->be_private;
+
+#ifdef HAVE_BERKELEY_DB2
+ memset( &key, 0, sizeof( key ) );
+ memset( &data, 0, sizeof( data ) );
+#endif
Debug( LDAP_DEBUG_TRACE, "=> dn2id_add( \"%s\", %ld )\n", dn, id, 0 );
data.dptr = (char *) &id;
data.dsize = sizeof(ID);
- rc = ldbm_cache_store( db, key, data, LDBM_INSERT );
+ flags = LDBM_INSERT;
+ if ( li->li_dbcachewsync ) flags |= LDBM_SYNC;
+
+ rc = ldbm_cache_store( db, key, data, flags );
free( dn );
ldbm_cache_close( be, db );
{
struct ldbminfo *li = (struct ldbminfo *) be->be_private;
struct dbcache *db;
- Entry *e;
ID id;
Datum key, data;
- Debug( LDAP_DEBUG_TRACE, "=> dn2id( \"%s\" )\n", dn, 0, 0 );
+#ifdef HAVE_BERKELEY_DB2
+ memset( &key, 0, sizeof( key ) );
+ memset( &data, 0, sizeof( data ) );
+#endif
dn = strdup( dn );
+ Debug( LDAP_DEBUG_TRACE, "=> dn2id( \"%s\" )\n", dn, 0, 0 );
dn_normalize_case( dn );
/* first check the cache */
- if ( (e = cache_find_entry_dn( &li->li_cache, dn )) != NULL ) {
- id = e->e_id;
+ if ( (id = cache_find_entry_dn2id( be, &li->li_cache, dn )) != NOID ) {
free( dn );
- Debug( LDAP_DEBUG_TRACE, "<= dn2id %d (in cache)\n", e->e_id,
- 0, 0 );
- cache_return_entry( &li->li_cache, e );
-
+ Debug( LDAP_DEBUG_TRACE, "<= dn2id %d (in cache)\n", id,
+ 0, 0 );
return( id );
}
if ( (db = ldbm_cache_open( be, "dn2id", LDBM_SUFFIX, LDBM_WRCREAT ))
- == NULL ) {
+ == NULL ) {
free( dn );
Debug( LDAP_DEBUG_ANY, "<= dn2id could not open dn2id%s\n",
- LDBM_SUFFIX, 0, 0 );
+ LDBM_SUFFIX, 0, 0 );
return( NOID );
}
Datum key;
int rc;
+#ifdef HAVE_BERKELEY_DB2
+ memset( &key, 0, sizeof( key ) );
+#endif
+
Debug( LDAP_DEBUG_TRACE, "=> dn2id_delete( \"%s\" )\n", dn, 0, 0 );
if ( (db = ldbm_cache_open( be, "dn2id", LDBM_SUFFIX, LDBM_WRCREAT ))
* entry.
*/
-Entry *
+static Entry *
dn2entry(
Backend *be,
char *dn,
- char **matched
+ char **matched,
+ int rw
)
{
struct ldbminfo *li = (struct ldbminfo *) be->be_private;
Entry *e;
char *pdn;
- if ( (id = dn2id( be, dn )) != NOID && (e = id2entry( be, id ))
- != NULL ) {
+ Debug(LDAP_DEBUG_TRACE, "dn2entry_%s: dn: %s\n",
+ rw ? "w" : "r", dn, 0);
+
+ if ( (id = dn2id( be, dn )) != NOID &&
+ (e = id2entry( be, id, rw )) != NULL )
+ {
return( e );
}
*matched = NULL;
/* entry does not exist - see how much of the dn does exist */
if ( (pdn = dn_parent( be, dn )) != NULL ) {
- if ( (e = dn2entry( be, pdn, matched )) != NULL ) {
+ /* get entry with reader lock */
+ if ( (e = dn2entry_r( be, pdn, matched )) != NULL ) {
*matched = pdn;
- cache_return_entry( &li->li_cache, e );
+ /* free entry with reader lock */
+ cache_return_entry_r( &li->li_cache, e );
} else {
free( pdn );
}
return( NULL );
}
+
+#if 0
+ if (e->e_state == ENTRY_STATE_DELETED)
+ continue;
+
+ if (strcmp(dn, e->e_dn) != 0)
+ continue;
+
+ /* return locked entry entry */
+ return(e);
+ }
+}
+#endif
+
+Entry *
+dn2entry_r(
+ Backend *be,
+ char *dn,
+ char **matched
+)
+{
+ return( dn2entry( be, dn, matched, 0 ) );
+}
+
+Entry *
+dn2entry_w(
+ Backend *be,
+ char *dn,
+ char **matched
+)
+{
+ return( dn2entry( be, dn, matched, 1 ) );
+}
+
+
+
#include "portable.h"
#include <stdio.h>
+#include <ac/string.h>
#include <ac/socket.h>
return( 0 );
}
+
+int
+id2children_remove(
+ Backend *be,
+ Entry *p,
+ Entry *e
+)
+{
+ struct dbcache *db;
+ Datum key;
+ int len, rc;
+ IDList *idl;
+ char buf[20];
+
+ Debug( LDAP_DEBUG_TRACE, "=> id2children_remove( %d, %d )\n", p ? p->e_id
+ : 0, e->e_id, 0 );
+
+ if ( (db = ldbm_cache_open( be, "id2children", LDBM_SUFFIX,
+ LDBM_WRCREAT )) == NULL ) {
+ Debug( LDAP_DEBUG_ANY,
+ "<= id2children_add -1 could not open \"id2children%s\"\n",
+ LDBM_SUFFIX, 0, 0 );
+ return( -1 );
+ }
+
+ memset( &key, 0, sizeof(key) );
+ sprintf( buf, "%c%d", EQ_PREFIX, p ? p->e_id : 0 );
+ key.dptr = buf;
+ key.dsize = strlen( buf ) + 1;
+
+ if ( idl_delete_key( be, db, key, e->e_id ) != 0 ) {
+ Debug( LDAP_DEBUG_TRACE, "<= id2children_add -1 (idl_insert)\n",
+ 0, 0, 0 );
+ ldbm_cache_close( be, db );
+ return( -1 );
+ }
+
+ ldbm_cache_close( be, db );
+
+ Debug( LDAP_DEBUG_TRACE, "<= id2children_add 0\n", 0, 0, 0 );
+ return( 0 );
+}
+
int
has_children(
Backend *be,
/* store it */
flags = LDBM_REPLACE;
- if ( li->li_flush_wrt ) flags |= LDBM_SYNC;
+ if ( li->li_dbcachewsync ) flags |= LDBM_SYNC;
rc = ldbm_cache_store( db, key, data, flags );
pthread_mutex_unlock( &entry2str_mutex );
#endif
flags = LDBM_REPLACE;
- if( li->li_flush_wrt ) flags |= LDBM_SYNC;
+ if( li->li_dbcachewsync ) flags |= LDBM_SYNC;
rc = ldbm_cache_store( db, key, data, flags );
/* Debug( LDAP_DEBUG_TRACE, "<= idl_store %d\n", rc, 0, 0 ); */
return( i == 0 ? 1 : 0 ); /* inserted - first id changed or not */
}
+int
+idl_delete_key (
+ Backend *be,
+ struct dbcache *db,
+ Datum key,
+ ID id
+)
+{
+ Datum k2;
+ IDList *idl, *tmp;
+ int i, j, nids;
+ char *kstr;
+
+ if ( (idl = idl_fetch_one( be, db, key ) ) == NULL )
+ {
+ /* It wasn't found. Hmm... */
+ return -1;
+ }
+
+ if ( ! INDIRECT_BLOCK( idl ) )
+ {
+ for ( i=0; i < idl->b_nids; i++ )
+ {
+ if ( idl->b_ids[i] == id )
+ {
+ memcpy ( &idl->b_ids[i], &idl->b_ids[i+1], sizeof(ID)*(idl->b_nids-(i+1)));
+ idl->b_ids[idl->b_nids-1] = NOID;
+ idl->b_nids--;
+ if ( idl->b_nids )
+ idl_store( be, db, key, idl );
+ else
+ ldbm_cache_delete( db, key );
+ return 0;
+ }
+ /* We didn't find the ID. Hmmm... */
+ }
+ return -1;
+ }
+
+ /* We have to go through an indirect block and find the ID
+ in the list of IDL's
+ */
+ for ( nids = 0; idl->b_ids[nids] != NOID; nids++ )
+ ; /* NULL */
+ kstr = (char *) ch_malloc( key.dsize + 20 );
+ for ( j = 0; idl->b_ids[j] != NOID; j++ )
+ {
+ memset( &k2, 0, sizeof(k2) );
+ sprintf( kstr, "%c%s%d", CONT_PREFIX, key.dptr, idl->b_ids[j] );
+ k2.dptr = kstr;
+ k2.dsize = strlen( kstr ) + 1;
+
+ if ( (tmp = idl_fetch_one( be, db, k2 )) == NULL ) {
+ Debug( LDAP_DEBUG_ANY,
+ "idl_fetch of (%s) returns NULL\n", k2.dptr, 0, 0 );
+ continue;
+ }
+ /*
+ Now try to find the ID in tmp
+ */
+ for ( i=0; i < tmp->b_nids; i++ )
+ {
+ if ( tmp->b_ids[i] == id )
+ {
+ memcpy ( &tmp->b_ids[i], &tmp->b_ids[i+1], sizeof(ID)*(tmp->b_nids-(i+1)));
+ tmp->b_ids[tmp->b_nids-1] = NOID;
+ tmp->b_nids--;
+ if ( tmp->b_nids )
+ idl_store ( be, db, k2, tmp );
+ else
+ {
+ ldbm_cache_delete( db, k2 );
+ memcpy ( &idl->b_ids[j], &idl->b_ids[j+1], sizeof(ID)*(nids-(j+1)));
+ idl->b_ids[nids-1] = NOID;
+ nids--;
+ if ( ! nids )
+ ldbm_cache_delete( db, key );
+ else
+ idl_store( be, db, key, idl );
+ }
+ return 0;
+ }
+ }
+ }
+ return -1;
+}
+
static IDList *
idl_dup( IDList *idl )
{
/* init.c - initialize ldbm backend */
+#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 "slap.h"
#include "back-ldbm.h"
char *argv[ 4 ];
int i;
+#ifdef SLAPD_CRYPT
+ extern pthread_mutex_t crypt_mutex;
+#endif /* SLAPD_CRYPT */
+
/* allocate backend-specific stuff */
li = (struct ldbminfo *) ch_calloc( 1, sizeof(struct ldbminfo) );
/* default database cache size */
li->li_dbcachesize = DEFAULT_DBCACHE_SIZE;
+ /* default cache mode is sync on write */
+ li->li_dbcachewsync = 1;
+
/* default file creation mode */
li->li_mode = DEFAULT_MODE;
pthread_mutex_init( &li->li_cache.c_mutex, pthread_mutexattr_default );
pthread_mutex_init( &li->li_nextid_mutex, pthread_mutexattr_default );
pthread_mutex_init( &li->li_dbcache_mutex, pthread_mutexattr_default );
+#ifdef SLAPD_CRYPT
+ pthread_mutex_init( &crypt_mutex, pthread_mutexattr_default );
+#endif /* SLAPD_CRYPT */
pthread_cond_init( &li->li_dbcache_cv, pthread_condattr_default );
for ( i = 0; i < MAXDBCACHE; i++ ) {
pthread_mutex_init( &li->li_dbcache[i].dbc_mutex,
extern IDList *idl_alloc();
extern Attribute *attr_find();
extern IDList *filter_candidates();
-extern char *ch_realloc();
extern char *dn_parent();
static IDList *base_candidates();
/* modify.c - shell backend modify function */
+#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 "slap.h"
#include "shell.h"
for ( ; mods != NULL; mods = mods->mod_next ) {
switch ( mods->mod_op & ~LDAP_MOD_BVALUES ) {
case LDAP_MOD_ADD:
- fprintf( wfp, "add: %s", mods->mod_type );
+ fprintf( wfp, "add: %s\n", mods->mod_type );
break;
case LDAP_MOD_DELETE:
- fprintf( wfp, "delete: %s", mods->mod_type );
+ fprintf( wfp, "delete: %s\n", mods->mod_type );
break;
case LDAP_MOD_REPLACE:
- fprintf( wfp, "replace: %s", mods->mod_type );
+ fprintf( wfp, "replace: %s\n", mods->mod_type );
break;
}
* is provided ``as is'' without express or implied warranty.
*/
+#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 "slap.h"
extern Backend *select_backend();
+extern char *suffixAlias();
extern char *default_referral;
)
{
BerElement *ber = op->o_ber;
- int version, method, len, rc;
+ int version, method, len;
+ unsigned long rc;
char *dn;
struct berval cred;
Backend *be;
* }
*/
-#ifdef COMPAT30
+#ifdef LDAP_COMPAT30
/*
* in version 3.0 there is an extra SEQUENCE tag after the
* BindRequest SEQUENCE tag.
"decoding error" );
return;
}
-#ifdef COMPAT30
+#ifdef LDAP_COMPAT30
if ( conn->c_version == 30 ) {
switch ( method ) {
case LDAP_AUTH_SIMPLE_30:
method = LDAP_AUTH_SIMPLE;
break;
-#ifdef KERBEROS
+#ifdef HAVE_KERBEROS
case LDAP_AUTH_KRBV41_30:
method = LDAP_AUTH_KRBV41;
break;
free( cred.bv_val );
}
if ( cred.bv_len == 0 ) {
- send_ldap_result( conn, op, LDAP_SUCCESS, NULL, NULL );
+ send_ldap_result( conn, op, LDAP_SUCCESS,
+ NULL, NULL );
+ } else if ( default_referral && *default_referral ) {
+ send_ldap_result( conn, op, LDAP_PARTIAL_RESULTS,
+ NULL, default_referral );
} else {
- send_ldap_result( conn, op, LDAP_PARTIAL_RESULTS, NULL,
- default_referral );
+ send_ldap_result( conn, op, LDAP_INVALID_CREDENTIALS,
+ NULL, default_referral );
}
return;
}
+ /* alias suffix */
+ dn = suffixAlias ( dn, op, be );
+
if ( be->be_bind != NULL ) {
if ( (*be->be_bind)( be, conn, op, dn, method, &cred ) == 0 ) {
pthread_mutex_lock( &conn->c_dnmutex );
/* ch_malloc.c - malloc routines that test returns from malloc and friends */
+#include "portable.h"
+
#include <stdio.h>
-#include <sys/types.h>
-#include <sys/socket.h>
+
+#include <ac/string.h>
+#include <ac/socket.h>
+
#include "slap.h"
-char *
+void *
ch_malloc(
unsigned long size
)
{
- char *new;
+ void *new;
- if ( (new = (char *) malloc( size )) == NULL ) {
+ if ( (new = (void *) malloc( size )) == NULL ) {
Debug( LDAP_DEBUG_ANY, "malloc of %d bytes failed\n", size, 0, 0 );
exit( 1 );
}
return( new );
}
-char *
+void *
ch_realloc(
- char *block,
+ void *block,
unsigned long size
)
{
- char *new;
+ void *new;
if ( block == NULL ) {
return( ch_malloc( size ) );
}
- if ( (new = (char *) realloc( block, size )) == NULL ) {
+ if ( (new = (void *) realloc( block, size )) == NULL ) {
Debug( LDAP_DEBUG_ANY, "realloc of %d bytes failed\n", size, 0, 0 );
exit( 1 );
}
return( new );
}
-char *
+void *
ch_calloc(
unsigned long nelem,
unsigned long size
)
{
- char *new;
+ void *new;
- if ( (new = (char *) calloc( nelem, size )) == NULL ) {
+ if ( (new = (void *) calloc( nelem, size )) == NULL ) {
Debug( LDAP_DEBUG_ANY, "calloc of %d elems of %d bytes failed\n",
nelem, size, 0 );
exit( 1 );
-#include <stdio.h>
-#include <string.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <errno.h>
-#include <signal.h>
#include "portable.h"
+
+#include <stdio.h>
+
+#include <ac/errno.h>
+#include <ac/signal.h>
+#include <ac/socket.h>
+#include <ac/string.h>
+#include <ac/time.h>
+
#include "slap.h"
extern Operation *op_add();
extern long ops_completed;
extern pthread_mutex_t ops_mutex;
extern pthread_t listener_tid;
-#ifndef SYSERRLIST_IN_STDIO
-extern int sys_nerr;
-extern char *sys_errlist[];
-#endif
struct co_arg {
Connection *co_conn;
do_bind( arg->co_conn, arg->co_op );
break;
-#ifdef COMPAT30
+#ifdef LDAP_COMPAT30
case LDAP_REQ_UNBIND_30:
#endif
case LDAP_REQ_UNBIND:
do_add( arg->co_conn, arg->co_op );
break;
-#ifdef COMPAT30
+#ifdef LDAP_COMPAT30
case LDAP_REQ_DELETE_30:
#endif
case LDAP_REQ_DELETE:
do_search( arg->co_conn, arg->co_op );
break;
-#ifdef COMPAT30
+#ifdef LDAP_COMPAT30
case LDAP_REQ_ABANDON_30:
#endif
case LDAP_REQ_ABANDON:
return;
}
-#ifdef COMPAT30
+#ifdef LDAP_COMPAT30
if ( conn->c_version == 30 ) {
(void) ber_skip_tag( ber, &len );
}
pthread_attr_init( &attr );
pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_DETACHED );
+#if !defined(HAVE_PTHREADS_D4)
+ /* POSIX_THREADS or compatible
+ * This is a draft 10 or standard pthreads implementation
+ */
+ if ( pthread_create( &arg->co_op->o_tid, &attr,
+ connection_operation, (void *) arg ) != 0 ) {
+ Debug( LDAP_DEBUG_ANY, "pthread_create failed\n", 0, 0, 0 );
+ } else {
+ pthread_mutex_lock( &active_threads_mutex );
+ active_threads++;
+ pthread_mutex_unlock( &active_threads_mutex );
+ }
+#else /* pthread draft4 */
+ /*
+ * This is a draft 4 or earlier pthreads implementation
+ */
if ( pthread_create( &arg->co_op->o_tid, attr,
- (void *) connection_operation, (void *) arg ) != 0 ) {
+ connection_operation, (void *) arg ) != 0 ) {
Debug( LDAP_DEBUG_ANY, "pthread_create failed\n", 0, 0, 0 );
} else {
pthread_mutex_lock( &active_threads_mutex );
active_threads++;
pthread_mutex_unlock( &active_threads_mutex );
}
+#endif /* pthread draft4 */
pthread_attr_destroy( &attr );
}
static int get_substring_filter();
extern int get_ava();
-extern char *ch_malloc();
-extern char *ch_realloc();
int
get_filter( Connection *conn, BerElement *ber, Filter **filt, char **fstr )
#else
lockf( fileno( *lfp ), F_ULOCK, 0 );
#endif
+ fclose( *lfp );
+ *lfp = NULL;
return( NULL );
}
pthread_attr_init( &attr );
pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_DETACHED );
-#if !defined(HAVE_PTHREADS_D4) && !defined(HAVE_DCE)
+#if !defined(HAVE_PTHREADS_D4)
/* POSIX_THREADS or compatible
* This is a draft 10 or standard pthreads implementation
*/
#ifndef _PROTO_SLAP
#define _PROTO_SLAP
+#include <ldap_cdefs.h>
+
/*
* acl.c
*/
-int access_allowed( Backend *be, Connection *conn, Operation *op, Entry *e,
- char *attr, struct berval *val, char *dn, int access );
-struct acl * acl_get_applicable( Backend *be, Operation *op, Entry *e,
- char *attr );
-int acl_access_allowed( struct acl *a, Backend *be, Connection *conn, Entry *e,
- struct berval *val, Operation *op, int access );
-int acl_check_mods( Backend *be, Connection *conn, Operation *op, Entry *e,
- LDAPMod *mods );
+int access_allowed LDAP_P(( Backend *be, Connection *conn, Operation *op, Entry *e,
+ char *attr, struct berval *val, char *dn, int access ));
+
+struct acl * acl_get_applicable LDAP_P(( Backend *be, Operation *op, Entry *e,
+ char *attr, char *edn, int nmatches, regmatch_t *matches ));
+int acl_access_allowed LDAP_P(( struct acl *a, Backend *be, Connection *conn, Entry *e,
+ struct berval *val, Operation *op, int access, char *edn,
+ regmatch_t *matches ));
+
+int acl_check_mods LDAP_P(( Backend *be, Connection *conn, Operation *op, Entry *e,
+ LDAPMod *mods ));
/*
* aclparse.c
*/
-void parse_acl( Backend *be, char *fname, int lineno, int argc, char **argv );
-char * access2str( int access );
-int str2access( char *str );
+void parse_acl LDAP_P(( Backend *be, char *fname, int lineno, int argc, char **argv ));
+char * access2str LDAP_P(( int access ));
+int str2access LDAP_P(( char *str ));
/*
* attr.c
*/
-void attr_free( Attribute *a );
-char * attr_normalize( char *s );
-int attr_merge_fast( Entry *e, char *type, struct berval **vals, int nvals,
- int naddvals, int *maxvals, Attribute ***a );
-int attr_merge( Entry *e, char *type, struct berval **vals );
-Attribute * attr_find( Attribute *a, char *type );
-int attr_delete( Attribute **attrs, char *type );
-int attr_syntax( char *type );
-void attr_syntax_config( char *fname, int lineno, int argc, char **argv );
+void attr_free LDAP_P(( Attribute *a ));
+char * attr_normalize LDAP_P(( char *s ));
+int attr_merge_fast LDAP_P(( Entry *e, char *type, struct berval **vals, int nvals,
+ int naddvals, int *maxvals, Attribute ***a ));
+int attr_merge LDAP_P(( Entry *e, char *type, struct berval **vals ));
+Attribute * attr_find LDAP_P(( Attribute *a, char *type ));
+int attr_delete LDAP_P(( Attribute **attrs, char *type ));
+int attr_syntax LDAP_P(( char *type ));
+void attr_syntax_config LDAP_P(( char *fname, int lineno, int argc, char **argv ));
/*
* ava.c
*/
-int get_ava( BerElement *ber, Ava *ava );
-void ava_free( Ava *ava, int freeit );
+int get_ava LDAP_P(( BerElement *ber, Ava *ava ));
+void ava_free LDAP_P(( Ava *ava, int freeit ));
/*
* backend.c
*/
-Backend * new_backend( char *type );
-Backend * select_backend( char * dn );
-int be_issuffix( Backend *be, char *suffix );
-int be_isroot( Backend *be, char *dn );
-int be_isroot_pw( Backend *be, char *dn, struct berval *cred );
-void be_close();
+Backend * new_backend LDAP_P(( char *type ));
+Backend * select_backend LDAP_P(( char * dn ));
+int be_issuffix LDAP_P(( Backend *be, char *suffix ));
+int be_isroot LDAP_P(( Backend *be, char *dn ));
+int be_isroot_pw LDAP_P(( Backend *be, char *dn, struct berval *cred ));
+void be_close LDAP_P(());
/*
* ch_malloc.c
*/
-char * ch_malloc( unsigned long size );
-char * ch_realloc( char *block, unsigned long size );
-char * ch_calloc( unsigned long nelem, unsigned long size );
+void * ch_malloc LDAP_P(( unsigned long size ));
+void * ch_realloc LDAP_P(( void *block, unsigned long size ));
+void * ch_calloc LDAP_P(( unsigned long nelem, unsigned long size ));
/*
* charray.c
*/
-void charray_add( char ***a, char *s );
-void charray_merge( char ***a, char **s );
-void charray_free( char **array );
-int charray_inlist( char **a, char *s );
-char ** charray_dup( char **a );
-char ** str2charray( char *str, char *brkstr );
+void charray_add LDAP_P(( char ***a, char *s ));
+void charray_merge LDAP_P(( char ***a, char **s ));
+void charray_free LDAP_P(( char **array ));
+int charray_inlist LDAP_P(( char **a, char *s ));
+char ** charray_dup LDAP_P(( char **a ));
+char ** str2charray LDAP_P(( char *str, char *brkstr ));
/*
* config.c
*/
-void read_config( char *fname, Backend **bep, FILE *pfp );
+void read_config LDAP_P(( char *fname, Backend **bep, FILE *pfp ));
/*
* connection.c
*/
-void connection_activity( Connection *conn );
+void connection_activity LDAP_P(( Connection *conn ));
/*
* dn.c
*/
-char * dn_normalize( char *dn );
-char * dn_normalize_case( char *dn );
-char * dn_parent( Backend *be, char *dn );
-int dn_issuffix( char *dn, char *suffix );
-int dn_type( char *dn );
-char * dn_upcase( char *dn );
+char * dn_normalize LDAP_P(( char *dn ));
+char * dn_normalize_case LDAP_P(( char *dn ));
+char * dn_parent LDAP_P(( Backend *be, char *dn ));
+int dn_issuffix LDAP_P(( char *dn, char *suffix ));
+int dn_type LDAP_P(( char *dn ));
+char * dn_upcase LDAP_P(( char *dn ));
/*
* entry.c
*/
-Entry * str2entry( char *s );
-char * entry2str( Entry *e, int *len, int printid );
-void entry_free( Entry *e );
+Entry * str2entry LDAP_P(( char *s ));
+char * entry2str LDAP_P(( Entry *e, int *len, int printid ));
+void entry_free LDAP_P(( Entry *e ));
+
+int entry_rdwr_lock LDAP_P(( Entry *e, int rw ));
+int entry_rdwr_rlock LDAP_P(( Entry *e ));
+int entry_rdwr_wlock LDAP_P(( Entry *e ));
+int entry_rdwr_unlock LDAP_P(( Entry *e, int rw ));
+int entry_rdwr_runlock LDAP_P(( Entry *e ));
+int entry_rdwr_wunlock LDAP_P(( Entry *e ));
+int entry_rdwr_init LDAP_P(( Entry *e ));
/*
* filter.c
*/
-int get_filter( Connection *conn, BerElement *ber, Filter **filt, char **fstr );
-void filter_free( Filter *f );
-void filter_print( Filter *f );
+int get_filter LDAP_P(( Connection *conn, BerElement *ber, Filter **filt, char **fstr ));
+void filter_free LDAP_P(( Filter *f ));
+void filter_print LDAP_P(( Filter *f ));
/*
* filterentry.c
*/
-int test_filter( Backend *be, Connection *conn, Operation *op, Entry *e,
- Filter *f );
+int test_filter LDAP_P(( Backend *be, Connection *conn, Operation *op, Entry *e,
+ Filter *f ));
/*
* lock.c
*/
-FILE * lock_fopen( char *fname, char *type, FILE **lfp );
-int lock_fclose( FILE *fp, FILE *lfp );
+FILE * lock_fopen LDAP_P(( char *fname, char *type, FILE **lfp ));
+int lock_fclose LDAP_P(( FILE *fp, FILE *lfp ));
/*
* monitor.c
*/
-void monitor_info( Connection *conn, Operation *op );
+void monitor_info LDAP_P(( Connection *conn, Operation *op ));
/*
* operation.c
*/
-void op_free( Operation *op );
-Operation * op_add( Operation **olist, BerElement *ber, unsigned long msgid,
- unsigned long tag, char *dn, int id, int connid );
-void op_delete( Operation **olist, Operation *op );
+void op_free LDAP_P(( Operation *op ));
+Operation * op_add LDAP_P(( Operation **olist, BerElement *ber, unsigned long msgid,
+ unsigned long tag, char *dn, int id, int connid ));
+void op_delete LDAP_P(( Operation **olist, Operation *op ));
/*
* phonetic.c
*/
-char * first_word( char *s );
-char * next_word( char *s );
-char * word_dup( char *w );
-char * phonetic( char *s );
+char * first_word LDAP_P(( char *s ));
+char * next_word LDAP_P(( char *s ));
+char * word_dup LDAP_P(( char *w ));
+char * phonetic LDAP_P(( char *s ));
/*
* repl.c
*/
-void replog( Backend *be, int optype, char *dn, void *change, int flag );
+void replog LDAP_P(( Backend *be, int optype, char *dn, void *change, int flag ));
/*
* result.c
*/
-void send_ldap_result( Connection *conn, Operation *op, int err, char *matched,
- char *text );
-void send_ldap_search_result( Connection *conn, Operation *op, int err,
- char *matched, char *text, int nentries );
-void close_connection( Connection *conn, int opconnid, int opid );
+void send_ldap_result LDAP_P(( Connection *conn, Operation *op, int err, char *matched,
+ char *text ));
+void send_ldap_search_result LDAP_P(( Connection *conn, Operation *op, int err,
+ char *matched, char *text, int nentries ));
+void close_connection LDAP_P(( Connection *conn, int opconnid, int opid ));
/*
* schema.c
*/
-int oc_schema_check( Entry *e );
+int oc_schema_check LDAP_P(( Entry *e ));
/*
* schemaparse.c
*/
-void parse_oc( Backend *be, char *fname, int lineno, int argc, char **argv );
+void parse_oc LDAP_P(( Backend *be, char *fname, int lineno, int argc, char **argv ));
/*
* str2filter.c
*/
-Filter * str2filter( char *str );
+Filter * str2filter LDAP_P(( char *str ));
/*
* value.c
*/
-int value_add_fast( struct berval ***vals, struct berval **addvals, int nvals,
- int naddvals, int *maxvals );
-int value_add( struct berval ***vals, struct berval **addvals );
-void value_normalize( char *s, int syntax );
-int value_cmp( struct berval *v1, struct berval *v2, int syntax,
- int normalize );
-int value_ncmp( struct berval *v1, struct berval *v2, int syntax, int len,
- int normalize );
-int value_find( struct berval **vals, struct berval *v, int syntax,
- int normalize );
+int value_add_fast LDAP_P(( struct berval ***vals, struct berval **addvals, int nvals,
+ int naddvals, int *maxvals ));
+int value_add LDAP_P(( struct berval ***vals, struct berval **addvals ));
+void value_normalize LDAP_P(( char *s, int syntax ));
+int value_cmp LDAP_P(( struct berval *v1, struct berval *v2, int syntax,
+ int normalize ));
+int value_ncmp LDAP_P(( struct berval *v1, struct berval *v2, int syntax, int len,
+ int normalize ));
+int value_find LDAP_P(( struct berval **vals, struct berval *v, int syntax,
+ int normalize ));
+
+/*
+ * suffixAlias.c
+ */
+char *suffixAlias LDAP_P(( char *dn, Operation *op, Backend *be ));
#endif /* _proto_slap */
/* repl.c - log modifications for replication purposes */
+#include "portable.h"
+
#include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
+
+#include <ac/string.h>
+#include <ac/socket.h>
+
#include <sys/file.h>
-#include <sys/socket.h>
-#include <slap.h>
+
+#include "slap.h"
extern pthread_mutex_t replog_mutex;
extern pthread_mutex_t entry2str_mutex;
extern FILE *lock_fopen();
extern int lock_fclose();
-extern char *ch_malloc();
extern char *entry2str();
void
len = strlen( mods->mod_type );
len = LDIF_SIZE_NEEDED( len,
mods->mod_bvalues[i]->bv_len ) + 1;
- buf = ch_malloc( len );
+ buf = (char *) ch_malloc( len );
bufp = buf;
put_type_and_value( &bufp, mods->mod_type,
#ifndef _SLDAPD_H_
#define _SLDAPD_H_
-#include "portable.h"
-
#include <stdlib.h>
#include <sys/types.h>
#include "portable.h"
#include <stdio.h>
+#include <stdlib.h>
#include <ac/ctype.h>
#include <ac/string.h>
* slapd/slurpd locking conventions.
*/
+#include "portable.h"
+
#include <stdio.h>
-#include <string.h>
#include <stdlib.h>
-#include <ctype.h>
+
+#include <ac/ctype.h>
+#include <ac/string.h>
#include <quipu/commonarg.h>
#include <quipu/attrvalue.h>
extern FILE *lock_fopen( char *, char *, FILE ** );
extern int lock_fclose( FILE *, FILE * );
-extern char *ch_realloc( char *, unsigned long );
+extern void *ch_realloc( void *, unsigned long );
short ldap_dn_syntax;
PS rps;
+#include "portable.h"
+
#include <stdio.h>
-#include <string.h>
-#include <memory.h>
-#include <sys/types.h>
-#include <sys/socket.h>
+#include <stdlib.h>
+
+#include <ac/string.h>
+#include <ac/socket.h>
+
#include "lber.h"
#include "ldap.h"
#include "ldif.h"
{
char buf[BUFSIZ];
char *type, *out;
- int binary = 0;
+ int len, binary = 0;
if (argc < 2 || argc > 3 ) {
usage( argv[0] );
}
/* not binary: one value per line... */
- while ( gets( buf ) != NULL ) {
+ while ( fgets( buf, sizeof(buf), stdin ) != NULL ) {
+ if( buf[len=strlen(buf)] == '\n') buf[len] = '\0';
+
if (( out = ldif_type_and_value( type, buf, strlen( buf ) ))
== NULL ) {
perror( "ldif_type_and_value" );
+#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 "../slap.h"
#include "../back-ldbm/back-ldbm.h"
-#define DEFAULT_CONFIGFILE "/usr/local/etc/slapd.conf"
+#include "ldapconfig.h"
+#include "ldif.h"
+
#define MAXARGS 100
extern struct dbcache *ldbm_cache_open();
extern void attr_index_config();
-extern char *str_getline();
extern char *dn_parent();
extern char *dn_normalize_case();
-extern int strcasecmp();
extern int nbackends;
extern Backend *backends;
extern int ldap_debug;
pthread_mutex_t ops_mutex;
pthread_mutex_t regex_mutex;
-static int make_index();
-
static char *tailorfile;
static char *inputfile;
int dbnum;
ID id;
struct dbcache *db, *db2;
- Backend *be;
+ Backend *be = NULL;
struct berval bv;
struct berval *vals[2];
Avlnode *avltypes = NULL;
extern char *optarg;
- tailorfile = DEFAULT_CONFIGFILE;
+ tailorfile = SLAPD_DEFAULT_CONFIGFILE;
dbnum = -1;
while ( (i = getopt( argc, argv, "d:f:i:n:" )) != EOF ) {
switch ( i ) {
fprintf( stderr, "No ldbm database found in config file\n" );
exit( 1 );
}
- } else if ( dbnum < 1 || dbnum > nbackends ) {
+ } else if ( dbnum < 0 || dbnum > (nbackends-1) ) {
fprintf( stderr, "Database number selected via -n is out of range\n" );
fprintf( stderr, "Must be in the range 1 to %d (number of databases in the config file)\n", nbackends );
exit( 1 );
+#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 "../slap.h"
-#define DEFAULT_CONFIGFILE "/usr/local/etc/slapd.conf"
+#include "ldapconfig.h"
+#include "ldif.h"
+
#define MAXARGS 100
extern void attr_index_config();
-extern char *str_getline();
extern char *attr_normalize();
extern int nbackends;
extern Backend *backends;
int lmax, lcur, indexmask, syntaxmask;
int dbnum;
unsigned long id;
- Backend *be;
+ Backend *be = NULL;
struct berval bv;
struct berval *vals[2];
extern char *optarg;
inputfile = NULL;
- tailorfile = DEFAULT_CONFIGFILE;
+ tailorfile = SLAPD_DEFAULT_CONFIGFILE;
dbnum = -1;
while ( (i = getopt( argc, argv, "d:f:i:n:" )) != EOF ) {
switch ( i ) {
fprintf( stderr, "No ldbm database found in config file\n" );
exit( 1 );
}
- } else if ( dbnum < 1 || dbnum > nbackends ) {
+ } else if ( dbnum < 0 || dbnum > (nbackends-1) ) {
fprintf( stderr, "Database number selected via -n is out of range\n" );
fprintf( stderr, "Must be in the range 1 to %d (number of databases in the config file)\n", nbackends );
exit( 1 );
+#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 <sys/param.h>
+
#include "../slap.h"
#include "../back-ldbm/back-ldbm.h"
+#include "ldapconfig.h"
+#include "ldif.h"
-#define DEFAULT_CONFIGFILE "%ETCDIR%/slapd.conf"
-#define DEFAULT_ETCDIR "%ETCDIR%"
#define INDEXCMD "ldif2index"
#define ID2ENTRYCMD "ldif2id2entry"
#define ID2CHILDRENCMD "ldif2id2children"
#define MAXARGS 100
-extern void attr_index_config();
-extern char *str_getline();
-extern int strcasecmp();
extern int nbackends;
-extern Backend *backends;
+extern Backend *backends;
extern int ldap_debug;
int ldap_debug;
pthread_mutex_t ops_mutex;
pthread_mutex_t regex_mutex;
-static void fork_child();
-static void wait4kids();
+static void fork_child( char *prog, char *args[] );
+static void wait4kids( int nkidval );
static char *indexcmd;
static char *tailorfile;
static void
usage( char *name )
{
- fprintf( stderr, "usage: %s -i inputfile [-d debuglevel] [-f configfile] [-j #jobs] [-n databasenumber] [-e etcdir]\n", name );
+ fprintf( stderr, "usage: %s -i inputfile [-d debuglevel] [-f configfile] [-j #jobs] [-n databasenumber] [-s sbindir]\n", name );
exit( 1 );
}
main( int argc, char **argv )
{
int i, stop, status;
- char *linep, *buf, *etcdir;
+ char *linep, *buf, *sbindir;
char *args[10];
char buf2[20], buf3[20];
char line[BUFSIZ];
Avlnode *avltypes = NULL;
extern char *optarg;
- etcdir = DEFAULT_ETCDIR;
- tailorfile = DEFAULT_CONFIGFILE;
+ sbindir = DEFAULT_SBINDIR;
+ tailorfile = SLAPD_DEFAULT_CONFIGFILE;
dbnum = -1;
- while ( (i = getopt( argc, argv, "d:e:f:i:j:n:" )) != EOF ) {
+ while ( (i = getopt( argc, argv, "d:e:s:f:i:j:n:" )) != EOF ) {
switch ( i ) {
case 'd': /* turn on debugging */
ldap_debug = atoi( optarg );
break;
- case 'e': /* alternate etcdir (index cmd location) */
- etcdir = strdup( optarg );
+ case 's': /* alternate sbindir (index cmd location) */
+ case 'e': /* accept -e for backwards compatibility */
+ sbindir = strdup( optarg );
break;
case 'f': /* specify a tailor file */
fprintf( stderr, "No ldbm database found in config file\n" );
exit( 1 );
}
- } else if ( dbnum < 0 || dbnum > nbackends ) {
+ } else if ( dbnum < 0 || dbnum > (nbackends-1) ) {
fprintf( stderr, "Database number selected via -n is out of range\n" );
fprintf( stderr, "Must be in the range 1 to %d (number of databases in the config file)\n", nbackends );
exit( 1 );
*/
i = 0;
- sprintf( cmd, "%s/%s", etcdir, ID2ENTRYCMD );
+ sprintf( cmd, "%s/%s", sbindir, ID2ENTRYCMD );
args[i++] = cmd;
args[i++] = "-i";
args[i++] = inputfile;
args[i++] = "-f";
args[i++] = tailorfile;
args[i++] = "-n";
- sprintf( buf2, "%d", dbnum );
+ sprintf( buf2, "%d", dbnum+1 );
args[i++] = buf2;
if ( ldap_debug ) {
sprintf( buf3, "%d", ldap_debug );
*/
i = 0;
- sprintf( cmd, "%s/%s", etcdir, ID2CHILDRENCMD );
+ sprintf( cmd, "%s/%s", sbindir, ID2CHILDRENCMD );
args[i++] = cmd;
args[i++] = "-i";
args[i++] = inputfile;
args[i++] = "-f";
args[i++] = tailorfile;
args[i++] = "-n";
- sprintf( buf2, "%d", dbnum );
+ sprintf( buf2, "%d", dbnum+1 );
args[i++] = buf2;
if ( ldap_debug ) {
sprintf( buf3, "%d", ldap_debug );
*/
i = 0;
- sprintf( cmd, "%s/%s", etcdir, INDEXCMD );
+ sprintf( cmd, "%s/%s", sbindir, INDEXCMD );
args[i++] = cmd;
args[i++] = "-i";
args[i++] = inputfile;
args[i++] = "-f";
args[i++] = tailorfile;
args[i++] = "-n";
- sprintf( buf2, "%d", dbnum );
+ sprintf( buf2, "%d", dbnum+1 );
args[i++] = buf2;
if ( ldap_debug ) {
sprintf( buf3, "%d", ldap_debug );
* Just like malloc, except we check the returned value and exit
* if anything goes wrong.
*/
-char *
+void *
ch_malloc(
unsigned long size
)
{
- char *new;
+ void *new;
- if ( (new = (char *) malloc( size )) == NULL ) {
+ if ( (new = (void *) malloc( size )) == NULL ) {
fprintf( stderr, "malloc of %lu bytes failed\n", size );
exit( 1 );
}
* Just like realloc, except we check the returned value and exit
* if anything goes wrong.
*/
-char *
+void *
ch_realloc(
- char *block,
+ void *block,
unsigned long size
)
{
- char *new;
+ void *new;
if ( block == NULL ) {
return( ch_malloc( size ) );
}
- if ( (new = (char *) realloc( block, size )) == NULL ) {
+ if ( (new = (void *) realloc( block, size )) == NULL ) {
fprintf( stderr, "realloc of %lu bytes failed\n", size );
exit( 1 );
}
* Just like calloc, except we check the returned value and exit
* if anything goes wrong.
*/
-char *
+void *
ch_calloc(
unsigned long nelem,
unsigned long size
)
{
- char *new;
+ void *new;
- if ( (new = (char *) calloc( nelem, size )) == NULL ) {
+ if ( (new = (void *) calloc( nelem, size )) == NULL ) {
fprintf( stderr, "calloc of %lu elems of %lu bytes failed\n",
nelem, size );
exit( 1 );
*/
void
ch_free(
- char *p
+ void *p
)
{
if ( p != NULL ) {
* fm.c - file management routines.
*/
+#include "portable.h"
+
#include <stdio.h>
-#include <string.h>
-#include <signal.h>
+
+#include <ac/string.h>
+#include <ac/signal.h>
#include "slurp.h"
#include "globals.h"
-extern void do_admin();
-
-static void set_shutdown();
-void do_nothing();
/*
* Externs
*/
-#ifdef NEEDPROTOS
-extern int file_nonempty( char * );
-extern int acquire_lock(char *, FILE **, FILE ** );
-extern int relinquish_lock(char *, FILE *, FILE * );
-#else /* NEEDPROTOS */
-extern int file_nonempty();
-extern int acquire_lock();
-extern int relinquish_lock();
-#endif /* NEEDPROTOS */
+extern RETSIGTYPE do_admin LDAP_P((int));
+extern int file_nonempty LDAP_P(( char * ));
+extern int acquire_lock LDAP_P((char *, FILE **, FILE ** ));
+extern int relinquish_lock LDAP_P((char *, FILE *, FILE * ));
/*
* Forward references
*/
-#ifdef NEEDPROTOS
-static char *get_record( FILE * );
-static void populate_queue( char *f );
-static void set_shutdown();
-void do_nothing();
-#else /* NEEDPROTOS */
-static char *get_record();
-static void populate_queue();
-static void set_shutdown();
-void do_nothing();
-#endif /* NEEDPROTOS */
-
-#ifndef SYSERRLIST_IN_STDIO
-extern char *sys_errlist[];
-#endif /* SYSERRLIST_IN_STDIO */
-
+static char *get_record LDAP_P(( FILE * ));
+static void populate_queue LDAP_P(( char *f ));
+static RETSIGTYPE set_shutdown LDAP_P((int));
+RETSIGTYPE do_nothing LDAP_P((int));
/*
/* Set up our signal handlers:
* SIG{TERM,INT,HUP} causes a shutdown
- * SIGUSR1 - does nothing, used to wake up sleeping threads.
- * SIGUSR2 - causes slurpd to read its administrative interface file.
+ * SIG(STKFLT|USR1) - does nothing, used to wake up sleeping threads.
+ * SIG(UNUSED|USR2) - causes slurpd to read its administrative interface file.
* (not yet implemented).
*/
- (void) SIGNAL( SIGUSR1, (void *) do_nothing );
- (void) SIGNAL( SIGUSR2, (void *) do_admin );
- (void) SIGNAL( SIGTERM, (void *) set_shutdown );
- (void) SIGNAL( SIGINT, (void *) set_shutdown );
- (void) SIGNAL( SIGHUP, (void *) set_shutdown );
+#ifdef HAVE_LINUX_THREADS
+ (void) SIGNAL( SIGSTKFLT, do_nothing );
+ (void) SIGNAL( SIGUNUSED, do_admin );
+#else
+ (void) SIGNAL( SIGUSR1, do_nothing );
+ (void) SIGNAL( SIGUSR2, do_admin );
+#endif
+ (void) SIGNAL( SIGTERM, set_shutdown );
+ (void) SIGNAL( SIGINT, set_shutdown );
+ (void) SIGNAL( SIGHUP, set_shutdown );
if ( sglob->one_shot_mode ) {
if ( file_nonempty( sglob->slapd_replogfile )) {
/*
* Set a global flag which signals that we're shutting down.
*/
-static void
-set_shutdown()
+static RETSIGTYPE
+set_shutdown(int x)
{
int i;
sglob->slurpd_shutdown = 1; /* set flag */
+#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 */
+#endif
sglob->rq->rq_lock( sglob->rq ); /* lock queue */
pthread_cond_broadcast( &(sglob->rq->rq_more) ); /* wake repl threads */
for ( i = 0; i < sglob->num_replicas; i++ ) {
(sglob->replicas[ i ])->ri_wake( sglob->replicas[ i ]);
}
sglob->rq->rq_unlock( sglob->rq ); /* unlock queue */
- (void) SIGNAL( SIGTERM, (void *) set_shutdown ); /* reinstall handlers */
- (void) SIGNAL( SIGINT, (void *) set_shutdown );
- (void) SIGNAL( SIGHUP, (void *) set_shutdown );
+ (void) SIGNAL( SIGTERM, set_shutdown ); /* reinstall handlers */
+ (void) SIGNAL( SIGINT, set_shutdown );
+ (void) SIGNAL( SIGHUP, set_shutdown );
}
/*
* A do-nothing signal handler.
*/
-void
-do_nothing()
+RETSIGTYPE
+do_nothing(int i)
{
- (void) SIGNAL( SIGUSR1, (void *) do_nothing );
+#ifdef HAVE_LINUX_THREADS
+ (void) SIGNAL( SIGSTKFLT, do_nothing );
+#else
+ (void) SIGNAL( SIGUSR1, do_nothing );
+#endif
}
Debug( LDAP_DEBUG_ANY,
"error: can't seek to offset %ld in file \"%s\"\n",
sglob->srpos, f, 0 );
- return;
- }
+ } else {
while (( p = get_record( fp )) != NULL ) {
if ( sglob->rq->rq_add( sglob->rq, p ) < 0 ) {
char *t;
pthread_yield();
}
sglob->srpos = ftell( fp );
+ }
(void) relinquish_lock( f, fp, lfp );
}
* globals.c - initialization code for global data
*/
+#include "portable.h"
+
#include <stdio.h>
+#include <stdlib.h>
#include "slurp.h"
#include "globals.h"
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;
}
static int do_unbind LDAP_P(( Ri * ));
-/* External references */
-extern char *ch_malloc LDAP_P(( unsigned long ));
-
static char *kattrs[] = {"kerberosName", NULL };
static struct timeval kst = {30L, 0L};
return( BIND_ERR_OPEN );
}
+ /*
+ * Disable string translation if enabled by default.
+ * The replication log is written in the internal format,
+ * so this would do another translation, breaking havoc.
+ */
+#if defined( STR_TRANSLATION ) && defined( LDAP_DEFAULT_CHARSET )
+ ri->ri_ldp->ld_lberoptions &= ~LBER_TRANSLATE_STRINGS;
+#endif /* STR_TRANSLATION && LDAP_DEFAULT_CHARSET */
+
/*
* Set ldap library options to (1) not follow referrals, and
* (2) restart the select() system call.
#else
lockf( fileno( *lfp ), F_ULOCK, 0 );
#endif
+ fclose( *lfp );
+ *lfp = NULL;
return( NULL );
}
*/
pthread_attr_init( &attr );
-#if !defined(HAVE_PTHREADS_D4) && !defined(HAVE_DCE)
+#if !defined(HAVE_PTHREADS_D4)
/* POSIX_THREADS or compatible
* This is a draft 10 or standard pthreads implementation
*/
/* externs */
extern char *str_getline LDAP_P(( char **next ));
-extern void ch_free LDAP_P(( char *p ));
/* Forward references */
static Rh *get_repl_hosts LDAP_P(( char *, int *, char ** ));
pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_DETACHED );
#endif
-#if !defined(HAVE_PTHREAD_D4) && !defined(HAVE_DCE)
+#if !defined(HAVE_PTHREADS_D4)
/* POSIX_THREADS or compatible
* This is a draft 10 or standard pthreads implementation
*/
* replog.c - routines which read and write replication log files.
*/
+#include "portable.h"
-#include <errno.h>
#include <stdio.h>
-#include <syslog.h>
-#include <sys/time.h>
-#include <sys/types.h>
+
+#include <ac/errno.h>
+#include <ac/string.h>
+#include <ac/syslog.h>
+#include <ac/time.h>
+#include <ac/unistd.h>
+
#include <sys/stat.h>
#include <sys/param.h>
#include <fcntl.h>
-#include <unistd.h>
-#include <string.h>
-#include "portable.h"
#include "slurp.h"
#include "globals.h"
/*
* Externs
*/
-#ifdef NEEDPROTOS
-extern FILE *lock_fopen( char *, char *, FILE ** );
-extern char *ch_malloc( unsigned long );
-#else /* NEEDPROTOS */
-extern FILE *lock_fopen();
-extern char *ch_malloc();
-#endif /* NEEDPROTOS */
+extern FILE *lock_fopen LDAP_P(( char *, char *, FILE ** ));
/*
* Forward declarations
*/
-#ifdef NEEDPROTOS
-int file_nonempty( char * );
-#else /* NEEDPROTOS */
-int file_nonempty();
-#endif /* NEEDPROTOS */
-
+int file_nonempty LDAP_P(( char * ));
-#ifndef SYSERRLIST_IN_STDIO
-extern char *sys_errlist[];
-#endif
/*
* Forward declarations
static int duplicate_replog( char *, char * );
-
-
/*
* Copy the replication log. Returns 0 on success, 1 if a temporary
* error occurs, and -1 if a fatal error occurs.
Debug( LDAP_DEBUG_ANY,
"Error: copy_replog: Can't lock replog \"%s\" for write: %s\n",
src, sys_errlist[ errno ], 0 );
- lock_fclose( rfp );
+ lock_fclose( rfp, lfp );
return( 1 );
}
truncate( src, (off_t) 0 );
}
- if ( lock_fclose( rfp, lfp ) == EOF ) {
+ if ( lock_fclose( dfp, dlfp ) == EOF ) {
Debug( LDAP_DEBUG_ANY,
"Error: copy_replog: Error closing \"%s\"\n",
src, 0, 0 );
}
- if ( lock_fclose( dfp, dlfp ) == EOF ) {
+ if ( lock_fclose( rfp, lfp ) == EOF ) {
Debug( LDAP_DEBUG_ANY,
"Error: copy_replog: Error closing \"%s\"\n",
src, 0, 0 );
#include "portable.h"
#include <stdio.h>
+#include <stdlib.h>
#include <ac/signal.h>
#include "slurp.h"
while ( !sglob->slurpd_shutdown &&
((new_re = re->re_getnext( re )) == NULL )) {
if ( sglob->one_shot_mode ) {
+ rq->rq_unlock( rq );
return 0;
}
/* No work - wait on condition variable */
*
*/
+#include "portable.h"
+
#include <stdio.h>
+#include <stdlib.h>
#include "slurp.h"
#include "globals.h"
/* externs */
-#ifdef NEEDPROTOS
-extern void Re_dump( Re *re );
-#else /* NEEDPROTOS */
-extern void Re_dump();
-#endif /* NEEDPROTOS */
-
-
-extern char *sys_errlist[];
-
+extern void Re_dump LDAP_P(( Re *re ));
/*
* Lock the replication queue.
}
-
-
-
/*
* Unlock the replication queue.
*/
}
-
-
/*
* Return the next item in the queue. Callers should lock the queue before
* calling this routine.
}
-
-
/*
* Delete the item at the head of the list. The queue should be locked
* by the caller before calling this routine.
}
-
-
/*
* Add an entry to the tail of the replication queue. Locking is handled
* internally. When items are added to the queue, this routine wakes
}
-
-
/*
* Garbage-collect the replication queue. Locking is handled internally.
*/
}
-
/*
* For debugging: dump the contents of the replication queue to a file.
* Locking is handled internally.
}
-
/*
* Write the contents of a replication queue to a file. Returns zero if
* successful, -1 if not. Handles queue locking internally. Callers should
}
-
-
/*
* Check to see if the private slurpd replication log needs trimming.
* The current criteria are:
}
-
-
/*
* Allocate and initialize an Rq object.
*/
#define LDAP_SYSLOG
-#include <syslog.h>
-#include <errno.h>
-#include <sys/types.h>
+#include <ac/syslog.h>
+#include <ac/errno.h>
+
#include <sys/param.h>
+
#include "lber.h"
#include "ldap.h"
#include "lthread.h"
-#include "portable.h"
#include "ldapconfig.h"
#include "ldif.h"
#define RETRY_SLEEP_TIME 60
+LDAP_BEGIN_DECL
/*
* ****************************************************************************
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 */
tl_t *tsl_list;
mon_t tsl_mon;
} tsl_t;
-#endif /* THREAD_SUNOS4_LWP */
+#endif /* HAVE_LWP */
+
+/* Public functions */
+/* In ch_malloc.c */
+void * ch_malloc LDAP_P(( unsigned long size ));
+void * ch_realloc LDAP_P(( void *block, unsigned long size ));
+void * ch_calloc LDAP_P(( unsigned long nelem, unsigned long size ));
+void ch_free LDAP_P(( void *p ));
/*
* Public functions used to instantiate and initialize queue objects.
*/
-#ifdef NEEDPROTOS
-extern int Ri_init( Ri **ri );
-extern int Rq_init( Rq **rq );
-extern int Re_init( Re **re );
-#else /* NEEDPROTOS */
-extern int Ri_init();
-extern int Rq_init();
-extern int Re_init();
-#endif /* NEEDPROTOS */
+extern int Ri_init LDAP_P(( Ri **ri ));
+extern int Rq_init LDAP_P(( Rq **rq ));
+extern int Re_init LDAP_P(( Re **re ));
-#endif /* _SLURPD_H_ */
+LDAP_END_DECL
+#endif /* _SLURPD_H_ */
* writing status information to disk.
*/
-
+#include "portable.h"
#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
+#include <stdlib.h>
+#include <ac/string.h>
+#include <ac/unistd.h>
#include "slurp.h"
#include "globals.h"
-#ifndef SYSERRLIST_IN_STDIO
-extern char *sys_errlist[];
-#endif /* SYSERRLIST_IN_STDIO */
-
/*
* Add information about replica host specified by Ri to list
* of hosts.
pthread_mutex_unlock( &(st->st_mutex ));
return NULL;
}
- st->st_data[ ind ] = ( Stel * ) ch_malloc( st->st_data,
- sizeof( Stel ));
+ st->st_data[ ind ] = ( Stel * ) ch_malloc( sizeof( Stel ) );
if ( st->st_data[ ind ] == NULL ) {
pthread_mutex_unlock( &(st->st_mutex ));
return NULL;
return 0;
}
if (( rc = acquire_lock( sglob->slurpd_status_file, &fp, &lfp)) < 0 ) {
+ pthread_mutex_unlock( &(st->st_mutex ));
return 0;
}
while ( fgets( buf, sizeof( buf ), fp ) != NULL ) {
echo "Cleaning up in $DBDIR..."
-rm -f $DBDIR/*
+rm -f $DBDIR/[!C]*
echo "Running ldif2ldbm to build slapd database..."
-$LDIF2LDBM -f $CONF -i $LDIF -e ../servers/slapd/tools
+$LDIF2LDBM -j 1 -d 1 -f $CONF -i $LDIF -e ../servers/slapd/tools
RC=$?
if [ $RC != 0 ]; then
echo "ldif2ldbm failed!"
fi
echo "Starting slapd on TCP/IP port $PORT..."
-$SLAPD -f $CONF -p $PORT -d 1 > /dev/null 2>&1 &
+$SLAPD -f $CONF -p $PORT -d 1 > $MASTERLOG 2>&1 &
PID=$!
echo "Using ldapsearch to retrieve all the entries..."