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

Side by Side Diff: remoting/host/user_authenticator_pam.h

Issue 6484002: Authenticate user/password with PAM in BeginSessionRequest() (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Add free() back in, and remove unused scoped_ptr #include. Created 9 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef REMOTING_HOST_USER_AUTHENTICATOR_PAM_H_
6 #define REMOTING_HOST_USER_AUTHENTICATOR_PAM_H_
7
8 #include <string>
9
10 #include "base/basictypes.h"
11 #include "remoting/host/user_authenticator.h"
12
13 struct pam_message;
14 struct pam_response;
15
16 namespace remoting {
17
18 // Class to perform a single PAM user authentication.
19 //
20 // TODO(lambroslambrou): As pam_authenticate() can be blocking, this needs to
21 // expose an asynchronous API, with pam_authenticate() called in a background
22 // thread.
23 class UserAuthenticatorPam : public UserAuthenticator {
24 public:
25 UserAuthenticatorPam();
26 virtual ~UserAuthenticatorPam();
27 virtual bool Authenticate(const std::string& username,
28 const std::string& password);
29
30 private:
31 // Conversation function passed to PAM as a callback.
32 static int ConvFunction(int num_msg,
33 const pam_message** msg,
34 pam_response** resp,
35 void* appdata_ptr);
36
37 // Store these for the PAM conversation function.
38 std::string username_;
39 std::string password_;
40
41 DISALLOW_COPY_AND_ASSIGN(UserAuthenticatorPam);
42 };
43
44 } // namespace remoting
45
46 #endif // REMOTING_HOST_USER_AUTHENTICATOR_PAM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698