version 1.12.8.5, 2000/06/13 17:57:30
|
version 1.12.8.8, 2001/02/03 03:46:00
|
Line 1
|
Line 1
|
/* schemaparse.c - routines to parse config file objectclass definitions */ |
/* $OpenLDAP: pkg/ldap/servers/slapd/schemaparse.c,v 1.12.8.7 2000/07/29 01:53:14 kurt Exp $ */ |
/* $OpenLDAP: pkg/ldap/servers/slapd/schemaparse.c,v 1.34 2000/06/07 03:17:30 kurt Exp $ */ |
|
/* |
/* |
* Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved. |
* Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved. |
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file |
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file |
Line 25 static char *const err2text[] = {
|
Line 24 static char *const err2text[] = {
|
"Success", |
"Success", |
"Out of memory", |
"Out of memory", |
"ObjectClass not found", |
"ObjectClass not found", |
|
"ObjectClass inappropriate SUPerior", |
"AttributeType not found", |
"AttributeType not found", |
|
"AttributeType inappropriate USAGE", |
"Duplicate objectClass", |
"Duplicate objectClass", |
"Duplicate attributeType", |
"Duplicate attributeType", |
"Duplicate ldapSyntax", |
"Duplicate ldapSyntax", |
Line 78 find_oidm(char *oid)
|
Line 79 find_oidm(char *oid)
|
OidMacro *om; |
OidMacro *om; |
|
|
/* OID macros must start alpha */ |
/* OID macros must start alpha */ |
if ( isdigit( *oid ) ) { |
if ( OID_LEADCHAR( *oid ) ) { |
return oid; |
return oid; |
} |
} |
|
|
Line 166 parse_oc(
|
Line 167 parse_oc(
|
char **argv |
char **argv |
) |
) |
{ |
{ |
LDAP_OBJECT_CLASS *oc; |
LDAPObjectClass *oc; |
int code; |
int code; |
const char *err; |
const char *err; |
char *oid = NULL; |
char *oid = NULL; |
Line 178 parse_oc(
|
Line 179 parse_oc(
|
oc_usage(); |
oc_usage(); |
} |
} |
if ( oc->oc_oid ) { |
if ( oc->oc_oid ) { |
if ( !isdigit( oc->oc_oid[0] )) { |
if ( !OID_LEADCHAR( oc->oc_oid[0] )) { |
/* Expand OID macros */ |
/* Expand OID macros */ |
oid = find_oidm( oc->oc_oid ); |
oid = find_oidm( oc->oc_oid ); |
if ( !oid ) { |
if ( !oid ) { |
Line 257 parse_at(
|
Line 258 parse_at(
|
char **argv |
char **argv |
) |
) |
{ |
{ |
LDAP_ATTRIBUTE_TYPE *at; |
LDAPAttributeType *at; |
int code; |
int code; |
const char *err; |
const char *err; |
char *oid = NULL; |
char *oid = NULL; |
Line 272 parse_at(
|
Line 273 parse_at(
|
for (; argv[3]; argv++) |
for (; argv[3]; argv++) |
{ |
{ |
if (!strcasecmp(argv[3], "syntax") && |
if (!strcasecmp(argv[3], "syntax") && |
!isdigit(*argv[4])) |
!OID_LEADCHAR(*argv[4])) |
{ |
{ |
int slen; |
int slen; |
Syntax *syn; |
Syntax *syn; |
Line 295 parse_at(
|
Line 296 parse_at(
|
at_usage(); |
at_usage(); |
} |
} |
if ( at->at_oid ) { |
if ( at->at_oid ) { |
if ( !isdigit( at->at_oid[0] )) { |
if ( !OID_LEADCHAR( at->at_oid[0] )) { |
/* Expand OID macros */ |
/* Expand OID macros */ |
oid = find_oidm( at->at_oid ); |
oid = find_oidm( at->at_oid ); |
if ( !oid ) { |
if ( !oid ) { |
Line 311 parse_at(
|
Line 312 parse_at(
|
} |
} |
} |
} |
/* at->at_oid == NULL will be an error someday */ |
/* at->at_oid == NULL will be an error someday */ |
if (soid) |
if (soid) { |
{ |
|
ldap_memfree(at->at_syntax_oid); |
ldap_memfree(at->at_syntax_oid); |
at->at_syntax_oid = soid; |
at->at_syntax_oid = soid; |
} |
} |