From ff8cc49b18e39c6138fa6eee3f0f71d52d13092e Mon Sep 17 00:00:00 2001 From: arlakshm <55814491+arlakshm@users.noreply.github.com> Date: Thu, 28 Jan 2021 23:12:01 -0800 Subject: [PATCH] [multi asic] add ip netns identify command to sudoer (#6591) Signed-off-by: Arvindsrinivasan Lakshmi Narasimhan - Why I did it The command sudo ip netns identify 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 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. --- files/image_config/sudoers/sudoers | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/files/image_config/sudoers/sudoers b/files/image_config/sudoers/sudoers index 4c2e684b4b..9a79027041 100644 --- a/files/image_config/sudoers/sudoers +++ b/files/image_config/sudoers/sudoers @@ -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 *