r21743: Always use the 'escaped' LDAPI path.
[Samba/ekacnet.git] / source4 / script / tests / mk-fedora-ds.sh
blob7ea012d0cb267db40afda0e642619ee94de80af5
1 FEDORA_DS_INF=$LDAPDIR/fedorads.inf
2 FEDORA_DS_INITIAL_LDIF=$LDAPDIR/fedorads-initial.ldif
4 echo "FEDORA_DS_LOGLEVEL=0"
6 #Make the subdirectory be as fedora DS would expect
7 FEDORA_DS_DIR=$LDAPDIR/slapd-samba4
8 echo FEDORA_DS_DIR=$FEDORA_DS_DIR
10 cat >$FEDORA_DS_INF <<EOF
11 [General]
12 SuiteSpotUserID = $ROOT
13 FullMachineName= localhost
14 ServerRoot= $LDAPDIR
16 [slapd]
17 ldapifilepath=$LDAPDIR/ldapi
18 Suffix= $BASEDN
19 RootDN= cn=Manager,$BASEDN
20 RootDNPwd= $PASSWORD
21 ServerIdentifier= samba4
22 InstallLdifFile=$FEDORA_DS_INITIAL_LDIF
24 inst_dir= $FEDORA_DS_DIR
25 config_dir= $FEDORA_DS_DIR
26 schema_dir= $FEDORA_DS_DIR/schema
27 lock_dir= $FEDORA_DS_DIR/lock
28 log_dir= $FEDORA_DS_DIR/logs
29 run_dir= $FEDORA_DS_DIR/logs
30 db_dir= $FEDORA_DS_DIR/db
31 bak_dir= $FEDORA_DS_DIR/bak
32 tmp_dir= $FEDORA_DS_DIR/tmp
33 ldif_dir= $FEDORA_DS_DIR/ldif
34 cert_dir= $FEDORA_DS_DIR
36 start_server= 0
38 EOF
40 cat >$FEDORA_DS_INITIAL_LDIF<<EOF
41 # These entries need to be added to get the container for the
42 # provision to be aimed at.
44 dn: cn="dc=$BASEDN",cn=mapping tree,cn=config
45 objectclass: top
46 objectclass: extensibleObject
47 objectclass: nsMappingTree
48 nsslapd-state: backend
49 nsslapd-backend: userData
50 cn: $BASEDN
52 dn: cn=userData,cn=ldbm database,cn=plugins,cn=config
53 objectclass: extensibleObject
54 objectclass: nsBackendInstance
55 nsslapd-suffix: $BASEDN
57 EOF
59 perl $FEDORA_DS_PREFIX/bin/ds_newinst.pl $FEDORA_DS_INF >&2 || exit 1;
62 cd $FEDORA_DS_DIR/schema
63 ls | grep -v ^00core | xargs rm
66 $srcdir/bin/ad2oLschema $CONFIGURATION -H $PRIVATEDIR/sam.ldb --option=convert:target=fedora-ds -I $srcdir/setup/schema-map-fedora-ds-1.0 -O $FEDORA_DS_DIR/schema/99_ad.ldif >&2
68 PROVISION_OPTIONS="$PROVISION_OPTIONS --ldap-module=nsuniqueid"
69 #it is easier to base64 encode this than correctly escape it:
70 # (targetattr = "*") (version 3.0;acl "full access to all by all";allow (all)(userdn = "ldap:///anyone");)
71 PROVISION_ACI="--aci=aci:: KHRhcmdldGF0dHIgPSAiKiIpICh2ZXJzaW9uIDMuMDthY2wgImZ1bGwgYWNjZXNzIHRvIGFsbCBieSBhbGwiO2FsbG93IChhbGwpKHVzZXJkbiA9ICJsZGFwOi8vL2FueW9uZSIpOykK"