summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-01-09 01:17:13 +0100
committerMichael Adam <obnox@samba.org>2008-01-09 01:47:10 +0100
commit22068a0c167b27cf1d74a32ac516df25dce0f70a (patch)
treeacf4389934f164447d5d8c9db1b33db2c9a1b268 /source3/lib
parentf269ed866d01b9924264941268d902b893fbac83 (diff)
downloadsamba-22068a0c167b27cf1d74a32ac516df25dce0f70a.tar.gz
samba-22068a0c167b27cf1d74a32ac516df25dce0f70a.tar.bz2
samba-22068a0c167b27cf1d74a32ac516df25dce0f70a.zip
Change registry_create_admin_token() to return NTSTATUS.
Michael (This used to be commit 9cd30fb25c42e79946b5140994d0bf2ef4c62f90)
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;
}
/*