Bug 606545 - core schema should include numSubordinates
core schema should include numSubordinates
Status: CLOSED CURRENTRELEASE
Product: 389
Classification: Community
Component: Schema (Show other bugs)
1.2.6
All All
high Severity medium
: ---
: ---
Assigned To: Rich Megginson
Viktor Ashirov
:
Depends On:
Blocks: 389_1.2.7 639035
  Show dependency treegraph
 
Reported: 2010-06-21 18:28 EDT by Endi Sukma Dewata
Modified: 2015-12-07 11:32 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-12-07 11:32:01 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
scripts.tar.gz (1.25 KB, application/x-gzip)
2010-06-21 18:28 EDT, Endi Sukma Dewata
no flags Details
0001-Bug-606545-core-schema-should-include-numSubordinate.patch (3.13 KB, patch)
2010-06-21 22:41 EDT, Endi Sukma Dewata
rmeggins: review+
Details | Diff

  None (edit)
Description Endi Sukma Dewata 2010-06-21 18:28:41 EDT
Created attachment 425766 [details]
scripts.tar.gz

The numSubordinates attribute is currently defined in the common schema:

attributeTypes: ( 1.3.1.1.4.1.453.16.2.103 NAME 'numSubordinates' DESC 'count of immediate subordinates' EQUALITY integerMatch ORDERING integerOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-ORIGIN 'numSubordinates Internet Draft' )

Since it's an operational attribute, it should not be returned in the search result unless the client requests this attribute specifically.

Some applications (e.g. Samba) may use DS only with the core schema, without the common schema. Since in that case the numSubordinates is not defined in the schema, it will be returned in the search result like a regular attribute.

How reproducible: consistently.

To reproduce the problem, unpack the attached scripts.tar.gz, then execute run.sh. It will execute the following operations:
1. Create slapd instance with core schema only.
2. Add the base entry.
3. Add a child to the base entry.
4. Search the base entry.
  
Actual results: The numSubordinates will be returned in the result of step #4:
dn: dc=example,dc=com
objectClass: dcObject
objectClass: top
dc: example
numsubordinates: 1

Expected results:
The numSubordinates should not be returned unless it's specified in the search attribute list.
Comment 1 Endi Sukma Dewata 2010-06-21 22:41:08 EDT
Created attachment 425801 [details]
0001-Bug-606545-core-schema-should-include-numSubordinate.patch

The numSubordinates attribute type definition has been moved from 02common.ldif into 00core.ldif.
Comment 2 Rich Megginson 2010-06-23 12:20:06 EDT
Comment on attachment 425801 [details]
0001-Bug-606545-core-schema-should-include-numSubordinate.patch

ok - also need to add these two schema files to the list of schema files in 60upgradeschemafiles.pl
Comment 3 Endi Sukma Dewata 2010-06-29 15:00:27 EDT
It seems that the files are already included in the list:

my @toremove = qw(00core.ldif 01core389.ldif 01common.ldif 02common.ldif 05rfc2247.ldif 05rfc4523.ldif 10presence.ldif 28pilot.ldif 30ns-common.ldif 50ns-directory.ldif 60mozilla.ldif);
Comment 6 Noriko Hosoi 2010-10-29 13:18:40 EDT
Reviewed by Rich.

Pushed to master on behalf of Endi.

$ git merge work
Updating 81fe698..07f9ed2
Fast-forward
 ldap/schema/00core.ldif   |   12 ++++++++++++
 ldap/schema/02common.ldif |    1 -
 2 files changed, 12 insertions(+), 1 deletions(-)

$ git push
Counting objects: 11, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 799 bytes, done.
Total 6 (delta 5), reused 0 (delta 0)
To ssh://git.fedorahosted.org/git/389/ds.git
   81fe698..07f9ed2  master -> master
Comment 7 Amita Sharma 2011-05-31 02:36:11 EDT
[root@amsharma scripts]# ps -aef | grep slapd
nobody   25898     1  0 12:02 ?        00:00:00 /usr/sbin/ns-slapd -D /etc/dirsrv/slapd-example -i /var/run/dirsrv/slapd-example.pid -w /var/run/dirsrv/slapd-example.startpid
root     25964 10741  0 12:02 pts/2    00:00:00 grep slapd
[root@amsharma scripts]# ldapadd -x -h localhost -p 389 -D "cn=Directory Manager" -w Secret123 << EOF
> dn: dc=example,dc=com
> objectClass: dcObject
> dc: example
> EOF
adding new entry "dc=example,dc=com"

[root@amsharma scripts]# ldapadd -x -h localhost -p 389 -D "cn=Directory Manager" -w xxx << EOF
dn: ou=Users,dc=example,dc=com
> objectClass: organizationalUnit
> ou: Users
> EOF
adding new entry "ou=Users,dc=example,dc=com"

[root@amsharma scripts]# ldapsearch -x -D "cn=Directory Manager" -w xxx -b dc=example,dc=com -s base
# extended LDIF
#
# LDAPv3
# base <dc=example,dc=com> with scope baseObject
# filter: (objectclass=*)
# requesting: ALL
#

# example.com
dn: dc=example,dc=com
objectClass: dcObject
objectClass: top
dc: example

# search result
search: 2
result: 0 Success

# numResponses: 2
# numEntries: 1

"No numsubordinates returns in the search" Hence VERIFIED.

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