mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
s4/dsdb: remove unused dsdb_schema_info_create() function
This commit is contained in:
parent
2264d917ae
commit
a8438015ca
@ -356,41 +356,6 @@ 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, 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) {
|
||||
return WERR_NOMEM;
|
||||
}
|
||||
|
||||
schema_info->revision = 1;
|
||||
if (invocation_id) {
|
||||
schema_info->invocation_id = *invocation_id;
|
||||
} else {
|
||||
schema_info->invocation_id = GUID_zero();
|
||||
}
|
||||
|
||||
*_schema_info = schema_info;
|
||||
|
||||
return WERR_OK;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Increments schemaInfo revision and save it to DB
|
||||
* setting our invocationID in the process
|
||||
|
@ -344,29 +344,6 @@ static bool test_dsdb_module_schema_info_update(struct torture_context *tctx,
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* Tests dsdb_schema_info_create()
|
||||
*/
|
||||
static bool test_dsdb_schema_info_create(struct torture_context *tctx,
|
||||
struct drsut_schemainfo_data *priv)
|
||||
{
|
||||
WERROR werr;
|
||||
struct dsdb_schema_info *schema_info = NULL;
|
||||
|
||||
werr = dsdb_schema_info_create(priv->ldb, true, priv, &schema_info);
|
||||
torture_assert_werr_ok(tctx, werr, "dsdb_schema_info_create() failed");
|
||||
|
||||
torture_assert(tctx, schema_info, "schema_info is NULL after dsdb_schema_info_create()");
|
||||
torture_assert_int_equal(tctx, schema_info->revision, 1, "Invalid schemaInfo revision");
|
||||
torture_assert(tctx,
|
||||
GUID_equal(&schema_info->invocation_id, &priv->schema_info->invocation_id),
|
||||
"Invalid invocationId returned");
|
||||
|
||||
talloc_free(schema_info);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Reset schemaInfo record to know value
|
||||
@ -574,8 +551,6 @@ struct torture_tcase * torture_drs_unit_schemainfo(struct torture_suite *suite)
|
||||
(pfn_run)test_dsdb_blob_from_schema_info);
|
||||
torture_tcase_add_simple_test(tc, "dsdb_module_schema_info_blob read|write",
|
||||
(pfn_run)test_dsdb_module_schema_info_blob_rw);
|
||||
torture_tcase_add_simple_test(tc, "dsdb_schema_info_create",
|
||||
(pfn_run)test_dsdb_schema_info_create);
|
||||
torture_tcase_add_simple_test(tc, "dsdb_module_schema_info_update",
|
||||
(pfn_run)test_dsdb_module_schema_info_update);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user