Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure files are owned by the openldap user. #561

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions image/service/slapd/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -426,12 +426,14 @@ EOF
echo "export PREVIOUS_LDAP_TLS_CRT_PATH=${LDAP_TLS_CRT_PATH}" >> $WAS_STARTED_WITH_TLS
echo "export PREVIOUS_LDAP_TLS_KEY_PATH=${LDAP_TLS_KEY_PATH}" >> $WAS_STARTED_WITH_TLS
echo "export PREVIOUS_LDAP_TLS_DH_PARAM_PATH=${LDAP_TLS_DH_PARAM_PATH}" >> $WAS_STARTED_WITH_TLS
chown openldap:openldap $WAS_STARTED_WITH_TLS

# enforce TLS
if [ "${LDAP_TLS_ENFORCE,,}" == "true" ]; then
log-helper info "Add enforce TLS..."
ldapmodify -Y EXTERNAL -Q -H ldapi:/// -f ${CONTAINER_SERVICE_DIR}/slapd/assets/config/tls/tls-enforce-enable.ldif 2>&1 | log-helper debug
touch $WAS_STARTED_WITH_TLS_ENFORCE
chown openldap:openldap $WAS_STARTED_WITH_TLS_ENFORCE

# disable tls enforcing (not possible for now)
#else
Expand Down Expand Up @@ -519,6 +521,7 @@ EOF

else
touch "$WAS_ADMIN_PASSWORD_SET"
chown openldap:openldap "$WAS_ADMIN_PASSWORD_SET"
fi

#
Expand Down Expand Up @@ -559,6 +562,7 @@ EOF
#
log-helper info "First start is done..."
touch $FIRST_START_DONE
chown openldap:openldap $FIRST_START_DONE
fi

ln -sf ${CONTAINER_SERVICE_DIR}/slapd/assets/.ldaprc $HOME/.ldaprc
Expand Down