]>
Commit | Line | Data |
---|---|---|
d2e58812 JR |
1 | --- Linux-PAM-0.99.7.1/modules/pam_exec/pam_exec.8.xml~ 2006-06-09 18:44:06.000000000 +0200 |
2 | +++ Linux-PAM-0.99.7.1/modules/pam_exec/pam_exec.8.xml 2007-02-09 22:35:07.000000000 +0100 | |
3 | @@ -25,6 +25,9 @@ | |
43fce6dd | 4 | quiet |
d2e58812 JR |
5 | </arg> |
6 | <arg choice="opt"> | |
7 | + failok | |
8 | + </arg> | |
9 | + <arg choice="opt"> | |
10 | log=<replaceable>file</replaceable> | |
11 | </arg> | |
12 | <arg choice="plain"> | |
13 | @@ -90,6 +93,18 @@ | |
14 | </listitem> | |
15 | </varlistentry> | |
16 | ||
17 | + <varlistentry> | |
18 | + <term> | |
19 | + <option>failok</option> | |
20 | + </term> | |
21 | + <listitem> | |
22 | + <para> | |
23 | + Return success regardles of the exit code returned | |
24 | + by the command. | |
25 | + </para> | |
26 | + </listitem> | |
27 | + </varlistentry> | |
28 | + | |
29 | </variablelist> | |
30 | ||
31 | </para> | |
32 | --- Linux-PAM-0.99.7.1/modules/pam_exec/pam_exec.c.orig 2007-02-09 22:30:39.000000000 +0100 | |
33 | +++ Linux-PAM-0.99.7.1/modules/pam_exec/pam_exec.c 2007-02-09 22:37:07.000000000 +0100 | |
34 | @@ -64,6 +64,7 @@ | |
d2e58812 JR |
35 | int debug = 0; |
36 | int call_setuid = 0; | |
43fce6dd | 37 | int quiet = 0; |
d2e58812 | 38 | + int fail_ok = 0; |
57fed07b | 39 | int expose_authtok = 0; |
d2e58812 JR |
40 | int optargc; |
41 | const char *logfile = NULL; | |
d2e58812 | 42 | @@ -85,6 +86,8 @@ |
43fce6dd | 43 | quiet = 1; |
57fed07b JR |
44 | else if (strcasecmp (argv[optargc], "expose_authtok") == 0) |
45 | expose_authtok = 1; | |
d2e58812 JR |
46 | + else if (strcasecmp (argv[optargc], "failok") == 0) |
47 | + fail_ok = 1; | |
48 | else | |
49 | break; /* Unknown option, assume program to execute. */ | |
50 | } | |
43fce6dd | 51 | @@ -115,29 +118,32 @@ |
d2e58812 JR |
52 | { |
53 | pam_syslog (pamh, LOG_ERR, "%s failed: exit code %d", | |
54 | argv[optargc], WEXITSTATUS(status)); | |
43fce6dd JR |
55 | - if (!quiet) |
56 | + if (!quiet && !fail_ok) | |
57 | pam_error (pamh, _("%s failed: exit code %d"), | |
58 | argv[optargc], WEXITSTATUS(status)); | |
d2e58812 JR |
59 | } |
60 | else if (WIFSIGNALED(status)) | |
61 | { | |
62 | pam_syslog (pamh, LOG_ERR, "%s failed: caught signal %d%s", | |
63 | argv[optargc], WTERMSIG(status), | |
64 | WCOREDUMP(status) ? " (core dumped)" : ""); | |
43fce6dd JR |
65 | - if (!quiet) |
66 | + if (!quiet && !fail_ok) | |
67 | pam_error (pamh, _("%s failed: caught signal %d%s"), | |
68 | argv[optargc], WTERMSIG(status), | |
69 | WCOREDUMP(status) ? " (core dumped)" : ""); | |
d2e58812 JR |
70 | } |
71 | else | |
72 | { | |
73 | pam_syslog (pamh, LOG_ERR, "%s failed: unknown status 0x%x", | |
74 | argv[optargc], status); | |
43fce6dd JR |
75 | - if (!quiet) |
76 | + if (!quiet && !fail_ok) | |
77 | pam_error (pamh, _("%s failed: unknown status 0x%x"), | |
78 | argv[optargc], status); | |
d2e58812 JR |
79 | } |
80 | - return PAM_SYSTEM_ERR; | |
43fce6dd | 81 | + if (!fail_ok) |
d2e58812 JR |
82 | + return PAM_SYSTEM_ERR; |
83 | + else | |
84 | + return PAM_SUCCESS; | |
85 | } | |
86 | return PAM_SUCCESS; | |
87 | } |