Skip to content

Fix code bug in parse config file.#4

Closed
liuh-80 wants to merge 3 commits intodev/liuh/fix_bug_basefrom
dev/liuh/fix_bug_pr
Closed

Fix code bug in parse config file.#4
liuh-80 wants to merge 3 commits intodev/liuh/fix_bug_basefrom
dev/liuh/fix_bug_pr

Conversation

@liuh-80
Copy link
Copy Markdown
Owner

@liuh-80 liuh-80 commented Nov 5, 2021

This PR is a draft PR to help review patch file change in sonic-net/sonic-buildimage#8715
The code change in this PR include:

  1. Because tacplus_nss.conf format issue, need update support.c to parse it correctly:
    Support debug=on setting.
    Support put server address and secret in same row.
  2. Fix the parse_config_file method not reset server list before parse config file issue.

support.c Outdated
int ctrl = 0;

if (!strcmp (arg, "debug")) { /* all */
if (!strcmp (arg, "debug") || !strcmp (arg, "debug=on")) { /* all */
Copy link
Copy Markdown

@qiluo-msft qiluo-msft Nov 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

|| !strcmp (arg, "debug=on")

Is it really needed? #Closed

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this is necessary for debug.
The reason of this change is because the tacplus_nss.conf config file using debug=on to enable debug. so we need change code here to enabled debug with the 'debug=on' setting.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not aware of the syntax of tacplus_nss.conf. I found a sample https://github.com/stemid/tacacs/blob/master/libnss-tacplus/tacplus_nss.conf. Will you support debug=1 ?

@qiluo-msft
Copy link
Copy Markdown

qiluo-msft commented Nov 9, 2021

Could you explain the motivation in code comment or in PR description?

@liuh-80
Copy link
Copy Markdown
Owner Author

liuh-80 commented Nov 11, 2021

Could you explain the motivation in code comment or in PR description?

Update the PR description in this PR: sonic-net/sonic-buildimage#8715

@liuh-80 liuh-80 closed this Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants