Bugzilla will be upgraded to version 5.0 on December 2, 2018. The outage period for the upgrade will start at 0:00 UTC and have a duration of 12 hours
Bug 1453155 - unable to retrieve specific cosAttribute when subtree password policy is configured.
unable to retrieve specific cosAttribute when subtree password policy is conf...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: 389-ds-base (Show other bugs)
7.1
Unspecified Unspecified
high Severity high
: rc
: ---
Assigned To: mreynolds
Viktor Ashirov
Marc Muehlfeld
: ZStream
Depends On:
Blocks: 1298243 1420851 1498958
  Show dependency treegraph
 
Reported: 2017-05-22 05:38 EDT by Hiroko Miura
Modified: 2018-04-10 10:17 EDT (History)
7 users (show)

See Also:
Fixed In Version: 389-ds-base-1.3.7.5-5.el7
Doc Type: Bug Fix
Doc Text:
Directory Server now correctly sets whether virtual attributes are operational The "pwdpolicysubentry" subtree password policy attribute in Directory Server is flagged as operational. However, in the previous version of Directory Server, this flag was incorrectly applied to following virtual attributes that were processed. As a consequence, the search results were not visible to the client. With this update, the server now resets the attribute before processing the next virtual attribute and Class of Service (CoS). As a result, the expected virtual attributes and CoS are now returned to the client.
Story Points: ---
Clone Of:
: 1498958 (view as bug list)
Environment:
Last Closed: 2018-04-10 10:16:50 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
custom schema and sample LDIF (1.67 KB, application/zip)
2017-05-22 05:38 EDT, Hiroko Miura
no flags Details
custom schema and sample LDIF (1.68 KB, application/zip)
2017-05-22 21:55 EDT, Hiroko Miura
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0811 None None None 2018-04-10 10:17 EDT

  None (edit)
Description Hiroko Miura 2017-05-22 05:38:04 EDT
Created attachment 1280972 [details]
custom schema and sample LDIF

Description of problem:

Indirect Cos is defined with custom attributes like the following.
---
dn: cn=cosDefinition,dc=test,dc=com
objectClass: top
objectClass: ldapsubentry
objectClass: cossuperdefinition
objectClass: cosIndirectDefinition
cosAttribute: ou merge-schemes
cosAttribute: x-department merge-schemes
cosAttribute: x-en-ou merge-schemes
cn: cosDefinition
cosIndirectSpecifier: seeAlso
---

This worked without problem.
But specific cosAttribute(custom attribute) 'x-department' is not returned in search with no attribute specified after Subtree password policy is configured.

Version-Release number of selected component (if applicable):

389-ds-base-1.3.4.0-29.el7_2.x86_64

How reproducible:

This can be reproduced with attached custom schema and sample LDIF.


Steps to Reproduce:

1. configure custom schema
 
  # ldapmodify -D "cn=directory manager -W -f modSchema.ldif

2. create suffix dc=test,dc=com and import test.ldif

   => please note that 2 CoS are defined at dc=test,dc=com.
         nsPwPolicy_CoS - CoS for sub-tree password policy
         cosDefinition - problematic CoS above

3. do search user1 which looks like below in test.ldif
---
dn: uid=user1,ou=sub1,dc=test,dc=com
uid: user1
seeAlso: uid=GManager,ou=Org,dc=test,dc=com
givenName: user1
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: inetorgperson
objectClass: xperson
sn: user1
cn: user1
---
   
$ ldapsearch -D "cn=directory manager" -w dirmanager -b dc=test,dc=com uid=user1
dn: uid=user1,ou=sub1,dc=test,dc=com
uid: user1
seeAlso: uid=GManager,ou=Org,dc=test,dc=com
givenName: user1
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: inetorgperson
objectClass: xperson
sn: user1
cn: user1
ou: OU_CoS
x-en-ou: OU-en_CoS

$
   => 'x-department' is not returned even though the other cosAttribute 'ou' and 'x-en-ou' are returned.

 But if problematic cosAttribute 'x-department' is specified explicitly, it can be retrieved.

$ ldapsearch -D "cn=directory manager" -w dirmanager -b dc=test,dc=com uid=user1 x-department
dn: uid=user1,ou=sub1,dc=test,dc=com
x-department: x-department_CoS

$

Actual results:

cosAttribute(custom attribute) 'x-department' is not returned.

Expected results:

cosAttribute(custom attribute) 'x-department' is returned even in search without specifying it.

Additional info:
Comment 2 Hiroko Miura 2017-05-22 21:55 EDT
Created attachment 1281302 [details]
custom schema and sample LDIF
Comment 5 mreynolds 2017-10-03 14:01:24 EDT
Upstream ticket:
https://pagure.io/389-ds-base/issue/49389
Comment 6 mreynolds 2017-10-03 17:05:57 EDT
I was able to reproduce the problem.  

The issue is that when a subtree password policy attribute was encountered during the virtual attribute processing it set a flag that said the attribute was operational (which is correct for the password policy attr: pwdpolicysubentry). 

However, this flag was accidentally carried over to the following virtual attributes that were being processed.  In this case "x-department" was accidentally still seen as operational which is why it was no longer being returned to the client.

Fix is in progress...
Comment 10 mreynolds 2017-10-04 09:20:04 EDT
Fixed upstream.

I will ask my manager to add a 7.4-z flag (as I can not do that).

But, this fix would not go into an official RHEL build for many months (batch update 3), but support can generate a hotfix for the customer now that the fix is upstream.
Comment 16 ashiveka 2017-11-27 00:08:19 EST
    ============================================================================ test session starts ============================================================================
    platform linux2 -- Python 2.7.5, pytest-3.2.5, py-1.5.2, pluggy-0.4.0 -- /usr/bin/python
    cachedir: .cache
    metadata: {'Python': '2.7.5', 'Platform': 'Linux-3.10.0-768.el7.x86_64-x86_64-with-redhat-7.5-Maipo', 'Packages': {'py': '1.5.2', 'pytest': '3.2.5', 'pluggy': '0.4.0'}, 'Plugins': {'html': '1.16.0', 'metadata': '1.5.0'}}
    389-ds-base: 1.3.7.5-9.el7
    nss: 3.34.0-0.1.beta1.el7
    nspr: 4.17.0-1.el7
    openldap: 2.4.44-9.el7
    svrcore: 4.1.3-2.el7
     
    rootdir: /export/tests, inifile:
    plugins: metadata-1.5.0, html-1.16.0
    collected 1 item                                                                                                                                                            
     
    suites/cos/indirect_cos_test.py::test_indirect_cos PASSED
     
    ------------------------------------------------------- generated xml file: /mnt/tests/rhds/tests/upstream/report.xml -------------------------------------------------------
    ------------------------------------------------------ generated html file: /mnt/tests/rhds/tests/upstream/report.html ------------------------------------------------------
    ========================================================================= 1 passed in 12.54 seconds =========================================================================
Comment 21 errata-xmlrpc 2018-04-10 10:16:50 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://access.redhat.com/errata/RHBA-2018:0811

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