Skip to content

Commit

Permalink
Fix LDAP entrypoint script no schema files injected
Browse files Browse the repository at this point in the history
Fixed logic preventing slapd entrypoint script from running to
completion when no schema files are injected into /schema.
  • Loading branch information
skoranda committed Jun 19, 2018
1 parent f702746 commit 3ffe26f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion comanage-registry-slapd-base/comanage_ldap_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ function comanage_ldap_utils::add_schemas() {

# Loop over all schema files.
for file_name in "${schema_files[@]}"; do
[[ -f "${file_name}" ]] || continue

# Parse schema name from the LDIF file.
schema_name=`head -n 1 "${file_name}" |
Expand Down Expand Up @@ -574,7 +575,8 @@ function comanage_ldap_utils::loop_ldapmodify() {
sed -i s@%%"${s}"%%@"${replacement}"@g "${newldif}"
done

ldapmodify -c ${auth} -H ldapi:/// -f "${newldif}" > "${OUTPUT}" 2>&1
ldapmodify -c ${auth} -H ldapi:/// \
-f "${newldif}" > "${OUTPUT}" 2>&1 || true

rm -f "${newldif}" > "${OUTPUT}" 2>&1
done
Expand Down

0 comments on commit 3ffe26f

Please sign in to comment.