From: Kamen Mazdrashki Date: Thu, 22 Apr 2010 15:11:39 +0000 (+0300) Subject: s4/dsdb: Update Schema cache with updated schemaInfo value X-Git-Url: http://git.samba.org/?p=metze%2Fsamba%2Fwip.git;a=commitdiff_plain;h=2264d917ae626d6f2d8f5d2c128a4a95a4066665 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. --- diff --git a/source4/dsdb/schema/schema_info_attr.c b/source4/dsdb/schema/schema_info_attr.c index 44a12ad629db..51fba90ec1df 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;