[SCM] Samba Shared Repository - branch master updated
Andrew Bartlett
abartlet at samba.org
Tue Jul 2 05:50:02 UTC 2019
The branch, master has been updated
via 82f327fce89 kcc: default to logging to DBGLVL_WARNING
via 731f0b7b52c docs/smbclient: document -Tcn
via 9c9f88758b6 man net: include --json option
via dfe32af975a net idmap check: correct spelling of --force
via 66620567ae3 s4/scripting/smbstatus: approach py3 compatibility
via 9c630b4bfd0 pytests/subunitrun: not usefully executable
via a4cea294d3d s4/tests/dsdb_schema: not usefully executable as script
via ae1472834b3 s4/script/rodcdns: str type doesn't need decoding
via 6972b53f505 wintest: py3 telnet.sendline() doesn't like string with ^Z
via 5331f913ac4 script/bisect-test: fix for py3
via e406b6d7960 s4/scripting/autoidl: another py3 incompatible except
via 98848142cde repl_md: Avoid dropping cross-partition links
via dba9987bf50 tests: Add getncchanges test for cross-partition links + TGT
from 92f9f836aba WHATSNEW.txt: samba-tool --backend-size-parameter
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 82f327fce897f452e269d22a8ed348bb5cddfa0b
Author: Gary Lockyer <gary at catalyst.net.nz>
Date: Thu Jun 6 11:40:08 2019 +1200
kcc: default to logging to DBGLVL_WARNING
If the "-d" debug level parameter is not supplied, default to DBGLVL_WARNING.
Overiding the "log level" set in smb.conf.
When samba runs the kcc command stderr output is logged at DBGLVL_ERR,
the default log destination is stderr. As a result any log messages
generated by the kcc command, are effectively logged at DBGLVL_ERR.
This causes issues if auth or audit logging are enabled in smb.conf.
Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
Pair-programmed-with: Tim Beale <timbeale at catalyst.net.nz>
Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
Autobuild-Date(master): Tue Jul 2 05:49:43 UTC 2019 on sn-devel-184
commit 731f0b7b52c666cabdc74c42f2f6cbe1e6abaf33
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date: Thu Jun 20 12:13:56 2019 +1200
docs/smbclient: document -Tcn
BUG:https://bugzilla.samba.org/show_bug.cgi?id=2352
Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
commit 9c9f88758b6dd3daa5636135ada83d5d8c8fa9ec
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date: Mon Jun 3 23:02:57 2019 +1200
man net: include --json option
Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
commit dfe32af975ae45782e0d8e1954457e7ad43770af
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date: Tue Jun 4 02:37:44 2019 +1200
net idmap check: correct spelling of --force
Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
commit 66620567ae325d6c20b0a38c41fa138e902ec8e0
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date: Sun Mar 17 17:17:28 2019 +1300
s4/scripting/smbstatus: approach py3 compatibility
It is still unused and untested, probably not working.
Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
commit 9c630b4bfd09dbfdb3709bf9499ebcc584bd3239
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date: Sun Mar 17 15:38:04 2019 +1300
pytests/subunitrun: not usefully executable
it only defines classes and fiddles with signals.
Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
commit a4cea294d3d394fd134e67f4ce463d6673ed6831
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date: Sun Mar 17 14:57:06 2019 +1300
s4/tests/dsdb_schema: not usefully executable as script
You could run the script, but it wouldn't do anything.
Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
commit ae1472834b3256dbe53733abecbee2129d364594
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date: Sun Mar 17 14:50:44 2019 +1300
s4/script/rodcdns: str type doesn't need decoding
Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
commit 6972b53f505a97985cb9127c181a5a7cfa987368
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date: Sun Mar 17 14:49:14 2019 +1300
wintest: py3 telnet.sendline() doesn't like string with ^Z
Try using bytes instead.
Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
commit 5331f913ac4dd3d94bed45846b64b89475029994
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date: Sun Mar 17 15:38:43 2019 +1300
script/bisect-test: fix for py3
Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
commit e406b6d79603e31d2179717c0a4c7dbeeed7c337
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date: Thu Mar 14 23:12:38 2019 +1300
s4/scripting/autoidl: another py3 incompatible except
Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
commit 98848142cde51d4b280a6fb5cd95dc4bd2471e17
Author: Tim Beale <timbeale at catalyst.net.nz>
Date: Mon Jul 1 13:41:14 2019 +1200
repl_md: Avoid dropping cross-partition links
Cross-partition links could still be dropped if GET_TGT was already
previously set for the replication.
This was due to a slight error in the order of logic. We never want to
ignore cross-partition links (regardless of whether the TARGETS_UPTODATE
/GET_TGT flag is set). We should only be returning early in the
GET_TGT case if the objects are both in the same partition.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14022
RN: When the AD domain contained a linked attribute that spanned
partitions, DRS replication could drop the link. This dropped link could
then result in subtle differences in behaviour between DCs, as some DCs
would have the link and others wouldn't. When this issue occurred, the
dropped link would be logged in a warning message:
"<target-dn> is Unknown but up to date. Ignoring link from <source-dn>"
This issue would not always occur - it depended a lot on the database
contents. Typically, it would only potentially occur when joining a new
DC to the domain (doing an ldapcmp after the join would also highlight
the problem, if it occurred). This issue has now been resolved.
Signed-off-by: Tim Beale <timbeale at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
commit dba9987bf500f82fbbcda1cd78c543a87f90cec5
Author: Tim Beale <timbeale at catalyst.net.nz>
Date: Mon Jul 1 14:16:13 2019 +1200
tests: Add getncchanges test for cross-partition links + TGT
This adds a test-case to highlight a bug in the client side GetNCChanges
handling.
These tests mostly exercise the server-side behaviour of sending the
GetNCChanges, however, there's a bug in the client-side code when we try
to handle a missing cross-partition link target *in combination* with
the GET_TGT flag already having been set.
The test is exercising the client-side code by using the 'samba-tool drs
replicate' command. By adding a one-way link to a deleted target object,
we force the client code to retry with the GET_TGT flag set.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14022
Signed-off-by: Tim Beale <timbeale at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
-----------------------------------------------------------------------
Summary of changes:
docs-xml/manpages/net.8.xml | 7 ++++++
docs-xml/manpages/smbclient.1.xml | 7 ++++++
python/samba/tests/subunitrun.py | 2 --
script/bisect-test.py | 2 +-
selftest/knownfail.d/getncchanges | 1 +
source3/utils/net_idmap.c | 2 +-
source4/dsdb/samdb/ldb_modules/repl_meta_data.c | 31 +++++++++++++------------
source4/dsdb/tests/python/dsdb_schema_info.py | 1 -
source4/scripting/bin/autoidl | 3 ++-
source4/scripting/bin/samba_kcc | 5 +++-
source4/scripting/bin/smbstatus | 4 ++--
source4/scripting/devel/rodcdns | 2 +-
source4/torture/drs/python/getncchanges.py | 28 +++++++++++++++++++++-
wintest/test-s4-howto.py | 4 ++--
wintest/wintest.py | 2 +-
15 files changed, 72 insertions(+), 29 deletions(-)
mode change 100755 => 100644 python/samba/tests/subunitrun.py
mode change 100755 => 100644 source4/dsdb/tests/python/dsdb_schema_info.py
Changeset truncated at 500 lines:
diff --git a/docs-xml/manpages/net.8.xml b/docs-xml/manpages/net.8.xml
index 37dfa2af694..df423a3df06 100644
--- a/docs-xml/manpages/net.8.xml
+++ b/docs-xml/manpages/net.8.xml
@@ -385,6 +385,13 @@
</para></listitem>
</varlistentry>
+ <varlistentry>
+ <term>--json</term>
+ <listitem><para>Report results in JSON format for
+ "net ads info" and "net ads lookup".
+ </para></listitem>
+ </varlistentry>
+
&stdarg.encrypt;
&popt.common.samba.client;
diff --git a/docs-xml/manpages/smbclient.1.xml b/docs-xml/manpages/smbclient.1.xml
index e25f7d3517b..ab62c12f36e 100644
--- a/docs-xml/manpages/smbclient.1.xml
+++ b/docs-xml/manpages/smbclient.1.xml
@@ -369,6 +369,13 @@
file. This flag is mutually exclusive with the
<parameter>x</parameter> flag. </para></listitem>
+ <listitem><para><parameter>n</parameter> - In
+ combination with the <parameter>c</parameter>
+ flag, do not actually create the archive,
+ instead perform a dry run that attempts
+ everything that involved in creation other than
+ writing the file.</para></listitem>
+
<listitem><para><parameter>x</parameter> - Extract (restore) a local
tar file back to a share. Unless the -D option is given, the tar
files will be restored from the top level of the share. Must be
diff --git a/python/samba/tests/subunitrun.py b/python/samba/tests/subunitrun.py
old mode 100755
new mode 100644
index d3956620259..88d68faa65c
--- a/python/samba/tests/subunitrun.py
+++ b/python/samba/tests/subunitrun.py
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-
# Simple subunit testrunner for python
# NOTE: DO NOT USE THIS MODULE FOR NEW CODE.
diff --git a/script/bisect-test.py b/script/bisect-test.py
index 313c4e3c6ce..b87df54ac09 100755
--- a/script/bisect-test.py
+++ b/script/bisect-test.py
@@ -58,7 +58,7 @@ cwd = os.getcwd()
gitroot = find_git_root()
# create a bisect script
-f = tempfile.NamedTemporaryFile(delete=False)
+f = tempfile.NamedTemporaryFile(delete=False, mode="w+t")
f.write("set -x\n")
f.write("cd %s || exit 125\n" % cwd)
if opts.autogen:
diff --git a/selftest/knownfail.d/getncchanges b/selftest/knownfail.d/getncchanges
index 967cd2f5278..df6464e0156 100644
--- a/selftest/knownfail.d/getncchanges
+++ b/selftest/knownfail.d/getncchanges
@@ -12,3 +12,4 @@ samba4.drs.getncchanges.python\(promoted_dc\).python2.getncchanges.DrsReplicaSyn
samba4.drs.getncchanges.python\(promoted_dc\).python2.getncchanges.DrsReplicaSyncIntegrityTestCase.test_repl_get_tgt_chain\(promoted_dc\)
samba4.drs.getncchanges.python\(promoted_dc\).python2.getncchanges.DrsReplicaSyncIntegrityTestCase.test_repl_get_tgt_and_anc\(promoted_dc\)
samba4.drs.getncchanges.python\(promoted_dc\).python2.getncchanges.DrsReplicaSyncIntegrityTestCase.test_repl_get_tgt_multivalued_links\(promoted_dc\)
+
diff --git a/source3/utils/net_idmap.c b/source3/utils/net_idmap.c
index 0aa45f742cd..24417a8620f 100644
--- a/source3/utils/net_idmap.c
+++ b/source3/utils/net_idmap.c
@@ -1311,7 +1311,7 @@ static int net_idmap_check(struct net_context *c, int argc, const char **argv)
" --repair,-r\trepair\n"
" --auto,-a\tnoninteractive mode\n"
" --test,-T\tdry run\n"
- " --fore,-f\tforce\n"
+ " --force,-f\tforce\n"
" --lock,-l\tlock db while doing the check\n"
" TDB\tidmap database\n"));
return c->display_usage ? 0 : -1;
diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
index 5202c41a7bf..9dd354743ff 100644
--- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
+++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
@@ -7433,27 +7433,28 @@ static int replmd_allow_missing_target(struct ldb_module *module,
return LDB_SUCCESS;
}
- if (dsdb_repl_flags & DSDB_REPL_FLAG_TARGETS_UPTODATE) {
+ is_in_same_nc = dsdb_objects_have_same_nc(ldb,
+ mem_ctx,
+ source_dn,
+ target_dn);
+ if (is_in_same_nc) {
/*
- * target should already be up-to-date so there's no point in
+ * if the target is already be up-to-date there's no point in
* retrying. This could be due to bad timing, or if a target
* on a one-way link was deleted. We ignore the link rather
* than failing the replication cycle completely
*/
- *ignore_link = true;
- DBG_WARNING("%s is %s but up to date. Ignoring link from %s\n",
- ldb_dn_get_linearized(target_dn), missing_str,
- ldb_dn_get_linearized(source_dn));
- return LDB_SUCCESS;
- }
-
- is_in_same_nc = dsdb_objects_have_same_nc(ldb,
- mem_ctx,
- source_dn,
- target_dn);
- if (is_in_same_nc) {
- /* fail the replication and retry with GET_TGT */
+ if (dsdb_repl_flags & DSDB_REPL_FLAG_TARGETS_UPTODATE) {
+ *ignore_link = true;
+ DBG_WARNING("%s is %s "
+ "but up to date. Ignoring link from %s\n",
+ ldb_dn_get_linearized(target_dn), missing_str,
+ ldb_dn_get_linearized(source_dn));
+ return LDB_SUCCESS;
+ }
+
+ /* otherwise fail the replication and retry with GET_TGT */
ldb_asprintf_errstring(ldb, "%s target %s GUID %s linked from %s\n",
missing_str,
ldb_dn_get_linearized(target_dn),
diff --git a/source4/dsdb/tests/python/dsdb_schema_info.py b/source4/dsdb/tests/python/dsdb_schema_info.py
old mode 100755
new mode 100644
index 8554e6c6082..26df1e04a45
--- a/source4/dsdb/tests/python/dsdb_schema_info.py
+++ b/source4/dsdb/tests/python/dsdb_schema_info.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Unix SMB/CIFS implementation.
diff --git a/source4/scripting/bin/autoidl b/source4/scripting/bin/autoidl
index f020d2a8d4f..82bdb4db5d8 100755
--- a/source4/scripting/bin/autoidl
+++ b/source4/scripting/bin/autoidl
@@ -140,7 +140,8 @@ if version is None:
for i in range(MAX_IFACE_VERSION):
try:
conn = ClientConnection(binding, (uuid, i))
- except RuntimeError, (num, msg):
+ except RuntimeError as e:
+ num, msg = e.args
if num == NT_STATUS_NET_WRITE_FAULT:
continue
raise
diff --git a/source4/scripting/bin/samba_kcc b/source4/scripting/bin/samba_kcc
index aded135907b..122a5ed2c5e 100755
--- a/source4/scripting/bin/samba_kcc
+++ b/source4/scripting/bin/samba_kcc
@@ -250,7 +250,6 @@ parser.add_option("--forget-intersite-links", default=False,
help="pretend not to know the existing intersite topology",
action="store_true")
-
opts, args = parser.parse_args()
@@ -286,6 +285,10 @@ else:
unix_now = int(time.time())
lp = sambaopts.get_loadparm()
+# only log warnings/errors by default, unless the user has specified otherwise
+if opts.debug is None:
+ lp.set('log level', '1')
+
creds = credopts.get_credentials(lp, fallback_machine=True)
if opts.dburl is None:
diff --git a/source4/scripting/bin/smbstatus b/source4/scripting/bin/smbstatus
index fd67b2ca691..cc06c4c4290 100755
--- a/source4/scripting/bin/smbstatus
+++ b/source4/scripting/bin/smbstatus
@@ -84,8 +84,8 @@ if opts.nbt:
else:
try:
conn = open_connection("smb_server")
- except RuntimeError, (num, msg):
- if msg == 'NT_STATUS_OBJECT_NAME_NOT_FOUND':
+ except RuntimeError as e:
+ if e.args[1] == 'NT_STATUS_OBJECT_NAME_NOT_FOUND':
print("No active connections")
else:
show_sessions(conn)
diff --git a/source4/scripting/devel/rodcdns b/source4/scripting/devel/rodcdns
index 8f1d90a4c9c..683058000b0 100755
--- a/source4/scripting/devel/rodcdns
+++ b/source4/scripting/devel/rodcdns
@@ -37,7 +37,7 @@ if __name__ == "__main__":
name.port = opts.port
name.dns_register = True
dns_names.names = [ name ]
- site_name = opts.site.decode('utf-8')
+ site_name = opts.site
ret_names = w.DsrUpdateReadOnlyServerDnsRecords(site_name, 600, dns_names)
print("Status: %u" % ret_names.names[0].status)
diff --git a/source4/torture/drs/python/getncchanges.py b/source4/torture/drs/python/getncchanges.py
index 023cb8a394c..1f6a53aa00b 100644
--- a/source4/torture/drs/python/getncchanges.py
+++ b/source4/torture/drs/python/getncchanges.py
@@ -994,7 +994,7 @@ class DrsReplicaSyncIntegrityTestCase(drs_base.DrsBaseTestCase):
self.assert_DCs_replication_is_consistent(peer_conn, all_objects,
expected_links)
- def test_repl_integrity_cross_partition_links(self):
+ def _test_repl_integrity_cross_partition_links(self, get_tgt=False):
"""
Checks that a cross-partition link to an unknown target object does
not result in missing links.
@@ -1007,6 +1007,18 @@ class DrsReplicaSyncIntegrityTestCase(drs_base.DrsBaseTestCase):
# stop replication so the peer gets the following objects in one go
self._disable_all_repl(self.dnsname_dc2)
+ # optionally force the client-side to use GET_TGT locally, by adding a
+ # one-way link to a missing/deleted target object
+ if get_tgt:
+ missing_target = "OU=missing_tgt,%s" % self.ou
+ self.add_object(missing_target)
+ get_tgt_source = "CN=get_tgt_src,%s" % self.ou
+ self.add_object(get_tgt_source,
+ objectclass="msExchConfigurationContainer")
+ self.modify_object(get_tgt_source, "addressBookRoots2",
+ missing_target)
+ self.test_ldb_dc.delete(missing_target)
+
# create a link source object in the main NC
la_source = "OU=cross_nc_src,%s" % self.ou
self.add_object(la_source)
@@ -1037,6 +1049,14 @@ class DrsReplicaSyncIntegrityTestCase(drs_base.DrsBaseTestCase):
self.repl_get_next(get_tgt=True)
self.set_dc_connection(self.default_conn)
+
+ # delete the GET_TGT test object. We're not interested in asserting its
+ # links - it was just there to make the client use GET_TGT (and it
+ # creates an inconsistency because one DC correctly ignores the link,
+ # because it points to a deleted object)
+ if get_tgt:
+ self.test_ldb_dc.delete(get_tgt_source)
+
self.init_test_state()
# Now sync across the partition containing the link target object
@@ -1093,6 +1113,12 @@ class DrsReplicaSyncIntegrityTestCase(drs_base.DrsBaseTestCase):
self.test_ldb_dc.delete(la_target)
self._enable_all_repl(self.dnsname_dc2)
+ def test_repl_integrity_cross_partition_links(self):
+ self._test_repl_integrity_cross_partition_links(get_tgt=False)
+
+ def test_repl_integrity_cross_partition_links_with_tgt(self):
+ self._test_repl_integrity_cross_partition_links(get_tgt=True)
+
def test_repl_get_tgt_multivalued_links(self):
"""Tests replication with multi-valued link attributes."""
diff --git a/wintest/test-s4-howto.py b/wintest/test-s4-howto.py
index 5102387124a..2c8758dd6e2 100755
--- a/wintest/test-s4-howto.py
+++ b/wintest/test-s4-howto.py
@@ -160,7 +160,7 @@ def run_dcpromo(t, vm):
t.info("Joining a windows VM ${WIN_VM} to the domain as a DC using dcpromo")
child = t.open_telnet("${WIN_HOSTNAME}", "administrator", "${WIN_PASS}", set_ip=True, set_noexpire=True)
child.sendline("copy /Y con answers.txt")
- child.sendline('''
+ child.sendline(b'''
[DCINSTALL]
RebootOnSuccess=Yes
RebootOnCompletion=Yes
@@ -315,7 +315,7 @@ def run_dcpromo_rodc(t, vm):
t.vm_restore("${WIN_VM}", "${WIN_SNAPSHOT}")
child = t.open_telnet("${WIN_HOSTNAME}", "administrator", "${WIN_PASS}", set_ip=True)
child.sendline("copy /Y con answers.txt")
- child.sendline('''
+ child.sendline(b'''
[DCInstall]
ReplicaOrNewDomain=ReadOnlyReplica
ReplicaDomainDNSName=${LCREALM}
diff --git a/wintest/wintest.py b/wintest/wintest.py
index c239bab5506..914b5d61689 100644
--- a/wintest/wintest.py
+++ b/wintest/wintest.py
@@ -834,7 +834,7 @@ options {
"""This server must therefore not yet be a directory server, so we must promote it"""
child.sendline("copy /Y con answers.txt")
- child.sendline('''
+ child.sendline(b'''
[DCInstall]
; New forest promotion
ReplicaOrNewDomain=Domain
--
Samba Shared Repository
More information about the samba-cvs
mailing list