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

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: 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
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..b1008b8fe9eb2ba893c7e1fe773b1913738c43c5 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,10 +102,9 @@ void PamAuthorizer::MaybeCheckLocalLogin() {
}
bool PamAuthorizer::IsLocalLoginAllowed() {
- std::string username;
- if (!base::Environment::Create()->GetVar("USER", &username)) {
+ std::string username = GetUsername();
+ if (username.empty())
Wez 2013/03/29 17:27:57 This if() differs in style from other single-line
Jamie 2013/03/29 18:30:00 I disagree with your use of the word "preferably"
Lambros 2013/03/29 19:30:22 Done.
return false;
- }
struct pam_conv conv = { PamConversation, NULL };
pam_handle_t* handle = NULL;

Powered by Google App Engine
This is Rietveld 408576698