From 705ee847fc7e6bed8ca6507b5a0227e940334ad7 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Thu, 15 Jul 1999 05:45:01 +0000 Subject: [PATCH] Add 'referral'/'ref' to schema --- servers/slapd/result.c | 10 ++++++---- servers/slapd/slapd.at.conf | 1 + servers/slapd/slapd.oc.conf | 15 +++++++++++++++ tests/data/referrals.ldif | 36 +++++++++++++++++++++++++++++++++--- tests/data/slapd.at.conf | 1 + tests/data/slapd.oc.conf | 21 ++++++++++++++------- 6 files changed, 70 insertions(+), 14 deletions(-) diff --git a/servers/slapd/result.c b/servers/slapd/result.c index 5b67b48ead..ef7736399e 100644 --- a/servers/slapd/result.c +++ b/servers/slapd/result.c @@ -494,6 +494,7 @@ send_search_entry( int i, rc=-1, bytes; struct acl *acl; char *edn; + int allattrs; Debug( LDAP_DEBUG_TRACE, "=> send_search_entry (%s)\n", e->e_dn, 0, 0 ); @@ -538,20 +539,21 @@ send_search_entry( goto error_return; } + /* check for special all user attributes ("*") attribute */ + allattrs = charray_inlist( attrs, LDAP_ALL_USER_ATTRIBUTES ); + for ( a = e->e_attrs; a != NULL; a = a->a_next ) { regmatch_t matches[MAXREMATCHES]; if ( attrs == NULL ) { /* all addrs request, skip operational attributes */ - if( !opattrs && oc_check_operational_attr( a->a_type )) { + if( !opattrs && oc_check_operational_attr( a->a_type ) ) { continue; } } else { /* specific addrs requested */ - if ( !charray_inlist( attrs, a->a_type ) - && !charray_inlist( attrs, LDAP_ALL_USER_ATTRIBUTES ) ) - { + if ( !allattrs && !charray_inlist( attrs, a->a_type ) ) { continue; } } diff --git a/servers/slapd/slapd.at.conf b/servers/slapd/slapd.at.conf index c3c8b136b0..01451706ff 100644 --- a/servers/slapd/slapd.at.conf +++ b/servers/slapd/slapd.at.conf @@ -3,6 +3,7 @@ attribute personalsignature bin attribute jpegphoto bin attribute audio bin attribute labeledurl ces +attribute ref ces attribute userpassword ces attribute telephonenumber tel attribute facsimiletelephonenumber fax tel diff --git a/servers/slapd/slapd.oc.conf b/servers/slapd/slapd.oc.conf index 94f2349ba5..56d90c531d 100644 --- a/servers/slapd/slapd.oc.conf +++ b/servers/slapd/slapd.oc.conf @@ -7,6 +7,21 @@ objectclass alias aliasedObjectName, objectClass +objectclass referral + requires + ref, + objectClass + +objectclass dcobject + requires + objectClass, + dc + +objectclass uidobject + requires + objectClass, + uid + objectclass country requires objectClass, diff --git a/tests/data/referrals.ldif b/tests/data/referrals.ldif index a6b603292e..9e605ac244 100644 --- a/tests/data/referrals.ldif +++ b/tests/data/referrals.ldif @@ -4,17 +4,47 @@ objectclass: country dn: o=ABC, c=US o: ABC -ref: ldap//hostA/ HostA -ref: ldap//hostB/ HostB +ref: ldap//hostA/o=abc,c=us HostA +ref: ldap//hostB/o=abc,c=us HostB objectclass: referral objectclass: extensibleObject dn: o=XYZ, c=US o: XYZ -ref: ldap//hostC/ HostC +ref: ldap//hostC/o=xyz,c=us HostC objectclass: referral objectclass: extensibleObject +dn: o=Alias, c=US +o: Alias +aliasedObjectName: o=University of Michigan, c=US +objectclass: alias +objectclass: extensibleObject + dn: o=University of Michigan, c=US o: University of Michigan objectclass: organization + +dn: cn=Manager, o=University of Michigan, c=US +cn: Manager +cn: Directory Manager +cn: Dir Man +sn: Manager +description: Manager of the directory +userpassword: secret +objectclass: person + +dn: cn=Alias, o=University of Michigan, c=US +cn: Alias +aliasedobjectname: cn=Manager, o=University of Michigan, c=US +objectclass: extensibleObject + +dn: cn=Circular, o=University of Michigan, c=US +cn: Circular +aliasedobjectname: cn=Circular, o=University of Michigan, c=US +objectclass: extensibleObject + +dn: cn=Subordinate, o=University of Michigan, c=US +cn: Subordinate +aliasedobjectname: cn=Subordinate, cn=Alias, o=University of Michigan, c=US +objectclass: extensibleObject diff --git a/tests/data/slapd.at.conf b/tests/data/slapd.at.conf index c3c8b136b0..01451706ff 100644 --- a/tests/data/slapd.at.conf +++ b/tests/data/slapd.at.conf @@ -3,6 +3,7 @@ attribute personalsignature bin attribute jpegphoto bin attribute audio bin attribute labeledurl ces +attribute ref ces attribute userpassword ces attribute telephonenumber tel attribute facsimiletelephonenumber fax tel diff --git a/tests/data/slapd.oc.conf b/tests/data/slapd.oc.conf index 94f2349ba5..5ff3243143 100644 --- a/tests/data/slapd.oc.conf +++ b/tests/data/slapd.oc.conf @@ -7,6 +7,11 @@ objectclass alias aliasedObjectName, objectClass +objectclass referral + requires + ref + objectClass + objectclass country requires objectClass, @@ -83,18 +88,17 @@ objectclass organizationalUnit objectclass person requires objectClass, - sn, cn allows description, seeAlso, + sn, telephoneNumber, userPassword objectclass organizationalPerson requires objectClass, - sn, cn allows description, @@ -110,6 +114,7 @@ objectclass organizationalPerson preferredDeliveryMethod, registeredAddress, seeAlso, + sn, st, streetAddress, telephoneNumber, @@ -161,7 +166,6 @@ objectclass groupOfNames objectclass residentialPerson requires objectClass, - sn, cn, l allows @@ -178,6 +182,7 @@ objectclass residentialPerson preferredDeliveryMethod, registeredAddress, seeAlso, + sn, st, streetAddress, telephoneNumber, @@ -261,7 +266,6 @@ objectclass pilotObject objectclass newPilotPerson requires objectClass, - sn, cn allows businessCategory, @@ -270,6 +274,8 @@ objectclass newPilotPerson homePhone, homePostalAddress, janetMailbox, + lastModifiedBy, + lastModifiedTime, mail, mailPreferenceOption, mobile, @@ -282,6 +288,7 @@ objectclass newPilotPerson roomNumber, secretary, seeAlso, + sn, telephoneNumber, textEncodedORaddress, uid, @@ -663,9 +670,7 @@ objectclass kerberosSecurityObject objectclass umichPerson requires objectClass, - sn, - cn, - universityID + cn allows affiliationCode, audio, @@ -714,6 +719,7 @@ objectclass umichPerson roomNumber, secretary, seeAlso, + sn, st, streetAddress, telephoneNumber, @@ -722,6 +728,7 @@ objectclass umichPerson textEncodedORaddress, title, uid, + universityID, updateSource, userCertificate, userClass, -- 2.39.5