From a5cabfb6ec3b732123682c736254e998ecb16232 Mon Sep 17 00:00:00 2001 From: Benjamin Guillon Date: Mon, 14 Dec 2020 11:11:29 +0100 Subject: [PATCH 1/3] Find should now follow symlinks when looking for custom LDIFs. This should help when loading LDIFs through configmaps in a Kubernetes environment. --- .../2/debian-10/rootfs/opt/bitnami/scripts/libopenldap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitnami/openldap/2/debian-10/rootfs/opt/bitnami/scripts/libopenldap.sh b/bitnami/openldap/2/debian-10/rootfs/opt/bitnami/scripts/libopenldap.sh index 9955641eb4a2..67184bb6b07d 100644 --- a/bitnami/openldap/2/debian-10/rootfs/opt/bitnami/scripts/libopenldap.sh +++ b/bitnami/openldap/2/debian-10/rootfs/opt/bitnami/scripts/libopenldap.sh @@ -308,7 +308,7 @@ EOF ldap_add_custom_ldifs() { info "Loading custom LDIF files..." warn "Ignoring LDAP_USERS, LDAP_PASSWORDS, LDAP_USER_DC and LDAP_GROUP environment variables..." - debug_execute find "$LDAP_CUSTOM_LDIF_DIR" -maxdepth 1 -type f -iname '*.ldif' -print0 | sort -z | xargs --null -I{} ldapadd -f {} -H 'ldapi:///' -D "$LDAP_ADMIN_DN" -w "$LDAP_ADMIN_PASSWORD" + debug_execute find "$LDAP_CUSTOM_LDIF_DIR" -maxdepth 1 -type f,l -iname '*.ldif' -print0 | sort -z | xargs --null -I{} ldapadd -f {} -H 'ldapi:///' -D "$LDAP_ADMIN_DN" -w "$LDAP_ADMIN_PASSWORD" } ######################## From 736a43269452e7a2b4291ebd4de305e6ef55db3f Mon Sep 17 00:00:00 2001 From: Benjamin Guillon Date: Tue, 15 Dec 2020 14:04:30 +0100 Subject: [PATCH 2/3] Narrowed down debug_execute scope when loading custom LDIFs. --- .../2/debian-10/rootfs/opt/bitnami/scripts/libopenldap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitnami/openldap/2/debian-10/rootfs/opt/bitnami/scripts/libopenldap.sh b/bitnami/openldap/2/debian-10/rootfs/opt/bitnami/scripts/libopenldap.sh index 67184bb6b07d..3c4a20803380 100644 --- a/bitnami/openldap/2/debian-10/rootfs/opt/bitnami/scripts/libopenldap.sh +++ b/bitnami/openldap/2/debian-10/rootfs/opt/bitnami/scripts/libopenldap.sh @@ -308,7 +308,7 @@ EOF ldap_add_custom_ldifs() { info "Loading custom LDIF files..." warn "Ignoring LDAP_USERS, LDAP_PASSWORDS, LDAP_USER_DC and LDAP_GROUP environment variables..." - debug_execute find "$LDAP_CUSTOM_LDIF_DIR" -maxdepth 1 -type f,l -iname '*.ldif' -print0 | sort -z | xargs --null -I{} ldapadd -f {} -H 'ldapi:///' -D "$LDAP_ADMIN_DN" -w "$LDAP_ADMIN_PASSWORD" + find "$LDAP_CUSTOM_LDIF_DIR" -maxdepth 1 -type f,l -iname '*.ldif' -print0 | sort -z | xargs --null -I{} bash -c ". /opt/bitnami/scripts/libos.sh && debug_execute ldapadd -f {} -H 'ldapi:///' -D $LDAP_ADMIN_DN -w $LDAP_ADMIN_PASSWORD" } ######################## From e9242f7386204181143ab063c4207600b45f8f80 Mon Sep 17 00:00:00 2001 From: Benjamin Guillon Date: Wed, 6 Jan 2021 16:55:05 +0100 Subject: [PATCH 3/3] Find should now be compatible with more ditros when loading custom LDIFs. --- .../2/debian-10/rootfs/opt/bitnami/scripts/libopenldap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitnami/openldap/2/debian-10/rootfs/opt/bitnami/scripts/libopenldap.sh b/bitnami/openldap/2/debian-10/rootfs/opt/bitnami/scripts/libopenldap.sh index 3c4a20803380..044108eea720 100644 --- a/bitnami/openldap/2/debian-10/rootfs/opt/bitnami/scripts/libopenldap.sh +++ b/bitnami/openldap/2/debian-10/rootfs/opt/bitnami/scripts/libopenldap.sh @@ -308,7 +308,7 @@ EOF ldap_add_custom_ldifs() { info "Loading custom LDIF files..." warn "Ignoring LDAP_USERS, LDAP_PASSWORDS, LDAP_USER_DC and LDAP_GROUP environment variables..." - find "$LDAP_CUSTOM_LDIF_DIR" -maxdepth 1 -type f,l -iname '*.ldif' -print0 | sort -z | xargs --null -I{} bash -c ". /opt/bitnami/scripts/libos.sh && debug_execute ldapadd -f {} -H 'ldapi:///' -D $LDAP_ADMIN_DN -w $LDAP_ADMIN_PASSWORD" + find "$LDAP_CUSTOM_LDIF_DIR" -maxdepth 1 \( -type f -o -type l \) -iname '*.ldif' -print0 | sort -z | xargs --null -I{} bash -c ". /opt/bitnami/scripts/libos.sh && debug_execute ldapadd -f {} -H 'ldapi:///' -D $LDAP_ADMIN_DN -w $LDAP_ADMIN_PASSWORD" } ########################