ldap/servers/slapd/schema.c | 22 ++++++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
New commits:
commit 2e8fc55fcc185577d0973eae58f1f8f26cbd442b
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Wed May 26 12:18:34 2010 -0600
Bug 595874 - 99user.ldif getting overpopulated
https://bugzilla.redhat.com/show_bug.cgi?id=595874
Resolves: bug 595874
Bug Description: 99user.ldif getting overpopulated
Reviewed by: self
Branch: HEAD
Fix Description: The schema code was adding X-ORIGIN 'user defined' to all
schema elements that had no X-ORIGIN. It should only add user defined to
schema elements from the user defined schema file, not to schema defined
in standard (read only) schema files. It looks like the code should work
fine if the schema element has no origin, so there is no reason to add
an origin for schema other than user defined schema.
Platforms tested: RHEL5 x86_64
Flag Day: no
Doc impact: no
diff --git a/ldap/servers/slapd/schema.c b/ldap/servers/slapd/schema.c
index 56c1b54..72c4898 100644
--- a/ldap/servers/slapd/schema.c
+++ b/ldap/servers/slapd/schema.c
@@ -2976,8 +2976,14 @@ read_oc_ldif ( const char *input, struct objclass **oc, char
*errorbuf,
if ( schema_ds4x_compat ) nextinput = input;
/* look for X-ORIGIN list */
- oc_origins = parse_origin_list( nextinput, &num_origins,
- schema_user_defined_origin );
+ if (is_user_defined) {
+ /* add X-ORIGIN 'user defined' */
+ oc_origins = parse_origin_list( nextinput, &num_origins,
+ schema_user_defined_origin );
+ } else {
+ /* add nothing */
+ oc_origins = parse_origin_list( nextinput, &num_origins, NULL );
+ }
/* set remaining flags */
if ( element_is_user_defined( oc_origins )) {
@@ -3377,8 +3383,14 @@ read_at_ldif(const char *input, struct asyntaxinfo **asipp, char
*errorbuf,
if ( schema_ds4x_compat ) nextinput = input;
/* X-ORIGIN list */
- attr_origins = parse_origin_list( nextinput, &num_origins,
- schema_user_defined_origin );
+ if (is_user_defined) {
+ /* add X-ORIGIN 'user defined' */
+ attr_origins = parse_origin_list( nextinput, &num_origins,
+ schema_user_defined_origin );
+ } else {
+ /* add nothing */
+ attr_origins = parse_origin_list( nextinput, &num_origins, NULL );
+ }
/* Do some sanity checking to make sure everything was read correctly */
@@ -4561,9 +4573,11 @@ parse_origin_list( const char *schema_value, int *num_originsp,
origins[i] = NULL;
}
+/* for debugging
if ( origins == NULL || origins[0] == NULL ) {
LDAPDebug( LDAP_DEBUG_ANY, "no origin (%s)\n", schema_value, 0, 0 );
}
+*/
return origins;
}