The branch, master has been updated
via db7497aef13 docs:man: document samba-tool dns add --allow-existing
via b41c6caaf02 samba_dnsupdate: samba-tool add avoids existing record
error messages
via 2594a0c57f4 samba_dnsupdate: slightly clarify handling of args
via d2201e72beb samba-tool dns: add --allow-existing to not complain if
records exist
via 19b63d3c87c samba-tool tests: test dns --allow-existing
via b5b08780f6d tests/samba-tool: optionally allow exception to be a
failure in .run*()
via 0e5b17adb00 pytests: samba_dnsupdate --use-samba-tool versus
existing records
via 06d394e7a83 s3:posix_acls: avoid unnecessary level 0 debug
via 01d0ec4a704 s4:prefork: raise debug level of normal exits
via 9cd75c48dc2 s4:prefork: mention service name in exit messages
via ff185e4e0a5 s3:smb2: debug mentions function name fewer times
from 11ba2ed4472 third_party/heimdal: Import
lorikeet-heimdal-202505280044 (commit 1be8ce37d618704abd82a2aa06058fa96845ad41)
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit db7497aef13bd78cd27d35338f9fb281007f8187
Author: Douglas Bagnall <[email protected]>
Date: Thu Jun 5 10:51:03 2025 +1200
docs:man: document samba-tool dns add --allow-existing
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13613
Signed-off-by: Douglas Bagnall <[email protected]>
Reviewed-by: Jennifer Sutton <[email protected]>
Reviewed-by: Rowland Penny <[email protected]>
Autobuild-User(master): Douglas Bagnall <[email protected]>
Autobuild-Date(master): Fri Jun 6 00:07:43 UTC 2025 on atb-devel-224
commit b41c6caaf02b436daba40d9d84006a15df661d98
Author: Douglas Bagnall <[email protected]>
Date: Wed Jun 4 14:59:02 2025 +1200
samba_dnsupdate: samba-tool add avoids existing record error messages
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13613
Signed-off-by: Douglas Bagnall <[email protected]>
Reviewed-by: Jennifer Sutton <[email protected]>
Reviewed-by: Rowland Penny <[email protected]>
commit 2594a0c57f43a4b0b16ab072833f8e0f0492b522
Author: Douglas Bagnall <[email protected]>
Date: Fri May 30 11:31:24 2025 +1200
samba_dnsupdate: slightly clarify handling of args
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13613
Signed-off-by: Douglas Bagnall <[email protected]>
Reviewed-by: Jennifer Sutton <[email protected]>
Reviewed-by: Rowland Penny <[email protected]>
commit d2201e72beb5b311995944921c3e8e9bead4f71d
Author: Douglas Bagnall <[email protected]>
Date: Wed Jun 4 15:43:40 2025 +1200
samba-tool dns: add --allow-existing to not complain if records exist
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13613
Signed-off-by: Douglas Bagnall <[email protected]>
Reviewed-by: Jennifer Sutton <[email protected]>
Reviewed-by: Rowland Penny <[email protected]>
commit 19b63d3c87c04af6287f20d3dc296e6709ebc5ee
Author: Douglas Bagnall <[email protected]>
Date: Wed Jun 4 13:23:36 2025 +1200
samba-tool tests: test dns --allow-existing
This will fail until the next commit.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13613
Signed-off-by: Douglas Bagnall <[email protected]>
Reviewed-by: Jennifer Sutton <[email protected]>
Reviewed-by: Rowland Penny <[email protected]>
commit b5b08780f6d16f1c771bb54e85bc94f94d57aeed
Author: Douglas Bagnall <[email protected]>
Date: Wed Jun 4 13:53:32 2025 +1200
tests/samba-tool: optionally allow exception to be a failure in .run*()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13613
Signed-off-by: Douglas Bagnall <[email protected]>
Reviewed-by: Jennifer Sutton <[email protected]>
Reviewed-by: Rowland Penny <[email protected]>
commit 0e5b17adb004ea26c0747719f096297709f7cf7f
Author: Douglas Bagnall <[email protected]>
Date: Fri May 30 11:27:30 2025 +1200
pytests: samba_dnsupdate --use-samba-tool versus existing records
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13613
Signed-off-by: Douglas Bagnall <[email protected]>
Reviewed-by: Jennifer Sutton <[email protected]>
Reviewed-by: Rowland Penny <[email protected]>
commit 06d394e7a83fa69c6441b0f1b104f721d71ea54d
Author: Douglas Bagnall <[email protected]>
Date: Fri May 23 04:05:49 2025 +0000
s3:posix_acls: avoid unnecessary level 0 debug
With 84cca757397dba107fde479bc2043d8412713cf7 (2001) we decided not to
fail if no security info was set, but we didn't remove the alarming
message. Here we hide the message under log level 3.
Signed-off-by: Douglas Bagnall <[email protected]>
Reviewed-by: Jennifer Sutton <[email protected]>
Reviewed-by: Rowland Penny <[email protected]>
commit 01d0ec4a704cd1e59b954e6c38b8d097ff548b00
Author: Douglas Bagnall <[email protected]>
Date: Fri May 23 03:57:09 2025 +0000
s4:prefork: raise debug level of normal exits
REF: https://lists.samba.org/archive/samba/2025-February/250946.html
Signed-off-by: Douglas Bagnall <[email protected]>
Reviewed-by: Jennifer Sutton <[email protected]>
Reviewed-by: Rowland Penny <[email protected]>
commit 9cd75c48dc2826013d0eed5c82d9f7f92d14a79e
Author: Douglas Bagnall <[email protected]>
Date: Fri May 23 15:55:57 2025 +1200
s4:prefork: mention service name in exit messages
REF: https://lists.samba.org/archive/samba/2025-February/250946.html
Signed-off-by: Douglas Bagnall <[email protected]>
Reviewed-by: Jennifer Sutton <[email protected]>
Reviewed-by: Rowland Penny <[email protected]>
commit ff185e4e0a56bcf981cd724d3056f0023e34b2b3
Author: Douglas Bagnall <[email protected]>
Date: Fri May 23 10:34:14 2025 +1200
s3:smb2: debug mentions function name fewer times
There was a complaint about messages like this
../../source3/smbd/smb2_server.c:4058(smbd_smb2_request_error_ex)
smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1]
status[NT_STATUS_OBJECT_NAME_NOT_FOUND] || at
../../source3/smbd/smb2_create.c:360
which weren't informing the admin know what was really
wrong. This patch doesn't help, but it does avoid
saying "smbd_smb2_request_error_ex" three times.
REF: https://lists.samba.org/archive/samba/2025-February/250967.html
Signed-off-by: Douglas Bagnall <[email protected]>
Reviewed-by: Jennifer Sutton <[email protected]>
Reviewed-by: Rowland Penny <[email protected]>
-----------------------------------------------------------------------
Summary of changes:
docs-xml/manpages/samba-tool.8.xml | 10 ++++++++++
python/samba/netcmd/dns.py | 22 ++++++++++++++++-----
python/samba/tests/blackbox/samba_dnsupdate.py | 13 +++++++++++++
python/samba/tests/samba_tool/base.py | 27 +++++++++++++++++++-------
python/samba/tests/samba_tool/dnscmd.py | 13 +++++++++++++
source3/smbd/posix_acls.c | 2 +-
source3/smbd/smb2_server.c | 2 +-
source4/samba/process_prefork.c | 17 +++++++++-------
source4/scripting/bin/samba_dnsupdate | 9 ++++++---
9 files changed, 91 insertions(+), 24 deletions(-)
Changeset truncated at 500 lines:
diff --git a/docs-xml/manpages/samba-tool.8.xml
b/docs-xml/manpages/samba-tool.8.xml
index 28bd8c00124..d0bbc30c9e6 100644
--- a/docs-xml/manpages/samba-tool.8.xml
+++ b/docs-xml/manpages/samba-tool.8.xml
@@ -612,6 +612,16 @@
<refsect3>
<title>dns add <replaceable>server</replaceable>
<replaceable>zone</replaceable> <replaceable>name</replaceable>
<replaceable>A|AAAA|PTR|CNAME|NS|MX|SRV|TXT</replaceable>
<replaceable>data</replaceable></title>
<para>Add a DNS record.</para>
+ <variablelist>
+ <varlistentry>
+ <term>--allow-existing</term>
+ <listitem><para> Do not treat an existing record of this name
+ and type as an error. This has no functional change (the new
+ DNS record is not added) but the message and samba-tool
+ return code will not indicate error. </para></listitem>
+ </varlistentry>
+ </variablelist>
+
</refsect3>
diff --git a/python/samba/netcmd/dns.py b/python/samba/netcmd/dns.py
index 693fc9aa65f..e9ee988949e 100644
--- a/python/samba/netcmd/dns.py
+++ b/python/samba/netcmd/dns.py
@@ -1159,8 +1159,13 @@ class cmd_add_record(Command):
"credopts": options.CredentialsOptions,
}
- def run(self, server, zone, name, rtype, data, sambaopts=None,
- credopts=None, versionopts=None):
+ takes_options = [
+ Option("--allow-existing", help="no error if record already exists",
+ action="store_true"),
+ ]
+
+ def run(self, server, zone, name, rtype, data, allow_existing=False,
+ sambaopts=None, credopts=None, versionopts=None):
if rtype.upper() not in ('A', 'AAAA', 'PTR', 'CNAME', 'NS', 'MX',
'SRV', 'TXT'):
raise CommandError('Adding record of type %s is not supported' %
rtype)
@@ -1183,9 +1188,16 @@ class cmd_add_record(Command):
'Record already exists; record could not be added. '
f'zone[{zone}] name[{name}]')
}
- dns_conn.DnssrvUpdateRecord2(dnsserver.DNS_CLIENT_VERSION_LONGHORN,
- 0, server, zone, name, add_rec_buf, None,
- messages=messages)
+ try:
+ dns_conn.DnssrvUpdateRecord2(dnsserver.DNS_CLIENT_VERSION_LONGHORN,
+ 0, server, zone, name, add_rec_buf,
None,
+ messages=messages)
+ except CommandError as e:
+ if e.inner_exception.args[0] ==
werror.WERR_DNS_ERROR_RECORD_ALREADY_EXISTS:
+ if allow_existing:
+ self.outf.write('Record already exists, not adding\n')
+ return
+ raise
self.outf.write('Record added successfully\n')
diff --git a/python/samba/tests/blackbox/samba_dnsupdate.py
b/python/samba/tests/blackbox/samba_dnsupdate.py
index e2c1e1450ee..65cb703a3c7 100644
--- a/python/samba/tests/blackbox/samba_dnsupdate.py
+++ b/python/samba/tests/blackbox/samba_dnsupdate.py
@@ -123,3 +123,16 @@ class SambaDnsUpdateTests(samba.tests.BlackboxTestCase):
errf=StringIO())
if result is not None:
self.fail("Error deleting site")
+
+ def test_samba_dnsupdate_samba_tool_all_names(self):
+ """We ask it to update all names, which should all already
+ exist and cause no errors."""
+ try:
+ out = self.check_output(["samba_dnsupdate",
+ "--verbose",
+ "--use-samba-tool",
+ "--all-names"])
+ except samba.tests.BlackboxProcessError as e:
+ self.fail(f"samba_dnsupdate returned an error: {e}")
+ self.assertIn(b"Record already exists", out)
+ self.assertNotIn(b"ERROR", out)
diff --git a/python/samba/tests/samba_tool/base.py
b/python/samba/tests/samba_tool/base.py
index 689ab11dde2..0fe450386c0 100644
--- a/python/samba/tests/samba_tool/base.py
+++ b/python/samba/tests/samba_tool/base.py
@@ -63,21 +63,34 @@ class SambaToolCmdTest(samba.tests.BlackboxTestCase):
credentials=creds, lp=lp)
@classmethod
- def _run(cls, *argv, verbose=False):
+ def _run(cls, *argv, verbose=False, catch_error=False):
"""run a samba-tool command.
positional arguments are effectively what gets passed to
bin/samba-tool.
+ Add catch_error=True to make samba-tool exceptions into
+ failures.
+
Add verbose=True during development to see the expanded
command and results.
+
"""
- cmd, args = cmd_sambatool()._resolve('samba-tool', *argv,
- outf=cls.stringIO(),
- errf=cls.stringIO())
- result = cmd._run(*args)
- out = cmd.outf.getvalue()
- err = cmd.errf.getvalue()
+ try:
+ cmd, args = cmd_sambatool()._resolve('samba-tool', *argv,
+ outf=cls.stringIO(),
+ errf=cls.stringIO())
+ result = cmd._run(*args)
+ out = cmd.outf.getvalue()
+ err = cmd.errf.getvalue()
+ except (Exception, SystemExit) as e:
+ # We need to catch SystemExit as well as Exception,
+ # because samba-tool will often convert exceptions into
+ # exits (SystemExit is a subclass of BaseException but not
+ # Exception).
+ if catch_error:
+ raise AssertionError(f"'samba-tool {' '.join(argv)}' raised
{e}")
+ raise
if verbose:
print(f"bin/samba-tool {' '.join(argv)}\n\nstdout:\n"
diff --git a/python/samba/tests/samba_tool/dnscmd.py
b/python/samba/tests/samba_tool/dnscmd.py
index d372bc5851e..aa475fb84ac 100644
--- a/python/samba/tests/samba_tool/dnscmd.py
+++ b/python/samba/tests/samba_tool/dnscmd.py
@@ -648,6 +648,19 @@ class DnsCmdTestCase(SambaToolCmdTest):
self.good_records[record_type][0],
self.creds_string)
self.assertCmdFail(result)
+ # Now we repeat the second add with --allow-existing,
+ # which should not complain.
+ result, out, err = self.runsubcmd("dns", "add",
+ os.environ["SERVER"],
+ self.zone, "testrecord",
+ record_type,
+
self.good_records[record_type][0],
+ self.creds_string,
+ "--allow-existing",
+ catch_error=True)
+ self.assertCmdSuccess(result, out, err)
+ self.assertIn("Record already exists", out)
+
result, out, err = self.runsubcmd("dns", "query",
os.environ["SERVER"],
self.zone, "testrecord",
diff --git a/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c
index aa53e33053d..47d310a946e 100644
--- a/source3/smbd/posix_acls.c
+++ b/source3/smbd/posix_acls.c
@@ -1090,7 +1090,7 @@ static NTSTATUS unpack_nt_owners(struct connection_struct
*conn,
*pgrp = (gid_t)-1;
if(security_info_sent == 0) {
- DEBUG(0,("unpack_nt_owners: no security info sent !\n"));
+ DBG_NOTICE("no security info sent !\n");
return NT_STATUS_OK;
}
diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c
index 5c3b7b90dc9..3b692fdca87 100644
--- a/source3/smbd/smb2_server.c
+++ b/source3/smbd/smb2_server.c
@@ -4077,7 +4077,7 @@ NTSTATUS smbd_smb2_request_error_ex(struct
smbd_smb2_request *req,
uint8_t *outhdr = SMBD_SMB2_OUT_HDR_PTR(req);
size_t unread_bytes = smbd_smb2_unread_bytes(req);
- DBG_NOTICE("smbd_smb2_request_error_ex: idx[%d] status[%s] |%s| "
+ DBG_NOTICE("idx[%d] status[%s] |%s| "
"at %s\n", req->current_idx, nt_errstr(status),
info ? " +info" : "", location);
diff --git a/source4/samba/process_prefork.c b/source4/samba/process_prefork.c
index 92e145d4c67..d5ca9a3ce2c 100644
--- a/source4/samba/process_prefork.c
+++ b/source4/samba/process_prefork.c
@@ -621,21 +621,24 @@ static void prefork_child_pipe_handler(struct
tevent_context *ev,
irpc_cleanup(rc->lp_ctx, ev, pid);
status = tfork_status(&rc->t, false);
if (status == -1) {
- DBG_ERR("Parent %d, Child %d terminated, "
+ DBG_ERR("%s: Parent %d, Child %d terminated, "
"unable to get status code from tfork\n",
- getpid(), pid);
+ rc->service_name, getpid(), pid);
rc_inuse = prefork_restart(ev, rc);
} else if (WIFEXITED(status)) {
status = WEXITSTATUS(status);
- DBG_ERR("Parent %d, Child %d exited with status %d\n",
- getpid(), pid, status);
- if (status != 0) {
+ if (status == 0) {
+ DBG_WARNING("%s: Parent %d, Child %d exited with status
0\n",
+ rc->service_name, getpid(), pid);
+ } else {
+ DBG_ERR("%s: Parent %d, Child %d exited with status
%d\n",
+ rc->service_name, getpid(), pid, status);
rc_inuse = prefork_restart(ev, rc);
}
} else if (WIFSIGNALED(status)) {
status = WTERMSIG(status);
- DBG_ERR("Parent %d, Child %d terminated with signal %d\n",
- getpid(), pid, status);
+ DBG_ERR("%s: Parent %d, Child %d terminated with signal %d\n",
+ rc->service_name, getpid(), pid, status);
if (status == SIGABRT || status == SIGBUS || status == SIGFPE ||
status == SIGILL || status == SIGSYS || status == SIGSEGV ||
status == SIGKILL) {
diff --git a/source4/scripting/bin/samba_dnsupdate
b/source4/scripting/bin/samba_dnsupdate
index 6d9d5bc3dee..2ca3dea1775 100755
--- a/source4/scripting/bin/samba_dnsupdate
+++ b/source4/scripting/bin/samba_dnsupdate
@@ -589,10 +589,13 @@ def call_samba_tool(d, op="add", zone=None):
global error_count
try:
cmd = cmd_dns()
+ full_args = ["dns", op, "--use-kerberos", "off", "-P"] + args
+ if op == 'add':
+ full_args.append("--allow-existing")
if opts.verbose:
- print(f'Calling samba-tool dns {op} --use-kerberos off -P {args}')
- command, args = cmd._resolve("dns", op, "--use-kerberos", "off", "-P",
*args)
- ret = command._run(*args)
+ print(f'Calling samba-tool {" ".join(full_args)}')
+ command, resolved_args = cmd._resolve(*full_args)
+ ret = command._run(*resolved_args)
if ret == -1:
if opts.fail_immediately:
sys.exit(1)
--
Samba Shared Repository