From: Kurt Zeilenga Date: Wed, 11 May 2005 22:24:18 +0000 (+0000) Subject: Mostly remove global_schemacheck. More cleanup needed in X-Git-Tag: OPENLDAP_AC_BP~667 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c83f7539ae968fbb834b92146ce217623069a4ae;p=openldap Mostly remove global_schemacheck. More cleanup needed in bconfig.c and back-sql. --- diff --git a/servers/slapd/bconfig.c b/servers/slapd/bconfig.c index a157ee49e8..b738a9871e 100644 --- a/servers/slapd/bconfig.c +++ b/servers/slapd/bconfig.c @@ -1089,10 +1089,12 @@ config_generic(ConfigArgs *c) { break; case CFG_CHECK: +#if 0 global_schemacheck = c->value_int; if(!global_schemacheck) Debug(LDAP_DEBUG_ANY, "%s: " "schema checking disabled! your mileage may vary!\n", c->log, 0, 0); +#endif break; case CFG_ACL: diff --git a/servers/slapd/modify.c b/servers/slapd/modify.c index f9c64d4c9f..f80cebdf66 100644 --- a/servers/slapd/modify.c +++ b/servers/slapd/modify.c @@ -842,7 +842,7 @@ int slap_mods_opattrs( if( op->o_tag == LDAP_REQ_ADD ) { struct berval tmpval; - if( global_schemacheck ) { + { int rc = mods_structural_class( mods, &tmpval, text, textbuf, textlen ); if( rc != LDAP_SUCCESS ) return rc; diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h index e2175c2279..2b63204f90 100644 --- a/servers/slapd/proto-slap.h +++ b/servers/slapd/proto-slap.h @@ -1495,7 +1495,9 @@ LDAP_SLAPD_V (const char) Versionstr[]; LDAP_SLAPD_V (int) global_gentlehup; LDAP_SLAPD_V (int) global_idletimeout; -LDAP_SLAPD_V (int) global_schemacheck; + +#define global_schemacheck (1) + LDAP_SLAPD_V (char *) global_host; LDAP_SLAPD_V (char *) global_realm; LDAP_SLAPD_V (char **) default_passwd_hash; diff --git a/servers/slapd/schema_check.c b/servers/slapd/schema_check.c index 253849d378..cdf21460ca 100644 --- a/servers/slapd/schema_check.c +++ b/servers/slapd/schema_check.c @@ -111,9 +111,6 @@ entry_schema_check( } } - /* it's a REALLY bad idea to disable schema checks */ - if( !global_schemacheck ) return LDAP_SUCCESS; - /* find the structural object class attribute */ asc = attr_find( e->e_attrs, ad_structuralObjectClass ); if ( asc == NULL ) { diff --git a/servers/slapd/schemaparse.c b/servers/slapd/schemaparse.c index d0b0d5b77a..0834dc0ae8 100644 --- a/servers/slapd/schemaparse.c +++ b/servers/slapd/schemaparse.c @@ -25,8 +25,6 @@ #include "slap.h" #include "ldap_schema.h" -int global_schemacheck = 1; /* schemacheck ON is default */ - static void oc_usage(void); static void at_usage(void); diff --git a/servers/slapd/slapadd.c b/servers/slapd/slapadd.c index 7aa4ee2931..1ee67a86b4 100644 --- a/servers/slapd/slapadd.c +++ b/servers/slapd/slapadd.c @@ -145,7 +145,7 @@ slapadd( int argc, char **argv ) break; } - if( global_schemacheck ) { + { Attribute *sc = attr_find( e->e_attrs, slap_schema.si_ad_structuralObjectClass ); Attribute *oc = attr_find( e->e_attrs, @@ -176,7 +176,8 @@ slapadd( int argc, char **argv ) break; } - attr_merge_one( e, slap_schema.si_ad_structuralObjectClass, &val, NULL ); + attr_merge_one( e, slap_schema.si_ad_structuralObjectClass, + &val, NULL ); } /* check schema */