diff --git a/ChangeLog b/ChangeLog index 46732e32..e047481e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -20541,3 +20541,6 @@ 2020-11-05 Fred Gleason * Added logging for failed PAM authentication in 'RDPam::authenticate()'. +2020-11-06 Fred Gleason + * Fixed a bug in Webget that caused authentication to fail + when using PAM. diff --git a/web/webget/webget.cpp b/web/webget/webget.cpp index b7c64370..337f9fae 100644 --- a/web/webget/webget.cpp +++ b/web/webget/webget.cpp @@ -464,7 +464,7 @@ void MainObject::ServeForm() printf(" \n", rda->user()->name().toUtf8().constData()); printf(" \n", - rda->user()->password().toUtf8().constData()); + webget_remote_password.toUtf8().constData()); // // Get Audio @@ -571,10 +571,6 @@ void MainObject::ServeLogin() // printf(" \n"); printf("
\n"); - printf(" \n", - rda->user()->name().toUtf8().constData()); - printf(" \n", - rda->user()->password().toUtf8().constData()); printf(" \n"); printf(" \n"); printf(" \n"); @@ -605,24 +601,23 @@ void MainObject::ServeLogin() bool MainObject::Authenticate() { - QString name; - QString passwd; - - if(!webget_post->getValue("LOGIN_NAME",&name)) { + if(!webget_post->getValue("LOGIN_NAME",&webget_remote_username)) { rda->syslog(LOG_WARNING,"missing LOGIN_NAME"); rda->logAuthenticationFailure(webget_post->clientAddress()); return false; } - if(!webget_post->getValue("PASSWORD",&passwd)) { + if(!webget_post->getValue("PASSWORD",&webget_remote_password)) { rda->syslog(LOG_WARNING,"missing PASSWORD"); - rda->logAuthenticationFailure(webget_post->clientAddress(),name); + rda->logAuthenticationFailure(webget_post->clientAddress(), + webget_remote_username); return false; } - rda->user()->setName(name); + rda->user()->setName(webget_remote_username); if((!rda->user()->exists())|| - (!rda->user()->checkPassword(passwd,false))|| + (!rda->user()->checkPassword(webget_remote_password,false))|| (!rda->user()->webgetLogin())) { - rda->logAuthenticationFailure(webget_post->clientAddress(),name); + rda->logAuthenticationFailure(webget_post->clientAddress(), + webget_remote_username); return false; } diff --git a/web/webget/webget.h b/web/webget/webget.h index 6dedf3c2..a96e7547 100644 --- a/web/webget/webget.h +++ b/web/webget/webget.h @@ -50,6 +50,8 @@ class MainObject : public QObject void TextExit(const QString &msg,int code,int line) const; RDFormPost *webget_post; QString webget_remote_hostname; + QString webget_remote_username; + QString webget_remote_password; QHostAddress webget_remote_address; };