Duplicate a SID token.
****************************************************************************/
-struct security_token *dup_nt_token(TALLOC_CTX *mem_ctx, const struct security_token *src)
+struct security_token *security_token_duplicate(TALLOC_CTX *mem_ctx, const struct security_token *src)
{
TALLOC_CTX *frame = NULL;
struct security_token *dst = NULL;
struct security_token *security_token_initialise(TALLOC_CTX *mem_ctx,
enum claims_evaluation_control evaluate_claims);
-struct security_token *dup_nt_token(TALLOC_CTX *mem_ctx, const struct security_token *ptoken);
+struct security_token *security_token_duplicate(TALLOC_CTX *mem_ctx, const struct security_token *src);
/****************************************************************************
prints a struct security_token to debug output.
dtl = &d->delete_tokens[d->num_delete_tokens];
dtl->name_hash = name_hash;
- dtl->delete_nt_token = dup_nt_token(d->delete_tokens, nt_tok);
+ dtl->delete_nt_token = security_token_duplicate(d->delete_tokens, nt_tok);
if (dtl->delete_nt_token == NULL) {
return false;
}
/* Replace this token with the given tok. */
TALLOC_FREE(dt->delete_nt_token);
- dt->delete_nt_token = dup_nt_token(dt, nt_tok);
+ dt->delete_nt_token = security_token_duplicate(dt, nt_tok);
SMB_ASSERT(dt->delete_nt_token != NULL);
TALLOC_FREE(dt->delete_token);
dt->delete_token = copy_unix_token(dt, tok);
SMB_ASSERT(strchr(name, '\\') == NULL);
if (!(regkey = talloc_zero(mem_ctx, struct registry_key)) ||
- !(regkey->token = dup_nt_token(regkey, token)) ||
+ !(regkey->token = security_token_duplicate(regkey, token)) ||
!(regkey->key = talloc_zero(regkey, struct registry_key_handle)))
{
result = WERR_NOT_ENOUGH_MEMORY;
DEBUG(4, ("push_sec_ctx(%u, %u) : sec_ctx_stack_ndx = %d\n",
(unsigned int)ctx_p->ut.uid, (unsigned int)ctx_p->ut.gid, sec_ctx_stack_ndx ));
- ctx_p->token = dup_nt_token(NULL,
+ ctx_p->token = security_token_duplicate(NULL,
sec_ctx_stack[sec_ctx_stack_ndx-1].token);
ctx_p->ut.ngroups = sys_getgroups(0, NULL);
}
if (token) {
- ctx_p->token = dup_nt_token(NULL, token);
+ ctx_p->token = security_token_duplicate(NULL, token);
if (!ctx_p->token) {
- smb_panic("dup_nt_token failed");
+ smb_panic("security_token_duplicate failed");
}
} else {
ctx_p->token = NULL;