Fix bug 1570 - Escaping spaces in Keystone LDAP config 14/11014/2
authorsousaedu <eduardo.sousa@canonical.com>
Wed, 16 Jun 2021 15:17:48 +0000 (16:17 +0100)
committersousaedu <eduardo.sousa@canonical.com>
Wed, 16 Jun 2021 15:22:12 +0000 (16:22 +0100)
Change-Id: Ia862be33f8ce408f3d033c8a469f3548e86075e0
Signed-off-by: sousaedu <eduardo.sousa@canonical.com>
docker/Keystone/scripts/start.sh

index 0e7af80..e4bb5f2 100755 (executable)
@@ -117,62 +117,62 @@ group_allow_update=false
 group_allow_delete=false
 query_scope = sub
 EOF
-    if [ $LDAP_BIND_USER ]; then
+    if [ "$LDAP_BIND_USER" ]; then
         echo "user = $LDAP_BIND_USER" >> /etc/keystone/domains/keystone.$LDAP_AUTHENTICATION_DOMAIN_NAME.conf
     fi
-    if [ $LDAP_BIND_PASSWORD ]; then
+    if [ "$LDAP_BIND_PASSWORD" ]; then
         echo "password = $LDAP_BIND_PASSWORD" >> /etc/keystone/domains/keystone.$LDAP_AUTHENTICATION_DOMAIN_NAME.conf
     fi
-    if [ $LDAP_CHASE_REFERRALS ]; then
+    if [ "$LDAP_CHASE_REFERRALS" ]; then
         echo "chase_referrals = $LDAP_CHASE_REFERRALS" >> /etc/keystone/domains/keystone.$LDAP_AUTHENTICATION_DOMAIN_NAME.conf
     fi
-    if [ $LDAP_PAGE_SIZE ]; then
+    if [ "$LDAP_PAGE_SIZE" ]; then
         echo "page_size = $LDAP_PAGE_SIZE" >> /etc/keystone/domains/keystone.$LDAP_AUTHENTICATION_DOMAIN_NAME.conf
     fi
-    if [ $LDAP_USER_TREE_DN ]; then
+    if [ "$LDAP_USER_TREE_DN" ]; then
         echo "user_tree_dn = $LDAP_USER_TREE_DN" >> /etc/keystone/domains/keystone.$LDAP_AUTHENTICATION_DOMAIN_NAME.conf
     fi
-    if [ $LDAP_USER_OBJECTCLASS ]; then
+    if [ "$LDAP_USER_OBJECTCLASS" ]; then
         echo "user_objectclass = $LDAP_USER_OBJECTCLASS" >> /etc/keystone/domains/keystone.$LDAP_AUTHENTICATION_DOMAIN_NAME.conf
     fi
-    if [ $LDAP_USER_ID_ATTRIBUTE ]; then
+    if [ "$LDAP_USER_ID_ATTRIBUTE" ]; then
         echo "user_id_attribute = $LDAP_USER_ID_ATTRIBUTE" >> /etc/keystone/domains/keystone.$LDAP_AUTHENTICATION_DOMAIN_NAME.conf
     fi
-    if [ $LDAP_USER_NAME_ATTRIBUTE ]; then
+    if [ "$LDAP_USER_NAME_ATTRIBUTE" ]; then
         echo "user_name_attribute = $LDAP_USER_NAME_ATTRIBUTE" >> /etc/keystone/domains/keystone.$LDAP_AUTHENTICATION_DOMAIN_NAME.conf
     fi
-    if [ $LDAP_USER_PASS_ATTRIBUTE ]; then
+    if [ "$LDAP_USER_PASS_ATTRIBUTE" ]; then
         echo "user_pass_attribute = $LDAP_USER_PASS_ATTRIBUTE" >> /etc/keystone/domains/keystone.$LDAP_AUTHENTICATION_DOMAIN_NAME.conf
     fi
-    if [ $LDAP_USER_FILTER ]; then
+    if [ "$LDAP_USER_FILTER" ]; then
         echo "user_filter = $LDAP_USER_FILTER" >> /etc/keystone/domains/keystone.$LDAP_AUTHENTICATION_DOMAIN_NAME.conf
     fi
-    if [ $LDAP_USER_ENABLED_ATTRIBUTE ]; then
+    if [ "$LDAP_USER_ENABLED_ATTRIBUTE" ]; then
         echo "user_enabled_attribute = $LDAP_USER_ENABLED_ATTRIBUTE" >> /etc/keystone/domains/keystone.$LDAP_AUTHENTICATION_DOMAIN_NAME.conf
     fi
-    if [ $LDAP_USER_ENABLED_MASK ]; then
+    if [ "$LDAP_USER_ENABLED_MASK" ]; then
         echo "user_enabled_mask = $LDAP_USER_ENABLED_MASK" >> /etc/keystone/domains/keystone.$LDAP_AUTHENTICATION_DOMAIN_NAME.conf
     fi
-    if [ $LDAP_USER_ENABLED_DEFAULT ]; then
+    if [ "$LDAP_USER_ENABLED_DEFAULT" ]; then
         echo "user_enabled_default = $LDAP_USER_ENABLED_DEFAULT" >> /etc/keystone/domains/keystone.$LDAP_AUTHENTICATION_DOMAIN_NAME.conf
     fi
-    if [ $LDAP_USER_ENABLED_INVERT ]; then
+    if [ "$LDAP_USER_ENABLED_INVERT" ]; then
         echo "user_enabled_invert = $LDAP_USER_ENABLED_INVERT" >> /etc/keystone/domains/keystone.$LDAP_AUTHENTICATION_DOMAIN_NAME.conf
     fi
-    if [ $LDAP_GROUP_OBJECTCLASS ]; then
+    if [ "$LDAP_GROUP_OBJECTCLASS" ]; then
         echo "group_objectclass = $LDAP_GROUP_OBJECTCLASS" >> /etc/keystone/domains/keystone.$LDAP_AUTHENTICATION_DOMAIN_NAME.conf
     fi
-    if [ $LDAP_GROUP_TREE_DN ]; then
+    if [ "$LDAP_GROUP_TREE_DN" ]; then
         echo "group_tree_dn = $LDAP_GROUP_TREE_DN" >> /etc/keystone/domains/keystone.$LDAP_AUTHENTICATION_DOMAIN_NAME.conf
     fi
-    if [ $LDAP_USE_STARTTLS ] && [ "$LDAP_USE_STARTTLS" == "true" ]; then
+    if [ "$LDAP_USE_STARTTLS" ] && [ "$LDAP_USE_STARTTLS" == "true" ]; then
         echo "use_tls = true" >> /etc/keystone/domains/keystone.$LDAP_AUTHENTICATION_DOMAIN_NAME.conf
         mkdir -p /etc/keystone/ssl/certs/
         echo "-----BEGIN CERTIFICATE-----" > /etc/keystone/ssl/certs/ca.pem
         echo $LDAP_TLS_CACERT_BASE64 >> /etc/keystone/ssl/certs/ca.pem
         echo "-----END CERTIFICATE-----" >> /etc/keystone/ssl/certs/ca.pem
         echo "tls_cacertfile = /etc/keystone/ssl/certs/ca.pem" >> /etc/keystone/domains/keystone.$LDAP_AUTHENTICATION_DOMAIN_NAME.conf
-        if [ $LDAP_TLS_REQ_CERT ]; then
+        if [ "$LDAP_TLS_REQ_CERT" ]; then
             echo "tls_req_cert = $LDAP_TLS_REQ_CERT" >> /etc/keystone/domains/keystone.$LDAP_AUTHENTICATION_DOMAIN_NAME.conf
         fi
     fi