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.
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.
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
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
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