Bug 1401046 - No users visible, if passwd, group entrees in /etc/nsswitch.conf changed from files to compat
Summary: No users visible, if passwd, group entrees in /etc/nsswitch.conf changed from...
Keywords:
Status: CLOSED DUPLICATE of bug 1400538
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc
Version: 25
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Florian Weimer
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-12-02 15:52 UTC by Mota Kardeh
Modified: 2017-03-07 16:03 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-03-07 16:02:41 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
/etc/nsswitch.conf of fedora25 (1.70 KB, text/plain)
2017-02-23 10:15 UTC, Mota Kardeh
no flags Details

Description Mota Kardeh 2016-12-02 15:52:41 UTC
Description of problem:

Hello Colleagues,

We have an issue on Fedora25 regarding to change the following parameter in /etc/nsswitch.conf as following:

Before change the passwd and group parts in /etc/nsswitch.conf, if I run the command "getent passwd root", I got the output and the troot user is visible:
[root@localhost ~]# getent passwd root
root:x:0:0:root:/root:/bin/bash

After change the following lines in /etc/nsswitch.conf from files to compat :
passwd:     compat sss
shadow:     files sss
group:      compat sss

I got no output of the command and the use is not visible anymore:
[root@localhost ~]# getent passwd root
-> ""

Version-Release number of selected component (if applicable):
glibc-2.24-3.fc25.x86_64


How reproducible:
always

Steps to Reproduce:
1.run the command "getent passwd root"
2.change the passwd: files sss and group: files sss in /etc/nsswitch.conf-> To passwd:  compat sss and group compat sss
3.run again the command "getent passwd root"

Actual results:
After change the parameter in /etc/nsswitch to " passwd compat sss, group compat sss":
[root@localhost ~]# getent passwd root
-> ""

Expected results:
The User should be visible
[root@localhost ~]# getent passwd root
root:x:0:0:root:/root:/bin/bash

Additional info:

I got no issue according run the same steps on Fedora24.

----------------------------------------------------------------------

It would be great to help, could you please take a look?

Thanks and best regards,
Mota

