1 SLAPD_CONF=$LDAPDIR/slapd.conf
7 include $LDAPDIR/ad.schema
9 pidfile $PIDDIR/slapd.pid
10 argsfile $LDAPDIR/slapd.args
12 access to * by * write
17 uid=([^,]*),cn=$DNSNAME,cn=digest-md5,cn=auth
18 ldap:///$BASEDN??sub?(samAccountName=\$1)
21 uid=([^,]*),cn=([^,]*),cn=digest-md5,cn=auth
22 ldap:///$BASEDN??sub?(samAccountName=\$1)
24 include $LDAPDIR/modules.conf
26 defaultsearchbase "$BASEDN"
31 rootdn "cn=Manager,$BASEDN"
35 index samAccountName eq
38 index objectCategory eq
45 index lDAPDisplayName eq
48 index nETBIOSName eq pres
51 syncprov-checkpoint 100 10
52 syncprov-sessionlog 100
56 cat > $LDAPDIR/db/DB_CONFIG <<EOF
58 # Set the database in memory cache size.
60 set_cachesize 0 524288 0
64 # Set database flags (this is a test environment, we don't need to fsync()).
66 set_flags DB_TXN_NOSYNC
71 set_lg_regionmax 104857
74 set_lg_dir $LDAPDIR/db/bdb-logs
78 # Set temporary file creation directory.
80 set_tmp_dir $LDAPDIR/db/tmp
83 LDAP_URI="ldapi://$LDAPDIR/ldapi"
84 LDAP_URI_ESCAPE="ldapi://"`echo $LDAPDIR/ldapi | sed 's|/|%2F|g'`
86 export LDAP_URI_ESCAPE
88 #This uses the provision we just did, to read out the schema
89 $srcdir/bin/ad2oLschema $CONFIGURATION -H $PRIVATEDIR/sam.ldb -I $srcdir/setup/schema-map-openldap-2.3 -O $LDAPDIR/ad.schema >&2
91 #Now create an LDAP baseDN
92 $srcdir/bin/smbscript $srcdir/setup/provision $PROVISION_OPTIONS --ldap-base >&2
95 PATH=/usr/local/sbin:/usr/sbin:/sbin:$PATH
98 MODCONF=$LDAPDIR/modules.conf
102 slaptest -u -f $SLAPD_CONF >&2 || {
103 echo "enabling slapd modules" >&2
105 modulepath /usr/lib/ldap
110 if slaptest -u -f $SLAPD_CONF; then
111 slapadd -f $SLAPD_CONF < $PRIVATEDIR/$DNSNAME.ldif >/dev/null || {
112 echo "slapadd failed" >&2
115 slaptest -f $SLAPD_CONF >/dev/null || {
116 echo "slaptest after database load failed" >&2