Skip to content

Commit

Permalink
Owner and permissions for slapd TLS files
Browse files Browse the repository at this point in the history
Added logic to set the owner and permissions for the slapd TLS
certificate, privkey, and CA cert files so that they are explicitly
owned by openldap with the correct permissions.
  • Loading branch information
skoranda committed Jul 24, 2018
1 parent b65387a commit 0436ac2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions comanage-registry-slapd-base/comanage_ldap_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -420,14 +420,20 @@ EOF
function comanage_ldap_utils::copy_cert_and_secrets() {
if [[ -f "${SLAPD_CERT_FILE}" ]]; then
cp ${SLAPD_CERT_FILE} /etc/ldap/slapd.crt
chown openldap:openldap /etc/ldap/slapd.crt
chmod 644 /etc/ldap/slapd.crt
fi

if [[ -f "${SLAPD_PRIVKEY_FILE}" ]]; then
cp ${SLAPD_PRIVKEY_FILE} /etc/ldap/slapd.key
chown openldap:openldap /etc/ldap/slapd.key
chmod 600 /etc/ldap/slapd.key
fi

if [[ -f "${SLAPD_CHAIN_FILE}" ]]; then
cp ${SLAPD_CHAIN_FILE} /etc/ldap/slapd.ca.crt
chown openldap:openldap /etc/ldap/slapd.ca.crt
chmod 644 /etc/ldap/slapd.ca.crt
fi

if [[ -f "${OLC_ROOT_PW_FILE}" ]]; then
Expand Down

0 comments on commit 0436ac2

Please sign in to comment.