summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--README3
-rw-r--r--sample.pam6
-rw-r--r--support.c6
4 files changed, 11 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 37552e9..6389bb9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/README b/README
index 91bab17..392994e 100644
--- a/README
+++ b/README
@@ -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
diff --git a/sample.pam b/sample.pam
index 24ee86f..d02915a 100644
--- a/sample.pam
+++ b/sample.pam
@@ -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
diff --git a/support.c b/support.c
index c26e4e4..e28dc71 100644
--- a/support.c
+++ b/support.c
@@ -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++;