"Objectclass not found",
"Attribute type not found",
"Duplicate objectclass",
- "Duplicate attributetype"
+ "Duplicate attributetype",
+ "Duplicate syntax",
+ "Duplicate matchingrule",
+ "OID or name required",
+ "Syntax or superior required",
+ "Matchingrule not found",
+ "Syntax not found",
+ "Syntax required"
};
char *
char last;
LDAP_OBJECT_CLASS *oc;
int code;
- char *err;
+ const char *err;
char **namep;
oc = (LDAP_OBJECT_CLASS *) ch_calloc( 1, sizeof(LDAP_OBJECT_CLASS) );
oc->oc_names = ch_calloc( 2, sizeof(char *) );
oc->oc_names[0] = ch_strdup( argv[1] );
oc->oc_names[1] = NULL;
+ if ( strcasecmp( oc->oc_names[0], "top" ) ) {
+ oc->oc_kind = LDAP_SCHEMA_STRUCTURAL;
+ }
for ( i = 2; i < argc; i++ ) {
/* required attributes */
if ( strcasecmp( argv[i], "requires" ) == 0 ) {
if ( code ) {
fprintf( stderr, "%s: line %d: %s %s\n",
fname, lineno, scherr2str(code), *namep);
- exit( 1 );
+ exit( EXIT_FAILURE );
}
namep++;
}
if ( code ) {
fprintf( stderr, "%s: line %d: %s %s\n",
fname, lineno, scherr2str(code), *namep);
- exit( 1 );
+ exit( EXIT_FAILURE );
}
namep++;
}
if ( code ) {
fprintf( stderr, "%s: line %d: %s %s\n",
fname, lineno, scherr2str(code), err);
- exit( 1 );
+ exit( EXIT_FAILURE );
}
ldap_memfree(oc);
}
{
LDAP_OBJECT_CLASS *oc;
int code;
- char *err;
+ const char *err;
oc = ldap_str2objectclass(line,&code,&err);
if ( !oc ) {
if ( code ) {
fprintf( stderr, "%s: line %d: %s %s\n",
fname, lineno, scherr2str(code), err);
- exit( 1 );
+ exit( EXIT_FAILURE );
}
ldap_memfree(oc);
}
fprintf( stderr, " [ \"MUST\" oids ] ; AttributeTypes\n");
fprintf( stderr, " [ \"MAY\" oids ] ; AttributeTypes\n");
fprintf( stderr, "whsp \")\"\n");
- exit( 1 );
+ exit( EXIT_FAILURE );
}
static void
fprintf( stderr, "<oc clause> ::= objectclass <ocname>\n" );
fprintf( stderr, " [ requires <attrlist> ]\n" );
fprintf( stderr, " [ allows <attrlist> ]\n" );
- exit( 1 );
+ exit( EXIT_FAILURE );
}
static void
fprintf( stderr, " ; distributedOperation\n");
fprintf( stderr, " ; dSAOperation\n");
fprintf( stderr, "whsp \")\"\n");
- exit( 1 );
+ exit( EXIT_FAILURE );
}
void
{
LDAP_ATTRIBUTE_TYPE *at;
int code;
- char *err;
+ const char *err;
at = ldap_str2attributetype(line,&code,&err);
if ( !at ) {
if ( code ) {
fprintf( stderr, "%s: line %d: %s %s\n",
fname, lineno, scherr2str(code), err);
- exit( 1 );
+ exit( EXIT_FAILURE );
}
ldap_memfree(at);
}