Bug 1298481 - 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 7
Classification: Red Hat
Component: slapi-nis (Show other bugs)
7.3
All Linux
urgent Severity urgent
: rc
: ---
Assigned To: Alexander Bokovoy
Namita Soman
: ZStream
Depends On: 1298478
Blocks: 1313797
  Show dependency treegraph
 
Reported: 2016-01-14 03:58 EST by Martin Kosek
Modified: 2016-11-04 03:05 EDT (History)
5 users (show)

See Also:
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 03:05:27 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:58:19 EST
+++ 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 05:31:36 EDT
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 03:05:27 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-2471.html

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