} else if ( strncasecmp( left, "attr", 4 ) == 0 ) {
a->acl_attrs = str2anlist( a->acl_attrs,
right, "," );
+ if ( a->acl_attrs == NULL ) {
+ fprintf( stderr,
+ "%s: line %d: unknown attr \"%s\" in to clause\n",
+ fname, lineno, right );
+ acl_usage();
+ }
} else {
fprintf( stderr,
"%s: line %d: expecting <what> got \"%s\"\n",
* EXTENSION: see if requested description is an object class
* if so, return attributes which the class requires/allows
*/
- oc = oc_bvfind( &attrs->an_name );
+ oc = attrs->an_oc;
+ if( oc == NULL ) {
+ oc = oc_bvfind( &attrs->an_name );
+ attrs->an_oc = oc;
+ }
if( oc != NULL ) {
if ( oc == slap_schema.si_oc_extensibleObject ) {
/* extensibleObject allows the return of anything */
s = ldap_pvt_strtok( NULL, brkstr, &lasts ) )
{
anew->an_desc = NULL;
+ anew->an_oc = NULL;
ber_str2bv(s, 0, 1, &anew->an_name);
slap_bv2ad(&anew->an_name, &anew->an_desc, &text);
+ if ( !anew->an_desc ) {
+ anew->an_oc = oc_bvfind( &anew->an_name );
+ if ( !anew->an_oc ) {
+ free( an );
+ /* overwrites input string on error! */
+ strcpy( in, s );
+ return NULL;
+ }
+ }
anew++;
}
anew->an_name.bv_val = NULL;
typedef struct slap_attr_name {
struct berval an_name;
AttributeDescription *an_desc;
+ ObjectClass *an_oc;
} AttributeName;
#define slap_ad_is_lang(ad) ( (ad)->ad_lang.bv_len != 0 )