X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fschemaparse.c;h=42aa19d83557391bd6efd384a09beaa513ab68a0;hb=ecb9c3b3fb3dc595b1b0c572762ae664babeb4db;hp=e68d0dcaec9e68c16468ed85790bf03e48663ebc;hpb=a97e3e94e665df092cc512cd5a3f9c5ceac820ef;p=openldap diff --git a/servers/slapd/schemaparse.c b/servers/slapd/schemaparse.c index e68d0dcaec..42aa19d835 100644 --- a/servers/slapd/schemaparse.c +++ b/servers/slapd/schemaparse.c @@ -23,7 +23,14 @@ static char *err2text[] = { "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 * @@ -49,13 +56,16 @@ parse_oc_old( 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 ) { @@ -103,7 +113,7 @@ parse_oc_old( if ( code ) { fprintf( stderr, "%s: line %d: %s %s\n", fname, lineno, scherr2str(code), *namep); - exit( 1 ); + exit( EXIT_FAILURE ); } namep++; } @@ -115,7 +125,7 @@ parse_oc_old( if ( code ) { fprintf( stderr, "%s: line %d: %s %s\n", fname, lineno, scherr2str(code), *namep); - exit( 1 ); + exit( EXIT_FAILURE ); } namep++; } @@ -125,7 +135,7 @@ parse_oc_old( if ( code ) { fprintf( stderr, "%s: line %d: %s %s\n", fname, lineno, scherr2str(code), err); - exit( 1 ); + exit( EXIT_FAILURE ); } ldap_memfree(oc); } @@ -139,7 +149,7 @@ parse_oc( { LDAP_OBJECT_CLASS *oc; int code; - char *err; + const char *err; oc = ldap_str2objectclass(line,&code,&err); if ( !oc ) { @@ -151,7 +161,7 @@ parse_oc( if ( code ) { fprintf( stderr, "%s: line %d: %s %s\n", fname, lineno, scherr2str(code), err); - exit( 1 ); + exit( EXIT_FAILURE ); } ldap_memfree(oc); } @@ -170,7 +180,7 @@ oc_usage( void ) fprintf( stderr, " [ \"MUST\" oids ] ; AttributeTypes\n"); fprintf( stderr, " [ \"MAY\" oids ] ; AttributeTypes\n"); fprintf( stderr, "whsp \")\"\n"); - exit( 1 ); + exit( EXIT_FAILURE ); } static void @@ -179,7 +189,7 @@ oc_usage_old( void ) fprintf( stderr, " ::= objectclass \n" ); fprintf( stderr, " [ requires ]\n" ); fprintf( stderr, " [ allows ]\n" ); - exit( 1 ); + exit( EXIT_FAILURE ); } static void @@ -205,7 +215,7 @@ at_usage( void ) fprintf( stderr, " ; distributedOperation\n"); fprintf( stderr, " ; dSAOperation\n"); fprintf( stderr, "whsp \")\"\n"); - exit( 1 ); + exit( EXIT_FAILURE ); } void @@ -217,7 +227,7 @@ parse_at( { LDAP_ATTRIBUTE_TYPE *at; int code; - char *err; + const char *err; at = ldap_str2attributetype(line,&code,&err); if ( !at ) { @@ -229,7 +239,7 @@ parse_at( if ( code ) { fprintf( stderr, "%s: line %d: %s %s\n", fname, lineno, scherr2str(code), err); - exit( 1 ); + exit( EXIT_FAILURE ); } ldap_memfree(at); }