[SCM] Samba Shared Repository - branch master updated

Andrew Bartlett abartlet at samba.org
Sun Jun 20 22:53:01 UTC 2021


The branch, master has been updated
       via  c09a56ea203 python:tests: Fix group_edit test with system libldb
       via  084e8616a89 python:tests: Fix user_edit test with system libldb
       via  f47ea8716f0 python:tests: Fix contact_edit test with system libldb
       via  a45ea91cd7e samba-tool: Ensure commands don't crash without ad-dc
       via  f241fe5d46e dns: Enable dnsserver_common install when not ad dc
       via  fb5fe30e824 samba-tool: Disable AD DC options in samba-tool domain
       via  779d0f02718 samba-tool: Enable samba-tool without ad dc (but with ads)
      from  4079efae767 s3:modules: Reduce debug level if file doesn't exists on dfs share

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


- Log -----------------------------------------------------------------
commit c09a56ea20333c1023c3873cbb0432fc68bae385
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Jun 17 15:02:59 2021 +0200

    python:tests: Fix group_edit test with system libldb
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date(master): Sun Jun 20 22:52:05 UTC 2021 on sn-devel-184

commit 084e8616a898fd9d645ebcdf4721a9c72631d8d3
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Jun 17 15:00:21 2021 +0200

    python:tests: Fix user_edit test with system libldb
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit f47ea8716f02fd4de44d3e0edbaeb26a9451f90d
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Jun 17 14:57:41 2021 +0200

    python:tests: Fix contact_edit test with system libldb
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit a45ea91cd7e8335319c96ea5bda02014f584df63
Author: David Mulder <dmulder at suse.com>
Date:   Thu Jun 17 15:20:41 2021 -0600

    samba-tool: Ensure commands don't crash without ad-dc
    
    This simply ensures against import errors when
    samba is built without the ad-dc. Calling every
    help message guarantees the imports succeeded.
    The test is intentionally run against the
    fileserver test environment, because it's
    configured --without-ad-dc and does not disable
    ads.
    
    Signed-off-by: David Mulder <dmulder at suse.com>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit f241fe5d46e8dd2b3265be7eddbd6686a6f920db
Author: David Mulder <dmulder at suse.com>
Date:   Thu Jun 10 09:53:56 2021 -0600

    dns: Enable dnsserver_common install when not ad dc
    
    dnsserver_common is enabled without the ad-dc to
    prevent imports from failing when samba-tool is
    called where the ad-dc was not built. The
    server-side dns code is used in the client when
    we do direct LDAP modification of DNS records.
    
    Signed-off-by: David Mulder <dmulder at suse.com>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit fb5fe30e824d2d511188053ce04cf797b769727a
Author: David Mulder <dmulder at suse.com>
Date:   Fri Sep 18 11:28:02 2020 -0600

    samba-tool: Disable AD DC options in samba-tool domain
    
    Signed-off-by: David Mulder <dmulder at suse.com>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 779d0f02718b3812024bafcd5477ec3039c7a0cf
Author: David Mulder <dmulder at suse.com>
Date:   Thu Sep 17 13:26:18 2020 -0600

    samba-tool: Enable samba-tool without ad dc (but with ads)
    
    Much of samba-tool can operate without the full AD DC,
    for remote operations.
    
    However the samba-tool gpo command depends on ads being
    built. Without ads, every samba-tool command
    crashes because ads imports fail.
    
    Signed-off-by: David Mulder <dmulder at suse.com>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

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

Summary of changes:
 python/samba/netcmd/domain.py                 | 30 ++++++++++++++-------------
 python/samba/tests/samba_tool/contact_edit.sh |  7 ++++++-
 python/samba/tests/samba_tool/group_edit.sh   |  7 ++++++-
 python/samba/tests/samba_tool/user_edit.sh    |  7 ++++++-
 source4/dns_server/wscript_build              |  6 ++++--
 source4/scripting/bin/wscript_build           |  5 +++--
 source4/scripting/wscript_build               |  2 +-
 source4/selftest/tests.py                     |  7 +++++++
 8 files changed, 49 insertions(+), 22 deletions(-)


Changeset truncated at 500 lines:

diff --git a/python/samba/netcmd/domain.py b/python/samba/netcmd/domain.py
index 91c82297e26..eccae4e2f75 100644
--- a/python/samba/netcmd/domain.py
+++ b/python/samba/netcmd/domain.py
@@ -71,6 +71,7 @@ from samba import remove_dc, arcfour_encrypt, string_to_byte_array
 from samba.auth_util import system_session_unix
 from samba.net_s3 import Net as s3_Net
 from samba.param import default_path
+from samba import is_ad_dc_built
 
 from samba.dsdb import (
     DS_DOMAIN_FUNCTION_2000,
@@ -694,7 +695,7 @@ class cmd_domain_join(Command):
                                                         debug=verbose)
 
             self.errf.write("Joined domain %s (%s)\n" % (domain_name, sid))
