Commit c0f5c884 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

SLAPD compiles. Needs LDBM work to link.

parent e40ec58a
......@@ -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 );
......
......@@ -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);
......
......@@ -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();
......
......@@ -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();
......
......@@ -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
......
......@@ -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"
......
......@@ -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"
......
......@@ -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
......
......@@ -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,
......
......@@ -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();
......
......@@ -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"
......
......@@ -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"
......
......@@ -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"
......
......@@ -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
......
......@@ -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"
......
......@@ -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
......
......@@ -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"
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment