Bug 1298481

Summary: NIS account passwords not disabled when nsAccountLock is TRUE
Product: Red Hat Enterprise Linux 7 Reporter: Martin Kosek <mkosek>
Component: slapi-nisAssignee: Alexander Bokovoy <abokovoy>
Status: CLOSED ERRATA QA Contact: Namita Soman <nsoman>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 7.3CC: abokovoy, ekeck, ksiddiqu, nsoman, rcritten
Target Milestone: rcKeywords: ZStream
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: slapi-nis-0.54-6.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1298478
: 1313797 (view as bug list) Environment:
Last Closed: 2016-11-04 07:05:27 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1298478    
Bug Blocks: 1313797    

Description Martin Kosek 2016-01-14 08:58:19 UTC
+++ This bug was initially created as a clone of Bug #1298478 +++

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.

--- Additional comment from Martin Kosek on 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 7 Kaleem 2016-08-11 09:31:36 UTC
Verified.

IPA Server:
===========
[root@dhcp207-129 ~]# ipa user-disable testuser1
---------------------------------
Disabled user account "testuser1"
---------------------------------
[root@dhcp207-129 ~]# ipa user-enable testuser1
--------------------------------
Enabled user account "testuser1"
--------------------------------
[root@dhcp207-129 ~]# rpm -q ipa-server slapi-nis
ipa-server-4.4.0-7.el7.x86_64
slapi-nis-0.56.0-4.el7.x86_64
[root@dhcp207-129 ~]# 


NIS Client:
===========
[root@dhcp207-90 ~]# ypcat passwd
testuser1:*:1992200001:1992200001:test user1:/home/testuser1:/bin/sh
admin:*:1992200000:1992200000:Administrator:/home/admin:/bin/bash
[root@dhcp207-90 ~]# ypcat passwd
testuser1:!!*:1992200001:1992200001:test user1:/home/testuser1:/bin/sh
admin:*:1992200000:1992200000:Administrator:/home/admin:/bin/bash
[root@dhcp207-90 ~]# ypcat passwd
testuser1:*:1992200001:1992200001:test user1:/home/testuser1:/bin/sh
admin:*:1992200000:1992200000:Administrator:/home/admin:/bin/bash
[root@dhcp207-90 ~]#

Comment 9 errata-xmlrpc 2016-11-04 07:05:27 UTC
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-2471.html