From ed775fc39f8603bd12fbad76d799ac29cda3a046 Mon Sep 17 00:00:00 2001 From: Dave Olson Date: Thu, 15 Sep 2016 17:57:14 -0700 Subject: When recursing into an included config, don't reset secret key index Ticket: CM-12880 Reviewed By: olson Testing Done: built, ran through test case. When recursing do to an included config file, the tac_key_no index into the server array was always starting at zero, so if there were server/key pairs in both the main config file and the included file, the secret from the 0th entry was being used for each, and we weren't adding the servers from the origianl config file. Make tac_key_no global like tac_srv_no --- nss_tacplus.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nss_tacplus.c b/nss_tacplus.c index 4b3bf75..3fbb4f1 100644 --- a/nss_tacplus.c +++ b/nss_tacplus.c @@ -63,7 +63,7 @@ typedef struct { /* set from configuration file parsing */ static tacplus_server_t tac_srv[TAC_PLUS_MAXSERVERS]; -static int tac_srv_no; +static int tac_srv_no, tac_key_no; static char tac_service[] = "shell"; static char tac_protocol[] = "ssh"; static int debug; @@ -72,7 +72,6 @@ static int conf_parsed = 0; static int nss_tacplus_config(int *errnop, const char *cfile, int top) { FILE *conf; - int tac_key_no = 0; char lbuf[256]; if(conf_parsed > 1) /* 1: we've tried and thrown errors, 2, OK */ -- cgit v1.2.3