]> git.sur5r.net Git - openldap/commitdiff
SLAPD compiles. Needs LDBM work to link.
authorKurt Zeilenga <kurt@openldap.org>
Wed, 21 Oct 1998 23:49:46 +0000 (23:49 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Wed, 21 Oct 1998 23:49:46 +0000 (23:49 +0000)
82 files changed:
servers/slapd/acl.c
servers/slapd/aclparse.c
servers/slapd/add.c
servers/slapd/attr.c
servers/slapd/ava.c
servers/slapd/back-ldbm/add.c
servers/slapd/back-ldbm/attr.c
servers/slapd/back-ldbm/back-ldbm.h
servers/slapd/back-ldbm/bind.c
servers/slapd/back-ldbm/cache.c
servers/slapd/back-ldbm/close.c
servers/slapd/back-ldbm/compare.c
servers/slapd/back-ldbm/config.c
servers/slapd/back-ldbm/dbcache.c
servers/slapd/back-ldbm/delete.c
servers/slapd/back-ldbm/dn2id.c
servers/slapd/back-ldbm/filterindex.c
servers/slapd/back-ldbm/group.c
servers/slapd/back-ldbm/id2children.c
servers/slapd/back-ldbm/id2entry.c
servers/slapd/back-ldbm/idl.c
servers/slapd/back-ldbm/index.c
servers/slapd/back-ldbm/init.c
servers/slapd/back-ldbm/kerberos.c
servers/slapd/back-ldbm/modify.c
servers/slapd/back-ldbm/modrdn.c
servers/slapd/back-ldbm/nextid.c
servers/slapd/back-ldbm/search.c
servers/slapd/back-ldbm/unbind.c
servers/slapd/back-passwd/config.c
servers/slapd/back-passwd/search.c
servers/slapd/back-shell/abandon.c
servers/slapd/back-shell/add.c
servers/slapd/back-shell/bind.c
servers/slapd/back-shell/compare.c
servers/slapd/back-shell/config.c
servers/slapd/back-shell/delete.c
servers/slapd/back-shell/fork.c
servers/slapd/back-shell/init.c
servers/slapd/back-shell/modify.c
servers/slapd/back-shell/modrdn.c
servers/slapd/back-shell/result.c
servers/slapd/back-shell/search.c
servers/slapd/back-shell/unbind.c
servers/slapd/backend.c
servers/slapd/bind.c
servers/slapd/ch_malloc.c
servers/slapd/charray.c
servers/slapd/compare.c
servers/slapd/config.c
servers/slapd/configinfo.c
servers/slapd/connection.c
servers/slapd/daemon.c
servers/slapd/delete.c
servers/slapd/detach.c
servers/slapd/dn.c
servers/slapd/entry.c
servers/slapd/filter.c
servers/slapd/filterentry.c
servers/slapd/init.c
servers/slapd/lock.c
servers/slapd/main.c
servers/slapd/modify.c
servers/slapd/modrdn.c
servers/slapd/monitor.c
servers/slapd/operation.c
servers/slapd/phonetic.c
servers/slapd/repl.c
servers/slapd/result.c
servers/slapd/schema.c
servers/slapd/schemaparse.c
servers/slapd/search.c
servers/slapd/shell-backends/Makefile.in
servers/slapd/shell-backends/passwd-shell.c
servers/slapd/shell-backends/shellutil.c
servers/slapd/shell-backends/shellutil.h
servers/slapd/slap.h
servers/slapd/str2filter.c
servers/slapd/strdup.c
servers/slapd/tempnam.c
servers/slapd/unbind.c
servers/slapd/value.c

index 10985533190df937542169770f0443e30b080c11..cbd734612d3d93b3cc897b041560e219c0029bf9 100644 (file)
@@ -3,12 +3,10 @@
 #include "portable.h"
 
 #include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#include <regex.h>
+
+#include <ac/regex.h>
+#include <ac/socket.h>
+#include <ac/string.h>
 
 #include "slap.h"
 
@@ -362,7 +360,7 @@ acl_access_allowed(
 
                        return( (b->a_access & ~ACL_SELF) >= access );
                }
-#ifdef ACLGROUP
+#ifdef SLAPD_ACLGROUPS
                if ( b->a_group != NULL && op->o_dn != NULL ) {
                        char buf[512];
 
@@ -386,7 +384,7 @@ acl_access_allowed(
                                return( (b->a_access & ~ACL_SELF) >= access );
                        }
                }
-#endif /* ACLGROUP */
+#endif /* SLAPD_ACLGROUPS */
        }
 
        if ( odn ) free( odn );
index a8ba9510896255886cec94d2c9eacfa87fe80ed6..4e92136f928f9e4bc6c6e92fbec7273557e26fc6 100644 (file)
@@ -3,16 +3,14 @@
 #include "portable.h"
 
 #include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#include <unistd.h>
-#include <regex.h>
+
+#include <ac/ctype.h>
+#include <ac/regex.h>
+#include <ac/socket.h>
+#include <ac/string.h>
+#include <ac/unistd.h>
 
 #include "slap.h"
-#include "portable.h"
 
 extern Filter          *str2filter();
 extern struct acl      *global_acl;
