Lines 1-4
Link Here
|
1 |
--- pam_module/pam_oslogin_login.cc.orig 2018-10-11 16:53:23 UTC |
1 |
--- pam_module/pam_oslogin_login.cc.orig 2019-02-20 12:34:55 UTC |
2 |
+++ pam_module/pam_oslogin_login.cc |
2 |
+++ pam_module/pam_oslogin_login.cc |
3 |
@@ -14,7 +14,6 @@ |
3 |
@@ -14,7 +14,6 @@ |
4 |
|
4 |
|
Lines 8-14
Link Here
|
8 |
#include <security/pam_modules.h> |
8 |
#include <security/pam_modules.h> |
9 |
#include <sys/stat.h> |
9 |
#include <sys/stat.h> |
10 |
#include <sys/types.h> |
10 |
#include <sys/types.h> |
11 |
@@ -46,7 +45,7 @@ PAM_EXTERN int pam_sm_acct_mgmt(pam_handle_t *pamh, in |
11 |
@@ -53,7 +52,7 @@ PAM_EXTERN int pam_sm_acct_mgmt(pam_handle_t *pamh, in |
12 |
int pam_result = PAM_PERM_DENIED; |
12 |
int pam_result = PAM_PERM_DENIED; |
13 |
const char *user_name; |
13 |
const char *user_name; |
14 |
if ((pam_result = pam_get_user(pamh, &user_name, NULL)) != PAM_SUCCESS) { |
14 |
if ((pam_result = pam_get_user(pamh, &user_name, NULL)) != PAM_SUCCESS) { |
Lines 17-23
Link Here
|
17 |
return pam_result; |
17 |
return pam_result; |
18 |
} |
18 |
} |
19 |
string str_user_name(user_name); |
19 |
string str_user_name(user_name); |
20 |
@@ -93,7 +92,7 @@ PAM_EXTERN int pam_sm_acct_mgmt(pam_handle_t *pamh, in |
20 |
@@ -100,7 +99,7 @@ PAM_EXTERN int pam_sm_acct_mgmt(pam_handle_t *pamh, in |
21 |
chown(users_filename.c_str(), 0, 0); |
21 |
chown(users_filename.c_str(), 0, 0); |
22 |
chmod(users_filename.c_str(), S_IRUSR | S_IWUSR | S_IRGRP); |
22 |
chmod(users_filename.c_str(), S_IRUSR | S_IWUSR | S_IRGRP); |
23 |
} |
23 |
} |
Lines 26-37
Link Here
|
26 |
"Granting login permission for organization user %s.", |
26 |
"Granting login permission for organization user %s.", |
27 |
user_name); |
27 |
user_name); |
28 |
pam_result = PAM_SUCCESS; |
28 |
pam_result = PAM_SUCCESS; |
29 |
@@ -101,7 +100,7 @@ PAM_EXTERN int pam_sm_acct_mgmt(pam_handle_t *pamh, in |
29 |
@@ -108,7 +107,7 @@ PAM_EXTERN int pam_sm_acct_mgmt(pam_handle_t *pamh, in |
30 |
if (file_exists) { |
30 |
if (file_exists) { |
31 |
remove(users_filename.c_str()); |
31 |
remove(users_filename.c_str()); |
32 |
} |
32 |
} |
33 |
- pam_syslog(pamh, LOG_INFO, |
33 |
- pam_syslog(pamh, LOG_INFO, |
34 |
+ syslog(LOG_INFO, |
34 |
+ syslog(LOG_INFO, |
35 |
"Denying login permission for organization user %s.", user_name); |
35 |
"Denying login permission for organization user %s.", |
|
|
36 |
user_name); |
36 |
|
37 |
|
37 |
pam_result = PAM_PERM_DENIED; |
38 |
@@ -128,7 +127,7 @@ PAM_EXTERN int pam_sm_authenticate(pam_handle_t * pamh |
|
|
39 |
{ |
40 |
const char* user_name; |
41 |
if (pam_get_user(pamh, &user_name, NULL) != PAM_SUCCESS) { |
42 |
- pam_syslog(pamh, LOG_INFO, "Could not get pam user."); |
43 |
+ syslog(LOG_INFO, "Could not get pam user."); |
44 |
return PAM_PERM_DENIED; |
45 |
} |
46 |
|
47 |
@@ -155,7 +154,7 @@ PAM_EXTERN int pam_sm_authenticate(pam_handle_t * pamh |
48 |
|
49 |
response = ""; |
50 |
if (!StartSession(email, &response)) { |
51 |
- pam_syslog(pamh, LOG_ERR, |
52 |
+ syslog(LOG_ERR, |
53 |
"Bad response from the two-factor start session request: %s", |
54 |
response.empty() ? "empty response" : response.c_str()); |
55 |
return PAM_PERM_DENIED; |
56 |
@@ -163,7 +162,7 @@ PAM_EXTERN int pam_sm_authenticate(pam_handle_t * pamh |
57 |
|
58 |
string status; |
59 |
if (!ParseJsonToKey(response, "status", &status)) { |
60 |
- pam_syslog(pamh, LOG_ERR, |
61 |
+ syslog(LOG_ERR, |
62 |
"Failed to parse status from start session response"); |
63 |
return PAM_PERM_DENIED; |
64 |
} |
65 |
@@ -179,7 +178,7 @@ PAM_EXTERN int pam_sm_authenticate(pam_handle_t * pamh |
66 |
|
67 |
std::vector<oslogin_utils::Challenge> challenges; |
68 |
if (!ParseJsonToChallenges(response, &challenges)) { |
69 |
- pam_syslog(pamh, LOG_ERR, |
70 |
+ syslog(LOG_ERR, |
71 |
"Failed to parse challenge values from JSON response"); |
72 |
return PAM_PERM_DENIED; |
73 |
} |
74 |
@@ -242,13 +241,13 @@ PAM_EXTERN int pam_sm_authenticate(pam_handle_t * pamh |
75 |
pam_error(pamh, "Unable to get user input"); |
76 |
} |
77 |
} else { |
78 |
- pam_syslog(pamh, LOG_ERR, "Unsupported challenge type %s", |
79 |
+ syslog(LOG_ERR, "Unsupported challenge type %s", |
80 |
challenge.type.c_str()); |
81 |
return PAM_PERM_DENIED; |
82 |
} |
83 |
|
84 |
if (!ContinueSession(email, user_token, session_id, challenge, &response)) { |
85 |
- pam_syslog(pamh, LOG_ERR, |
86 |
+ syslog(LOG_ERR, |
87 |
"Bad response from two-factor continue session request: %s", |
88 |
response.empty() ? "empty response" : response.c_str()); |
89 |
return PAM_PERM_DENIED; |