Ticket #3892: mythtv-mythfilldatabase-single_quote_in_password.patch

File mythtv-mythfilldatabase-single_quote_in_password.patch, 1.0 KB (added by sphery <mtdean@…>, 17 years ago)
  • libs/libmythtv/datadirect.cpp

     
    985985    poststream << "</SOAP-ENV:Envelope>\n";
    986986    postfile.close();
    987987
     988    // Allow for single quotes in userid and password (shell escape)
     989    password.replace('\'', "'\\''");
     990    userid.replace('\'', "'\\''");
    988991    QString command = QString(
    989992        "wget --http-user='%1' --http-passwd='%2' --post-file='%3' "
    990993        "--header='Accept-Encoding:gzip' %4 --output-document=- ")
     
    10351038
    10361039    QString command = QString("wget --http-user='%1' --http-passwd='%2' "
    10371040                              "--post-file='%3' %4 --output-document='%5'")
    1038         .arg(GetUserID()).arg(GetPassword()).arg(GetPostFilename())
     1041        .arg(GetUserID().replace('\'', "'\\''"))
     1042        .arg(GetPassword().replace('\'', "'\\''")).arg(GetPostFilename())
    10391043        .arg(ddurl).arg(GetResultFilename());
    10401044
    10411045    if (SHOW_WGET_OUTPUT)