diff options
| -rw-r--r-- | nss_tacplus.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/nss_tacplus.c b/nss_tacplus.c index 4c62a82..5b0766a 100644 --- a/nss_tacplus.c +++ b/nss_tacplus.c @@ -113,6 +113,7 @@ static int nss_tacplus_config(int *errnop, const char *cfile, int top) !strncmp(lbuf, "login=", 6)) ; else if(!strncmp(lbuf, "secret=", 7)) { + int i; /* no need to complain if too many on this one */ if(tac_key_no < TAC_PLUS_MAXSERVERS) { if((tac_srv[tac_key_no].key = strdup(lbuf+7))) @@ -121,6 +122,13 @@ static int nss_tacplus_config(int *errnop, const char *cfile, int top) syslog(LOG_ERR, "%s: unable to copy server secret %s", nssname, lbuf+7); } + /* handle case where 'secret=' was given after a 'server=' + * parameter, fill in the current secret */ + for(i = tac_srv_no-1; i >= 0; i--) { + if (tac_srv[i].key) + continue; + tac_srv[i].key = strdup(lbuf+7); + } } else if(!strncmp(lbuf, "exclude_users=", 14)) { /* |
