Index: remoting/host/host_stub_fake.cc |
diff --git a/remoting/host/host_stub_fake.cc b/remoting/host/host_stub_fake.cc |
index 895b21a3ce3d069e547ab336eb27dd11a20a9214..b11e277778a5d34e8d0350471d561ce95a735601 100644 |
--- a/remoting/host/host_stub_fake.cc |
+++ b/remoting/host/host_stub_fake.cc |
@@ -9,6 +9,10 @@ |
#include "remoting/protocol/client_stub.h" |
#include "remoting/protocol/connection_to_client.h" |
+#if defined(OS_LINUX) |
+#include "remoting/host/user_auth_pam.h" |
+#endif |
+ |
namespace remoting { |
HostStubFake::HostStubFake(ChromotingHost* host) |
@@ -23,14 +27,31 @@ void HostStubFake::SuggestResolution( |
void HostStubFake::BeginSessionRequest( |
const protocol::LocalLoginCredentials* credentials, Task* done) { |
- done->Run(); |
- delete done; |
- |
protocol::LocalLoginStatus* status = new protocol::LocalLoginStatus(); |
Sergey Ulanov
2011/02/10 20:14:28
We shouldn't add pam auth in HostStubFake. It is f
|
- status->set_success(true); |
+ bool success = false; |
+ switch (credentials->type()) { |
+ case protocol::PASSWORD: |
+#if defined(OS_LINUX) |
+ success = UserAuthPam().Authenticate(credentials->username(), |
+ credentials->credential()); |
+#else |
+ // TODO(lambroslambrou): implement on other platforms |
+ success = true; |
+#endif // defined(OS_LINUX) |
+ break; |
+ default: |
+ break; |
+ } |
+ status->set_success(success); |
host_->connection_to_client()->client_stub()->BeginSessionResponse( |
status, new DeleteTask<protocol::LocalLoginStatus>(status)); |
- host_->LocalLoginSucceeded(); |
+ if (success) { |
+ host_->LocalLoginSucceeded(); |
+ } else { |
+ // ??? |
Sergey Ulanov
2011/02/10 20:14:28
I think it should be enough to log the failure her
|
+ } |
+ done->Run(); |
+ delete done; |
} |
} // namespace remoting |