]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:utils: Remove overwrite of opt_workgroup in rpc_trustdom_establish()
authorAndreas Schneider <asn@samba.org>
Tue, 30 Apr 2024 07:46:33 +0000 (09:46 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 6 Jun 2024 20:25:36 +0000 (20:25 +0000)
This is not used anywhere in that functions or the functions we are
calling. It was replaced by command line cli credentials stored in
c->creds. This fixes a memory leak.

Direct leak of 12 byte(s) in 1 object(s) allocated from:
    #0 0x7f17fdaf5830 in strdup ../../../../libsanitizer/asan/asan_interceptors.cpp:578
    #1 0x7f17fc7e7339 in smb_xstrdup ../../lib/util/util.c:752
    #2 0x55f079bf0723 in rpc_trustdom_establish ../../source3/utils/net_rpc.c:6591
    #3 0x55f079c529af in net_run_function ../../source3/utils/net_util.c:464
    #4 0x55f079bdbecf in rpc_trustdom ../../source3/utils/net_rpc.c:7483
    #5 0x55f079c529af in net_run_function ../../source3/utils/net_util.c:464
    #6 0x55f079bfe7de in net_rpc ../../source3/utils/net_rpc.c:8413
    #7 0x55f079c529af in net_run_function ../../source3/utils/net_util.c:464
    #8 0x55f079baa0a8 in main ../../source3/utils/net.c:1436
    #9 0x7f17f8a2a1ef in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/utils/net_rpc.c

index c7f0126c4658afffbc2fc2c1d8fa4d48a4540e92..85b3f24e2216b68e9abcfdedca99e23e58cde6c1 100644 (file)
@@ -6582,14 +6582,6 @@ static int rpc_trustdom_establish(struct net_context *c, int argc,
        }
        cli_credentials_set_username(c->creds, acct_name, CRED_SPECIFIED);
 
-       /*
-        * opt_workgroup will be used by connection functions further,
-        * hence it should be set to remote domain name instead of ours
-        */
-       if (c->opt_workgroup) {
-               c->opt_workgroup = smb_xstrdup(domain_name);
-       };
-
        /* find the domain controller */
        if (!net_find_pdc(&server_ss, pdc_name, domain_name)) {
                DEBUG(0, ("Couldn't find domain controller for domain %s\n", domain_name));