Bug 1298478 - NIS account passwords not disabled when nsAccountLock is TRUE
NIS account passwords not disabled when nsAccountLock is TRUE
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: slapi-nis (Show other bugs)
6.0
Unspecified Unspecified
high Severity high
: rc
: ---
Assigned To: Alexander Bokovoy
Namita Soman
:
Depends On:
Blocks: 1298481
  Show dependency treegraph
 
Reported: 2016-01-14 03:53 EST by Martin Kosek
Modified: 2016-05-10 21:21 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1298481 (view as bug list)
Environment:
Last Closed: 2016-05-10 21:21:17 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Martin Kosek 2016-01-14 03:53:53 EST
This bug is created as a clone of upstream ticket:
https://fedorahosted.org/freeipa/ticket/5480

When the password algorithm is defined as CRYPT and NIS is used to authenticate users on other systems, there is no way to disable or lock accounts.   Traditional convention has been to put two bang (exclamation) characters in front of the password, creating an impossible password hash.  This effectively locks the user account, preventing authentication.

On line 55 of defs-nis.c, line 55 can have the following added to add a pair of bang characters in front of the password hash:

{{{
%ifeq("nsAccountLock","TRUE","!!","")
}}}

There may be a better place within the format to put that, but the syntax escapes me.  Simply adding the above code in the password field before the %regsubi... would produce a !!* for locked accounts instead of just the * as it sits now.  This may cause problems.
Comment 1 Martin Kosek 2016-01-14 03:56:12 EST
The bug needs to be fixed in slapi-nis, in the plugin itself. It is a security related fix, as account lock is not effective in NIS - thus increasing severity.
Comment 5 Alexander Bokovoy 2016-02-18 06:25:46 EST
To test this you need:
 1. Configure IPA to serve NIS maps
 2. Configure NIS client
 3. Create an IPA user, let's say, 'user'
 4. On NIS client, run 'ypcat passwd', this will print the map in passwd format. Note that second field is '*' for enabled users.
 5. As IPA admin, disable 'user' with 'ipa user-disable user'
 6. On NIS client, run 'ypcat passwd' and notice that 'user' now has '!!*' in the second field.
 7. As IPA admin, enable 'user' with 'ipa user-enable user'
 8. On NIS client, run 'ypcat passwd' and notice that 'user' now has only '*' in the second field.

For example:

# ipa user-disable foobar
------------------------------
Disabled user account "foobar"
------------------------------
# ypcat passwd |grep foobar:
foobar:!!*:955000024:955000024:Foo Bar:/home/foobar:/bin/sh
# ipa user-enable foobar
-----------------------------
Enabled user account "foobar"
-----------------------------
# ypcat passwd |grep foobar:
foobar:*:955000024:955000024:Foo Bar:/home/foobar:/bin/sh
Comment 6 Sudhir Menon 2016-02-22 07:49:33 EST
Verified using RHEL6.8 IPA-Server and IPA-Client

ipa-server-3.0.0-50.el6.x86_64
ipa-client-3.0.0-50.el6.x86_64
sssd-1.13.3-15.el6.x86_64

[root@r68client yp]# /etc/init.d/ypbind start
Starting NIS service:                                      [  OK  ]
Binding NIS service:                                       [  OK  ]

[root@r68client yp]# ypcat passwd
user:*:163400006:163400006:user test:/home/user:/bin/sh

[root@r68server ~]# ipa user-disable user
----------------------------
Disabled user account "user"
----------------------------

[root@r68client yp]# ypcat passwd
user:!!*:163400006:163400006:user test:/home/user:/bin/sh

[root@r68server ~]# ipa user-enable user
---------------------------
Enabled user account "user"
---------------------------

[root@r68client yp]# ypcat passwd
user:*:163400006:163400006:user test:/home/user:/bin/sh
Comment 8 errata-xmlrpc 2016-05-10 21:21:17 EDT
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-0966.html

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