Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add IPv6 Support in TACACS #3395

Merged
merged 3 commits into from
Sep 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
From aa8af2b2400b7bbcbe7af0cb50047a98e93660ca Mon Sep 17 00:00:00 2001
From: SuvarnaMeenakshi <sumeenak@microsoft.com>
Date: Thu, 29 Aug 2019 09:44:24 -0700
Subject: [PATCH] libnss: Modify parsing of IP addr and port number string to
support IPv6

---
nss_tacplus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nss_tacplus.c b/nss_tacplus.c
index f2a86e1..3ff3c35 100644
--- a/nss_tacplus.c
+++ b/nss_tacplus.c
@@ -98,7 +98,7 @@ static int parse_tac_server(char *srv_buf)
hints.ai_socktype = SOCK_STREAM;

srv = token + 7;
- port = strchr(srv, ':');
+ port = strrchr(srv, ':');
if(port) {
*port = '\0';
port++;
--
2.17.1

1 change: 1 addition & 0 deletions src/tacacs/nss/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
git $(GIT_APPLY) ../0002-Enable-modifying-local-user-permission.patch
git $(GIT_APPLY) ../0003-management-vrf-support.patch
git $(GIT_APPLY) ../0004-Skip-accessing-tacacs-servers-for-local-non-tacacs-u.patch
git $(GIT_APPLY) ../0005-libnss-Modify-parsing-of-IP-addr-and-port-number-str.patch

dpkg-buildpackage -rfakeroot -b -us -uc
popd
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
From 264de96e8a1c411371f9fc20b0b5b00c10e7052d Mon Sep 17 00:00:00 2001
From: SuvarnaMeenakshi <sumeenak@microsoft.com>
Date: Thu, 29 Aug 2019 09:51:43 -0700
Subject: [PATCH] pam: Modify parsing of IP address and port number to support
IPv6

---
support.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/support.c b/support.c
index 44efee3..7c00618 100644
--- a/support.c
+++ b/support.c
@@ -225,11 +226,11 @@ int _pam_parse (int argc, const char **argv) {

if (*server_buf == '[' && (close_bracket = strchr(server_buf, ']')) != NULL) { /* Check for URI syntax */
server_name = server_buf + 1;
- port = strchr(close_bracket, ':');
+ port = strrchr(close_bracket, ':');
*close_bracket = '\0';
} else { /* Fall back to traditional syntax */
server_name = server_buf;
- port = strchr(server_buf, ':');
+ port = strrchr(server_buf, ':');
}
if (port != NULL) {
*port = '\0';
--
2.17.1

1 change: 1 addition & 0 deletions src/tacacs/pam/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
git apply ../0002-Fix-libtac2-bin-install-directory-error.patch
git apply ../0003-Obfuscate-key-before-printing-to-syslog.patch
git apply ../0004-management-vrf-support.patch
git apply ../0005-pam-Modify-parsing-of-IP-address-and-port-number-to-.patch

dpkg-buildpackage -rfakeroot -b -us -uc
popd
Expand Down