Bug 807099

Summary: groupadd -g 1000 <username> -- fails with "configuration error - unknown item 'LASTLOG_ENAB' (notify administrator)
Product: [openSUSE] openSUSE 12.3 Reporter: Jon Nelson <jnelson-suse>
Component: YaST2Assignee: Jiří Suchomel <jsuchome>
Status: RESOLVED NORESPONSE QA Contact: Jiri Srain <jsrain>
Severity: Major    
Priority: P1 - Urgent CC: axel.braun, coolo, kukuk, plinnell, security-team
Version: RC 2   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: patch for yast2-security

Description Jon Nelson 2013-03-01 22:28:32 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:19.0) Gecko/20100101 Firefox/19.0

Title has all the details.

groupadd -g 1000 <username>   --   fails with "configuration error - unknown item 'LASTLOG_ENAB' (notify administrator)



Reproducible: Always

Steps to Reproduce:
1.
2.
3.
Comment 1 Thorsten Kukuk 2013-03-05 19:04:34 UTC
I assume you modified /etc/login.defs and now you have a /etc/login.defs.rpmnew, and you did not merge your changes?
Comment 2 Jon Nelson 2013-03-05 19:19:52 UTC
I did not modify that file for sure. This is on a fresh install.  I checked /etc/login.def* and there is only /etc/login.defs, no .rpmnew or .rpmsave, etc...
Comment 3 Thorsten Kukuk 2013-03-06 10:35:37 UTC
If you install new and choose automatic configuration, a broken entry is
added to /etc/login.defs at the end:

'LASTLOG_ENAB   ""'

That's not and was never a valid syntax.

