Skip to content

Commit dbb063a

Browse files
liuh-80pull[bot]
authored andcommitted
[TACACS] Improve nss-tacplus TACACS connect timeout (#17460)
Improve nss-tacplus TACACS connect timeout #### Why I did it TACACS login usually config multiple server, when a high priority server not reachable or high lantency, remote user login will slowly, also run SUDO command will slowly. To improve this issue, enable read timeout in nss-tacplus. ### How I did it Enable read timeout in nss-tacplus. #### How to verify it Pass all UT. ### Description for the changelog Improve nss-tacplus TACACS connect timeout.
1 parent 8f648e6 commit dbb063a

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/tacacs/nss/patch/0001-Modify-user-map-profile.patch

+10-4
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ index 79e62b9..ecfa0b0 100644
180180

181181
/*
182182
* pwbuf is used to reduce number of arguments passed around; the strings in
183-
@@ -63,255 +59,239 @@ struct pwbuf {
183+
@@ -63,255 +59,245 @@ struct pwbuf {
184184
typedef struct {
185185
struct addrinfo *addr;
186186
char *key;
@@ -445,9 +445,15 @@ index 79e62b9..ecfa0b0 100644
445445
+ tac_srv[tac_srv_no].key = strdup(token + 7);
446446
+ }
447447
+ else if(!strncmp(token, "timeout=", 8)) {
448-
+ tac_srv[tac_srv_no].timeout = (int)strtoul(token + 8, NULL, 0);
449-
+ if(tac_srv[tac_srv_no].timeout < 0)
450-
+ tac_srv[tac_srv_no].timeout = 0;
448+
+ int timeout = (int)strtoul(token + 8, NULL, 0);
449+
+ if(timeout < 0) {
450+
+ tac_srv[tac_srv_no].timeout = 0;
451+
+ tac_readtimeout_enable = 0;
452+
+ }
453+
+ else {
454+
+ tac_srv[tac_srv_no].timeout = timeout;
455+
+ tac_readtimeout_enable = 1;
456+
+ }
451457
+ /* Limit timeout to make sure upper application not wait
452458
+ * for a long time*/
453459
+ if(tac_srv[tac_srv_no].timeout > 5)

0 commit comments

Comments
 (0)