mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-11 01:12:54 -05:00
Add HARDCODE schema flags
This commit is contained in:
parent
09919ad2c8
commit
fba9235d0f
12 changed files with 23 additions and 12 deletions
|
|
@ -313,6 +313,7 @@ at_insert(
|
|||
int
|
||||
at_add(
|
||||
LDAPAttributeType *at,
|
||||
int user,
|
||||
const char **err )
|
||||
{
|
||||
AttributeType *sat;
|
||||
|
|
@ -451,6 +452,9 @@ at_add(
|
|||
}
|
||||
}
|
||||
|
||||
if ( !user )
|
||||
sat->sat_flags |= SLAP_AT_HARDCODE;
|
||||
|
||||
if ( at->at_syntax_oid ) {
|
||||
syn = syn_find(sat->sat_syntax_oid);
|
||||
if ( syn == NULL ) {
|
||||
|
|
|
|||
|
|
@ -1035,7 +1035,7 @@ monitor_back_db_init(
|
|||
return -1;
|
||||
}
|
||||
|
||||
code = at_add(at, &err);
|
||||
code = at_add(at, 0, &err);
|
||||
if ( code ) {
|
||||
Debug( LDAP_DEBUG_ANY, "monitor_back_db_init: "
|
||||
"%s in attributeType \"%s\"\n",
|
||||
|
|
|
|||
|
|
@ -899,7 +899,7 @@ config_generic(ConfigArgs *c) {
|
|||
break;
|
||||
|
||||
case CFG_OID:
|
||||
if(parse_oidm(c->fname, c->lineno, c->argc, c->argv)) return(0);
|
||||
if(parse_oidm(c->fname, c->lineno, c->argc, c->argv, 1)) return(0);
|
||||
break;
|
||||
|
||||
case CFG_OC:
|
||||
|
|
@ -3547,7 +3547,7 @@ config_back_initialize( BackendInfo *bi )
|
|||
for (i=0; OidMacros[i].name; i++ ) {
|
||||
argv[1] = OidMacros[i].name;
|
||||
argv[2] = OidMacros[i].oid;
|
||||
parse_oidm( "slapd", i, 3, argv );
|
||||
parse_oidm( "slapd", i, 3, argv, 0 );
|
||||
}
|
||||
|
||||
bi->bi_cf_table = ct;
|
||||
|
|
|
|||
|
|
@ -404,7 +404,7 @@ init_config_attrs(ConfigTable *ct) {
|
|||
ct[i].attribute, ldap_scherr2str(code), err );
|
||||
return code;
|
||||
}
|
||||
code = at_add( at, &err );
|
||||
code = at_add( at, 0, &err );
|
||||
if ( code && code != SLAP_SCHERR_ATTR_DUP ) {
|
||||
fprintf( stderr, "init_config_attrs: AttributeType \"%s\": %s, %s\n",
|
||||
ct[i].attribute, scherr2str(code), err );
|
||||
|
|
|
|||
|
|
@ -95,7 +95,8 @@ parse_oidm(
|
|||
const char *fname,
|
||||
int lineno,
|
||||
int argc,
|
||||
char **argv )
|
||||
char **argv,
|
||||
int user )
|
||||
{
|
||||
char *oid;
|
||||
OidMacro *om;
|
||||
|
|
@ -143,6 +144,8 @@ usage: fprintf( stderr, "\tObjectIdentifier <name> <oid>\n");
|
|||
}
|
||||
|
||||
om->som_oid.bv_len = strlen( om->som_oid.bv_val );
|
||||
if ( !user )
|
||||
om->som_flags |= SLAP_OM_HARDCODE;
|
||||
|
||||
LDAP_SLIST_INSERT_HEAD( &om_list, om, som_next );
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -781,7 +781,7 @@ lastmod_db_init(
|
|||
return -1;
|
||||
}
|
||||
|
||||
code = at_add(at, &err);
|
||||
code = at_add(at, 0, &err);
|
||||
if ( code ) {
|
||||
Debug( LDAP_DEBUG_ANY, "lastmod_init: "
|
||||
"%s in attributeType '%s'\n",
|
||||
|
|
|
|||
|
|
@ -1925,7 +1925,7 @@ int pcache_init()
|
|||
ldap_scherr2str(code), err );
|
||||
return code;
|
||||
}
|
||||
code = at_add( at, &err );
|
||||
code = at_add( at, 0, &err );
|
||||
if ( !code ) {
|
||||
slap_str2ad( at->at_names[0], &ad_queryid, &err );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1797,7 +1797,7 @@ int ppolicy_init()
|
|||
ldap_scherr2str(code), err );
|
||||
return code;
|
||||
}
|
||||
code = at_add( at, &err );
|
||||
code = at_add( at, 0, &err );
|
||||
if ( !code ) {
|
||||
slap_str2ad( at->at_names[0], pwd_OpSchema[i].ad, &err );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ LDAP_SLAPD_F (int) at_delete_from_list LDAP_P((
|
|||
int pos, AttributeType ***listp ));
|
||||
LDAP_SLAPD_F (int) at_schema_info LDAP_P(( Entry *e ));
|
||||
LDAP_SLAPD_F (int) at_add LDAP_P((
|
||||
LDAPAttributeType *at, const char **err ));
|
||||
LDAPAttributeType *at, int user, const char **err ));
|
||||
LDAP_SLAPD_F (void) at_destroy LDAP_P(( void ));
|
||||
|
||||
LDAP_SLAPD_F (int) is_at_subtype LDAP_P((
|
||||
|
|
@ -1008,7 +1008,7 @@ LDAP_SLAPD_F(char *) oidm_find(char *oid);
|
|||
LDAP_SLAPD_F (void) oidm_destroy LDAP_P(( void ));
|
||||
LDAP_SLAPD_F (void) oidm_unparse LDAP_P(( BerVarray *bva ));
|
||||
LDAP_SLAPD_F (int) parse_oidm LDAP_P((
|
||||
const char *fname, int lineno, int argc, char **argv ));
|
||||
const char *fname, int lineno, int argc, char **argv, int user ));
|
||||
|
||||
/*
|
||||
* operation.c
|
||||
|
|
|
|||
|
|
@ -1124,7 +1124,7 @@ slap_schema_load( void )
|
|||
return LDAP_OTHER;
|
||||
}
|
||||
|
||||
code = at_add( at, &err );
|
||||
code = at_add( at, 0, &err );
|
||||
if ( code ) {
|
||||
fprintf( stderr, "slap_schema_load: AttributeType "
|
||||
"\"%s\": %s: \"%s\"\n",
|
||||
|
|
|
|||
|
|
@ -274,7 +274,7 @@ parse_at(
|
|||
return 1;
|
||||
}
|
||||
|
||||
code = at_add(at,&err);
|
||||
code = at_add(at,1,&err);
|
||||
if ( code ) {
|
||||
fprintf( stderr, "%s: line %d: %s: \"%s\"\n",
|
||||
fname, lineno, scherr2str(code), err);
|
||||
|
|
|
|||
|
|
@ -323,6 +323,8 @@ typedef struct slap_oid_macro {
|
|||
struct berval som_oid;
|
||||
BerVarray som_names;
|
||||
BerVarray som_subs;
|
||||
#define SLAP_OM_HARDCODE 0x10000U /* This is hardcoded schema */
|
||||
int som_flags;
|
||||
LDAP_SLIST_ENTRY(slap_oid_macro) som_next;
|
||||
} OidMacro;
|
||||
|
||||
|
|
@ -649,6 +651,7 @@ typedef struct slap_attribute_type {
|
|||
#define SLAP_AT_DYNAMIC 0x0400U /* dynamically generated */
|
||||
|
||||
#define SLAP_AT_ORDERED 0x0001U /* values are ordered */
|
||||
#define SLAP_AT_HARDCODE 0x10000U /* This is hardcoded schema */
|
||||
|
||||
slap_mask_t sat_flags;
|
||||
|
||||
|
|
@ -725,6 +728,7 @@ typedef struct slap_object_class {
|
|||
#else
|
||||
#define SLAP_OC_HIDE 0x8000
|
||||
#endif
|
||||
#define SLAP_OC_HARDCODE 0x10000U /* This is hardcoded schema */
|
||||
|
||||
/*
|
||||
* DIT content rule
|
||||
|
|
|
|||
Loading…
Reference in a new issue