@@ -210,11 +208,11 @@ parse_acl(
                        } else if ( strcasecmp( left, "dnattr" ) == 0 ) {
                                b->a_dnattr = strdup( right );
 
-#ifdef ACLGROUP
+#ifdef SLAPD_ACLGROUPS
                        } else if ( strcasecmp( left, "group" ) == 0 ) {
                                regtest(fname, lineno, right);
                                b->a_group = dn_upcase(strdup( right ));
-#endif /* ACLGROUP */
+#endif /* SLAPD_ACLGROUPS */
                        } else if ( strcasecmp( left, "domain" ) == 0 ) {
                                char    *s;
                                regtest(fname, lineno, right);
index 7d31bc8744aec3e5795ba34e1eab5099bdea59da..110e3d365dd94715ee392feab4fab3d9d8241899 100644 (file)
 #include "portable.h"
 
 #include <stdio.h>
-#include <string.h>
-#include <time.h>
-#include <sys/types.h>
-#include <sys/socket.h>
+
+#include <ac/string.h>
+#include <ac/time.h>
+#include <ac/socket.h>
+
 #include "slap.h"
 
 extern Backend *select_backend();
index 5842813b96b4b03246c8298c72a995ddee72a667..1aa239239588c557989755251035ce2f66bd9626 100644 (file)
@@ -3,15 +3,22 @@
 #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();
index 12ef18cbf4f9acfd27c6e2165a39aafc68acb47b..1e10339cb2c98614de6d2b51b7f6ad665661721e 100644 (file)
@@ -3,9 +3,10 @@
 #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"
 
 int
index 37b6a4063536263b53437637d94cee47acd196b3..eebcf4a2574cb096875f68b42a3464732ce8e254 100644 (file)
@@ -3,9 +3,10 @@
 #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"
 #include "proto-back-ldbm.h"
index ca59ba309090332fe4f99337e7012b597551d998..ea9694857fc2897f069c1480224884666c674829 100644 (file)
@@ -3,9 +3,10 @@
 #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"
 
index 3d656f4dd91f1cc8f865d3f28e2a910f98031de0..dda1ff8452aa6bb37d6b18bb17c49bc6e09add26 100644 (file)
@@ -9,7 +9,7 @@ LDAP_BEGIN_DECL
 
 #define DEFAULT_CACHE_SIZE     1000
 
-#ifdef LDBM_USE_DB2
+#ifdef HAVE_BERKELEY_DB2
 #      define DEFAULT_DBCACHE_SIZE (100 * DEFAULT_DB_PAGE_SIZE)
 #else
 #      define DEFAULT_DBCACHE_SIZE 100000
index 90aa228f089b44e7cd90c3eef85b63def75caac1..f27872456e984b3131d370ed4a80ed43b210266b 100644 (file)
@@ -3,45 +3,33 @@
 #include "portable.h"
 
 #include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/socket.h>
+
+#include <ac/krb.h>
+#include <ac/socket.h>
+#include <ac/string.h>
+#include <ac/unistd.h>
+
 #include "slap.h"
 #include "back-ldbm.h"
 #include "proto-back-ldbm.h"
-#ifdef KERBEROS
-#ifdef KERBEROS_V
-#include <kerberosIV/krb.h>
-#else
-#include <krb.h>
-#endif /* KERBEROS_V */
-#endif /* KERBEROS */
-
-#ifdef LDAP_CRYPT
-/* change for crypted passwords -- lukeh */
-#ifdef __NeXT__
-extern char *crypt (char *key, char *salt);
-#else
-#include <unistd.h>
-#endif
-#endif /* LDAP_CRYPT */
 
-#ifdef LDAP_SHA1
+#ifdef SLAPD_SHA1
 #include <lutil_sha1.h>
-#endif /* LDAP_SHA1 */
-#ifdef LDAP_MD5
+#endif /* SLAPD_SHA1 */
+
+#ifdef SLAPD_MD5
 #include <lutil_md5.h>
-#endif /* LDAP_MD5 */
+#endif /* SLAPD_MD5 */
 
 #include <lutil.h>
 
 extern Attribute       *attr_find();
 
-#ifdef KERBEROS
+#ifdef HAVE_KERBEROS
 extern int     krbv4_ldap_auth();
 #endif
 
-#ifdef LDAP_CRYPT
+#ifdef SLAPD_CRYPT
 pthread_mutex_t crypt_mutex;
 
 static int
@@ -65,7 +53,7 @@ crypted_value_find(
                                        return ( 0 );
                                }
                                pthread_mutex_unlock( &crypt_mutex );
-#ifdef LDAP_MD5
+#ifdef SLAPD_MD5
                } else if ( syntax != SYNTAX_BIN && strncasecmp( "{MD5}",
                        vals[i]->bv_val, (sizeof("{MD5}") - 1 ) ) == 0 ) {
                                ldap_MD5_CTX MD5context;
@@ -87,8 +75,8 @@ crypted_value_find(
                                if (strcmp(userpassword, base64digest) == 0) {
                                        return ( 0 );
                                }
-#endif /* LDAP_MD5 */
-#ifdef LDAP_SHA1
+#endif /* SLAPD_MD5 */
+#ifdef SLAPD_SHA1
                } else if ( syntax != SYNTAX_BIN && strncasecmp( "{SHA}",
                        vals[i]->bv_val, (sizeof("{SHA}") - 1 ) ) == 0 ) {
                                ldap_SHA1_CTX SHA1context;
@@ -110,7 +98,7 @@ crypted_value_find(
                                if (strcmp(userpassword, base64digest) == 0) {
                                        return ( 0 );
                                }
-#endif /* LDAP_SHA1 */
+#endif /* SLAPD_SHA1 */
                } else {
                 if ( value_cmp( vals[i], v, syntax, normalize ) == 0 ) {
                         return( 0 );
@@ -120,7 +108,7 @@ crypted_value_find(
 
        return( 1 );
 }
-#endif /* LDAP_CRYPT */
+#endif /* SLAPD_CRYPT */
 
 int
 ldbm_back_bind(
@@ -137,7 +125,7 @@ ldbm_back_bind(
        Attribute       *a;
        int             rc;
        char            *matched = NULL;
-#ifdef KERBEROS
+#ifdef HAVE_KERBEROS
        char            krbname[MAX_K_NAME_SZ + 1];
        AUTH_DAT        ad;
 #endif
@@ -195,7 +183,7 @@ ldbm_back_bind(
                        goto return_results;
                }
 
-#ifdef LDAP_CRYPT
+#ifdef SLAPD_CRYPT
                if ( crypted_value_find( a->a_vals, cred, a->a_syntax, 0, cred ) != 0 )
 #else
                if ( value_find( a->a_vals, cred, a->a_syntax, 0 ) != 0 )
@@ -214,7 +202,7 @@ ldbm_back_bind(
                rc = 0;
                break;
 
-#ifdef KERBEROS
+#ifdef HAVE_KERBEROS
        case LDAP_AUTH_KRBV41:
                if ( krbv4_ldap_auth( be, cred, &ad ) != LDAP_SUCCESS ) {
                        send_ldap_result( conn, op, LDAP_INVALID_CREDENTIALS,
index 4c5e7c32038f51eb2562273d28a1ef01fc2b0dd4..940a226b842404c47cf1d064af21182392832b8e 100644 (file)
@@ -3,9 +3,10 @@
 #include "portable.h"
 
 #include <stdio.h>
-#include <sys/types.h>
-#include <sys/socket.h>
+
+#include <ac/socket.h>
 #include "slap.h"
+
 #include "back-ldbm.h"
 
 static int     cache_delete_entry_internal();
index 66ef3e860640eff4d9842497f0c8e9bff84a5d6b..f300d9f92d94e8234392b4645987383d2ba7ce2a 100644 (file)
@@ -3,8 +3,9 @@
 #include "portable.h"
 
 #include <stdio.h>
-#include <sys/types.h>
-#include <sys/socket.h>
+
+#include <ac/socket.h>
+
 #include "slap.h"
 #include "back-ldbm.h"
 
index 714923e1774e09eb71d613c9d2adb217be5e1213..e98f83dd94e3823838619ca869277bd496bf15c2 100644 (file)
@@ -3,9 +3,10 @@
 #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"
 #include "proto-back-ldbm.h"
index 5cbfd6e924413c85c11f5013b3bef518130e1c6c..0e087dc0b18badec3009ca2f54fe9fbedd4c68b5 100644 (file)
@@ -3,9 +3,10 @@
 #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"
 
index bef299be86f319f87dd56793d26c3f2c17051d5b..ff09593f930dd593c68797b12e8dd1da03c9b585 100644 (file)
@@ -3,14 +3,17 @@
 #include "portable.h"
 
 #include <stdio.h>
+
+#include <ac/errno.h>
+#include <ac/socket.h>
 #include <ac/string.h>
 #include <ac/time.h>
 
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/param.h>
 #include <sys/stat.h>
-#include <errno.h>
+
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
 
 #include "slap.h"
 #include "back-ldbm.h"
@@ -180,7 +183,7 @@ ldbm_cache_fetch(
 )
 {
        Datum   data;
-#ifdef LDBM_USE_DB2
+#ifdef HAVE_BERKELEY_DB2
        memset( &data, 0, sizeof( data ) );
 #endif
 
index ee5fbabca6ba1db807c60f7a26541c5ceeb79a68..a7997e0f3f641bd4f2b913bf90f9700d90b03bef 100644 (file)
@@ -3,9 +3,10 @@
 #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"
index 89a5ea13eac76794c64eda97415471a6da033a65..ff56ba616be5f11aa0d251524ef3939a0cbc26f1 100644 (file)
@@ -3,9 +3,10 @@
 #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"
@@ -26,7 +27,7 @@ dn2id_add(
        Datum           key, data;
        struct ldbminfo *li = (struct ldbminfo *) be->be_private;
 
-#ifdef LDBM_USE_DB2
+#ifdef HAVE_BERKELEY_DB2
        memset( &key, 0, sizeof( key ) );
        memset( &data, 0, sizeof( data ) );
 #endif
@@ -71,7 +72,7 @@ dn2id(
        ID              id;
        Datum           key, data;
 
-#ifdef LDBM_USE_DB2
+#ifdef HAVE_BERKELEY_DB2
        memset( &key, 0, sizeof( key ) );
        memset( &data, 0, sizeof( data ) );
 #endif
@@ -128,7 +129,7 @@ dn2id_delete(
        Datum           key;
        int             rc;
 
-#ifdef LDBM_USE_DB2
+#ifdef HAVE_BERKELEY_DB2
        memset( &key, 0, sizeof( key ) );
 #endif
 
index b65b841e2440a7353790b9081fe723eac337bca2..ffb9292b4245d08b69eabd8f97226ecafb4d28de 100644 (file)
@@ -3,9 +3,10 @@
 #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"
 
index e3e3436ceb9e9f864e07f97e22cfda78d5b6b5f1..16106d890468570a8179b12bb16226f69b217f7a 100644 (file)
@@ -3,9 +3,10 @@
 #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"
 #include "proto-back-ldbm.h"
@@ -13,7 +14,7 @@
 extern Attribute        *attr_find();
 
 
-#ifdef ACLGROUP
+#ifdef SLAPD_ACLGROUPS
 /* return 0 IFF edn is a value in uniqueMember attribute
  * of entry with bdn AND that entry has an objectClass
  * value of groupOfUniqueNames
index 2906c5b2cb97b91a4666dec5946cc9cb37aaf8d3..b25a14c54d1871823a0f81e54219bea3039bf9e2 100644 (file)
@@ -3,8 +3,9 @@
 #include "portable.h"
 
 #include <stdio.h>
-#include <sys/types.h>
-#include <sys/socket.h>
+
+#include <ac/socket.h>
+
 #include "slap.h"
 #include "back-ldbm.h"
 
@@ -25,7 +26,7 @@ id2children_add(
        IDList          *idl;
        char            buf[20];
 
-#ifdef LDBM_USE_DB2
+#ifdef HAVE_BERKELEY_DB2
        memset( &key, 0, sizeof( key ) );
        memset( &data, 0, sizeof( data ) );
 #endif
@@ -70,7 +71,7 @@ has_children(
        IDList          *idl;
        char            buf[20];
 
-#ifdef LDBM_USE_DB2
+#ifdef HAVE_BERKELEY_DB2
        memset( &key, 0, sizeof( key ) );
 #endif
 
index 140555c0c32cabc9b44245fd09f47e2e5702743e..5e7582daf767180a2a305c2659378884fe294ab7 100644 (file)
@@ -3,8 +3,9 @@
 #include "portable.h"
 
 #include <stdio.h>
-#include <sys/types.h>
-#include <sys/socket.h>
+
+#include <ac/socket.h>
+
 #include "slap.h"
 #include "back-ldbm.h"
 
@@ -23,7 +24,7 @@ id2entry_add( Backend *be, Entry *e )
        Datum           key, data;
        int             len, rc, flags;
 
-#ifdef LDBM_USE_DB2
+#ifdef HAVE_BERKELEY_DB2
        memset( &key, 0, sizeof( key ) );
        memset( &data, 0, sizeof( data ) );
 #endif
@@ -75,7 +76,7 @@ id2entry_delete( Backend *be, Entry *e )
        /* XXX - check for writer lock - should also check no reader pending */
        assert(pthread_rdwr_wchk_np(&e->e_rdwr));
 
-#ifdef LDBM_USE_DB2
+#ifdef HAVE_BERKELEY_DB2
        memset( &key, 0, sizeof( key ) );
 #endif
 
@@ -116,7 +117,7 @@ id2entry( Backend *be, ID id, int rw )
        Datum           key, data;
        Entry           *e;
 
-#ifdef LDBM_USE_DB2
+#ifdef HAVE_BERKELEY_DB2
        memset( &key, 0, sizeof( key ) );
        memset( &data, 0, sizeof( data ) );
 #endif
index d68c7b834bc28d947822e7217f0c0bedd5314105..88f089116f040a9a09941481d05a891d7d9aad2f 100644 (file)
@@ -3,12 +3,10 @@
 #include "portable.h"
 
 #include <stdio.h>
+
 #include <ac/string.h>
+#include <ac/socket.h>
 
-#include <sys/types.h>
-#ifdef CLDAP
-#include <sys/socket.h>
-#endif
 #include "slap.h"
 #include "ldapconfig.h"
 #include "back-ldbm.h"
@@ -63,7 +61,7 @@ idl_fetch_one(
        char    *kstr;
        int     i, nids;
 
-#ifdef LDBM_USE_DB2
+#ifdef HAVE_BERKELEY_DB2
        memset( &k2, 0, sizeof( k2 ) );
        memset( &data, 0, sizeof( data ) );
 #endif
@@ -90,7 +88,7 @@ idl_fetch(
        char    *kstr;
        int     i, nids;
 
-#ifdef LDBM_USE_DB2
+#ifdef HAVE_BERKELEY_DB2
        memset( &k2, 0, sizeof( k2 ) );
        memset( &data, 0, sizeof( data ) );
 #endif
@@ -184,7 +182,7 @@ idl_store(
        Datum   data;
        struct ldbminfo *li = (struct ldbminfo *) be->be_private;
 
-#ifdef LDBM_USE_DB2
+#ifdef HAVE_BERKELEY_DB2
        memset( &data, 0, sizeof( data ) );
 #endif
 
@@ -306,7 +304,7 @@ idl_insert_key(
        char    *kstr;
        Datum   k2;
 
-#ifdef LDBM_USE_DB2
+#ifdef HAVE_BERKELEY_DB2
        memset( &k2, 0, sizeof( k2 ) );
 #endif
 
index 1e58ab8c91b29bf80fbf68b35f3595d18015eb24..0581fc1a1ed14b966e219e05682a64f3e01ff65f 100644 (file)
@@ -3,9 +3,10 @@
 #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"
 
@@ -107,7 +108,7 @@ index_read(
        char            *realval, *tmpval;
        char            buf[BUFSIZ];
 
-#ifdef LDBM_USE_DB2
+#ifdef HAVE_BERKELEY_DB2
        memset( &key, 0, sizeof( key ) );
 #endif
 
@@ -181,7 +182,7 @@ add_value(
        char    *realval, *tmpval, *s;
        char    buf[BUFSIZ];
 
-#ifdef LDBM_USE_DB2
+#ifdef HAVE_BERKELEY_DB2
        memset( &key, 0, sizeof( key ) );
 #endif
 
index eaf886baf847c6828dfec76715c6702cf5154d30..65fda4378518a767f0bda90906cb6dde32604bf7 100644 (file)
@@ -3,9 +3,10 @@
 #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"
 
@@ -17,9 +18,9 @@ ldbm_back_init(
        char            *argv[ 4 ];
        int             i;
 
-#ifdef LDAP_CRYPT
+#ifdef SLAPD_CRYPT
        extern pthread_mutex_t crypt_mutex;
-#endif /* LDAP_CRYPT */
+#endif /* SLAPD_CRYPT */
 
        /* allocate backend-specific stuff */
        li = (struct ldbminfo *) ch_calloc( 1, sizeof(struct ldbminfo) );
@@ -65,9 +66,9 @@ ldbm_back_init(
        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 LDAP_CRYPT
+#ifdef SLAPD_CRYPT
        pthread_mutex_init( &crypt_mutex, pthread_mutexattr_default );
-#endif /* LDAP_CRYPT */
+#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,
index c369c2bc1394b30d7426650c98bbc9c040b6c3ef..14ab368db56fd0dcb6bb5547b39f483a9429b4e2 100644 (file)
@@ -2,20 +2,17 @@
 
 #include "portable.h"
 
+#ifdef HAVE_KERBEROS
+
 #include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/socket.h>
+
+#include <ac/krb.h>
+#include <ac/socket.h>
+#include <ac/string.h>
+
 #include "slap.h"
 #include "back-ldbm.h"
 
-#ifdef KERBEROS
-#ifdef KERBEROS_V
-#include <kerberosIV/krb.h>
-#else
-#include <krb.h>
-#endif /* KERBEROS_V */
-
 #define LDAP_KRB_PRINCIPAL     "ldapserver"
 
 extern char            *ldap_srvtab;
index 455dd8c175f3d087a50b82a6439c43940efaa9fe..666547f1c99c583a791c85fec09cdde66163c3da 100644 (file)
@@ -3,9 +3,10 @@
 #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"
index 62a2acd18bf626c694c0a2a6c47fa161865a7824..155538304523b763b8a8d239bce0ea467b44d348 100644 (file)
@@ -3,9 +3,10 @@
 #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"
index b680890a79ef7e71ec190608971d7e265b7a7c73..b16100a3f011df13bd84f4254b83046563b16808 100644 (file)
@@ -3,9 +3,13 @@
 #include "portable.h"
 
 #include <stdio.h>
-#include <sys/types.h>
-#include <sys/socket.h>
+
+#include <ac/socket.h>
+
+#ifdef HAVE_SYS_PARAM_H
 #include <sys/param.h>
+#endif
+
 #include "slap.h"
 #include "back-ldbm.h"
 
index 2bf35034bfa4bca8a7b5906031908a4ee643337a..705d6b47d67f607c790c120cc1aac9f5eb42b20f 100644 (file)
@@ -3,9 +3,10 @@
 #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"
index 56e3e426a4d3cd655db71615d58690c1705cf8a6..6330b4db20d94845af6ee5e9b9b43a04dbeb59ed 100644 (file)
@@ -3,8 +3,9 @@
 #include "portable.h"
 
 #include <stdio.h>
-#include <sys/types.h>
-#include <sys/socket.h>
+
+#include <ac/socket.h>
+
 #include "slap.h"
 
 int
index 252717ab7307108b8f636ad979d37e19d1a38c7e..839af28cab70685b9baed13512de900d70c92ca8 100644 (file)
@@ -3,11 +3,11 @@
 #include "portable.h"
 
 #include <stdio.h>
-#include <string.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include "portable.h"
+
+#include <ac/socket.h>
+#include <ac/string.h>
+#include <ac/time.h>
+
 #include "slap.h"
 
 passwd_back_config(
index 3e9a0f9a8c8dbcc63a19d1ccc398db95068461b5..7c32656ec2d39b75496070f38e3db95fa6385637 100644 (file)
@@ -3,12 +3,13 @@
 #include "portable.h"
 
 #include <stdio.h>
-#include <string.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/socket.h>
+
+#include <ac/socket.h>
+#include <ac/string.h>
+#include <ac/time.h>
+
 #include <pwd.h>
-#include "portable.h"
+
 #include "slap.h"
 
 extern time_t          currenttime;
index 090ba26a4b1bac8c11df93c3b87dd29c142caede..36e81963a9826f061f113461cc642b79accd9307 100644 (file)
@@ -3,10 +3,11 @@
 #include "portable.h"
 
 #include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/socket.h>
 #include <signal.h>
+
+#include <ac/socket.h>
+#include <ac/string.h>
+
 #include "slap.h"
 #include "shell.h"
 
index e9840e9eaa72194f17202752e39471e1e845a316..c798e8c6c1404e4d81e3ee016df85121b4c98d2a 100644 (file)
@@ -3,9 +3,10 @@
 #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"
 
index 2d8e5a0a133dd3e910acbf3259fa424798f2029c..33bcd9df97e41ea8f6b36d67c461ce10bf9f33f2 100644 (file)
@@ -3,9 +3,10 @@
 #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 "shell.h"
 
index 642524f04d60b360dec748c3f89e2c1932b322ba..ed93c411d9af32cfc4697b0b23f6c08d8996c0cc 100644 (file)
@@ -3,9 +3,10 @@
 #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"
 
index fc22aac49a3d8ceda0ce7eeb8a48b08c9d5b5126..10aee26a2c795c6e3accb906e796dd0410ddae51 100644 (file)
@@ -3,9 +3,10 @@
 #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"
 
index e794a23a62486a59e81edccff8c1045d58fa69ae..75760ed2711e6af5cad115d5df03035487f3211b 100644 (file)
@@ -3,9 +3,10 @@
 #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"
 
index 1b25031cbb3c61bc0a352028913afeb58fc0c39f..14eaca43490680b602ac2e461b4abe24dfe33e5f 100644 (file)
@@ -3,9 +3,10 @@
 #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"
 
 forkandexec(
index b4087cb8a88294639d405d9229aa07dfb5a8fbf4..0865887123467d1df69e0aadfef3f7004bf7eace 100644 (file)
@@ -3,8 +3,9 @@
 #include "portable.h"
 
 #include <stdio.h>
-#include <sys/types.h>
-#include <sys/socket.h>
+
+#include <ac/socket.h>
+
 #include "slap.h"
 #include "shell.h"
 
index b61dc8234d958cd506d64ef9587378e629b6b0f3..ce2c7bfd07129070e4d90af4596841259744b33f 100644 (file)
@@ -3,9 +3,10 @@
 #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"
 
index a4735164d0b1909a0ca4df0efe8c04af37176e98..f3f00217ad95bfe5a553f5d988f3dfb498d6ebb3 100644 (file)
@@ -3,9 +3,10 @@
 #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 "shell.h"
 
index f1ac898526c3edb1a817f82eb1f19e3f2234c675..3d18e23baacde91489e3e86d71a94be2a5bf33c3 100644 (file)
@@ -3,9 +3,10 @@
 #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"
 
index cbc3243d2128c8eacad24955f3c233d5a7b857c4..969215883bfb008066cd107e2913bd120143e33e 100644 (file)
@@ -3,9 +3,10 @@
 #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 "shell.h"
 
index df836f3e8f0143a782cf7fde5ebe5d703d977ce8..93c6889468632f7381578ff7e6853c5d1920f1d2 100644 (file)
@@ -3,9 +3,10 @@
 #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 "shell.h"
 
index 93675af31b8221df1832056bd9485914f64658b4..d40093b087593a54797955ee19cca23dc3cde83d 100644 (file)
@@ -4,13 +4,15 @@
 #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/stat.h>
+
 #include "slap.h"
 
-#ifdef LDAP_LDBM
+#ifdef SLAPD_LDBM
 extern int     ldbm_back_bind();
 extern int     ldbm_back_unbind();
 extern int     ldbm_back_search();
@@ -26,12 +28,12 @@ extern int  ldbm_back_close();
 extern int      ldbm_back_group();
 #endif
 
-#ifdef LDAP_PASSWD
+#ifdef SLAPD_PASSWD
 extern int     passwd_back_search();
 extern int     passwd_back_config();
 #endif
 
-#ifdef LDAP_SHELL
+#ifdef SLAPD_SHELL
 extern int     shell_back_bind();
 extern int     shell_back_unbind();
 extern int     shell_back_search();
@@ -75,7 +77,7 @@ new_backend(
        be->be_timelimit = deftime;
        foundit = 0;
 
-#ifdef LDAP_LDBM
+#ifdef SLAPD_LDBM
        if ( strcasecmp( type, "ldbm" ) == 0 ) {
                be->be_bind = ldbm_back_bind;
                be->be_unbind = ldbm_back_unbind;
@@ -89,7 +91,7 @@ new_backend(
                be->be_config = ldbm_back_config;
                be->be_init = ldbm_back_init;
                be->be_close = ldbm_back_close;
-#ifdef ACLGROUP
+#ifdef SLAPD_ACLGROUPS
                be->be_group = ldbm_back_group;
 #endif
                be->be_type = "ldbm";
@@ -97,7 +99,7 @@ new_backend(
        }
 #endif
 
-#ifdef LDAP_PASSWD
+#ifdef SLAPD_PASSWD
        if ( strcasecmp( type, "passwd" ) == 0 ) {
                be->be_bind = NULL;
                be->be_unbind = NULL;
@@ -111,7 +113,7 @@ new_backend(
                be->be_config = passwd_back_config;
                be->be_init = NULL;
                be->be_close = NULL;
-#ifdef ACLGROUP
+#ifdef SLAPD_ACLGROUPS
                be->be_group = NULL;
 #endif
                be->be_type = "passwd";
@@ -119,7 +121,7 @@ new_backend(
        }
 #endif
 
-#ifdef LDAP_SHELL
+#ifdef SLAPD_SHELL
        if ( strcasecmp( type, "shell" ) == 0 ) {
                be->be_bind = shell_back_bind;
                be->be_unbind = shell_back_unbind;
@@ -133,7 +135,7 @@ new_backend(
                be->be_config = shell_back_config;
                be->be_init = shell_back_init;
                be->be_close = NULL;
-#ifdef ACLGROUP
+#ifdef SLAPD_ACLGROUPS
                be->be_group = NULL;
 #endif
                be->be_type = "shell";
@@ -257,7 +259,7 @@ be_unbind(
        }
 }
 
-#ifdef ACLGROUP
+#ifdef SLAPD_ACLGROUPS
 int 
 be_group(Backend *be, char *bdn, char *edn)
 {
index 4fa847853540897df6232299bade1f27978846bf..12a913bd15f0003b61603b2a75c91afd30381b97 100644 (file)
 #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();
@@ -52,7 +53,7 @@ do_bind(
         *      }
         */
 
-#ifdef COMPAT30
+#ifdef LDAP_COMPAT30
        /*
         * in version 3.0 there is an extra SEQUENCE tag after the
         * BindRequest SEQUENCE tag.
@@ -81,13 +82,13 @@ do_bind(
                    "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;
index 9f5cf5607356a9f95b24d693c043a465d67fe8b3..9ce0ed80ec8936c9ab3d80c701954616f59242c6 100644 (file)
@@ -3,8 +3,10 @@
 #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 *
index 71ef9e63451816b70340c260cee310a0d41d4a92..7edb80c8480d34ce3eecffcb9ec5fdbd73cc799c 100644 (file)
@@ -3,9 +3,10 @@
 #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"
 
 void
index d836a4336542a1e2714f1330f66cc738744fc684..d31f2655a41f8e7bf557590dd4ae7ad3e916bc50 100644 (file)
@@ -13,8 +13,9 @@
 #include "portable.h"
 
 #include <stdio.h>
-#include <sys/types.h>
-#include <sys/socket.h>
+
+#include <ac/socket.h>
+
 #include "slap.h"
 
 extern Backend *select_backend();
index 55660182c6388f8c88c675129ae22adc0a27f655..66e856796274133c3c80dd96caccd55838ae7dd7 100644 (file)
@@ -3,9 +3,10 @@
 #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 "ldapconfig.h"
 
index f6dcfe9d5fa26e304b1e02f4d1232fe5cf5cb717..744d611ad80c5c57eebe378f542459699bd97999 100644 (file)
 #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 "ldapconfig.h"
 
index bbfdd4344e5cef97d2feee0230c33b908f7136df..661877ffb41a3944d0fbb5d2ab1958b65be9812f 100644 (file)
@@ -1,12 +1,13 @@
 #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 <sys/types.h>
-#include <sys/socket.h>
-#include <errno.h>
-#include <signal.h>
+
 #include "slap.h"
 
 extern Operation       *op_add();
@@ -18,11 +19,6 @@ extern long          ops_completed;
 extern pthread_mutex_t ops_mutex;
 extern pthread_t       listener_tid;
 
-#ifdef DECL_SYS_ERRLIST
-extern int             sys_nerr;
-extern char            *sys_errlist[];
-#endif
-
 struct co_arg {
        Connection      *co_conn;
        Operation       *co_op;
@@ -52,7 +48,7 @@ connection_operation( struct co_arg *arg )
                do_bind( arg->co_conn, arg->co_op );
                break;
 
-#ifdef COMPAT30
+#ifdef LDAP_COMPAT30
        case LDAP_REQ_UNBIND_30:
 #endif
        case LDAP_REQ_UNBIND:
@@ -63,7 +59,7 @@ connection_operation( struct co_arg *arg )
                do_add( arg->co_conn, arg->co_op );
                break;
 
-#ifdef COMPAT30
+#ifdef LDAP_COMPAT30
        case LDAP_REQ_DELETE_30:
 #endif
        case LDAP_REQ_DELETE:
@@ -86,7 +82,7 @@ connection_operation( struct co_arg *arg )
                do_search( arg->co_conn, arg->co_op );
                break;
 
-#ifdef COMPAT30
+#ifdef LDAP_COMPAT30
        case LDAP_REQ_ABANDON_30:
 #endif
        case LDAP_REQ_ABANDON:
@@ -177,7 +173,7 @@ connection_activity(
                return;
        }
 
-#ifdef COMPAT30
+#ifdef LDAP_COMPAT30
        if ( conn->c_version == 30 ) {
                (void) ber_skip_tag( ber, &len );
        }
@@ -205,7 +201,7 @@ connection_activity(
 
        pthread_attr_init( &attr );
        pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_DETACHED );
-#ifndef THREAD_MIT_PTHREADS
+#if !defined(HAVE_PTHREADS_D4) && !defined(HAVE_DCE)
        /* POSIX_THREADS or compatible
         * This is a draft 10 or standard pthreads implementation
         */
@@ -217,7 +213,7 @@ connection_activity(
                active_threads++;
                pthread_mutex_unlock( &active_threads_mutex );
        }
-#else  /* !THREAD_MIT_PTHREAD */
+#else  /* pthread draft4  */
        /*
         * This is a draft 4 or earlier pthreads implementation
         */
@@ -229,6 +225,6 @@ connection_activity(
                active_threads++;
                pthread_mutex_unlock( &active_threads_mutex );
        }
-#endif /* !THREAD_MIT_PTHREAD */
+#endif /* pthread draft4 */
        pthread_attr_destroy( &attr );
 }
index 1dfc8682b16c1793dcce66210ad2922db1a253af..d95c0a059eee167c1f99c64c5b87da158e81352d 100644 (file)
@@ -8,43 +8,33 @@
 #include "portable.h"
 
 #include <stdio.h>
+
+#include <ac/ctype.h>
+#include <ac/errno.h>
+#include <ac/signal.h>
+#include <ac/socket.h>
 #include <ac/string.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <errno.h>
 #include <ac/time.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <signal.h>
-#ifdef _AIX
-#include <sys/select.h>
-#endif
+#include <ac/unistd.h>
+
 #include "slap.h"
 #include "ldapconfig.h"
-#ifdef NEED_FILIO
+
+#ifdef HAVE_SYS_FILIO_H
 #include <sys/filio.h>
-#else /* NEED_FILIO */
+#elif HAVE_SYS_IOCTL_H
 #include <sys/ioctl.h>
-#endif /* NEED_FILIO */
-#ifdef USE_SYSCONF
-#include <unistd.h>
-#endif /* USE_SYSCONF */
+#endif
 
-#ifdef TCP_WRAPPERS
+#ifdef HAVE_TCPD
 #include <tcpd.h>
 
 int allow_severity = LOG_INFO;
 int deny_severity = LOG_NOTICE;
-#endif /* TCP_WRAPPERS */
+#endif /* TCP Wrappers */
 
 extern Operation       *op_add();
 
-#ifdef DECL_SYS_ERRLIST
-extern int             sys_nerr;
-extern char            *sys_errlist[];
-#endif
-
 extern time_t          currenttime;
 extern pthread_mutex_t currenttime_mutex;
 extern int             active_threads;
@@ -79,14 +69,14 @@ slapd_daemon(
        FILE                    *fp;
        int                     on = 1;
 
-#ifdef USE_SYSCONF
+#ifdef HAVE_SYSCONF
        dtblsize = sysconf( _SC_OPEN_MAX );
-#else /* USE_SYSCONF */
+#elif HAVE_GETDTABLESIZE
        dtblsize = getdtablesize();
-#endif /* USE_SYSCONF */
-       /*
-        * Add greg@greg.rim.or.jp
-        */
+#else
+       dtblsize = FD_SETSIZE
+#endif
+
 #ifdef FD_SETSIZE
        if(dtblsize > FD_SETSIZE) {
                dtblsize = FD_SETSIZE;
@@ -151,14 +141,14 @@ slapd_daemon(
        }
 
        (void) SIGNAL( SIGPIPE, SIG_IGN );
-#ifdef linux
+#ifdef HAVE_LINUX_THREADS
        /*
         * LinuxThreads are implemented using SIGUSR1/USR2,
         * so we'll use SIGSTKFLT and SIGUNUSED
         */
        (void) SIGNAL( SIGSTKFLT, (void *) do_nothing );
        (void) SIGNAL( SIGUNUSED, (void *) set_shutdown );
-#else /* !linux */
+#else  /* !linux */
        (void) SIGNAL( SIGUSR1, (void *) do_nothing );
        (void) SIGNAL( SIGUSR2, (void *) set_shutdown );
 #endif /* !linux */
@@ -284,7 +274,7 @@ slapd_daemon(
                                char *s;
                                client_addr = inet_ntoa( from.sin_addr );
 
-#if defined(REVERSE_LOOKUP) || defined(TCP_WRAPPERS)
+#if defined(SLAPD_RLOOKUPS) || defined(HAVE_TCPD)
                                hp = gethostbyaddr( (char *)
                                    &(from.sin_addr.s_addr),
                                    sizeof(from.sin_addr.s_addr), AF_INET );
@@ -309,7 +299,7 @@ slapd_daemon(
                                client_addr = NULL;
                        }
 
-#ifdef TCP_WRAPPERS
+#ifdef HAVE_TCPD
                        if(!hosts_ctl("slapd", client_name, client_addr,
                                STRING_UNKNOWN))
                        {
@@ -325,7 +315,7 @@ slapd_daemon(
                                pthread_mutex_unlock( &new_conn_mutex );
                                continue;
                        }
-#endif /* TCP_WRAPPERS */
+#endif /* HAVE_TCPD */
 
                        Statslog( LDAP_DEBUG_STATS,
                            "conn=%d fd=%d connection from %s (%s) accepted.\n",
@@ -424,7 +414,7 @@ set_shutdown()
 {
        Debug( LDAP_DEBUG_ANY, "slapd got shutdown signal\n", 0, 0, 0 );
        slapd_shutdown = 1;
-#ifdef linux
+#ifdef HAVE_LINUX_THREADS
        /*
         * LinuxThreads are implemented using SIGUSR1/USR2,
         * so we'll use SIGSTKFLT and SIGUNUSED
@@ -444,7 +434,7 @@ static void
 do_nothing()
 {
        Debug( LDAP_DEBUG_TRACE, "slapd got do_nothing signal\n", 0, 0, 0 );
-#ifdef linux
+#ifdef HAVE_LINUX_THREADS
        /*
         * LinuxThreads are implemented using SIGUSR1/USR2,
         * so we'll use SIGSTKFLT and SIGUNUSED
index bab22d924f10210e19f5da8dfcf7e5f8bb915bde..eecf64090f750df6341620e71d36a78695069379 100644 (file)
 #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();
index bb28bc96a2d9fd156d1c7322e12d86e31e5b909e..dd6db49d69a9ec9db074422dced7e974463cf45f 100644 (file)
 #include "portable.h"
 
 #include <stdio.h>
-#include <sys/types.h>
-#ifdef SVR4
+
+#include <ac/signal.h>
+#include <ac/unistd.h>
+
 #include <sys/stat.h>
-#endif /* svr4 */
 #include <fcntl.h>
 #include <sys/file.h>
 #include <sys/ioctl.h>
-#include <signal.h>
-#include "portable.h"
-
-#ifdef USE_SYSCONF
-#include <unistd.h>
-#endif /* USE_SYSCONF */
-
 
 detach()
 {
@@ -35,11 +29,13 @@ detach()
        extern int      ldap_debug;
 #endif
 
-#ifdef USE_SYSCONF
+#ifdef HAVE_SYSCONF
        nbits = sysconf( _SC_OPEN_MAX );
-#else /* USE_SYSCONF */
+#elif HAVE_GETDTABLESIZE
        nbits = getdtablesize();
-#endif /* USE_SYSCONF */
+#else
+       nbits = FD_SETSIZE
+#endif 
 
 #ifdef FD_SETSIZE
        if ( nbits > FD_SETSIZE ) {
@@ -51,7 +47,7 @@ detach()
        if ( ldap_debug == 0 ) {
 #endif
                for ( i = 0; i < 5; i++ ) {
-#if defined( sunos5 ) && defined( THREAD_SUNOS5_LWP )
+#if defined( HAVE_LWP_THR )
                        switch ( fork1() ) {
 #else
                        switch ( fork() ) {
@@ -88,14 +84,14 @@ detach()
                        (void) dup2( sd, 2 );
                close( sd );
 
-#ifdef USE_SETSID
+#ifdef HAVE_SETSID
                setsid();
-#else /* USE_SETSID */
+#else /* HAVE_SETSID */
                if ( (sd = open( "/dev/tty", O_RDWR )) != -1 ) {
                        (void) ioctl( sd, TIOCNOTTY, NULL );
                        (void) close( sd );
                }
-#endif /* USE_SETSID */
+#endif /* HAVE_SETSID */
 #ifdef LDAP_DEBUG
        } 
 #endif
index de10e368c70ba5b7779aad604c92da04bf5d846d..d67aca70acb54293f011788fed664b829ca7d9f8 100644 (file)
@@ -3,11 +3,12 @@
 #include "portable.h"
 
 #include <stdio.h>
-#include <ctype.h>
-#include <string.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/socket.h>
+
+#include <ac/ctype.h>
+#include <ac/socket.h>
+#include <ac/string.h>
+#include <ac/time.h>
+
 #include "slap.h"
 
 static char    **dn_explode();
index 562cc47b689e05c24d1ae0582c5c33a6c1c0f310..c0474e20238eded3a92d3bce734e248856d8e924 100644 (file)
@@ -3,10 +3,11 @@
 #include "portable.h"
 
 #include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <sys/types.h>
-#include <sys/socket.h>
+
+#include <ac/ctype.h>
+#include <ac/socket.h>
+#include <ac/string.h>
+
 #include "slap.h"
 
 void   entry_free();
index 49f8166f2b04c65d1700107a56fd8f77c8ba89b3..be8a8ea2425d0b5013aaccd8665987555a8c6793 100644 (file)
@@ -3,9 +3,10 @@
 #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"
 
 static int     get_filter_list();
@@ -56,7 +57,7 @@ get_filter( Connection *conn, BerElement *ber, Filter **filt, char **fstr )
        err = 0;
        *fstr = NULL;
        f->f_choice = ber_peek_tag( ber, &len );
-#ifdef COMPAT30
+#ifdef LDAP_COMPAT30
        if ( conn->c_version == 30 ) {
                switch ( f->f_choice ) {
                case LDAP_FILTER_EQUALITY:
@@ -194,7 +195,7 @@ get_filter_list( Connection *conn, BerElement *ber, Filter **f, char **fstr )
 
        Debug( LDAP_DEBUG_FILTER, "begin get_filter_list\n", 0, 0, 0 );
 
-#ifdef COMPAT30
+#ifdef LDAP_COMPAT30
        if ( conn->c_version == 30 ) {
                (void) ber_skip_tag( ber, &len );
        }
@@ -235,7 +236,7 @@ get_substring_filter(
 
        Debug( LDAP_DEBUG_FILTER, "begin get_substring_filter\n", 0, 0, 0 );
 
-#ifdef COMPAT30
+#ifdef LDAP_COMPAT30
        if ( conn->c_version == 30 ) {
                (void) ber_skip_tag( ber, &len );
        }
@@ -253,7 +254,7 @@ get_substring_filter(
        sprintf( *fstr, "(%s=", f->f_sub_type );
        for ( tag = ber_first_element( ber, &len, &last ); tag != LBER_DEFAULT;
            tag = ber_next_element( ber, &len, last ) ) {
-#ifdef COMPAT30
+#ifdef LDAP_COMPAT30
                if ( conn->c_version == 30 ) {
                        rc = ber_scanf( ber, "{a}", &val );
                } else
@@ -271,7 +272,7 @@ get_substring_filter(
                value_normalize( val, syntax );
 
                switch ( tag ) {
-#ifdef COMPAT30
+#ifdef LDAP_COMPAT30
                case LDAP_SUBSTRING_INITIAL_30:
 #endif
                case LDAP_SUBSTRING_INITIAL:
@@ -285,7 +286,7 @@ get_substring_filter(
                        strcat( *fstr, val );
                        break;
 
-#ifdef COMPAT30
+#ifdef LDAP_COMPAT30
                case LDAP_SUBSTRING_ANY_30:
 #endif
                case LDAP_SUBSTRING_ANY:
@@ -297,7 +298,7 @@ get_substring_filter(
                        strcat( *fstr, val );
                        break;
 
-#ifdef COMPAT30
+#ifdef LDAP_COMPAT30
                case LDAP_SUBSTRING_FINAL_30:
 #endif
                case LDAP_SUBSTRING_FINAL:
index 495fcb2ca624b324b545c592dcc215e0da2d4a20..ac0a943d02e4d7b58d5ed811a8ef0c569e157c28 100644 (file)
@@ -3,10 +3,11 @@
 #include "portable.h"
 
 #include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <regex.h>
+
+#include <ac/socket.h>
+#include <ac/string.h>
+#include <ac/regex.h>
+
 #include "slap.h"
 
 extern Attribute       *attr_find();
index 7ba83187584a30403971bd7362ae2e87bf6225f1..81384199e3148351faaf7f2315b7064ad2650abe 100644 (file)
@@ -3,13 +3,11 @@
 #include "portable.h"
 
 #include <stdio.h>
-#include <string.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
+
+#include <ac/socket.h>
+#include <ac/string.h>
+#include <ac/time.h>
+
 #include "portable.h"
 #include "slap.h"
 
index 2e3cb917fda37569985384d9a0a640f242518961..debc102e2ef056c70ad900572fecd435b49a0f43 100644 (file)
@@ -3,15 +3,13 @@
 #include "portable.h"
 
 #include <stdio.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include "portable.h"
-#ifdef USE_LOCKF
-#include <unistd.h>
-#endif
+
+#include <ac/socket.h>
+#include <ac/time.h>
+#include <ac/unistd.h>
+
 #include <sys/file.h>
 #include <sys/param.h>
-#include <sys/socket.h>
 #include "slap.h"
 
 FILE *
index 258923e61efb1573dd8ad97d576195e92ae3ef1c..59fb391b1fdb411f5a8d3fa4dc5ed756a4a3a1cf 100644 (file)
@@ -1,14 +1,11 @@
 #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 "portable.h"
+
+#include <ac/socket.h>
+#include <ac/string.h>
+#include <ac/time.h>
+
 #include "slap.h"
 #include "ldapconfig.h"
 
@@ -184,7 +181,7 @@ main( argc, argv )
                pthread_attr_init( &attr );
                pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_DETACHED );
 
-#ifndef THREAD_MIT_PTHREADS
+#if !defined(HAVE_PTHREADS_D4) && !defined(HAVE_DCE)
                /* POSIX_THREADS or compatible
                 * This is a draft 10 or standard pthreads implementation
                 */
@@ -194,7 +191,7 @@ main( argc, argv )
                            "listener pthread_create failed\n", 0, 0, 0 );
                        exit( 1 );
                }
-#else  /* !THREAD_MIT_PTHREADS */
+#else  /* draft4 */
                /*
                 * This is a draft 4 or earlier pthreads implementation
                 */
@@ -204,7 +201,7 @@ main( argc, argv )
                            "listener pthread_create failed\n", 0, 0, 0 );
                        exit( 1 );
                }
-#endif /* !THREAD_MIT_PTHREADS */
+#endif /* !draft4 */
                pthread_attr_destroy( &attr );
                pthread_join( listener_tid, (void *) &status );
                pthread_exit( 0 );
@@ -236,7 +233,7 @@ main( argc, argv )
 #endif
                flen = sizeof(from);
                if ( getpeername( 0, (struct sockaddr *) &from, &flen ) == 0 ) {
-#ifdef REVERSE_LOOKUP
+#ifdef SLAPD_RLOOKUPS
                        hp = gethostbyaddr( (char *) &(from.sin_addr.s_addr),
                            sizeof(from.sin_addr.s_addr), AF_INET );
 #else
index 2820a3ed19d2ccf59c35f9ecaf088c12939d58ed..1406b985b52210f56510ff98b06ca35686c14d8c 100644 (file)
 #include "portable.h"
 
 #include <stdio.h>
-#include <string.h>
-#include <time.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/socket.h>
+
+#include <ac/socket.h>
+#include <ac/string.h>
+#include <ac/time.h>
+
 #include "slap.h"
 
 extern Backend *select_backend();
index 75af6e13e832efb40987ecb1e73204019d617203..4928727817c1ed4f9b29fbd11eadc836893fc17c 100644 (file)
 #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"
 
 extern Backend *select_backend();
index c43b61ac46bc6b3e77a856d5e82f4b8bf63aadbb..05940823ca2207987fc83339e045decc42c0a274 100644 (file)
 #include "portable.h"
 
 #include <stdio.h>
-#include <string.h>
-#include <time.h>
-#include <sys/types.h>
-#include <sys/socket.h>
+
+#include <ac/socket.h>
+#include <ac/string.h>
+#include <ac/time.h>
+
 #include "slap.h"
 #include "ldapconfig.h"
 
@@ -194,7 +195,7 @@ monitor_info( Connection *conn, Operation *op )
        val.bv_len = strlen( buf );
        attr_merge( e, "nbackends", vals );
 
-#ifdef THREAD_SUNOS5_LWP
+#ifdef HAVE_LWP_THR
        sprintf( buf, "%d", thr_getconcurrency() );
        val.bv_val = buf;
        val.bv_len = strlen( buf );
index a960c30695d509ec1901c2a3bcea05fa413e7df2..b08d67929840f6e0a4b5f326664aef1d23b04529 100644 (file)
@@ -3,9 +3,10 @@
 #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 time_t          currenttime;
index 996c68160cb75b66b168acae343e7491e0ab30e3..485e3718a758a0a728048d767b59d4ed51cfac96 100644 (file)
@@ -3,15 +3,15 @@
 #include "portable.h"
 
 #include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include "portable.h"
+
+#include <ac/ctype.h>
+#include <ac/string.h>
+#include <ac/socket.h>
+#include <ac/time.h>
+
 #include "slap.h"
 
-#if !defined(METAPHONE) && !defined(SOUNDEX)
+#if !defined(METAPHONE) && !defined(SLAPD_PHONETIC)
 #define METAPHONE
 #endif
 
@@ -79,7 +79,7 @@ word_dup( char *w )
 #define MAXPHONEMELEN  4
 #endif
 
-#if defined(SOUNDEX)
+#if defined(SLAPD_PHONETIC)
 
 /* lifted from isode-8.0 */
 char *
@@ -430,4 +430,4 @@ phonetic( char *Word )
 }
 
 #endif /* metaphone */
-#endif /* soundex */
+#endif /* SLAPD_PHONETIC */
index cd0198ebd754c2af46f35a0921029eeaae760224..4450be586654bea2683ca1ae67143c6e6ae12490 100644 (file)
@@ -3,10 +3,12 @@
 #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"
 
 extern pthread_mutex_t replog_mutex;
index 185cc0269d511c3440c573538ba6df451050d801..07bf54540f831e380dab0ab541c9777089b5e285 100644 (file)
@@ -3,19 +3,14 @@
 #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 <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <errno.h>
-#include <signal.h>
-#include "slap.h"
 
-#ifdef DECL_SYS_ERRLIST
-extern int             sys_nerr;
-extern char            *sys_errlist[];
-#endif
+#include "slap.h"
 
 extern int             active_threads;
 extern pthread_mutex_t active_threads_mutex;
@@ -63,7 +58,7 @@ send_ldap_result2(
                break;
        }
 
-#ifdef COMPAT30
+#ifdef LDAP_COMPAT30
        if ( (ber = ber_alloc_t( conn->c_version == 30 ? 0 : LBER_USE_DER ))
            == NULLBER ) {
 #else
@@ -73,13 +68,13 @@ send_ldap_result2(
                return;
        }
 
-#ifdef CLDAP
+#ifdef LDAP_CONNECTIONLESS
        if ( op->o_cldap ) {
                rc = ber_printf( ber, "{is{t{ess}}}", op->o_msgid, "", tag,
                    err, matched ? matched : "", text ? text : "" );
        } else
 #endif
-#ifdef COMPAT30
+#ifdef LDAP_COMPAT30
        if ( conn->c_version == 30 ) {
                rc = ber_printf( ber, "{it{{ess}}}", op->o_msgid, tag, err,
                    matched ? matched : "", text ? text : "" );
@@ -124,7 +119,7 @@ send_ldap_result2(
                active_threads--;
                conn->c_writewaiter = 1;
 
-#ifdef linux
+#ifdef HAVE_LINUX_THREADS
                pthread_kill( listener_tid, SIGSTKFLT );
 #else /* !linux */
                pthread_kill( listener_tid, SIGUSR1 );
@@ -159,7 +154,7 @@ send_ldap_result(
     char       *text
 )
 {
-#ifdef CLDAP
+#ifdef LDAP_CONNECTIONLESS
        if ( op->o_cldap ) {
                SAFEMEMCPY( (char *)conn->c_sb.sb_useaddr, &op->o_clientaddr,
                    sizeof( struct sockaddr ));
@@ -213,7 +208,7 @@ send_search_entry(
 
        edn = dn_normalize_case( strdup( e->e_dn ) );
 
-#ifdef COMPAT30
+#ifdef LDAP_COMPAT30
        if ( (ber = ber_alloc_t( conn->c_version == 30 ? 0 : LBER_USE_DER ))
                == NULLBER )
 #else
@@ -226,7 +221,7 @@ send_search_entry(
                goto error_return;
        }
 
-#ifdef COMPAT30
+#ifdef LDAP_COMPAT30
        if ( conn->c_version == 30 ) {
                rc = ber_printf( ber, "{it{{s{", op->o_msgid,
                    LDAP_RES_SEARCH_ENTRY, e->e_dn );
@@ -315,7 +310,7 @@ send_search_entry(
 
        free(edn);
 
-#ifdef COMPAT30
+#ifdef LDAP_COMPAT30
        if ( conn->c_version == 30 ) {
                rc = ber_printf( ber, "}}}}" );
        } else
index fc5f0214faeb94c0b14ebfd25697cebce659a1ce..a324a60d1d8ca26a85fa06d025953bc21d763ef5 100644 (file)
@@ -3,9 +3,10 @@
 #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 Attribute       *attr_find();
index 70edf66b8bcc422745e16d5afac4baaa2c0aebf0..8f72136abbc2711209d36b66d69ab713c32d4fcc 100644 (file)
@@ -3,9 +3,10 @@
 #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 char            **str2charray();
index 721c013f84dee4bfef97a620d4e8b04f3e180d10..a1c34b76dac8192bd7c5487012fbfac9d7e7b3d8 100644 (file)
 #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 "ldapconfig.h"
 
index aab59ca8fcfdaa47867aaeacd111d5ff045ec6f2..8789dede37e4fd09b9ff5422f1641d827eedc0d4 100644 (file)
@@ -7,6 +7,11 @@ OBJS = passwd-shell.o shellutil.o
 LDAP_INCDIR= ../../../include       
 LDAP_LIBDIR= ../../../libraries
 
+BUILD_OPT = "--enable-shell"
+BUILD_SRV = @BUILD_SHELL@
+
+all-local: $(PROGRAMS)
+
 passwd-shell:  pwd-version.o
        $(CC) $(LDFLAGS) -o $@ $(OBJS) pwd-version.o $(LIBS)
 
index fd354e0fe4b6530df645ffc1c98ba6a1422c91a7..2d7df71c74b31030c164bb4155478b76a6b141b4 100644 (file)
 
 #include "portable.h"
 
-#include <sys/types.h>
 #include <stdio.h>
-#include <string.h>
 #include <stdlib.h>
 #include <pwd.h>
-#include <varargs.h>
+
+#include <ac/string.h>
+
 #include <lber.h>
 #include <ldap.h>
+
 #include "shellutil.h"
 #include "passwd-shell.h"
 
 
-#ifdef LDAP_DEBUG
-void debug_printf();
-#else /* LDAP_DEBUG */
-#define debug_printf()
-#endif /* LDAP_DEBUG */
-
-
-static void pwdfile_search( struct ldop *op, FILE *ofp );
-static struct ldentry *pw2entry( struct ldop *op, struct passwd *pw );
+static void pwdfile_search LDAP_P(( struct ldop *op, FILE *ofp ));
+static struct ldentry *pw2entry LDAP_P(( struct ldop *op, struct passwd *pw ));
 
 static char    tmpbuf[ MAXLINELEN * 2 ];
 
index e1a6d030a480b5830d6292c521e1fc59e1ef7988..4f7b4690433b21c92f4518ed1ddaeb245754204c 100644 (file)
 
 #include "portable.h"
 
-#include <sys/types.h>
 #include <stdio.h>
-#include <string.h>
+
+#ifdef STDC_HEADERS
 #include <stdlib.h>
-#include <pwd.h>
+#include <stdarg.h>
+#else
 #include <varargs.h>
+#endif
+
+#include <pwd.h>
+
+#include <ac/string.h>
+
 #include <lber.h>
 #include <ldap.h>
 #include "shellutil.h"
@@ -316,19 +323,30 @@ ecalloc( unsigned nelem, unsigned elsize )
 
 /* VARARGS */
 void
-debug_printf( va_alist /* char *fmt, args... */ )
+debug_printf
+#ifdef STDC_HEADERS
+       ( char *fmt, ... )
+#else
+       ( va_alist )
     va_dcl
+#endif
 {
-    char       *fmt;
     va_list    ap;
-
-    if ( debugflg ) {
-       va_start( ap );
-       fmt = va_arg( ap, char * );
-       fprintf( stderr, "%s: ", progname );
-       vfprintf( stderr, fmt, ap );
-       va_end( ap );
-    }
+#ifndef STDC_HEADERS
+    char       *fmt;
+#endif
+
+       if ( debugflg ) {
+#ifdef STDC_HEADERS
+               va_start( ap, fmt );
+#else
+               va_start( ap );
+               fmt = va_arg( ap, char * );
+#endif
+               fprintf( stderr, "%s: ", progname );
+               vfprintf( stderr, fmt, ap );
+               va_end( ap );
+       }
 }
 
 
index 8c52ab5dcf0547bdf7e1897efd73fde92ce59516..58775b2f99f5d99eca24284ad4e868fb94680b20 100644 (file)
@@ -75,7 +75,7 @@ struct ldentry {
 
 
 #ifdef LDAP_DEBUG
-void debug_printf();
+void debug_printf LDAP_P((char *, ...));
 #else /* LDAP_DEBUG */
 #define debug_printf()
 #endif /* LDAP_DEBUG */
index f5dee02400a728e06155cd0c69bf1fc019e93b76..fad750b28d03330690ee2066009cdece6dca46d7 100644 (file)
@@ -139,7 +139,7 @@ struct access {
        char            *a_dnattr;
        long            a_access;
 
-#ifdef SLAPD_ACLGROUP
+#ifdef SLAPD_ACLGROUPS
     char               *a_group;
 #endif
 
@@ -211,7 +211,7 @@ typedef struct backend {
        IFP     be_init;        /* backend init routine                    */
        IFP     be_close;       /* backend close routine                   */
 
-#ifdef ACLGROUP
+#ifdef SLAPD_ACLGROUPS
        IFP     be_group;       /* backend group member test               */
 #endif
 } Backend;
index 46b80f5fe678b6393eec854e80cc98674c8518da..5aea1d55b3b5bf248ab8d8e39077f0dbd110ffda 100644 (file)
@@ -3,9 +3,10 @@
 #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"
 
 static char    *find_matching_paren();
index ec7398d4a88300cea5dee303d6abe2371b074e7a..d9c24e69cb8232af19e7037bfc551b1d62453afc 100644 (file)
@@ -1,8 +1,8 @@
 #include "portable.h"
 
-#if defined( ultrix ) || defined( nextstep )
+#ifndef HAVE_STRDUP
 
-#include <string.h>
+#include <ac/string.h>
 
 char *strdup( char *s )
 {
@@ -16,4 +16,4 @@ char *strdup( char *s )
         return( p );
 }
 
-#endif /* ultrix || nextstep */
+#endif /* !strdup */
index 53c0e502286830444d5d8554d9910bc10a4690ea..9aa21870b874f073dcf6b84067db9c69b4a17444 100644 (file)
@@ -1,10 +1,8 @@
 #include "portable.h"
 
-#if defined( nextstep )
+#ifndef HAVE_TEMPNAME
 
-#include <string.h>
-
-char *tempnam( char *dir, char *pfx );
+#include <ac/string.h>
 
 char *tempnam( char *dir, char *pfx )
 {
index 487fbbead5af88c2fd0e214850d8d0be12863c74..1b0d820e68aa11be91e7e98fab34fdfc2503277c 100644 (file)
@@ -16,8 +16,9 @@
 #include "portable.h"
 
 #include <stdio.h>
-#include <sys/types.h>
-#include <sys/socket.h>
+
+#include <ac/socket.h>
+
 #include "slap.h"
 
 extern Backend *select_backend();
index 5be4338ed0050f52b6541189c2f15b3898946096..f5ee5f47772798de588772427fce2c35da80247a 100644 (file)
@@ -1,13 +1,16 @@
 /* value.c - routines for dealing with values */
 
 #include "portable.h"
+
 #include <stdio.h>
-#include <string.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/socket.h>
+
+#include <ac/ctype.h>
+#include <ac/socket.h>
+#include <ac/string.h>
+#include <ac/time.h>
+
 #include <sys/stat.h>
-#include "portable.h"
+
 #include "slap.h"
 
 int
@@ -100,7 +103,7 @@ value_normalize(
        *d = '\0';
 }
 
-#define MIN( a, b )    (a < b ? a : b )
+#define LDAP_MIN( a, b )       ((a) < (b) ? (a) : (b) )
 
 int
 value_cmp(
@@ -134,7 +137,7 @@ value_cmp(
                break;
 
        case SYNTAX_BIN:
-               rc = memcmp( v1->bv_val, v2->bv_val, MIN( v1->bv_len,
+               rc = memcmp( v1->bv_val, v2->bv_val, LDAP_MIN( v1->bv_len,
                    v2->bv_len ) );
                break;
        }