fix: change acls and how to apply them

This commit is contained in:
Thomas Schweiger
2025-10-23 16:03:35 +02:00
parent f253158ae7
commit c689b26275
2 changed files with 1 additions and 19 deletions

View File

@@ -1,26 +1,11 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eu set -eu
# load OpenLDAP environment and functions
. /opt/bitnami/scripts/libopenldap.sh
trap ldap_stop EXIT
# start LDAP in background
ldap_start_bg
# wait until LDAP is started
while ! ldapsearch -Y EXTERNAL -H ldapi:/// -b "cn=admin,dc=opencloud,dc=eu" >/dev/null 2>&1; do
echo "Waiting for LDAP to start..."
sleep 1
done
# apply acls # apply acls
echo -n "Applying acls... " echo -n "Applying acls... "
ldapmodify -Y EXTERNAL -H ldapi:/// -f /opt/bitnami/openldap/etc/schema/50_acls.ldif slapmodify -F /opt/bitnami/openldap/etc/slapd.d -b cn=config -l /opt/bitnami/openldap/etc/schema/50_acls.ldif
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
echo "done." echo "done."
else else
echo "failed." echo "failed."
fi fi

View File

@@ -7,6 +7,3 @@ olcAccess: {0}to dn.subtree="dc=opencloud,dc=eu" attrs=entry,uid,objectClass,ent
olcAccess: {1}to attrs=userPassword olcAccess: {1}to attrs=userPassword
by self write by self write
by * auth by * auth
olcAccess: {2}to *
by dn.base="uid=admin,ou=users,dc=opencloud,dc=eu" write
by * none