-        elif role == "DC":
+        elif role == "DC" and is_ad_dc_built():
             join_DC(logger=logger, server=server, creds=creds, lp=lp, domain=domain,
                     site=site, netbios_name=netbios_name, targetdir=targetdir,
                     domain_critical_only=domain_critical_only,
@@ -703,7 +704,7 @@ class cmd_domain_join(Command):
                     plaintext_secrets=plaintext_secrets,
                     backend_store=backend_store,
                     backend_store_size=backend_store_size)
-        elif role == "RODC":
+        elif role == "RODC" and is_ad_dc_built():
             join_RODC(logger=logger, server=server, creds=creds, lp=lp, domain=domain,
                       site=site, netbios_name=netbios_name, targetdir=targetdir,
                       domain_critical_only=domain_critical_only,
@@ -4338,19 +4339,20 @@ class cmd_domain(SuperCommand):
     """Domain management."""
 
     subcommands = {}
-    subcommands["demote"] = cmd_domain_demote()
     if cmd_domain_export_keytab is not None:
         subcommands["exportkeytab"] = cmd_domain_export_keytab()
     subcommands["info"] = cmd_domain_info()
-    subcommands["provision"] = cmd_domain_provision()
     subcommands["join"] = cmd_domain_join()
-    subcommands["dcpromo"] = cmd_domain_dcpromo()
-    subcommands["level"] = cmd_domain_level()
-    subcommands["passwordsettings"] = cmd_domain_passwordsettings()
-    subcommands["classicupgrade"] = cmd_domain_classicupgrade()
-    subcommands["samba3upgrade"] = cmd_domain_samba3upgrade()
-    subcommands["trust"] = cmd_domain_trust()
-    subcommands["tombstones"] = cmd_domain_tombstones()
-    subcommands["schemaupgrade"] = cmd_domain_schema_upgrade()
-    subcommands["functionalprep"] = cmd_domain_functional_prep()
-    subcommands["backup"] = cmd_domain_backup()
+    if is_ad_dc_built():
+        subcommands["demote"] = cmd_domain_demote()
+        subcommands["provision"] = cmd_domain_provision()
+        subcommands["dcpromo"] = cmd_domain_dcpromo()
+        subcommands["level"] = cmd_domain_level()
+        subcommands["passwordsettings"] = cmd_domain_passwordsettings()
+        subcommands["classicupgrade"] = cmd_domain_classicupgrade()
+        subcommands["samba3upgrade"] = cmd_domain_samba3upgrade()
+        subcommands["trust"] = cmd_domain_trust()
+        subcommands["tombstones"] = cmd_domain_tombstones()
+        subcommands["schemaupgrade"] = cmd_domain_schema_upgrade()
+        subcommands["functionalprep"] = cmd_domain_functional_prep()
+        subcommands["backup"] = cmd_domain_backup()
diff --git a/python/samba/tests/samba_tool/contact_edit.sh b/python/samba/tests/samba_tool/contact_edit.sh
index 038fbe2b4d7..05eac69c4e6 100755
--- a/python/samba/tests/samba_tool/contact_edit.sh
+++ b/python/samba/tests/samba_tool/contact_edit.sh
@@ -13,6 +13,11 @@ SERVER="$1"
 USERNAME="$2"
 PASSWORD="$3"
 
+samba_ldbsearch=ldbsearch
+if test -x $BINDIR/ldbsearch; then
+    samba_ldbsearch=$BINDIR/ldbsearch
+fi
+
 STpath=$(pwd)
 . $STpath/testprogs/blackbox/subunit.sh
 
@@ -51,7 +56,7 @@ EOF
 }
 
 get_attribute_base64() {
-	${STpath}/bin/ldbsearch '(&(objectClass=contact)(name=testcontact1))' \
+	$samba_ldbsearch '(&(objectClass=contact)(name=testcontact1))' \
 		displayName \
 		-H "ldap://$SERVER" "-U$USERNAME" "--password=$PASSWORD"
 }
diff --git a/python/samba/tests/samba_tool/group_edit.sh b/python/samba/tests/samba_tool/group_edit.sh
index e8e4fecb2a9..4e8c6dffa2d 100755
--- a/python/samba/tests/samba_tool/group_edit.sh
+++ b/python/samba/tests/samba_tool/group_edit.sh
@@ -13,6 +13,11 @@ SERVER="$1"
 USERNAME="$2"
 PASSWORD="$3"
 
+samba_ldbsearch=ldbsearch
+if test -x $BINDIR/ldbsearch; then
+    samba_ldbsearch=$BINDIR/ldbsearch
+fi
+
 STpath=$(pwd)
 . $STpath/testprogs/blackbox/subunit.sh
 
@@ -97,7 +102,7 @@ EOF
 }
 
 get_attribute_base64() {
-	${STpath}/bin/ldbsearch '(sAMAccountName=testgroup1)' displayName \
+	$samba_ldbsearch '(sAMAccountName=testgroup1)' displayName \
 		-H "ldap://$SERVER" "-U$USERNAME" "--password=$PASSWORD"
 }
 
