Explicitly pass in SLAPPASS when setting up LDAP

Change-Id: Ibcceabf2c76aaeeb8902a670557cc0093943a3e4
Closes-Bug: #1373750
This commit is contained in:
Julie Pichon 2014-11-21 14:57:16 +00:00
parent f4fed56e93
commit a3d60c80d9

View File

@ -51,9 +51,10 @@ fi
# _ldap_varsubst file # _ldap_varsubst file
function _ldap_varsubst { function _ldap_varsubst {
local infile=$1 local infile=$1
local slappass=$2
sed -e " sed -e "
s|\${LDAP_OLCDB_NUMBER}|$LDAP_OLCDB_NUMBER| s|\${LDAP_OLCDB_NUMBER}|$LDAP_OLCDB_NUMBER|
s|\${SLAPPASS}|$SLAPPASS| s|\${SLAPPASS}|$slappass|
s|\${LDAP_ROOTPW_COMMAND}|$LDAP_ROOTPW_COMMAND| s|\${LDAP_ROOTPW_COMMAND}|$LDAP_ROOTPW_COMMAND|
s|\${BASE_DC}|$LDAP_BASE_DC| s|\${BASE_DC}|$LDAP_BASE_DC|
s|\${BASE_DN}|$LDAP_BASE_DN| s|\${BASE_DN}|$LDAP_BASE_DN|
@ -130,7 +131,7 @@ function install_ldap {
printf "LDAP secret is $slappass\n" printf "LDAP secret is $slappass\n"
# Create manager.ldif and add to olcdb # Create manager.ldif and add to olcdb
_ldap_varsubst $FILES/ldap/manager.ldif.in >$tmp_ldap_dir/manager.ldif _ldap_varsubst $FILES/ldap/manager.ldif.in $slappass >$tmp_ldap_dir/manager.ldif
sudo ldapmodify -Y EXTERNAL -H ldapi:/// -f $tmp_ldap_dir/manager.ldif sudo ldapmodify -Y EXTERNAL -H ldapi:/// -f $tmp_ldap_dir/manager.ldif
# On fedora we need to manually add cosine and inetorgperson schemas # On fedora we need to manually add cosine and inetorgperson schemas