Bug 371558

Summary: yast2 corrupting file /etc/pam.d/common-account-pc locking out users
Product: [openSUSE] openSUSE 11.0 Reporter: Casual J. Programmer <casualprogrammer>
Component: YaST2Assignee: Michael Calmer <mc>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Major    
Priority: P5 - None CC: jsuchome, kukuk
Version: Alpha 2   
Target Milestone: ---   
Hardware: x86   
OS: openSUSE 11.0   
Whiteboard:
Found By: Beta-Customer Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: yast2logs from today
yast2logs from 20080301
yast2logs
/etc/pam.d/*

Description Casual J. Programmer 2008-03-16 14:13:23 UTC
Configuring Network Services with yast2 under certain conditions corrupts /etc/pam.d/common-account-pc, removing the entry

account	sufficient	pam_localuser.so 

locking out all users, including root.

Only access possible is through runlevel 1

The first time it happened, I was configuring LDAP, this time SAMBA, NTP and Xinetd.

While the first time I could only recover with a clean install of alpha2 from DVD ( after being able to back up all files, so yast logs are still there ), this time I managed to repair the system with the help of some other users.

Notebook: Fujitsu Siemens Amilo Si 1520
Graphics: Fujitsu Siemens Mobile 945GM/GMS/GME, 943/940GML Express
Monitor:  QUANTADISPLAY LCD Monitor 1280x800@60Hz
Wireless: Intel PRO/Wireless 3945ABG Network Connection
Sound:    82801G (ICH7 Family) High Definition Audio Controller
Desktop:  gnome2-SuSE-10.3-168
YaST GUI: yast2-qt-2.16.33-2
OS:       openSUSE 11.0 (i586) Alpha3 VERSION = 11.0
Kernel:   2.6.25-rc4-git1-2-pae

yast2-2.16.35-2
yast2-users-2.16.16-4
yast2-ldap-2.16.0-11
yast2-ldap-server-2.15.5-142
yast2-samba-server-2.16.0-65
yast2-ntp-client-2.16.4-17
yast2-pam-2.16.0-62
Comment 1 Casual J. Programmer 2008-03-16 14:15:27 UTC
Created attachment 202341 [details]
yast2logs from today
Comment 2 Casual J. Programmer 2008-03-16 14:17:54 UTC
Created attachment 202342 [details]
yast2logs from 20080301
Comment 3 Stefan Hundhammer 2008-03-25 12:35:27 UTC
I am not sure whom to assign this to. It might be in one of those network services, or it might be in yast2-users. The yast2-users maintainer probably knows best what to look for.
Comment 4 Jiří Suchomel 2008-03-25 12:42:38 UTC
YaST does not directly touch /etc/pam.d/* files, pam-config (which is called from yast) maybe does it. Michael?
Comment 5 Michael Calmer 2008-03-25 15:29:34 UTC
(In reply to comment #0 from Casual J. Programmer)
> Configuring Network Services with yast2 under certain conditions corrupts
> /etc/pam.d/common-account-pc, removing the entry
> 
> account sufficient      pam_localuser.so 
> 
> locking out all users, including root.
> 
> Only access possible is through runlevel 1

Please explain a little bit more verbose what happens.

Are you logged-in as a user (maybe root) and you configure with yast a service and after you finished yast the system do an automatic logout and you cannot login anymore?

Or after the configuration with yast _you_ do a logout and cannot login anymore?

If the second is the case, please attach all /etc/pam.d/common-*-pc files to this bug. 
Comment 6 Casual J. Programmer 2008-03-26 08:47:36 UTC
"Are you logged-in as a user (maybe root) and you configure with yast a service
and after you finished yast the system do an automatic logout and you cannot
login anymore?" actually yes, and as stated in comment #0

"Configuring Network Services with yast2 under certain conditions corrupts
/etc/pam.d/common-account-pc, removing the entry

account sufficient      pam_localuser.so 

locking out all users, including root."

As I can't reproduce this at will, we either need to let it rest until the next hit, or else you find something in the yast2 logs provided, that sheds some light on the issue.
Comment 7 Casual J. Programmer 2008-03-26 09:56:24 UTC
Actually just happend again after a fresh install from alpha3 DVD & updating from factory, then setting up everything from scratch.

The last thing I did was /sbin/yast2 samba-client and from there activating NTP Configuration.

After finishing I logged off and was locked out.

Booting to runlevel 1 and editing /etc/pam.d/common-account-pc shows

account requisite pam_unix2.so
account required pam_ldap.so use_first_pass

while the line

account requisite pam_unix2.so 

doesn't look right, changing it to 

account required pam_unix2.so

doesn't help.

only adding 

account sufficient pam_localuser.so

as second line gets me going again.



Comment 8 Casual J. Programmer 2008-03-26 10:03:32 UTC
Created attachment 203981 [details]
yast2logs
Comment 9 Casual J. Programmer 2008-03-26 10:04:00 UTC
Created attachment 203982 [details]
/etc/pam.d/*
Comment 10 Michael Calmer 2008-03-26 17:19:15 UTC
Hmm, I think I have an idea what happens.

What else do you have configured on this host. I see pam_ldap configured but not pam_winbind. I think this was not done by the samba-client module. 

Casual: Have you run the ldap-client module before you run samba-client?

Jiri: or does samba-client (or samba-server) configure pam_ldap ?
Comment 11 Casual J. Programmer 2008-03-26 19:41:48 UTC
Actually, after installing and updating I configured LDAP server, LDAP Client, CA Server Certificate and then as per comment #7 ( don't nail me for details, I may have done something in between like installing/deleting/updating software ).
But that is pretty much what I did.


Comment 12 Jiří Suchomel 2008-03-27 06:38:07 UTC
(In reply to comment #10 from Michael Calmer)

> Jiri: or does samba-client (or samba-server) configure pam_ldap ?

Samba-server does not configure authentication at all. Samba-client uses pam-config to configure winbind and possibly for setting mkhomedir option. If there's an Active Directory setup, than it also configures kerberos ("krb5"). No LDAP.
Comment 13 Michael Calmer 2008-03-27 09:10:24 UTC
I think you hit the problem if pam-config commands are executed in this order:

pam-config -a --ldap
pam-config -a --winbind
pam-config -d --ldap

The last "-d --ldap" disable also the localuser module, but it is still needed because of winbind is still active. 

I will see how we can fix this.

Comment 14 Michael Calmer 2008-04-01 14:12:06 UTC
fix submitted.

Many thanks for the bugreport.