Skip to content

Commit

Permalink
[tacacs]: fix /etc/nsswitch.conf for buster image
Browse files Browse the repository at this point in the history
in buster image, default /etc/nsswitch.conf becomes

```
passwd:         files
```

when tacacs is enable, this files changes to

```
passwd:         tacplus files
```
  • Loading branch information
lguohan committed Mar 22, 2020
1 parent cfe754f commit be4ef5c
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 @@ -207,10 +207,10 @@ class AaaCfg(object):
# Add tacplus in nsswitch.conf if TACACS+ enable
if 'tacacs+' in auth['login']:
if os.path.isfile(NSS_CONF):
self.modify_single_file(NSS_CONF, [ "'/tacplus/b'", "'/^passwd/s/compat/tacplus &/'"])
self.modify_single_file(NSS_CONF, [ "'/tacplus/b'", "'/^passwd/s/compat/tacplus &/'", "'/^passwd/s/files/tacplus &/'" ])
else:
if os.path.isfile(NSS_CONF):
self.modify_single_file(NSS_CONF, [ "'/^passwd/s/tacplus //'" ])
self.modify_single_file(NSS_CONF, [ "'/^passwd/s/tacplus //g'" ])

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

0 comments on commit be4ef5c

Please sign in to comment.