diff --git a/python/samba/tests/samba_tool/user_edit.sh b/python/samba/tests/samba_tool/user_edit.sh
index 7f0140ce6dd..cff646955db 100755
--- a/python/samba/tests/samba_tool/user_edit.sh
+++ b/python/samba/tests/samba_tool/user_edit.sh
@@ -13,6 +13,11 @@ SERVER="$1"
 USERNAME="$2"
 PASSWORD="$3"
 
+samba_ldbsearch=ldbsearch
+if test -x $BINDIR/ldbsearch; then
+    samba_ldbsearch=$BINDIR/ldbsearch
+fi
+
 STpath=$(pwd)
 . $STpath/testprogs/blackbox/subunit.sh
 
@@ -65,7 +70,7 @@ EOF
 }
 
 get_attribute_base64() {
-	${STpath}/bin/ldbsearch '(sAMAccountName=sambatool1)' displayName \
+	$samba_ldbsearch '(sAMAccountName=sambatool1)' displayName \
 		-H "ldap://$SERVER" "-U$USERNAME" "--password=$PASSWORD"
 }
 
diff --git a/source4/dns_server/wscript_build b/source4/dns_server/wscript_build
index ce786f635ae..8f606f92692 100644
--- a/source4/dns_server/wscript_build
+++ b/source4/dns_server/wscript_build
@@ -1,10 +1,12 @@
 #!/usr/bin/env python
 
+# dnsserver_common is enabled without the ad-dc to prevent imports from failing
+# when samba-tool is called where the ad-dc was not built. The server-side dns
+# code is used in the client when we do direct LDAP modification of DNS records.
 bld.SAMBA_LIBRARY('dnsserver_common',
         source='dnsserver_common.c',
         deps='samba-util samba-errors ldbsamba clidns',
-        private_library=True,
-        install=bld.AD_DC_BUILD_IS_ENABLED()
+        private_library=True
         )
 
 bld.SAMBA_MODULE('service_dns',
diff --git a/source4/scripting/bin/wscript_build b/source4/scripting/bin/wscript_build
index 87d23545487..d31afb2f132 100644
--- a/source4/scripting/bin/wscript_build
+++ b/source4/scripting/bin/wscript_build
@@ -1,8 +1,7 @@
 #!/usr/bin/env python3
 
 if bld.CONFIG_SET('AD_DC_BUILD_IS_ENABLED'):
-    for script in ['samba-tool',
-                   'samba_dnsupdate',
+    for script in ['samba_dnsupdate',
                    'samba_spnupdate',
                    'samba_kcc',
                    'samba_upgradeprovision',
@@ -10,4 +9,6 @@ if bld.CONFIG_SET('AD_DC_BUILD_IS_ENABLED'):
                    'gen_output.py',
                    'samba_downgrade_db']:
         bld.SAMBA_SCRIPT(script, pattern=script, installdir='.')
+if bld.CONFIG_SET('WITH_ADS'):
+    bld.SAMBA_SCRIPT('samba-tool', pattern='samba-tool', installdir='.')
 bld.SAMBA_SCRIPT('samba-gpupdate', pattern='samba-gpupdate', installdir='.')
diff --git a/source4/scripting/wscript_build b/source4/scripting/wscript_build
index c5883f1fc8c..6728dec998e 100644
--- a/source4/scripting/wscript_build
+++ b/source4/scripting/wscript_build
@@ -16,7 +16,7 @@ if sbin_files:
     if 'XSLTPROC_MANPAGES' in bld.env and bld.env['XSLTPROC_MANPAGES']:
         bld.MANPAGES(man_files, True)
 
-if bld.CONFIG_SET('AD_DC_BUILD_IS_ENABLED'):
+if bld.CONFIG_SET('WITH_ADS'):
     bld.INSTALL_FILES('${BINDIR}',
                   'bin/samba-tool',
                   chmod=MODE_755, python_fixup=True, flat=True)
diff --git a/source4/selftest/tests.py b/source4/selftest/tests.py
index ef095001cdb..aec57881ff0 100755
--- a/source4/selftest/tests.py
+++ b/source4/selftest/tests.py
@@ -811,6 +811,13 @@ planpythontestsuite("none", "samba.tests.samba_tool.provision_password_check")
 planpythontestsuite("none", "samba.tests.samba_tool.provision_lmdb_size")
 planpythontestsuite("none", "samba.tests.samba_tool.provision_userPassword_crypt")
 planpythontestsuite("none", "samba.tests.samba_tool.help")
+# Make sure samba-tool can execute without import failures when run
+# without the ad-dc built. The fileserver test environment runs against
+# the samba-h5l-build autobuild. This build was chosen because it's
+# configured with --without-ad-dc and does not disable ads, which is
+# required to run some samba-tool commands.
+planpythontestsuite("fileserver", "samba.tests.samba_tool.help")
+
 planpythontestsuite("ad_dc_default:local", "samba.tests.samba_tool.passwordsettings")
 planpythontestsuite("ad_dc:local", "samba.tests.samba_tool.dsacl")
 


-- 
Samba Shared Repository



More information about the samba-cvs mailing list