summaryrefslogtreecommitdiffstats
path: root/ldap/servers/slapd/schema.c
diff options
context:
space:
mode:
authorRich Megginson <rmeggins@redhat.com>2010-05-26 12:18:34 -0600
committerRich Megginson <rmeggins@redhat.com>2010-05-26 14:06:33 -0600
commit2e8fc55fcc185577d0973eae58f1f8f26cbd442b (patch)
tree90f5e9ec147e0999c60de0cae70e1674f5ae9af8 /ldap/servers/slapd/schema.c
parent8e6e74009c80a7032308657e71450cb5aed9483c (diff)
downloadds-2e8fc55fcc185577d0973eae58f1f8f26cbd442b.tar.gz
ds-2e8fc55fcc185577d0973eae58f1f8f26cbd442b.tar.xz
ds-2e8fc55fcc185577d0973eae58f1f8f26cbd442b.zip
Bug 595874 - 99user.ldif getting overpopulated389-ds-base-1.2.6.a4
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
Diffstat (limited to 'ldap/servers/slapd/schema.c')
-rw-r--r--ldap/servers/slapd/schema.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/ldap/servers/slapd/schema.c b/ldap/servers/slapd/schema.c
index 56c1b54c..72c4898b 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;
}