[SCM] Samba Shared Repository - branch master updated

David Mulder dmulder at samba.org
Tue Oct 26 14:24:01 UTC 2021


The branch, master has been updated
       via  7c9195e28bc samba-tool: Pick local host if calling samba-tool from DC
      from  5a75212b60b Revert "gp: Add Firewalld ADMX templates"

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


- Log -----------------------------------------------------------------
commit 7c9195e28bc51ac375d609f8306db2456f348167
Author: David Mulder <dmulder at suse.com>
Date:   Mon Oct 25 08:49:35 2021 -0600

    samba-tool: Pick local host if calling samba-tool from DC
    
    It is reasonable to assume, that if we are running a command from a DC,
    that a user expects that the command will run against this DC.
    
    Signed-off-by: David Mulder <dmulder at suse.com>
    Reviewed-by: Rowland Penny <rpenny at samba.org>
    
    Autobuild-User(master): David Mulder <dmulder at samba.org>
    Autobuild-Date(master): Tue Oct 26 14:23:42 UTC 2021 on sn-devel-184

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

Summary of changes:
 python/samba/netcmd/common.py | 5 +++++
 1 file changed, 5 insertions(+)


Changeset truncated at 500 lines:

diff --git a/python/samba/netcmd/common.py b/python/samba/netcmd/common.py
index bb17bfa10f2..588806b2ad3 100644
--- a/python/samba/netcmd/common.py
+++ b/python/samba/netcmd/common.py
@@ -18,6 +18,7 @@
 #
 
 import re
+from socket import gethostname
 from samba.dcerpc import nbt
 from samba.net import Net
 import ldb
@@ -59,6 +60,10 @@ def netcmd_finddc(lp, creds, realm=None):
     '''Return domain-name of a writable/ldap-capable DC for the default
        domain (parameter "realm" in smb.conf) unless another realm has been
        specified as argument'''
+    # It is reasonable to assume, that if we are running a command from a DC,
+    # that a user expects that the command will run against this DC.
+    if lp.get('server role') == 'active directory domain controller':
+        return gethostname()
     net = Net(creds=creds, lp=lp)
     if realm is None:
         realm = lp.get('realm')


-- 
Samba Shared Repository



More information about the samba-cvs mailing list