X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=sidebyside;f=servers%2Fslapd%2Fat.c;h=ed8fd6ef79c67a3a9debf83650f2e3750c717ed6;hb=2c94c7915a52f8df4323c8193ec424df568f0fc1;hp=90c58551c25d1ad3bf6e0cd2ccb99c69ded1a1e1;hpb=587d36e18b923f47b4b56288df2b26821c2a7750;p=openldap diff --git a/servers/slapd/at.c b/servers/slapd/at.c index 90c58551c2..ed8fd6ef79 100644 --- a/servers/slapd/at.c +++ b/servers/slapd/at.c @@ -274,7 +274,35 @@ at_add( MatchingRule *mr; Syntax *syn; int code; - char *cname; + char *cname; + char *oid; + + if ( !OID_LEADCHAR( at->at_oid[0] )) { + /* Expand OID macros */ + oid = oidm_find( at->at_oid ); + if ( !oid ) { + *err = at->at_oid; + return SLAP_SCHERR_OIDM; + } + if ( oid != at->at_oid ) { + ldap_memfree( at->at_oid ); + at->at_oid = oid; + } + } + + if ( at->at_syntax_oid && !OID_LEADCHAR( at->at_syntax_oid[0] )) { + /* Expand OID macros */ + oid = oidm_find( at->at_syntax_oid ); + if ( !oid ) { + *err = at->at_syntax_oid; + return SLAP_SCHERR_OIDM; + } + if ( oid != at->at_syntax_oid ) { + ldap_memfree( at->at_syntax_oid ); + at->at_syntax_oid = oid; + } + + } if ( at->at_names && at->at_names[0] ) { int i; @@ -304,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) );