-
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
[multi asic] add ip netns identify command to sudoer #6591
Conversation
Signed-off-by: Arvindsrinivasan Lakshmi Narasimhan <[email protected]>
is pid a number? can we only match number? |
Instead of fixing sudoers file, is it possible to implement above function by linux ip API, and run as normal user? |
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.
Agree with @lguohan and also add alternative option.
Signed-off-by: Arvindsrinivasan Lakshmi Narasimhan <[email protected]>
@qiluo-msft, I couldn't find a python library which provides an API to get this function. I think use the |
@lguohan, addressed in the latest commit. |
Signed-off-by: Arvindsrinivasan Lakshmi Narasimhan <[email protected]> - Why I did it The command sudo ip netns identify <pid> is used in function get_current_namespace to check in the cli command is running in host context or within a namespace. This function is used for every CLI command and command sudo ip netns identify <pid> needs to be added in sudoer files to allow users with RO access to run show cli commands This problem is not there on single asic platforms. - How I did it Add ip netns identify [0-9]* to sudoers file.
Signed-off-by: Arvindsrinivasan Lakshmi Narasimhan <[email protected]> - Why I did it The command sudo ip netns identify <pid> is used in function get_current_namespace to check in the cli command is running in host context or within a namespace. This function is used for every CLI command and command sudo ip netns identify <pid> needs to be added in sudoer files to allow users with RO access to run show cli commands This problem is not there on single asic platforms. - How I did it Add ip netns identify [0-9]* to sudoers file.
Signed-off-by: Arvindsrinivasan Lakshmi Narasimhan <[email protected]> - Why I did it The command sudo ip netns identify <pid> is used in function get_current_namespace to check in the cli command is running in host context or within a namespace. This function is used for every CLI command and command sudo ip netns identify <pid> needs to be added in sudoer files to allow users with RO access to run show cli commands This problem is not there on single asic platforms. - How I did it Add ip netns identify [0-9]* to sudoers file.
Signed-off-by: Arvindsrinivasan Lakshmi Narasimhan [email protected]
- Why I did it
The command
sudo ip netns identify <pid>
is used in function get_current_namespaceto check in the cli command is running in host context or within a namespace.
This function is used for every CLI command and command
sudo ip netns identify <pid>
needs to be added in sudoer files to allow users withRO
access to run show cli commandsThis problem is not there on single asic platforms.
- How I did it
Add
ip netns identify *
to sudoers file.- How to verify it
Verify on multi asic platforms
- Which release branch to backport (provide reason below if selected)
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)