]> git.pld-linux.org Git - packages/pam.git/blob - pam-exec-failok.patch
really builds on builders
[packages/pam.git] / pam-exec-failok.patch
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 @@
4          quiet
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 @@
35    int debug = 0;
36    int call_setuid = 0;
37    int quiet = 0;
38 +  int fail_ok = 0;
39    int expose_authtok = 0;
40    int optargc;
41    const char *logfile = NULL;
42 @@ -85,6 +86,8 @@
43         quiet = 1;
44        else if (strcasecmp (argv[optargc], "expose_authtok") == 0)
45         expose_authtok = 1;
46 +      else if (strcasecmp (argv[optargc], "failok") == 0)
47 +       fail_ok = 1;
48        else
49         break; /* Unknown option, assume program to execute. */
50      }
51 @@ -115,29 +118,32 @@
52             {
53               pam_syslog (pamh, LOG_ERR, "%s failed: exit code %d",
54                           argv[optargc], WEXITSTATUS(status));
55 -               if (!quiet)
56 +               if (!quiet && !fail_ok)
57               pam_error (pamh, _("%s failed: exit code %d"),
58                          argv[optargc], WEXITSTATUS(status));
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)" : "");
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)" : "");
70             }
71           else
72             {
73               pam_syslog (pamh, LOG_ERR, "%s failed: unknown status 0x%x",
74                           argv[optargc], status);
75 -               if (!quiet)
76 +               if (!quiet && !fail_ok)
77               pam_error (pamh, _("%s failed: unknown status 0x%x"),
78                          argv[optargc], status);
79             }
80 -         return PAM_SYSTEM_ERR;
81 +         if (!fail_ok)
82 +           return PAM_SYSTEM_ERR;
83 +         else
84 +           return PAM_SUCCESS;
85         }
86        return PAM_SUCCESS;
87      }
This page took 0.084801 seconds and 3 git commands to generate.