summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/util_reg_smbconf.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/source3/lib/util_reg_smbconf.c b/source3/lib/util_reg_smbconf.c
index 5fb862ac35..6452b0b15b 100644
--- a/source3/lib/util_reg_smbconf.c
+++ b/source3/lib/util_reg_smbconf.c
@@ -31,14 +31,20 @@ extern REGISTRY_OPS smbconf_reg_ops;
* - builtin administrators sid
* - disk operators privilege
*/
-NT_USER_TOKEN *registry_create_admin_token(TALLOC_CTX *mem_ctx)
+NTSTATUS registry_create_admin_token(TALLOC_CTX *mem_ctx,
+ NT_USER_TOKEN **ptoken)
{
NTSTATUS status;
NT_USER_TOKEN *token = NULL;
+ if (ptoken == NULL) {
+ return NT_STATUS_INVALID_PARAMETER;
+ }
+
token = TALLOC_ZERO_P(mem_ctx, NT_USER_TOKEN);
if (token == NULL) {
DEBUG(1, ("talloc failed\n"));
+ status = NT_STATUS_NO_MEMORY;
goto done;
}
token->privileges = se_disk_operators;
@@ -49,8 +55,11 @@ NT_USER_TOKEN *registry_create_admin_token(TALLOC_CTX *mem_ctx)
"to fake token.\n"));
goto done;
}
+
+ *ptoken = token;
+
done:
- return token;
+ return status;
}
/*