Browse code
remove unneeded handler
Showing 2 changed files
... | ... |
@@ -3,11 +3,6 @@ |
3 | 3 |
#include <stdio.h> |
4 | 4 |
#include "logging.h" |
5 | 5 |
|
6 |
-PAM_EXTERN int pam_sm_acct_mgmt(pam_handle_t *pamh, int flags, int argc, const char **argv) { |
|
7 |
- printf("Acct mgmt\n"); |
|
8 |
- return PAM_SUCCESS; |
|
9 |
-} |
|
10 |
- |
|
11 | 6 |
PAM_EXTERN int pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc, const char **argv) { |
12 | 7 |
printf("Authentication\n"); |
13 | 8 |
|
... | ... |
@@ -8,15 +8,6 @@ void log_success() { |
8 | 8 |
log_success_invoked = 1; |
9 | 9 |
} |
10 | 10 |
|
11 |
-int pam_sm_acct_mgmt_returns_successs() { |
|
12 |
- // given |
|
13 |
- |
|
14 |
- // when |
|
15 |
- int result = pam_sm_acct_mgmt(NULL, 0, 0, NULL); |
|
16 |
- |
|
17 |
- // then |
|
18 |
- return result == PAM_SUCCESS; |
|
19 |
-} |
|
20 | 11 |
|
21 | 12 |
int pam_sm_authenticate_returns_success() { |
22 | 13 |
//given |
... | ... |
@@ -47,11 +38,6 @@ int pam_sm_authenticate_invokes_log_success() { |
47 | 38 |
|
48 | 39 |
|
49 | 40 |
int main(int argc, char* argv[]) { |
50 |
- int test1_result = pam_sm_acct_mgmt_returns_successs(); |
|
51 |
- if (!test1_result) { |
|
52 |
- fprintf(stderr, "acct management failed\n"); |
|
53 |
- } |
|
54 |
- |
|
55 | 41 |
int test2_result = pam_sm_authenticate_returns_success(); |
56 | 42 |
if (!test2_result) { |
57 | 43 |
fprintf(stderr, "acct auth failed\n"); |
... | ... |
@@ -67,7 +53,7 @@ int main(int argc, char* argv[]) { |
67 | 53 |
fprintf(stderr, "authenticate invokes log_success failed\n"); |
68 | 54 |
} |
69 | 55 |
|
70 |
- if (test1_result && test2_result && test3_result && test4_result) { |
|
56 |
+ if (test2_result && test3_result && test4_result) { |
|
71 | 57 |
fprintf(stderr, "success\n"); |
72 | 58 |
return 0; |
73 | 59 |
} else { |