The branch, master has been updated
       via  5cadaf91bc9 s3:utils: Remove call of ads_startup() from 
net_ads_keytab_create()
      from  c72554260c9 s3:libads: Make sure that REALM is always added to 
keytab principals

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 5cadaf91bc96cd2a8e0f6bcbd8a212e86b714180
Author: Pavel Filipenský <pfilipen...@samba.org>
Date:   Thu Mar 6 15:24:05 2025 +0100

    s3:utils: Remove call of ads_startup() from net_ads_keytab_create()
    
    Calling ads_startup() is not needed in net_ads_keytab_create.  Keytab
    creation code in sync_pw2keytabs() decides if it needs to talk to DC or
    not and connects to AD accordingly.
    
    Fixing this, makes the bug below easier to reproduce using
    'net ads keytab create'.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15727
    
    Signed-off-by: Pavel Filipenský <pfilipen...@samba.org>
    Reviewed-by: Andreas Schneider <a...@samba.org>
    
    Autobuild-User(master): Pavel Filipensky <pfilipen...@samba.org>
    Autobuild-Date(master): Mon Mar 10 11:09:29 UTC 2025 on atb-devel-224

-----------------------------------------------------------------------

Summary of changes:
 source3/utils/net_ads.c | 11 -----------
 1 file changed, 11 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c
index 0f1193d7ec0..0128f3eb7e8 100644
--- a/source3/utils/net_ads.c
+++ b/source3/utils/net_ads.c
@@ -2947,9 +2947,6 @@ out:
 
 static int net_ads_keytab_create(struct net_context *c, int argc, const char 
**argv)
 {
-       TALLOC_CTX *tmp_ctx = talloc_stackframe();
-       ADS_STRUCT *ads = NULL;
-       ADS_STATUS status;
        NTSTATUS ntstatus;
        int ret = -1;
 
@@ -2959,7 +2956,6 @@ static int net_ads_keytab_create(struct net_context *c, 
int argc, const char **a
                           "    %s\n",
                         _("Usage:"),
                         _("Create (sync) new default keytab"));
-               TALLOC_FREE(tmp_ctx);
                return -1;
        }
 
@@ -2969,15 +2965,8 @@ static int net_ads_keytab_create(struct net_context *c, 
int argc, const char **a
                net_use_krb_machine_account(c);
        }
 
-       status = ads_startup(c, true, tmp_ctx, &ads);
-       if (!ADS_ERR_OK(status)) {
-               goto out;
-       }
-
        ntstatus = sync_pw2keytabs();
        ret = NT_STATUS_IS_OK(ntstatus) ? 0 : 1;
-out:
-       TALLOC_FREE(tmp_ctx);
        return ret;
 }
 


-- 
Samba Shared Repository

Reply via email to