diff options
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | README | 3 | ||||
-rw-r--r-- | sample.pam | 6 | ||||
-rw-r--r-- | support.c | 6 |
4 files changed, 11 insertions, 5 deletions
@@ -1,4 +1,5 @@ 1.3.8 +* Added port option per server, thanks to Luc Ducazu <lducazu@gmail.com> * Fixed missing FIONREAD for solaris * Rearranged header file include for libtac.h, fixes AIX compile problems * Renamed rem_addr, rem_addr_len to r_addr and r_addr_len @@ -32,7 +32,8 @@ secret=STRING ALL can be specified more than once; server=HOSTNAME auth, session can be specified more than once; server=IP_ADDR adds a TACACS+ server to the servers - list +server=HOSTNAME:PORT list +server=IP_ADDR:PORT timeout=INT ALL connection timeout in seconds default is 5 seconds @@ -1,7 +1,7 @@ #%PAM-1.0 -auth required /lib/security/pam_tacplus.so debug server=1.1.1.1 server=2.2.2.2 secret=SAME-SECRET +auth required /lib/security/pam_tacplus.so debug server=1.1.1.1 server=2.2.2.2:49 secret=SAME-SECRET account required /lib/security/pam_tacplus.so debug secret=SAME-SECRET service=ppp protocol=lcp account sufficient /lib/security/pam_exec.so /usr/local/bin/showenv.sh -password required /lib/security/pam_cracklib.so +password required /lib/security/pam_cracklib. password required /lib/security/pam_pwdb.so shadow use_authtok -session required /lib/security/pam_tacplus.so debug server=1.1.1.1 secret=SECRET-1 server=2.2.2.2 secret=SECRET-2 service=ppp protocol=lcp +session required /lib/security/pam_tacplus.so debug server=1.1.1.1 secret=SECRET-1 server=2.2.2.2:49 secret=SECRET-2 service=ppp protocol=lcp @@ -228,11 +228,15 @@ int _pam_parse (int argc, const char **argv) { if(tac_srv_no < TAC_PLUS_MAXSERVERS) { struct addrinfo hints, *servers, *server; int rv; + char *port; memset(&hints, 0, sizeof hints); hints.ai_family = AF_UNSPEC; // use IPv4 or IPv6, whichever hints.ai_socktype = SOCK_STREAM; - if ((rv = getaddrinfo(*argv + 7, "49", &hints, &servers)) == 0) { + port = strchr(*argv + 7, ':'); + if(port) + *port = '\0'; + if ((rv = getaddrinfo(*argv + 7, (port == NULL ? "49" : port+1), &hints, &servers)) == 0) { for(server = servers; server != NULL; server = server->ai_next) { tac_srv[tac_srv_no] = server; tac_srv_no++; |