summaryrefslogtreecommitdiff
path: root/source3/lib/util_reg_smbconf.c
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-01-09 00:11:31 +0100
committerMichael Adam <obnox@samba.org>2008-01-09 01:47:10 +0100
commitf3603d5a5ab878d45b67bf0f33e2beca50d0af2d (patch)
tree5d9cd096404ddc55941cbc60751ce19fa4146411 /source3/lib/util_reg_smbconf.c
parentde53e47c76cc6dfdc8056be1e376549b9e8a94a4 (diff)
downloadsamba-f3603d5a5ab878d45b67bf0f33e2beca50d0af2d.tar.gz
samba-f3603d5a5ab878d45b67bf0f33e2beca50d0af2d.tar.bz2
samba-f3603d5a5ab878d45b67bf0f33e2beca50d0af2d.zip
Convert add_sid_to_array() add_sid_to_array_unique() to return NTSTATUS.
Michael (This used to be commit 6b2b9a60ef857ec31da5fea631535205fbdede4a)
Diffstat (limited to 'source3/lib/util_reg_smbconf.c')
-rw-r--r--source3/lib/util_reg_smbconf.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/source3/lib/util_reg_smbconf.c b/source3/lib/util_reg_smbconf.c
index fa58f28d03..472fef7a2d 100644
--- a/source3/lib/util_reg_smbconf.c
+++ b/source3/lib/util_reg_smbconf.c
@@ -30,18 +30,21 @@ extern REGISTRY_OPS smbconf_reg_ops;
*/
NT_USER_TOKEN *registry_create_admin_token(TALLOC_CTX *mem_ctx)
{
+ NTSTATUS status;
NT_USER_TOKEN *token = NULL;
/* fake a user token: builtin administrators sid and the
* disk operators privilege is all we need to access the
* registry... */
- if (!(token = TALLOC_ZERO_P(mem_ctx, NT_USER_TOKEN))) {
+ token = TALLOC_ZERO_P(mem_ctx, NT_USER_TOKEN);
+ if (token == NULL) {
DEBUG(1, ("talloc failed\n"));
goto done;
}
token->privileges = se_disk_operators;
- if (!add_sid_to_array(token, &global_sid_Builtin_Administrators,
- &token->user_sids, &token->num_sids)) {
+ status = add_sid_to_array(token, &global_sid_Builtin_Administrators,
+ &token->user_sids, &token->num_sids);
+ if (!NT_STATUS_IS_OK(status)) {
DEBUG(1, ("Error adding builtin administrators sid "
"to fake token.\n"));
goto done;