diff options
Diffstat (limited to 'source4')
-rw-r--r-- | source4/torture/rpc/samsync.c | 49 |
1 files changed, 45 insertions, 4 deletions
diff --git a/source4/torture/rpc/samsync.c b/source4/torture/rpc/samsync.c index 7249705bf7..81027d0658 100644 --- a/source4/torture/rpc/samsync.c +++ b/source4/torture/rpc/samsync.c @@ -423,6 +423,15 @@ static bool samsync_handle_policy(struct torture_context *tctx, { struct netr_DELTA_POLICY *policy = delta->delta_union.policy; + switch (database_id) { + case SAM_DATABASE_DOMAIN: + case SAM_DATABASE_BUILTIN: + break; + case SAM_DATABASE_PRIVS: + torture_comment(tctx, "DOMAIN entry on privs DB!\n"); + return false; + } + samsync_state->seq_num[database_id] = policy->sequence_num; @@ -459,11 +468,22 @@ static bool samsync_handle_user(struct torture_context *tctx, TALLOC_CTX *mem_ct struct samr_Password nt_hash; struct samr_Password *lm_hash_p = NULL; struct samr_Password *nt_hash_p = NULL; - const char *domain = samsync_state->domain_name[database_id]; + const char *domain; const char *username = user->account_name.string; NTSTATUS nt_status; bool ret = true; + switch (database_id) { + case SAM_DATABASE_DOMAIN: + case SAM_DATABASE_BUILTIN: + break; + case SAM_DATABASE_PRIVS: + torture_comment(tctx, "DOMAIN entry on privs DB!\n"); + return false; + } + + domain = samsync_state->domain_name[database_id]; + struct samr_OpenUser r; struct samr_QueryUserInfo q; union samr_UserInfo *info; @@ -472,7 +492,8 @@ static bool samsync_handle_user(struct torture_context *tctx, TALLOC_CTX *mem_ct struct samr_GetGroupsForUser getgroups; struct samr_RidWithAttributeArray *rids; - if (!samsync_state->domain_name || !samsync_state->domain_handle[database_id]) { + if (domain == NULL || + samsync_state->domain_handle[database_id] == NULL) { torture_comment(tctx, "SamSync needs domain information before the users\n"); return false; } @@ -747,7 +768,17 @@ static bool samsync_handle_alias(struct torture_context *tctx, union samr_AliasInfo *info; struct policy_handle alias_handle; - if (!samsync_state->domain_name || !samsync_state->domain_handle[database_id]) { + switch (database_id) { + case SAM_DATABASE_DOMAIN: + case SAM_DATABASE_BUILTIN: + break; + case SAM_DATABASE_PRIVS: + torture_comment(tctx, "DOMAIN entry on privs DB!\n"); + return false; + } + + if (samsync_state->domain_name[database_id] == NULL || + samsync_state->domain_handle[database_id] == NULL) { torture_comment(tctx, "SamSync needs domain information before the users\n"); return false; } @@ -800,7 +831,17 @@ static bool samsync_handle_group(struct torture_context *tctx, union samr_GroupInfo *info; struct policy_handle group_handle; - if (!samsync_state->domain_name || !samsync_state->domain_handle[database_id]) { + switch (database_id) { + case SAM_DATABASE_DOMAIN: + case SAM_DATABASE_BUILTIN: + break; + case SAM_DATABASE_PRIVS: + torture_comment(tctx, "DOMAIN entry on privs DB!\n"); + return false; + } + + if (samsync_state->domain_name[database_id] == NULL || + samsync_state->domain_handle[database_id] == NULL) { torture_comment(tctx, "SamSync needs domain information before the users\n"); return false; } |