1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-08 21:18:16 +03:00

libcli/security: Rename dup_nt_token() -> security_token_duplicate()

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
This commit is contained in:
Andrew Bartlett 2023-09-15 10:08:01 +12:00
parent 13d3c6156f
commit dc7dc6f549
5 changed files with 8 additions and 8 deletions

View File

@ -48,7 +48,7 @@ struct security_token *security_token_initialise(TALLOC_CTX *mem_ctx,
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;

View File

@ -39,7 +39,7 @@
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.

View File

@ -792,7 +792,7 @@ static bool add_delete_on_close_token(struct share_mode_data *d,
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;
}
@ -909,7 +909,7 @@ void set_delete_on_close_lck(files_struct *fsp,
/* 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);

View File

@ -145,7 +145,7 @@ static WERROR regkey_open_onelevel(TALLOC_CTX *mem_ctx,
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;

View File

@ -206,7 +206,7 @@ bool push_sec_ctx(void)
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);
@ -340,9 +340,9 @@ static void set_sec_ctx_internal(uid_t uid, gid_t gid,
}
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;