Comment 1 Carlos O'Donell 2017-02-20 16:14:54 UTC
(In reply to Mota Kardeh from comment #0)
> After change the following lines in /etc/nsswitch.conf from files to compat :
> passwd:     compat sss
> shadow:     files sss
> group:      compat sss

Please provide your full /etc/nsswitch.conf.

> It would be great to help, could you please take a look?

Where did you get the instructions regarding how to change /etc/nsswitch.conf?

Comment 2 Mota Kardeh 2017-02-23 10:15:56 UTC
Created attachment 1256858 [details]
/etc/nsswitch.conf of fedora25

Comment 3 Mota Kardeh 2017-02-23 10:30:06 UTC
(In reply to Carlos O'Donell from comment #1)
> (In reply to Mota Kardeh from comment #0)
> > After change the following lines in /etc/nsswitch.conf from files to compat :
> > passwd:     compat sss
> > shadow:     files sss
> > group:      compat sss
> 
> Please provide your full /etc/nsswitch.conf.

The only difference in /etc/nsswitch.conf are the lines as I mentioned above:

---------------------------------------------
passwd:     compat sss
shadow:     files sss
group:      compat sss
---------------------------------------------

I attached the /etc/nsswitch.conf of fedora25 to the bug.

> 
> > It would be great to help, could you please take a look?
> 
> Where did you get the instructions regarding how to change
> /etc/nsswitch.conf?

Our SAP colleague has changed the mentioned lines in the /etc/nsswitch.conf for some testing in NIS env.

We had a similar issues before, please check the Bug 193226 and Bug 192072.
https://bugzilla.redhat.com/show_bug.cgi?id=193226
https://bugzilla.redhat.com/show_bug.cgi?id=192072

Thanks and best regards,
Mota

Comment 4 Carlos O'Donell 2017-02-24 16:48:49 UTC
(In reply to Mota Kardeh from comment #3)
> (In reply to Carlos O'Donell from comment #1)
> > (In reply to Mota Kardeh from comment #0)
> > > After change the following lines in /etc/nsswitch.conf from files to compat :
> > > passwd:     compat sss
> > > shadow:     files sss
> > > group:      compat sss
> > 
> > Please provide your full /etc/nsswitch.conf.
> 
> The only difference in /etc/nsswitch.conf are the lines as I mentioned above:
> 
> ---------------------------------------------
> passwd:     compat sss
> shadow:     files sss
> group:      compat sss
> ---------------------------------------------
> 
> I attached the /etc/nsswitch.conf of fedora25 to the bug.

OK.

> Our SAP colleague has changed the mentioned lines in the /etc/nsswitch.conf
> for some testing in NIS env.

Have you gone through basic validation that the NIS environment works? Is it actually a NIS+ environment?

The 'compat' NSS service will fetch data from NIS by default, which is how you have it configured.

> We had a similar issues before, please check the Bug 193226 and Bug 192072.
> https://bugzilla.redhat.com/show_bug.cgi?id=193226
> https://bugzilla.redhat.com/show_bug.cgi?id=192072

Do you see your problems at boot, before NIS comes up, or after boot also?

Comment 5 Mota Kardeh 2017-02-24 17:22:38 UTC
(In reply to Carlos O'Donell from comment #4)
> (In reply to Mota Kardeh from comment #3)
> > (In reply to Carlos O'Donell from comment #1)
> > > (In reply to Mota Kardeh from comment #0)
> > > > After change the following lines in /etc/nsswitch.conf from files to compat :
> > > > passwd:     compat sss
> > > > shadow:     files sss
> > > > group:      compat sss
> > > 
> > > Please provide your full /etc/nsswitch.conf.
> > 
> > The only difference in /etc/nsswitch.conf are the lines as I mentioned above:
> > 
> > ---------------------------------------------
> > passwd:     compat sss
> > shadow:     files sss
> > group:      compat sss
> > ---------------------------------------------
> > 
> > I attached the /etc/nsswitch.conf of fedora25 to the bug.
> 
> OK.
> 
> > Our SAP colleague has changed the mentioned lines in the /etc/nsswitch.conf
> > for some testing in NIS env.
> 
> Have you gone through basic validation that the NIS environment works? Is it
> actually a NIS+ environment?

I see in the '/etc/nsswitch.conf':

publickey: nisplus
aliases: files nisplus

Should I change something in the /etc/nsswitch.conf, if you are in opinion, this is a nisplus environment?

> 
> The 'compat' NSS service will fetch data from NIS by default, which is how
> you have it configured.
> 
> > We had a similar issues before, please check the Bug 193226 and Bug 192072.
> > https://bugzilla.redhat.com/show_bug.cgi?id=193226
> > https://bugzilla.redhat.com/show_bug.cgi?id=192072
> 
> Do you see your problems at boot, before NIS comes up, or after boot also?

I see the problem immediately after change the mentioned lines, don't need to reboot.

Comment 6 Carlos O'Donell 2017-02-28 16:08:11 UTC
(In reply to Mota Kardeh from comment #5)
> > Do you see your problems at boot, before NIS comes up, or after boot also?
> 
> I see the problem immediately after change the mentioned lines, don't need
> to reboot.

When you change the NSS passwd service database to use `compat` that _immediately_ starts requesting results from NIS. If you don't have a NIS service setup then you will have no users visible.

Did you configure NIS on this system?

Comment 7 Mota Kardeh 2017-03-06 10:12:45 UTC
(In reply to Carlos O'Donell from comment #6)
> (In reply to Mota Kardeh from comment #5)
> > > Do you see your problems at boot, before NIS comes up, or after boot also?
> > 
> > I see the problem immediately after change the mentioned lines, don't need
> > to reboot.
> 
> When you change the NSS passwd service database to use `compat` that
> _immediately_ starts requesting results from NIS. If you don't have a NIS
> service setup then you will have no users visible.
> 
> Did you configure NIS on this system?

Yes, we have implemented a shell script and during run the script on the system, NIS is configured.

But I mean changing the lines passwd and group from to "compat" should be nevertheless take care, that the users to be found in the system.

Again, I run the same steps on Fedora24, and didn't get any issue there.

Thanks and best regards,
Mota

Comment 9 Florian Weimer 2017-03-06 10:20:41 UTC
(In reply to Mota Kardeh from comment #7)
> > Did you configure NIS on this system?
> 
> Yes, we have implemented a shell script and during run the script on the
> system, NIS is configured.
> 
> But I mean changing the lines passwd and group from to "compat" should be
> nevertheless take care, that the users to be found in the system.

That depends to some degree on the kind of data supplied by the NIS user.

Could you capture NIS packets in some way (perhaps using “strace -s 8000” or “tcpdump -s 0”) when running “getent passwd root”?  This data can contain confidential information, so feel free to send it directly to me by email.

Comment 10 Mota Kardeh 2017-03-07 15:20:10 UTC
(In reply to Florian Weimer from comment #9)
> (In reply to Mota Kardeh from comment #7)
> > > Did you configure NIS on this system?
> > 
> > Yes, we have implemented a shell script and during run the script on the
> > system, NIS is configured.
> > 
> > But I mean changing the lines passwd and group from to "compat" should be
> > nevertheless take care, that the users to be found in the system.
> 
> That depends to some degree on the kind of data supplied by the NIS user.
> 
> Could you capture NIS packets in some way (perhaps using “strace -s 8000” or
> “tcpdump -s 0”) when running “getent passwd root”?  This data can contain
> confidential information, so feel free to send it directly to me by email.

Florian,
thanks for that.
I sent you a couple of minutes ago "strace" output by mail. "tcpdump -s 0", is doesn't work, when I change the mentioned lines in /etc/nsswitch.conf to compat sss, and I get the following output:

[root@localhost ~]# tcpdump -s 0 -x >/home/mota/tcpdump.txt
tcpdump: Couldn't find user 'tcpdump'

Thanks and best regards,
Mota

Comment 11 Mota Kardeh 2017-03-07 15:36:06 UTC
Hi Florian,

good news and very interesting result:

I installed nss_nis package on the Fedora25 system:

[root@localhost etc]# rpm -qa | grep nss_nis
nss_nis-2.24-4.fc25.x86_64

and then afterwards I changed the mentioned lines under /etc/nsswitch from 'files' to 'compat' and run the "getent passwd root":

[root@localhost etc]# getent passwd root
root:x:0:0:root:/root:/bin/bash


It works !:-)

Comment 12 Florian Weimer 2017-03-07 16:02:41 UTC

*** This bug has been marked as a duplicate of bug 1400538 ***


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