| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "remoting/host/pam_authorization_factory_posix.h" | 5 #include "remoting/host/pam_authorization_factory_posix.h" |
| 6 | 6 |
| 7 #include <security/pam_appl.h> | 7 #include <security/pam_appl.h> |
| 8 | 8 |
| 9 #include "base/environment.h" | 9 #include "base/environment.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "remoting/protocol/channel_authenticator.h" | 11 #include "remoting/protocol/channel_authenticator.h" |
| 12 #include "third_party/libjingle/source/talk/xmllite/xmlelement.h" | 12 #include "third_party/libjingle/source/talk/xmllite/xmlelement.h" |
| 13 | 13 |
| 14 namespace remoting { | 14 namespace remoting { |
| 15 | 15 |
| 16 namespace { | 16 namespace { |
| 17 class PamAuthorizer : public protocol::Authenticator { | 17 class PamAuthorizer : public protocol::Authenticator { |
| 18 public: | 18 public: |
| 19 PamAuthorizer(scoped_ptr<protocol::Authenticator> underlying); | 19 explicit PamAuthorizer(scoped_ptr<protocol::Authenticator> underlying); |
| 20 virtual ~PamAuthorizer(); | 20 virtual ~PamAuthorizer(); |
| 21 | 21 |
| 22 // protocol::Authenticator interface. | 22 // protocol::Authenticator interface. |
| 23 virtual State state() const OVERRIDE; | 23 virtual State state() const OVERRIDE; |
| 24 virtual RejectionReason rejection_reason() const OVERRIDE; | 24 virtual RejectionReason rejection_reason() const OVERRIDE; |
| 25 virtual void ProcessMessage(const buzz::XmlElement* message) OVERRIDE; | 25 virtual void ProcessMessage(const buzz::XmlElement* message) OVERRIDE; |
| 26 virtual scoped_ptr<buzz::XmlElement> GetNextMessage() OVERRIDE; | 26 virtual scoped_ptr<buzz::XmlElement> GetNextMessage() OVERRIDE; |
| 27 virtual scoped_ptr<protocol::ChannelAuthenticator> | 27 virtual scoped_ptr<protocol::ChannelAuthenticator> |
| 28 CreateChannelAuthenticator() const OVERRIDE; | 28 CreateChannelAuthenticator() const OVERRIDE; |
| 29 | 29 |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 const std::string& remote_jid, | 153 const std::string& remote_jid, |
| 154 const buzz::XmlElement* first_message) { | 154 const buzz::XmlElement* first_message) { |
| 155 scoped_ptr<protocol::Authenticator> authenticator( | 155 scoped_ptr<protocol::Authenticator> authenticator( |
| 156 underlying_->CreateAuthenticator(local_jid, remote_jid, first_message)); | 156 underlying_->CreateAuthenticator(local_jid, remote_jid, first_message)); |
| 157 return scoped_ptr<protocol::Authenticator>( | 157 return scoped_ptr<protocol::Authenticator>( |
| 158 new PamAuthorizer(authenticator.Pass())); | 158 new PamAuthorizer(authenticator.Pass())); |
| 159 } | 159 } |
| 160 | 160 |
| 161 | 161 |
| 162 } // namespace remoting | 162 } // namespace remoting |
| OLD | NEW |