Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(749)

Unified Diff: remoting/host/pam_authorization_factory_posix.cc

Issue 13312005: Don't use $USER for Local Login check (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix comment Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/base/util.cc ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/pam_authorization_factory_posix.cc
diff --git a/remoting/host/pam_authorization_factory_posix.cc b/remoting/host/pam_authorization_factory_posix.cc
index 1a5b0b3e7ea14509bb6b9ce576d97a31b76bbd90..d82c7013b39535f5dbe764a6ca163ae7c43325fd 100644
--- a/remoting/host/pam_authorization_factory_posix.cc
+++ b/remoting/host/pam_authorization_factory_posix.cc
@@ -10,6 +10,7 @@
#include "base/callback.h"
#include "base/environment.h"
#include "base/logging.h"
+#include "remoting/base/util.h"
#include "remoting/protocol/channel_authenticator.h"
#include "third_party/libjingle/source/talk/xmllite/xmlelement.h"
@@ -101,11 +102,10 @@ void PamAuthorizer::MaybeCheckLocalLogin() {
}
bool PamAuthorizer::IsLocalLoginAllowed() {
- std::string username;
- if (!base::Environment::Create()->GetVar("USER", &username)) {
+ std::string username = GetUsername();
+ if (username.empty()) {
return false;
}
-
struct pam_conv conv = { PamConversation, NULL };
pam_handle_t* handle = NULL;
int result = pam_start("chrome-remote-desktop", username.c_str(),
« no previous file with comments | « remoting/base/util.cc ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698