Skip to content

Commit

Permalink
validate username/password fields when unencrypted (fixes #1545)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcphers committed Apr 19, 2018
1 parent a6001ee commit f873acc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions NEWS.md
Expand Up @@ -3,6 +3,7 @@
### Bug Fixes

- Fix sign-out issue when "stay signed in" is checked in RStudio Server (#1538)
- Fix hang when submitting empty passwords and password encryption is turned off (#1545)
- Fix dark theme partial application in data viewer when upgrading from 1.0 (#1573)
- Fix overlap between Refresh icon and plot title text (#1585)
- Fix slow File Open dialog on RStudio Desktop for Linux (#1587)
Expand Down
11 changes: 10 additions & 1 deletion src/cpp/server/ServerPAMAuth.cpp
Expand Up @@ -244,7 +244,9 @@ void signIn(const http::Request& request,
variables[kFormAction] = "action=\"javascript:void\" "
"onsubmit=\"submitRealForm();return false\"";
else
variables[kFormAction] = "action=\"" + variables["action"] + "\"";
variables[kFormAction] = "action=\"" + variables["action"] + "\" "
"onsubmit=\"return verifyMe()\"";


variables[kAppUri] = request.queryParamValue(kAppUri);

Expand Down Expand Up @@ -442,6 +444,13 @@ bool pamLogin(const std::string& username, const std::string& password)
std::vector<std::string> args;
args.push_back(username);

// don't try to login with an empty password (this hangs PAM as it waits for input)
if (password.empty())
{
LOG_WARNING_MESSAGE("No PAM password provided for user '" + username + "'; refusing login");
return false;
}

// options (assume priv after fork)
core::system::ProcessOptions options;
options.onAfterFork = assumeRootPriv;
Expand Down

0 comments on commit f873acc

Please sign in to comment.