summaryrefslogtreecommitdiffstats
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:07:53 -0600
commitdf777e3de911e3b5428938a7f1c91b76678fb0e2 (patch)
treefe966341839076fb556bdee7e1ecdc677a97485a
parent84b40e3a1d249ec7d74a3d89ca1bb3294ab65e6d (diff)
downloadds-df777e3de911e3b5428938a7f1c91b76678fb0e2.tar.gz
ds-df777e3de911e3b5428938a7f1c91b76678fb0e2.tar.xz
ds-df777e3de911e3b5428938a7f1c91b76678fb0e2.zip
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: Directory_Server_8_2_Branch 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 (cherry picked from commit 2e8fc55fcc185577d0973eae58f1f8f26cbd442b)
-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 45cfa5fe..6a6fe4c6 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;
}