Skip to content

Commit

Permalink
[multi asic] add ip netns identify command to sudoer (#6591)
Browse files Browse the repository at this point in the history
Signed-off-by: Arvindsrinivasan Lakshmi Narasimhan <arlakshm@microsoft.com>

- 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.
  • Loading branch information
arlakshm authored and lguohan committed Feb 3, 2021
1 parent 8f8520e commit 197f75a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion files/image_config/sudoers/sudoers
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ Cmnd_Alias READ_ONLY_CMDS = /bin/cat /var/log/syslog*, \
/usr/local/bin/lldpshow, \
/usr/local/bin/psuutil *, \
/usr/local/bin/sonic-installer list, \
/usr/local/bin/sfputil show *
/usr/local/bin/sfputil show *, \
/bin/ip netns identify [0-9]*


Cmnd_Alias PASSWD_CMDS = /usr/local/bin/config tacacs passkey *, \
/usr/sbin/chpasswd *
Expand Down

0 comments on commit 197f75a

Please sign in to comment.