Skip to content

Commit

Permalink
[tacplus nss conf] tacplus should be before compat (#2163)
Browse files Browse the repository at this point in the history
  • Loading branch information
taoyl-ms authored and lguohan committed Oct 18, 2018
1 parent 891e256 commit 2a24a30
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions files/image_config/hostcfgd/hostcfgd
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,10 @@ class AaaCfg(object):
# Add tacplus in nsswitch.conf if TACACS+ enable
if 'tacacs+' in auth['login']:
if os.path.isfile(NSS_CONF):
os.system("sed -i -e '/tacplus/b' -e '/^passwd/s/compat/& tacplus/' /etc/nsswitch.conf")
os.system("sed -i -e '/tacplus/b' -e '/^passwd/s/compat/tacplus &/' /etc/nsswitch.conf")
else:
if os.path.isfile(NSS_CONF):
os.system("sed -i -e '/^passwd/s/ tacplus//' /etc/nsswitch.conf")
os.system("sed -i -e '/^passwd/s/tacplus //' /etc/nsswitch.conf")

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

0 comments on commit 2a24a30

Please sign in to comment.