diff options
author | Kamen Mazdrashki <kamenim@samba.org> | 2010-04-08 08:27:07 +0300 |
---|---|---|
committer | Kamen Mazdrashki <kamenim@samba.org> | 2010-04-09 12:21:33 +0300 |
commit | fbef33fb7369f57e6851d3766f87c953ca2d26bd (patch) | |
tree | 1b4e78bad78e959f96919c48b428172b5f1c3fbc /source4/dsdb | |
parent | 2763a4ac4e8c93701e00a3baa9fb2dfa24b776f4 (diff) | |
download | samba-fbef33fb7369f57e6851d3766f87c953ca2d26bd.tar.gz samba-fbef33fb7369f57e6851d3766f87c953ca2d26bd.tar.bz2 samba-fbef33fb7369f57e6851d3766f87c953ca2d26bd.zip |
s4/dsdb: Let caller to control if valid invocationId is critical or zero-guid is acceptable
Diffstat (limited to 'source4/dsdb')
-rw-r--r-- | source4/dsdb/schema/schema_info_attr.c | 7 | ||||
-rw-r--r-- | source4/dsdb/schema/schema_init.c | 2 | ||||
-rw-r--r-- | source4/dsdb/schema/schema_set.c | 2 |
3 files changed, 8 insertions, 3 deletions
diff --git a/source4/dsdb/schema/schema_info_attr.c b/source4/dsdb/schema/schema_info_attr.c index 2d3dfc827c..21ffb1d79f 100644 --- a/source4/dsdb/schema/schema_info_attr.c +++ b/source4/dsdb/schema/schema_info_attr.c @@ -297,14 +297,19 @@ static WERROR dsdb_module_schema_info_write(struct ldb_module *ldb_module, /** * Creates new dsdb_schema_info object using * invocationId from supplied ldb + * @param check_invocation_id Error out if invocationId is not yet set */ -WERROR dsdb_schema_info_create(struct ldb_context *ldb, TALLOC_CTX *mem_ctx, struct dsdb_schema_info **_schema_info) +WERROR dsdb_schema_info_create(struct ldb_context *ldb, bool check_invocation_id, + TALLOC_CTX *mem_ctx, struct dsdb_schema_info **_schema_info) { const struct GUID *invocation_id; struct dsdb_schema_info *schema_info; /* try to determine invocationId from ldb */ invocation_id = samdb_ntds_invocation_id(ldb); + if (check_invocation_id && !invocation_id) { + return WERR_INTERNAL_DB_CORRUPTION; + } schema_info = talloc(mem_ctx, struct dsdb_schema_info); if (!schema_info) { diff --git a/source4/dsdb/schema/schema_init.c b/source4/dsdb/schema/schema_init.c index 1f2b1b8e17..eb3400cedc 100644 --- a/source4/dsdb/schema/schema_init.c +++ b/source4/dsdb/schema/schema_init.c @@ -736,7 +736,7 @@ int dsdb_schema_from_ldb_results(TALLOC_CTX *mem_ctx, struct ldb_context *ldb, if (!info_val) { struct dsdb_schema_info *schema_info; - status = dsdb_schema_info_create(ldb, mem_ctx, &schema_info); + status = dsdb_schema_info_create(ldb, false, mem_ctx, &schema_info); if (!W_ERROR_IS_OK(status)) { *error_string = talloc_asprintf(mem_ctx, "schema_fsmo_init: dsdb_schema_info_create() failed - %s", diff --git a/source4/dsdb/schema/schema_set.c b/source4/dsdb/schema/schema_set.c index 9dcf2b8d42..f0c3c068cd 100644 --- a/source4/dsdb/schema/schema_set.c +++ b/source4/dsdb/schema/schema_set.c @@ -623,7 +623,7 @@ WERROR dsdb_set_schema_from_ldif(struct ldb_context *ldb, const char *pf, const info_val = ldb_msg_find_ldb_val(msg, "schemaInfo"); if (!info_val) { - status = dsdb_schema_info_create(ldb, mem_ctx, &schema_info); + status = dsdb_schema_info_create(ldb, false, mem_ctx, &schema_info); W_ERROR_NOT_OK_GOTO(status, failed); status = dsdb_blob_from_schema_info(schema_info, mem_ctx, &info_val_default); W_ERROR_NOT_OK_GOTO(status, failed); |