diff --git a/install/alternc.install b/install/alternc.install index fa0e023b..55638a6c 100755 --- a/install/alternc.install +++ b/install/alternc.install @@ -264,6 +264,14 @@ PHPMYADMIN_BLOWFISH="$(generate_string 32)" # XXX: I assume this is secure if /tmp is sticky (+t) # we should have a better way to deal with templating, of course. SED_SCRIPT="/tmp/alternc.install.sedscript" +# Escape passwords for sed and restore afterwards +# Escaping '&' and '|' since those are used as special characters +MYSQL_PASS_ORIG="$MYSQL_PASS" +MYSQL_PASS=$(echo "$MYSQL_PASS" | sed -e 's/[|&]/\\&/g') +MYSQL_MAIL_PASS_ORIG="$MYSQL_MAIL_PASS" +MYSQL_MAIL_PASS=$(echo "$MYSQL_MAIL_PASS" | sed -e 's/[|&]/\\&/g') +PHPMYADMIN_BLOWFISH_ORIG="$PHPMYADMIN_BLOWFISH_ORIG" +PHPMYADMIN_BLOWFISH=$(echo "$PHPMYADMIN_BLOWFISH" | sed -e 's/[|&]/\\&/g') cat > $SED_SCRIPT <