Debian Codegraph @

debian/patches/031_pam_include

raw
1 From: Sam Hartman <[email protected]>
2 Date: Mon, 11 Sep 2023 14:00:42 -0600
3 Subject: _pam_include
4
5 Patch to implement an @include directive for use in pam.d config files.
6
7 Authors: Jan Christoph Nordholz <[email protected]>
8
9 Updated for pam 1.7.0 by Sam Hartman <[email protected]>
10
11 Upstream status: not yet submitted
12 ---
13 libpam/pam_handlers.c | 5 +++++
14 1 file changed, 5 insertions(+)
15
16 diff --git a/libpam/pam_handlers.c b/libpam/pam_handlers.c
17 index 1f1917b..61aaea8 100644
18 --- a/libpam/pam_handlers.c
19 +++ b/libpam/pam_handlers.c
20 @@ -127,6 +127,10 @@ static int _pam_parse_conf_file(pam_handle_t *pamh, FILE *f
21 module_type = PAM_T_ACCT;
22 } else if (!strcasecmp("password", tok)) {
23 module_type = PAM_T_PASS;
24 + } else if (!strcasecmp("@include", tok)) {
25 + pam_include = 1;
26 + module_type = requested_module_type;
27 + goto parsing_done;
28 } else {
29 /* Illegal module type */
30 D(("bad module type: %s", tok));
31 @@ -197,6 +201,7 @@ static int _pam_parse_conf_file(pam_handle_t *pamh, FILE *f
32 _pam_set_default_control(actions, _PAM_ACTION_BAD);
33 }
34
35 +parsing_done:
36 tok = _pam_tokenize(NULL, &nexttok);
37 if (pam_include) {
38 if (substack) {