RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1329508 - "authconfig --passalgo=sha512 --update" command modifies nsswitch.conf file
Summary: "authconfig --passalgo=sha512 --update" command modifies nsswitch.conf file
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: authconfig
Version: 7.3
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Tomas Mraz
QA Contact: Dalibor Pospíšil
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-22 06:43 UTC by shridhar
Modified: 2019-12-16 05:42 UTC (History)
2 users (show)

Fixed In Version: authconfig-6.2.8-11.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-04 06:47:39 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:2462 0 normal SHIPPED_LIVE authconfig bug fix update 2016-11-03 14:05:55 UTC

Description shridhar 2016-04-22 06:43:16 UTC
Description of problem:
change of password algorithm with 'authcofig' command modifies the /etc/nsswitch.conf' to remove third party modules defined previously.

Version-Release number of selected component (if applicable):
RHEL-7.2
authconfig-6.2.8-9.el7.x86_64

How reproducible:
always

Steps to Reproduce:
1. On rhel-7.2 with authconfig-6.2.8-9.el7.x86_64 , run:
 # authconfig --update

2. configure /etc/nsswitch.conf as:
 [root@rhel7-ipa-2 ~]# egrep -v '#' /etc/nsswitch.conf|awk NF
passwd:     files sss vas4
shadow:     files sss vas4
group:      files sss vas4
hosts:      files dns
bootparams: nisplus [NOTFOUND=return] files
ethers:     files
netmasks:   files
networks:   files
protocols:  files
rpc:        files
services:   files sss vas4
netgroup:   files sss vas4
publickey:  nisplus
automount:  files sss vas4
aliases:    files nisplus
sudoers: files sss vas4

[root@rhel7-ipa-2 ~]# authconfig --passalgo=sha512  --update 

Actual results:

[root@rhel7-ipa-2 ~]# egrep -v '#' /etc/nsswitch.conf|awk NF
passwd:     files sss
shadow:     files sss
group:      files sss
hosts:      files dns
bootparams: nisplus [NOTFOUND=return] files
ethers:     files
netmasks:   files
networks:   files
protocols:  files
rpc:        files
services:   files sss
netgroup:   files sss
publickey:  nisplus
automount:  files sss
aliases:    files nisplus
sudoers: files sss vas4


Expected results:
[root@rhel7-ipa-2 ~]# egrep -v '#' /etc/nsswitch.conf|awk NF
passwd:     files sss vas4
shadow:     files sss vas4
group:      files sss vas4
hosts:      files dns
bootparams: nisplus [NOTFOUND=return] files
ethers:     files
netmasks:   files
networks:   files
protocols:  files
rpc:        files
services:   files sss vas4
netgroup:   files sss vas4
publickey:  nisplus
automount:  files sss vas4
aliases:    files nisplus
sudoers: files sss vas4


Additional info:
authconfig also overwrites configuration from system-auth and password-auth as well. Should it be treated as different bug or is it expected behavior?

Comment 2 Tomas Mraz 2016-04-22 08:58:35 UTC
System-auth and password-auth must be updated when --passalgo is set, so that is not a bug.

Please attach /etc/nsswitch.conf and /etc/sysconfig/authconfig files before and after the 'authconfig --passalgo=sha512 --update' call.

Comment 3 shridhar 2016-04-25 20:44:05 UTC
Hello, 
I'm attaching the files as well. Following are results of testing.

[root@rhel7-ipa-2 ~]# egrep -v '#' /etc/nsswitch.conf|awk NF
passwd:     files sss vas4
shadow:     files sss vas4
group:      files sss vas4
hosts:      files dns
bootparams: nisplus [NOTFOUND=return] files
ethers:     files
netmasks:   files
networks:   files
protocols:  files
rpc:        files
services:   files sss
netgroup:   files sss
publickey:  nisplus
automount:  files sss
aliases:    files nisplus
sudoers: files sss vas4


[root@rhel7-ipa-2 ~]# cat /etc/sysconfig/authconfig 
IPADOMAINJOINED=no
USEMKHOMEDIR=no
USEPAMACCESS=no
CACHECREDENTIALS=yes
USESSSDAUTH=yes
USESHADOW=yes
USEWINBIND=no
PASSWDALGORITHM=sha256
FORCELEGACY=no
USEFPRINTD=no
USEHESIOD=no
FORCESMARTCARD=no
USEDB=no
USELDAPAUTH=no
IPAV2NONTP=no
WINBINDKRB5=no
USELOCAUTHORIZE=yes
USEECRYPTFS=no
USEIPAV2=no
USEWINBINDAUTH=no
USESMARTCARD=no
USELDAP=no
USENIS=no
USEKERBEROS=no
USESYSNETAUTH=no
USESSSD=yes
USEPWQUALITY=yes
USEPASSWDQC=no



After:
[root@rhel7-ipa-2 ~]# egrep -v '#' /etc/nsswitch.conf|awk NF
passwd:     files sss
shadow:     files sss
group:      files sss
hosts:      files dns
bootparams: nisplus [NOTFOUND=return] files
ethers:     files
netmasks:   files
networks:   files
protocols:  files
rpc:        files
services:   files sss
netgroup:   files sss
publickey:  nisplus
automount:  files sss
aliases:    files nisplus
sudoers: files sss vas4



[root@rhel7-ipa-2 ~]# cat /etc/sysconfig/authconfig 
IPADOMAINJOINED=no
USEMKHOMEDIR=no
USEPAMACCESS=no
CACHECREDENTIALS=yes
USESSSDAUTH=yes
USESHADOW=yes
USEWINBIND=no
USESSSD=yes
USEDB=no
FORCELEGACY=no
USEFPRINTD=no
FORCESMARTCARD=no
USELDAPAUTH=no
USEPASSWDQC=no
IPAV2NONTP=no
WINBINDKRB5=no
USELDAP=no
USEECRYPTFS=no
USEIPAV2=no
USEWINBINDAUTH=no
USESMARTCARD=no
USELOCAUTHORIZE=yes
USENIS=no
USEKERBEROS=no
USESYSNETAUTH=no
PASSWDALGORITHM=sha512
USEPWQUALITY=yes
USEHESIOD=no

Comment 5 Tomas Mraz 2016-04-26 08:04:19 UTC
OK, I can reproduce the problem with these settings - particularly the USESSSD=yes causes the issue. If the authconfig sets up the SSSD in the 'managed' mode - i.e. USEKERBEROS and USELDAP is set to yes and USESSSD is set to no, then this problem does not happen. However if the SSSD is not managed by authconfig and thus USESSSD is set to yes, the file will get overwritten.

I can try to work on patch but I cannot guarantee it will get into RHEL-7.3 as this area of the authconfig code is very brittle and I do not want to cause a regression for other customers.

I am setting tentatively a devel_ack.

Comment 9 Tomas Mraz 2016-06-30 11:47:09 UTC
Just note that the fix for this bug will make authconfig to not touch nsswitch.conf if it thinks it does not need update. For example if I remove sss from some of the nsswitch.conf entries but not from the 'passwd:' entry and I issue authconfig --enablesssd --update, it will not update nsswitch.conf. The reader for the nsswitch.conf in authconfig is simple and cannot recognize all the various configurations or misconfigurations that someone can invent.

In general if there is known-inconsistent state of the authentication and identity configuration and it is needed to make it consistent, it is better to call authconfig --updateall.

Comment 11 errata-xmlrpc 2016-11-04 06:47:39 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-2462.html


Note You need to log in before you can comment on or make changes to this bug.