Looks like old code in YaST2 is writing something it shouldn't do.
Comment 4 Jiří Suchomel 2013-03-06 15:55:24 UTC
It is true YaST writes "" for LASTLOG_ENAB, but why is not LASTLOG_ENAB defined in installed /etc/login.defs before?
Comment 5 Thorsten Kukuk 2013-03-06 16:07:21 UTC
(In reply to comment #4)
> It is true YaST writes "" for LASTLOG_ENAB, but why is not LASTLOG_ENAB defined
> in installed /etc/login.defs before?

8 years ago it was decided (I think the request did come from somebody from the security team, but my notes don't go back so far anymore) that LASTLOG_ENAB is a bad idea since it was only used by /bin/login and nothing else, and that we should use pam_lastlog.so instead, so that all tools can use it.

The old tools ignored syntax errors, the new tools now aborts, that's why it did not show up earlier.

But in any case, YaST should never add new variables to config files, especially not with an empty value, except the user/sysadmin explicit enables this option somewhere ...
Comment 6 Jiří Suchomel 2013-03-06 21:59:03 UTC
Still: if LASTLOG_ENAB is not even present in fresh /etc/login.defs and because it is bad idea itself, should YaST offer its configuration? Shouldn't we drop it completly?
Comment 7 Thorsten Kukuk 2013-03-06 22:27:36 UTC
(In reply to comment #6)
> Still: if LASTLOG_ENAB is not even present in fresh /etc/login.defs and because
> it is bad idea itself, should YaST offer its configuration? Shouldn't we drop
> it completly?

Sorry, misunderstand you: we should not offer it, since nobody uses this variable anymore. So drop completly.

And we should check at some point (before SLE12) which variables YaST else uses and if they are still valid.
Comment 8 Jiří Suchomel 2013-03-07 08:38:25 UTC
https://build.opensuse.org/request/show/157607
Comment 9 Jiří Suchomel 2013-03-08 07:37:53 UTC
Hm, so the fix did not make it to openSUSE 12.3

And simply releasing yast2-security for online update won't fix it: current fix means that LASTLOG_ENAB is dropped and that yast2-security won't write new config file variables.


Thorsten, how severe is the problem? This looks like all 12.3 users will have that broken line in their login.defs.
Maybe we can fix it by some rpm script, that would just look for such line in /etc/login.defs and remove it.
Comment 10 Thorsten Kukuk 2013-03-08 08:21:00 UTC
(In reply to comment #9)

> Thorsten, how severe is the problem? This looks like all 12.3 users will have
> that broken line in their login.defs.

I would assume that at least all users which use the default "automatical configuration" cannot create users/groups after a fresh installation.
I had always disabled that option and didn't saw the problem.
Comment 11 Jiří Suchomel 2013-03-08 08:38:39 UTC
(In reply to comment #10)

> I would assume that at least all users which use the default "automatical
> configuration" cannot create users/groups after a fresh installation.

You mean, cannot create users/groups with command line tools. It still should work with YaST.

> I had always disabled that option and didn't saw the problem.

I think most of openSUSE users do not disable Automatic Configuration.

And thinking about it... I actually think that disabling it will not help, as yast2-security is used anyway (for saving the crypt method).
Comment 12 Jiří Suchomel 2013-03-08 10:24:56 UTC
So, I propose adding this to %post of yast2-security, released as online update:


sed -e '/^[ \t]*LASTLOG_ENAB[ \t]*\"\"/d' -i /etc/login.defs
Comment 13 Jiří Suchomel 2013-03-08 12:53:47 UTC
OK, I've just tested with 12.3 GM:

- /etc/login.defs is not broken every time, just when yast2 Security is written. This happens for example when changing password encryption in Users module

- even with LASTLOG_ENAB = "" present, useradd can add new user (but it reports error). I guess friend tools act alike.

- adding users with YaST is not affected, as expected
Comment 14 Jiří Suchomel 2013-03-08 13:58:36 UTC
Could I prepare yast2-security for update?
Comment 15 Jiří Suchomel 2013-03-08 13:59:14 UTC
Created attachment 528911 [details]
patch for yast2-security
Comment 16 Benjamin Brunner 2013-03-11 10:35:23 UTC
It looks good for an update. Could you create a maintenancerequest with the updated package please?
Comment 17 Jiří Suchomel 2013-03-12 12:17:00 UTC
I hope this is it:


> osc maintenancerequest home:jsuchome:12.3 yast2-security openSUSE:12.3
Using target project 'openSUSE:Maintenance'
158659
Comment 18 Bernhard Wiedemann 2013-03-12 13:00:12 UTC
This is an autogenerated message for OBS integration:
This bug (807099) was mentioned in
https://build.opensuse.org/request/show/158659 Maintenance /
Comment 19 Swamp Workflow Management 2013-03-18 16:04:49 UTC
openSUSE-RU-2013:0474-1: An update that has two recommended fixes can now be installed.

Category: recommended (low)
Bug References: 802006,807099
CVE References: 
Sources used:
openSUSE 12.3 (src):    yast2-security-2.23.5-1.4.1
Comment 20 Peter Linnell 2013-10-13 05:03:32 UTC
This error is still present in 13.1Rc1
Comment 21 Peter Linnell 2013-10-13 05:04:44 UTC
Yast2 is leaving LASTLOG_ENAB "" in /etc/login.defs which is causing error messages
Comment 22 Jiří Suchomel 2013-10-14 06:56:08 UTC
(In reply to comment #21)
> Yast2 is leaving LASTLOG_ENAB "" in /etc/login.defs which is causing error
> messages

How? The code for writing LASTLOG_ENAB was removed from YaST. When (after which module run) do you see such behavior?
Comment 23 Axel Braun 2013-11-03 19:18:08 UTC
Today I did a new installation of 12.3x64 in a virtualbox, all patches applied

Right afterwards I installed trytond (see http://code.google.com/p/tryton/wiki/InstallationonopenSUSE ) via zypper, during which a group and user-add should take place.
Result:
(25/37) Installation von: trytond-2.8.3-5.1 .........................................................................[fertig]
Zusätzliche rpm-Ausgabe:
configuration error - unknown item 'LASTLOG_ENAB' (notify administrator)
configuration error - unknown item 'LASTLOG_ENAB' (notify administrator)

I have no /etc/login.defs.rpmnew or similar.
User and group were created properly.

Any information I can provide?
Comment 24 Jiří Suchomel 2013-11-04 06:33:38 UTC
Is LASTLOG_ENAB in /etc/login.defs?
Peter, how do you know it's there from YaST?
Comment 25 Jiří Suchomel 2014-01-07 13:42:32 UTC
Any news?
Comment 26 Peter Linnell 2014-01-07 16:26:34 UTC
Let me retest in the coming days..
Comment 27 Jiří Suchomel 2014-03-20 08:26:26 UTC
ping...
Comment 28 Jiří Suchomel 2014-09-22 08:43:17 UTC
No response for quite some time...