]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libcli/security: Rename dup_nt_token() -> security_token_duplicate()
authorAndrew Bartlett <abartlet@samba.org>
Thu, 14 Sep 2023 22:08:01 +0000 (10:08 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 26 Sep 2023 23:45:36 +0000 (23:45 +0000)
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
libcli/security/security_token.c
libcli/security/security_token.h
source3/locking/locking.c
source3/registry/reg_api.c
source3/smbd/sec_ctx.c

index 1c76b921e951c4a78fff55a4b86267fb618dd483..060c3ee82a0cc7d891a167d15539307ce3d84769 100644 (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;
index f2ff1b84b840d85f9feced990c1aebebf87c8b13..8baf4cf9e4264f69ccbffe2c23a605f36ef77f9c 100644 (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.
index 6ee5987ffda46310777a273976ce557602eac8ab..fa1c85afe919488d807e83ee7dae37bbb1d1f7e2 100644 (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);
index 60caa5a27c1e62463e9cd8aa7b96f9516cc43391..ce5beb90c221a922fa5c4ef08ddb991a42c08fe2 100644 (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;
index 56fdf1fe4761bffef06cc74e5cef53ddcd10fbe5..dc06acd60ad2fa53b220b189b3c230c8cd88c18b 100644 (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;