[PATCH] A couple of python patches I am unsure about

Douglas Bagnall douglas.bagnall at catalyst.net.nz
Thu Oct 25 03:30:27 UTC 2018


I am not really sure what this code thought it was doing,
so I don't trust my fixes.

Douglas
-------------- next part --------------
From bc3951335e7b318b3d8eb1f80c540a36ce820d90 Mon Sep 17 00:00:00 2001
From: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date: Thu, 11 Oct 2018 13:08:38 +1300
Subject: [PATCH 1/2] samba-tool join: cleanup_old_accounts uses received
 new_krbtgt_dn

Previously the value of new_krbtgt_dn was unused.

Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
---
 python/samba/join.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/python/samba/join.py b/python/samba/join.py
index 01636fe3840..d03c6c7b07c 100644
--- a/python/samba/join.py
+++ b/python/samba/join.py
@@ -257,7 +257,7 @@ class DCJoinContext(object):
 
         if "msDS-Krbtgtlink" in res[0]:
             new_krbtgt_dn = res[0]["msDS-Krbtgtlink"][0]
-            ctx.del_noerror(ctx.new_krbtgt_dn)
+            ctx.del_noerror(new_krbtgt_dn)
 
         res = ctx.samdb.search(base=ctx.samdb.get_default_basedn(),
                                expression='(&(sAMAccountName=%s)(servicePrincipalName=%s))' %
-- 
2.17.1


From eb705e54c0779d0f5ef66a7455f85f97177623a3 Mon Sep 17 00:00:00 2001
From: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date: Thu, 11 Oct 2018 22:54:32 +1300
Subject: [PATCH 2/2] s4/scripting/samba_dnsupdate: remove unreachable code

Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
---
 source4/scripting/bin/samba_dnsupdate | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/source4/scripting/bin/samba_dnsupdate b/source4/scripting/bin/samba_dnsupdate
index ae355e9ec4e..e89e8b10380 100755
--- a/source4/scripting/bin/samba_dnsupdate
+++ b/source4/scripting/bin/samba_dnsupdate
@@ -602,11 +602,6 @@ def call_samba_tool(d, op="add", zone=None):
         if op == "add" and d.existing_port is not None:
             print("Not handling modify of exising SRV %s using samba-tool" % d)
             return False
-            op = "update"
-            args = [rpc_server_ip, zone, short_name, "SRV",
-                    "%s %s %s %s" % (d.existing_weight,
-                                     d.existing_port, "0", "100"),
-                    "%s %s %s %s" % (d.dest, d.port, "0", "100")]
         else:
             args = [rpc_server_ip, zone, short_name, "SRV", "%s %s %s %s" % (d.dest, d.port, "0", "100")]
     if d.type == "CNAME":
-- 
2.17.1



More information about the samba-technical mailing list