summaryrefslogtreecommitdiff
path: root/source4/dsdb/schema/schema_init.c
diff options
context:
space:
mode:
authorKamen Mazdrashki <kamenim@samba.org>2010-09-17 02:48:50 +0300
committerKamen Mazdrashki <kamenim@samba.org>2010-09-17 13:53:03 +0300
commit1295da92f9a5272b73a0abcecb680f7c0d5bc854 (patch)
tree446808a19beb34242c33210b9010134e6717ccbd /source4/dsdb/schema/schema_init.c
parentaedefd3e99f36d11e49e6fbf51cb16ceffec13c4 (diff)
downloadsamba-1295da92f9a5272b73a0abcecb680f7c0d5bc854.tar.gz
samba-1295da92f9a5272b73a0abcecb680f7c0d5bc854.tar.bz2
samba-1295da92f9a5272b73a0abcecb680f7c0d5bc854.zip
s4-schema: use dsdb_schema_info_blob_is_valid() to verify schemaInfo blob
instead of parsing it.
Diffstat (limited to 'source4/dsdb/schema/schema_init.c')
-rw-r--r--source4/dsdb/schema/schema_init.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/source4/dsdb/schema/schema_init.c b/source4/dsdb/schema/schema_init.c
index a95e7ec2af..ba12f523e8 100644
--- a/source4/dsdb/schema/schema_init.c
+++ b/source4/dsdb/schema/schema_init.c
@@ -113,20 +113,17 @@ WERROR dsdb_load_oid_mappings_ldb(struct dsdb_schema *schema,
WERROR werr;
const char *schema_info;
struct dsdb_schema_prefixmap *pfm;
- struct dsdb_schema_info *schi;
TALLOC_CTX *mem_ctx;
+ /* verify schemaInfo blob is valid one */
+ if (!dsdb_schema_info_blob_is_valid(schemaInfo)) {
+ DEBUG(0,(__location__": dsdb_schema_info_blob_is_valid() failed.\n"));
+ return WERR_INVALID_PARAMETER;
+ }
+
mem_ctx = talloc_new(schema);
W_ERROR_HAVE_NO_MEMORY(mem_ctx);
- /* parse schemaInfo blob to verify it is valid */
- werr = dsdb_schema_info_from_blob(schemaInfo, mem_ctx, &schi);
- if (!W_ERROR_IS_OK(werr)) {
- DEBUG(0, (__location__ " dsdb_schema_info_from_blob failed: %s\n", win_errstr(werr)));
- talloc_free(mem_ctx);
- return werr;
- }
-
/* fetch prefixMap */
werr = _dsdb_prefixmap_from_ldb_val(prefixMap,
mem_ctx, &pfm);