diff options
author | Dave Olson <olson@cumulusnetworks.com> | 2016-09-15 17:57:14 -0700 |
---|---|---|
committer | Dave Olson <olson@cumulusnetworks.com> | 2016-10-06 14:20:11 -0700 |
commit | ed775fc39f8603bd12fbad76d799ac29cda3a046 (patch) | |
tree | c6b259713eb315987407e101b3618b6aa7845525 | |
parent | 3279fbbb9e0f3744623fbb6a2d658d6ff5ab3f0d (diff) | |
download | libnss-tacplus-ed775fc39f8603bd12fbad76d799ac29cda3a046.tar.gz libnss-tacplus-ed775fc39f8603bd12fbad76d799ac29cda3a046.zip |
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
-rw-r--r-- | nss_tacplus.c | 3 |
1 files changed, 1 insertions, 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 */ |