Chromium Code Reviews| 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; |