summaryrefslogtreecommitdiff
path: root/source4/dsdb
diff options
context:
space:
mode:
authorKamen Mazdrashki <kamenim@samba.org>2010-04-22 18:11:39 +0300
committerKamen Mazdrashki <kamenim@samba.org>2010-04-29 04:54:07 +0300
commit2264d917ae626d6f2d8f5d2c128a4a95a4066665 (patch)
tree58c07b2ccb513825cc1404adcf2e66aa5afbfa3a /source4/dsdb
parente41eac96afb1d6d465faeb1e4e9a669cff1b8bc1 (diff)
downloadsamba-2264d917ae626d6f2d8f5d2c128a4a95a4066665.tar.gz
samba-2264d917ae626d6f2d8f5d2c128a4a95a4066665.tar.bz2
samba-2264d917ae626d6f2d8f5d2c128a4a95a4066665.zip
s4/dsdb: Update Schema cache with updated schemaInfo value
Error checking is simplified and my leave leeks. I did it this way to make code more readable, and if we get error in those lines, it will be WERR_NOMEM in which case we are in a much deeper troubles than delayed freeing of few bytes.
Diffstat (limited to 'source4/dsdb')
-rw-r--r--source4/dsdb/schema/schema_info_attr.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/source4/dsdb/schema/schema_info_attr.c b/source4/dsdb/schema/schema_info_attr.c
index 44a12ad629..51fba90ec1 100644
--- a/source4/dsdb/schema/schema_info_attr.c
+++ b/source4/dsdb/schema/schema_info_attr.c
@@ -407,7 +407,9 @@ WERROR dsdb_module_schema_info_update(struct ldb_module *ldb_module,
{
WERROR werr;
const struct GUID *invocation_id;
+ DATA_BLOB ndr_blob;
struct dsdb_schema_info *schema_info;
+ const char *schema_info_str;
TALLOC_CTX *temp_ctx = talloc_new(schema);
W_ERROR_HAVE_NO_MEMORY(temp_ctx);
@@ -444,11 +446,14 @@ WERROR dsdb_module_schema_info_update(struct ldb_module *ldb_module,
}
/* finally, update schema_info in the cache */
- /* TODO: update schema_info in dsdb_schema cache */
-/*
+ werr = dsdb_blob_from_schema_info(schema_info, temp_ctx, &ndr_blob);
+ W_ERROR_NOT_OK_RETURN(werr);
+
+ schema_info_str = hex_encode_talloc(schema, ndr_blob.data, ndr_blob.length);
+ W_ERROR_HAVE_NO_MEMORY(schema_info_str);
+
talloc_unlink(schema, discard_const(schema->schema_info));
- schema->schema_info = talloc_steal(schema, schema_info);
-*/
+ schema->schema_info = schema_info_str;
talloc_free(temp_ctx);
return WERR_OK;