Ticket #12780: mythweb.postinst.patch

File mythweb.postinst.patch, 839 bytes (added by jason@…, 3 years ago)

escape the password string before using in sed replace

  • mythweb.postinst

    old new  
    6464        mythtv_username="$RET"
    6565        db_get mythtv/mysql_mythtv_password
    6666        mythtv_password="$RET"
    67         mythtv_password_escaped=$(printf "%s" "$mythtv_password" | sed 's/[&/\]/\\&/g')
    6867
    6968        db_get mythweb/enable || true
    7069        AUTH_ENABLE="$RET"
     
    120119s/^.*\(setenv\sdb_server\s\+\"\).*\"/\t\1$hostname\"/g;
    121120s/^.*\(setenv\sdb_name\s\+\"\).*\"/\t\1$database\"/g;
    122121s/^.*\(setenv\sdb_login\s\+\"\).*\"/\t\1$mythtv_username\"/g;
    123 s/^.*\(setenv\sdb_password\s\+\"\).*\"/\t\1$mythtv_password_escaped\"/g;
     122s/^.*\(setenv\sdb_password\s\+\"\).*\"/\t\1$mythtv_password\"/g;
    124123            " > $NEW
    125124        if [ "$INPUT" != "$MYTHWEBCONF" ]; then
    126125                sed "s,/var/www/html,$SYMLINK,;" -i $NEW