From 44aab771605505d7d37cc8706a88ac363e18bfd5 Mon Sep 17 00:00:00 2001
From: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Date: Fri, 19 Sep 2008 17:25:16 +0200
Subject: [PATCH] Add @include support.

Besides

<service> include <filename>

one can write

@include <filename>

too. The PAM configuration on Debian/Ubuntu heavily relies on it.
---
 libpam/pam_handlers.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/libpam/pam_handlers.c b/libpam/pam_handlers.c
index 848c4fa..c900125 100644
--- a/libpam/pam_handlers.c
+++ b/libpam/pam_handlers.c
@@ -117,6 +117,11 @@ static int _pam_parse_conf_file(pam_handle_t *pamh, FILE *f
 		module_type = PAM_T_ACCT;
 	    } else if (!strcasecmp("password", tok)) {
 		module_type = PAM_T_PASS;
+	    } else if (!strcasecmp("@include", tok)) {
+	    	pam_include = 1;
+	    	substack = 0;
+	    	module_type = requested_module_type;
+	    	goto parsing_done;
 	    } else {
 		/* Illegal module type */
 		D(("_pam_init_handlers: bad module type: %s", tok));
@@ -186,6 +191,7 @@ static int _pam_parse_conf_file(pam_handle_t *pamh, FILE *f
 		_pam_set_default_control(actions, _PAM_ACTION_BAD);
 	    }
 
+parsing_done:
 	    tok = _pam_StrTok(NULL, " \n\t", &nexttok);
 	    if (pam_include) {
 	    	if (substack) {
-- 
1.5.3.4

