Commit 2d09d18d authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Add collective attribute system schema support.

parent 70d6f394
......@@ -332,18 +332,15 @@ at_add(
}
if ( at->at_collective ) {
#ifdef SLAP_COLLECTIVE
if( at->at_usage ) {
/* collective attributes cannot be operational */
return SLAP_SCHERR_NOT_SUPPORTED;
}
if( at->at_single_value ) {
/* collective attributes cannot be single-valued */
return SLAP_SCHERR_NOT_SUPPORTED;
}
#else
return SLAP_SCHERR_NOT_SUPPORTED;
#endif
}
sat = (AttributeType *) ch_calloc( 1, sizeof(AttributeType) );
......
......@@ -809,6 +809,8 @@ LDAP_SLAPD_F (int) is_entry_objectclass LDAP_P((
is_entry_objectclass((e), slap_schema.si_oc_referral)
#define is_entry_subentry(e) \
is_entry_objectclass((e), slap_schema.si_oc_subentry)
#define is_entry_collectiveAttributes(e) \
is_entry_objectclass((e), slap_schema.si_oc_collectiveAttributes)
#define is_entry_dynamicObject(e) \
is_entry_objectclass((e), slap_schema.si_oc_dynamicObject)
......
......@@ -3,6 +3,7 @@ use with slapd(5).
File Description
---- -----------
collective.schema Collective attributes
corba.schema Corba Object (RFC 2714)
core.schema OpenLDAP "core"
cosine.schema COSINE Pilot
......@@ -13,10 +14,9 @@ microsoft.ext.schema Microsoft (FYI)
microsoft.schema Microsoft (FYI)
microsoft.std.schema Microsoft (FYI)
misc.schema misc (experimental)
nadf.schema North American Directory Forum schema (obsolete)
nadf.schema North American Directory Forum (obsolete)
nis.schema Network Information Service
openldap.schema OpenLDAP Project (FYI)
vendor.schema Vendor Information (RFC 3045) schema
Additional "generally useful" schema definitions can be submitted
using the OpenLDAP Issue Tracking System <http://www.openldap.org/its/>.
......
......@@ -50,7 +50,7 @@
# The c-l attribute type specifies a locality name for a collection of
# entries.
#
objectClass ( 2.5.4.7.1 NAME 'c-l'
attributeType ( 2.5.4.7.1 NAME 'c-l'
SUP l COLLECTIVE )
#
#
......@@ -59,7 +59,7 @@ objectClass ( 2.5.4.7.1 NAME 'c-l'
# The c-st attribute type specifies a state or province name for a
# collection of entries.
#
objectClass ( 2.5.4.8.1 NAME 'c-st'
attributeType ( 2.5.4.8.1 NAME 'c-st'
SUP st COLLECTIVE )
#
#
......@@ -68,7 +68,7 @@ objectClass ( 2.5.4.8.1 NAME 'c-st'
# The c-street attribute type specifies a street address for a
# collection of entries.
#
objectClass ( 2.5.4.9.1 NAME 'c-street'
attributeType ( 2.5.4.9.1 NAME 'c-street'
SUP street COLLECTIVE )
#
#
......@@ -77,7 +77,7 @@ objectClass ( 2.5.4.9.1 NAME 'c-street'
# The c-o attribute type specifies an organization name for a collection
# of entries.
#
objectClass ( 2.5.4.10.1 NAME 'c-o'
attributeType ( 2.5.4.10.1 NAME 'c-o'
SUP o COLLECTIVE )
#
#
......@@ -86,7 +86,7 @@ objectClass ( 2.5.4.10.1 NAME 'c-o'
# The c-ou attribute type specifies an organizational unit name for a
# collection of entries.
#
objectClass ( 2.5.4.11.1 NAME 'c-ou'
attributeType ( 2.5.4.11.1 NAME 'c-ou'
SUP ou COLLECTIVE )
#
#
......@@ -95,7 +95,7 @@ objectClass ( 2.5.4.11.1 NAME 'c-ou'
# The c-PostalAddress attribute type specifies a postal address for a
# collection of entries.
#
objectClass ( 2.5.4.16.1 NAME 'c-PostalAddress'
attributeType ( 2.5.4.16.1 NAME 'c-PostalAddress'
SUP postalAddress COLLECTIVE )
#
#
......@@ -104,7 +104,7 @@ objectClass ( 2.5.4.16.1 NAME 'c-PostalAddress'
# The c-PostalCode attribute type specifies a postal code for a
# collection of entries.
#
objectClass ( 2.5.4.17.1 NAME 'c-PostalCode'
attributeType ( 2.5.4.17.1 NAME 'c-PostalCode'
SUP postalCode COLLECTIVE )
#
#
......@@ -113,7 +113,7 @@ objectClass ( 2.5.4.17.1 NAME 'c-PostalCode'
# The c-PostOfficeBox attribute type specifies a post office box for a
# collection of entries.
#
objectClass ( 2.5.4.18.1 NAME 'c-PostOfficeBox'
attributeType ( 2.5.4.18.1 NAME 'c-PostOfficeBox'
SUP postOfficeBox COLLECTIVE )
#
#
......@@ -122,7 +122,7 @@ objectClass ( 2.5.4.18.1 NAME 'c-PostOfficeBox'
# The c-PhysicalDeliveryOfficeName attribute type specifies a physical
# delivery office name for a collection of entries.
#
objectClass ( 2.5.4.19.1 NAME 'c-PhysicalDeliveryOfficeName'
attributeType ( 2.5.4.19.1 NAME 'c-PhysicalDeliveryOfficeName'
SUP physicalDeliveryOfficeName COLLECTIVE )
#
#
......@@ -131,7 +131,7 @@ objectClass ( 2.5.4.19.1 NAME 'c-PhysicalDeliveryOfficeName'
# The c-TelephoneNumber attribute type specifies a telephone number for
# a collection of entries.
#
objectClass ( 2.5.4.20.1 NAME 'c-TelephoneNumber'
attributeType ( 2.5.4.20.1 NAME 'c-TelephoneNumber'
SUP telephoneNumber COLLECTIVE )
#
#
......@@ -140,7 +140,7 @@ objectClass ( 2.5.4.20.1 NAME 'c-TelephoneNumber'
# The c-TelexNumber attribute type specifies a telex number for a
# collection of entries.
#
objectClass ( 2.5.4.19.1 NAME 'c-TelexNumber'
attributeType ( 2.5.4.21.1 NAME 'c-TelexNumber'
SUP telexNumber COLLECTIVE )
#
#
......@@ -149,7 +149,7 @@ objectClass ( 2.5.4.19.1 NAME 'c-TelexNumber'
# The c-FacsimileTelephoneNumber attribute type specifies a facsimile
# telephone number for a collection of entries.
#
objectClass ( 2.5.4.23.1 NAME 'c-FacsimileTelephoneNumber'
attributeType ( 2.5.4.23.1 NAME 'c-FacsimileTelephoneNumber'
SUP facsimileTelephoneNumber COLLECTIVE )
#
#
......@@ -158,5 +158,5 @@ objectClass ( 2.5.4.23.1 NAME 'c-FacsimileTelephoneNumber'
# The c-InternationalISDNNumber attribute type specifies an
# international ISDN number for a collection of entries.
#
objectClass ( 2.5.4.25.1 NAME 'c-InternationalISDNNumber'
attributeType ( 2.5.4.25.1 NAME 'c-InternationalISDNNumber'
SUP internationalISDNNumber COLLECTIVE )
......@@ -426,7 +426,6 @@ attributetype ( 0.9.2342.19200300.100.1.22 NAME 'otherMailbox'
# distinguishedNameSyntax
# ::= {pilotAttributeType 24}
#
## OBSOLETE
#attributetype ( 0.9.2342.19200300.100.1.24 NAME 'lastModifiedBy'
# DESC 'RFC1274: last modifier, replaced by modifiersName'
......
......@@ -45,11 +45,17 @@ entry_schema_check(
AttributeDescription *ad_objectClass
= slap_schema.si_ad_objectClass;
int extensible = 0;
int subentry = is_entry_subentry( e );
int collective = 0;
if( subentry) collective = is_entry_collectiveAttributes( e );
*text = textbuf;
/* misc attribute checks */
for ( a = e->e_attrs; a != NULL; a = a->a_next ) {
const char *type = a->a_desc->ad_cname.bv_val;
/* there should be at least one value */
assert( a->a_vals );
assert( a->a_vals[0].bv_val != NULL );
......@@ -62,12 +68,17 @@ entry_schema_check(
}
}
if( !collective && is_at_collective( a->a_desc->ad_type ) ) {
snprintf( textbuf, textlen, "attribute '%s' "
"may only appear in collectiveAttributes subentry",
type );
return LDAP_OBJECT_CLASS_VIOLATION;
}
/* if single value type, check for multiple values */
if( is_at_single_value( a->a_desc->ad_type ) &&
a->a_vals[1].bv_val != NULL )
{
char *type = a->a_desc->ad_cname.bv_val;
snprintf( textbuf, textlen,
"attribute '%s' cannot have multiple values",
type );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment