SLAPD compiles. Needs LDBM work to link.

This commit is contained in:
Kurt Zeilenga 1998-10-21 23:49:46 +00:00
parent e40ec58ab2
commit c0f5c88429
82 changed files with 498 additions and 459 deletions

View 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 );

View 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);

View file

@ -13,10 +13,11 @@
#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();

View 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();

View 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

View 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"

View 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"

View 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

View 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,

View 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();

View 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"

View 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"

View 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"

View 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

View 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"

View 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

View 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"

View 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

View 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

View 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

View file

@ -3,12 +3,10 @@
#include "portable.h"
#include <stdio.h>
#include <ac/string.h>
#include <sys/types.h>
#ifdef CLDAP
#include <sys/socket.h>
#endif
#include <ac/string.h>
#include <ac/socket.h>
#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

View 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

View 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,

View 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;

View 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"

View 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"

View 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"

View 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"

View 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

View 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(

View 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;

View 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"

View 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"

View 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"

View 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"

View 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"

View 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"

View 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(

View 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"

View 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"

View 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"

View 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"

View 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"

View 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"

View 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)
{

View file

@ -15,9 +15,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 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;

View 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 *

View 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

View 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();

View 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"

View file

@ -13,9 +13,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"

View 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 );
}

View 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
#include <sys/filio.h>
#else /* NEED_FILIO */
#include <sys/ioctl.h>
#endif /* NEED_FILIO */
#ifdef USE_SYSCONF
#include <unistd.h>
#endif /* USE_SYSCONF */
#ifdef TCP_WRAPPERS
#ifdef HAVE_SYS_FILIO_H
#include <sys/filio.h>
#elif HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif
#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

View file

@ -13,9 +13,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 Backend *select_backend();

View file

@ -13,20 +13,14 @@
#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

View 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();

View 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();

View 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:

View 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();

View 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"

View 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 *

View 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

View file

@ -13,11 +13,11 @@
#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();

View file

@ -13,9 +13,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"
extern Backend *select_backend();

View file

@ -20,10 +20,11 @@
#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 );

View 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;

View 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 */

View 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;

View 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

View 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();

View 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();

View file

@ -13,9 +13,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"

View 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)

View file

@ -15,27 +15,21 @@
#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 ];

View file

@ -16,12 +16,19 @@
#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;
#ifndef STDC_HEADERS
char *fmt;
#endif
if ( debugflg ) {
va_start( ap );
fmt = va_arg( ap, char * );
fprintf( stderr, "%s: ", progname );
vfprintf( stderr, fmt, ap );
va_end( ap );
}
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 );
}
}

View 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 */

View 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;

View 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();

View 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 */

View 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 )
{

View 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();

View 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;
}