Skip to content

Commit 3c6f23e

Browse files
authored
[tacacs]: fix /etc/nsswitch.conf for buster image (sonic-net#4303)
in buster image, default /etc/nsswitch.conf becomes ``` passwd: files ``` when tacacs is enable, this files changes to ``` passwd: tacplus files ```
1 parent 1038182 commit 3c6f23e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

files/image_config/hostcfgd/hostcfgd

+2-2
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,10 @@ class AaaCfg(object):
207207
# Add tacplus in nsswitch.conf if TACACS+ enable
208208
if 'tacacs+' in auth['login']:
209209
if os.path.isfile(NSS_CONF):
210-
self.modify_single_file(NSS_CONF, [ "'/tacplus/b'", "'/^passwd/s/compat/tacplus &/'"])
210+
self.modify_single_file(NSS_CONF, [ "'/tacplus/b'", "'/^passwd/s/compat/tacplus &/'", "'/^passwd/s/files/tacplus &/'" ])
211211
else:
212212
if os.path.isfile(NSS_CONF):
213-
self.modify_single_file(NSS_CONF, [ "'/^passwd/s/tacplus //'" ])
213+
self.modify_single_file(NSS_CONF, [ "'/^passwd/s/tacplus //g'" ])
214214

215215
# Set tacacs+ server in nss-tacplus conf
216216
template_file = os.path.abspath(NSS_TACPLUS_CONF_TEMPLATE)

0 commit comments

Comments
 (0)