Commits

Zhang Huangbin  committed b1e7652

Do not use '$' in password.

  • Participants
  • Parent commits 8db84b3

Comments (0)

Files changed (3)

File iRedMail/dialog/ldap_config.sh

 
 WARNING:
 
+    * Do *NOT* use $ in password.
     * EMPTY password is *NOT* permitted.
 " 20 76 2>/tmp/ldap_rootpw
 
     LDAP_ROOTPW="$(cat /tmp/ldap_rootpw)"
-    if [ ! -z "${LDAP_ROOTPW}" ]; then
-        break
-    fi
+
+    # Check '$' in password
+    echo ${LDAP_ROOTPW} | grep '\$' &>/dev/null
+    [ X"$?" != X'0' -a X"${LDAP_ROOTPW}" != X'' ] && break
 done
 
 echo "export LDAP_ROOTPW='${LDAP_ROOTPW}'" >>${IREDMAIL_CONFIG_FILE}

File iRedMail/dialog/mysql_config.sh

 
 WARNING:
 
+    * Do *NOT* use $ in password.
     * EMPTY password is *NOT* permitted.
 " 20 76 2>/tmp/mysql_rootpw
 
     MYSQL_ROOT_PASSWD="$(cat /tmp/mysql_rootpw)"
-    [ X"${MYSQL_ROOT_PASSWD}" != X"" ] && break
+
+    # Check '$' in password
+    echo ${MYSQL_ROOT_PASSWD} | grep '\$' &>/dev/null
+    [ X"$?" != X'0' -a X"${MYSQL_ROOT_PASSWD}" != X'' ] && break
 done
 
 echo "export MYSQL_ROOT_PASSWD='${MYSQL_ROOT_PASSWD}'" >>${IREDMAIL_CONFIG_FILE}

File iRedMail/dialog/pgsql_config.sh

 
 WARNING:
 
+    * Do *NOT* use $ in password.
     * EMPTY password is *NOT* permitted.
 " 20 76 2>/tmp/pgsql_rootpw
 
     PGSQL_ROOT_PASSWD="$(cat /tmp/pgsql_rootpw)"
-    [ X"${PGSQL_ROOT_PASSWD}" != X"" ] && break
+
+    # Check '$' in password
+    echo ${PGSQL_ROOT_PASSWD} | grep '\$' &>/dev/null
+    [ X"$?" != X'0' -a X"${PGSQL_ROOT_PASSWD}" != X'' ] && break
 done
 
 echo "export PGSQL_ROOT_PASSWD='${PGSQL_ROOT_PASSWD}'" >>${IREDMAIL_CONFIG_FILE}