-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[TACACS] Stop authorization after user being rejected by server. #14249
Merged
qiluo-msft
merged 4 commits into
sonic-net:master
from
liuh-80:dev/liuh/stop-when-authfailed
May 30, 2023
Merged
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
src/tacacs/nss/patch/0011-Stop-authorization-after-user-rejected-by-serv.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
From f971f48f4e92f0dfbaf02799f0f7515e31a6ec9e Mon Sep 17 00:00:00 2001 | ||
From: liuh <liuh@microsoft.com> | ||
Date: Wed, 15 Mar 2023 16:36:52 +0800 | ||
Subject: [PATCH] Stop authorization after user rejected by server. | ||
|
||
--- | ||
nss_tacplus.c | 5 +++++ | ||
1 file changed, 5 insertions(+) | ||
|
||
diff --git a/nss_tacplus.c b/nss_tacplus.c | ||
index 048745a..de26306 100644 | ||
--- a/nss_tacplus.c | ||
+++ b/nss_tacplus.c | ||
@@ -866,7 +866,12 @@ lookup_tacacs_user(struct pwbuf *pb) | ||
" invalid (%d)", nssname, | ||
tac_ntop(tac_srv[srvr].addr->ai_addr), pb->name, | ||
arep.status); | ||
+ | ||
+ if (arep.status == TAC_PLUS_AUTHOR_STATUS_FAIL) { | ||
+ done = 1; /* break out of loop after server reject user */ | ||
+ } | ||
} | ||
+ | ||
if(arep.msg) | ||
free(arep.msg); | ||
if(arep.attr) /* free returned attributes */ | ||
-- | ||
2.39.0.windows.2 | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The patch looks good to me. On the file location, I am thinking modifying 0001-Modify-user-map-profile.patch may be better since you are modifying a function which overlapped there. And it is really diffcult to read a patch on another patch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, I create this draft PR for code review: https://github.com/liuh-80/libnss-tacplus/pull/1/files