The branch, v4-21-test has been updated
via 13587f415c9 VERSION: Bump version up to Samba 4.21.10...
via 894e1537d93 Merge tag 'samba-4.21.9' into v4-21-test
via 25ea748dac2 VERSION: Disable GIT_SNAPSHOT for the 4.21.9 release.
via 6175ff81da1 WHATSNEW: Add release notes for Samba 4.21.9.
via 52969774d13 CVE-2025-9640: s3/modules/vfs_streams_xattr fix
unitialized write
via ad80099b697 CVE-2025-9640: Add torture test for inserting hole in
stream
via e8639734faa CVE-2025-10230: s4:wins: restrict names fed to shell
via 3db699b8e65 CVE-2025-10230: s4/tests: check that wins hook
sanitizes names
via 1589410ca78 VERSION: Bump version up to Samba 4.21.9...
via 825d6197eff ctdb-common: Only respect CTDB_SOCKET in CTDB_TEST_MODE
via 467557d63a0 ctdb-common: Factor out checking of CTDB_TEST_MODE
via 086f6393ab3 ctdb-pmda: Do not directly support CTDB_SOCKET
environment variable
via 13bc5d1887e vfs_ceph_new: Use integer value instead of boolean
via c74aa4a6cbe vfs_ceph_new: dont use ceph_ll_nonblocking_readv_writev
for fsync_send
via a200d4720ee smbd: return correct reparse tag DFS when listing
directories
via c9f67123071 CI: add Python test
samba.tests.dcerpc.dfs.DfsTests.test_dfs_reparse_tag
via 327fd685213 python/tests: also populate self.server in calls
LibsmbTests setup()
via 3c7b596f1bb pylibsmb: add SMB2_FIND_ID_BOTH_DIRECTORY_INFO
via 2de3b8ec09c vfs_xattr_tdb: fix dangling symlink detection
via a2ad8f49cfe s3/rpc_server/dfs: fix creating a DFS link
from d1a778414e1 s3:net: Pass down the server from cmdline to
sync_pw2keytabs()
https://git.samba.org/?p=samba.git;a=shortlog;h=v4-21-test
- Log -----------------------------------------------------------------
commit 13587f415c90630c224da93611d8b367c80b58e8
Author: Jule Anger <[email protected]>
Date: Wed Oct 15 15:18:58 2025 +0200
VERSION: Bump version up to Samba 4.21.10...
and re-enable GIT_SNAPSHOT.
Signed-off-by: Jule Anger <[email protected]>
commit 894e1537d93f931e529c83df00bf36404c379c8a
Merge: 825d6197eff 25ea748dac2
Author: Jule Anger <[email protected]>
Date: Wed Oct 15 15:18:18 2025 +0200
Merge tag 'samba-4.21.9' into v4-21-test
samba: tag release samba-4.21.9
commit 825d6197effca4d252ca5172ac9e15abe257b91e
Author: Martin Schwenke <[email protected]>
Date: Fri Aug 15 15:01:58 2025 +1000
ctdb-common: Only respect CTDB_SOCKET in CTDB_TEST_MODE
At the moment CTDB_SOCKET can be used outside of test mode even though
nobody should do this. So, no longer allow this.
This means ensuring CTDB_TEST_MODE is set in the in the
"clusteredmember" selftest environment, so that CTDB_SOCKET is
respected there..
Details...
The associated use of chown(2) and chmod(2), used to secure the socket
in ctdb_daemon.c:ux_socket_bind(), potentially enables a symlink race
attack. However, the chown(2) is currently not done in test mode, so
restricting the use of CTDB_SOCKET to test mode solves the potential
security issue.
Also, sprinkle warnings about use of CTDB_TEST_MODE in appropriate
places, just to attempt to limit unwanted behaviour.
An alternative could be to use the socket file descriptor with
fchown(2) and fchmod(2). However, these system calls are not well
defined on sockets. Still, this was previously done in CTDB's early
days (using the poorly documented method where they are allowed in
Linux (only?) before calling bind(2)). It was removed (due to
portability issues, via commits
cf1056df94943ddcc3d547d4533b4bc04f57f265 and
2da3fe1b175a468fdff4aa4f65627facd2c28394) and replaced with the
current post-bind chown(2) and chmod(2).
I would like to remove the CTDB_SOCKET environment variable entirely,
since setting CTDB_TEST_MODE and CTDB_BASE covers all reasonable test
environments. However, I have a feeling that people use it for
interactive testing, and that can still be done in CTDB_TEST_MODE.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15921
Signed-off-by: Martin Schwenke <[email protected]>
Reported-by: *GUIAR OQBA * <[email protected]>
Reviewed-by: Volker Lendecke <[email protected]>
Autobuild-User(master): Volker Lendecke <[email protected]>
Autobuild-Date(master): Thu Sep 25 09:02:06 UTC 2025 on atb-devel-224
(cherry picked from commit 7e2358fcf7be177d6e5de6e26f9d7c5af4acbb0c)
commit 467557d63a0ffebb15b88e5f5bee1ca9dbddcb2b
Author: Martin Schwenke <[email protected]>
Date: Fri Aug 15 14:59:49 2025 +1000
ctdb-common: Factor out checking of CTDB_TEST_MODE
For use elsewhere.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15921
Signed-off-by: Martin Schwenke <[email protected]>
(cherry picked from commit 4c12a36eb5b44fb08d0461e6fa77fcdb4a128433)
commit 086f6393ab300f37962428b9a1cd318624b95130
Author: Martin Schwenke <[email protected]>
Date: Fri Aug 15 12:08:47 2025 +1000
ctdb-pmda: Do not directly support CTDB_SOCKET environment variable
Always use whatever CTDB uses in the current environment.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15921
Signed-off-by: Martin Schwenke <[email protected]>
Reviewed-by: Volker Lendecke <[email protected]>
(cherry picked from commit c4794e40529c63c696ecc3f8f27c810c22dd63a5)
commit 13bc5d1887e90741cf286066c8fd19d8a5b67c74
Author: Anoop C S <[email protected]>
Date: Mon Sep 22 11:11:46 2025 +0530
vfs_ceph_new: Use integer value instead of boolean
ceph_ll_fsync() API[1] accepts the third and final argument as integer
and not a boolean value.
[1]
https://github.com/ceph/ceph/blob/main/src/include/cephfs/libcephfs.h#L2041
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15919
Signed-off-by: Anoop C S <[email protected]>
Reviewed-by: Guenther Deschner <[email protected]>
Autobuild-User(master): Günther Deschner <[email protected]>
Autobuild-Date(master): Mon Sep 22 12:24:35 UTC 2025 on atb-devel-224
(cherry picked from commit 5200c120f34c4a28fa9f4cb55b46dbb9d90eb758)
commit c74aa4a6cbe02b60e2b9b01b58fd28d91f2e3f60
Author: Shachar Sharon <[email protected]>
Date: Wed Sep 17 14:25:27 2025 +0300
vfs_ceph_new: dont use ceph_ll_nonblocking_readv_writev for fsync_send
Commit 4ae922413844 ("vfs_ceph_new: use libcephfs nonblocking API for
async-io ops") uses ceph_ll_nonblocking_readv_writev for fsync_send.
However, the actual behaviour of libcephfs when using this API with
'fsync=true' is not async-fsync, as one may assume. Instead,
vfs_ceph_new should use a nonblocking fsync API[1], once it is ready.
Removed the usage of ceph_ll_nonblocking_readv_writev for fsync.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=15919
[1]
https://github.com/ceph/ceph/commit/c88a21c30d8b265adb152f631d2629d29539f7b7
Signed-off-by: Shachar Sharon <[email protected]>
Reviewed-by: Anoop C S <[email protected]>
Reviewed-by: Xavi Hernandez <[email protected]>
Reviewed-by: Guenther Deschner <[email protected]>
(cherry picked from commit 82c0988a8bc3d3e364e2d56ad8ea27e359fbc3f0)
commit a200d4720ee4dd8f26753436a63ccb58c7c1f0f0
Author: Ralph Boehme <[email protected]>
Date: Fri Aug 15 10:13:33 2025 +0200
smbd: return correct reparse tag DFS when listing directories
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15843
Signed-off-by: Ralph Boehme <[email protected]>
Reviewed-by: Volker Lendecke <[email protected]>
Autobuild-User(master): Volker Lendecke <[email protected]>
Autobuild-Date(master): Fri Aug 15 15:37:05 UTC 2025 on atb-devel-224
(cherry picked from commit 0be53d7ac0a39d6a48c6c5e2144f342c0d406781)
commit c9f671230717754912cbdc77ee262bb5afa5ffc6
Author: Ralph Boehme <[email protected]>
Date: Thu Aug 14 17:18:08 2025 +0200
CI: add Python test samba.tests.dcerpc.dfs.DfsTests.test_dfs_reparse_tag
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15843
Signed-off-by: Ralph Boehme <[email protected]>
Reviewed-by: Volker Lendecke <[email protected]>
(cherry picked from commit 43ee86c0c757e95712ed52bd336d2085485498ba)
commit 327fd68521380aa55b7407ad1189612024756384
Author: Ralph Boehme <[email protected]>
Date: Fri Aug 15 11:49:27 2025 +0200
python/tests: also populate self.server in calls LibsmbTests setup()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15843
Signed-off-by: Ralph Boehme <[email protected]>
Reviewed-by: Volker Lendecke <[email protected]>
(cherry picked from commit 5f7b31927733b0ff3e1207be242f1ddb2cb699bd)
commit 3c7b596f1bbf26f5378446391e1c1f6dcd4bc912
Author: Ralph Boehme <[email protected]>
Date: Fri Aug 15 10:14:53 2025 +0200
pylibsmb: add SMB2_FIND_ID_BOTH_DIRECTORY_INFO
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15843
Signed-off-by: Ralph Boehme <[email protected]>
Reviewed-by: Volker Lendecke <[email protected]>
(cherry picked from commit 698a0195f72a091e9ed6b0448160c79e37761840)
commit 2de3b8ec09cf3dcd6d17ccf5b025477b338f51cc
Author: Ralph Boehme <[email protected]>
Date: Fri Aug 15 11:50:26 2025 +0200
vfs_xattr_tdb: fix dangling symlink detection
The caller might not have called stat on smb_fname.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15843
Signed-off-by: Ralph Boehme <[email protected]>
Reviewed-by: Volker Lendecke <[email protected]>
(cherry picked from commit 2e88ba4b4de146327c19682d59bbe34d68158bf7)
commit a2ad8f49cfe0039b67300243e6033613b5301df5
Author: Ralph Boehme <[email protected]>
Date: Thu Aug 14 19:20:02 2025 +0200
s3/rpc_server/dfs: fix creating a DFS link
If there's no existing link, get_referred_path() returns
NT_STATUS_OBJECT_PATH_NOT_FOUND.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15843
Signed-off-by: Ralph Boehme <[email protected]>
Reviewed-by: Volker Lendecke <[email protected]>
(cherry picked from commit 2cb2991ccdd5d4f63e4c5b3ccc4454a6b39d6afe)
-----------------------------------------------------------------------
Summary of changes:
VERSION | 4 +-
WHATSNEW.txt | 51 ++++++++-
ctdb/common/path.c | 35 ++++--
ctdb/server/ctdbd.c | 7 ++
ctdb/tests/README | 10 +-
ctdb/utils/pmda/pmda_ctdb.c | 13 ++-
python/samba/tests/dcerpc/dfs.py | 48 ++++++++
python/samba/tests/libsmb.py | 1 +
python/samba/tests/usage.py | 2 +
selftest/target/Samba.pm | 1 +
selftest/target/Samba3.pm | 1 +
selftest/target/Samba4.pm | 1 +
source3/libsmb/pylibsmb.c | 1 +
source3/modules/vfs_ceph_new.c | 12 +-
source3/modules/vfs_streams_xattr.c | 5 +-
source3/modules/vfs_xattr_tdb.c | 13 +--
source3/rpc_server/dfs/srv_dfs_nt.c | 4 +-
source3/selftest/tests.py | 3 +
source3/smbd/dir.c | 2 +
source4/nbt_server/wins/wins_hook.c | 9 ++
source4/selftest/tests.py | 1 +
source4/torture/nbt/wins.c | 136 ++++++++++++++++++++++-
source4/torture/vfs/streams_xattr.c | 211 ++++++++++++++++++++++++++++++++++++
source4/torture/vfs/vfs.c | 1 +
source4/torture/wscript_build | 2 +-
testprogs/blackbox/wins_hook_test | 15 +++
26 files changed, 545 insertions(+), 44 deletions(-)
create mode 100644 python/samba/tests/dcerpc/dfs.py
create mode 100644 source4/torture/vfs/streams_xattr.c
create mode 100755 testprogs/blackbox/wins_hook_test
Changeset truncated at 500 lines:
diff --git a/VERSION b/VERSION
index fcc7e6eca24..00ab3d93cca 100644
--- a/VERSION
+++ b/VERSION
@@ -27,7 +27,7 @@ SAMBA_COPYRIGHT_STRING="Copyright Andrew Tridgell and the
Samba Team 1992-2024"
########################################################
SAMBA_VERSION_MAJOR=4
SAMBA_VERSION_MINOR=21
-SAMBA_VERSION_RELEASE=9
+SAMBA_VERSION_RELEASE=10
########################################################
# If a official release has a serious bug #
@@ -101,7 +101,7 @@ SAMBA_VERSION_RC_RELEASE=
# e.g. SAMBA_VERSION_IS_SVN_SNAPSHOT=yes #
# -> "3.0.0-SVN-build-199" #
########################################################
-SAMBA_VERSION_IS_GIT_SNAPSHOT=yes
+SAMBA_VERSION_IS_GIT_SNAPSHOT=no
########################################################
# This is for specifying a release nickname #
diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index b3c21a5ebaf..299c894c198 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -1,3 +1,51 @@
+ ==============================
+ Release Notes for Samba 4.21.9
+ October 15, 2025
+ ==============================
+
+
+This is a security release in order to address the following defects:
+
+o CVE-2025-9640: Uninitialized memory disclosure via vfs_streams_xattr.
+ https://www.samba.org/samba/security/CVE-2025-9640.html
+
+o CVE-2025-10230: Command injection via WINS server hook script.
+ https://www.samba.org/samba/security/CVE-2025-10230.html
+
+
+Changes since 4.21.8
+--------------------
+
+o Douglas Bagnall <[email protected]>
+ * BUG 15903: CVE-2025-10230.
+
+o Andrew Walker <[email protected]>
+ * BUG 15885: CVE-2025-9640.
+
+
+#######################################
+Reporting bugs & Development Discussion
+#######################################
+
+Please discuss this release on the samba-technical mailing list or by
+joining the #samba-technical:matrix.org matrix room, or
+#samba-technical IRC channel on irc.libera.chat.
+
+If you do report problems then please try to send high quality
+feedback. If you don't provide vital information to help us track down
+the problem then you will probably be ignored. All bug reports should
+be filed under the Samba 4.1 and newer product in the project's Bugzilla
+database (https://bugzilla.samba.org/).
+
+
+======================================================================
+== Our Code, Our Bugs, Our Responsibility.
+== The Samba Team
+======================================================================
+
+
+Release notes for older releases follow:
+----------------------------------------
==============================
Release Notes for Samba 4.21.8
September 09, 2025
@@ -66,8 +114,7 @@ database (https://bugzilla.samba.org/).
======================================================================
-Release notes for older releases follow:
-----------------------------------------
+----------------------------------------------------------------------
==============================
Release Notes for Samba 4.21.7
July 07, 2025
diff --git a/ctdb/common/path.c b/ctdb/common/path.c
index ea3b08f4b2e..0d935429460 100644
--- a/ctdb/common/path.c
+++ b/ctdb/common/path.c
@@ -45,16 +45,30 @@ struct {
.vardir = CTDB_VARDIR,
};
-static void path_set_basedir(void)
+static void path_set_test_mode(void)
{
- const char *t;
-
+ const char *t = NULL;
+
+ /*
+ * Do not use CTDB_TEST_MODE outside a test environment to
+ * attempt to (for example) improve installation flexibility.
+ * This is unsupported, may cause unwanted security issues and
+ * may break in future releases.
+ */
t = getenv("CTDB_TEST_MODE");
if (t == NULL) {
- goto done;
+ return;
}
ctdb_paths.test_mode = true;
+}
+
+static void path_set_basedir(void)
+{
+ path_set_test_mode();
+ if (!ctdb_paths.test_mode) {
+ goto done;
+ }
ctdb_paths.basedir = getenv("CTDB_BASE");
if (ctdb_paths.basedir == NULL) {
@@ -188,11 +202,14 @@ char *path_config(TALLOC_CTX *mem_ctx)
char *path_socket(TALLOC_CTX *mem_ctx, const char *daemon)
{
- if (strcmp(daemon, "ctdbd") == 0) {
- const char *t = getenv("CTDB_SOCKET");
-
- if (t != NULL) {
- return talloc_strdup(mem_ctx, t);
+ path_set_test_mode();
+ if (ctdb_paths.test_mode) {
+ if (strcmp(daemon, "ctdbd") == 0) {
+ const char *t = getenv("CTDB_SOCKET");
+
+ if (t != NULL) {
+ return talloc_strdup(mem_ctx, t);
+ }
}
}
diff --git a/ctdb/server/ctdbd.c b/ctdb/server/ctdbd.c
index 67311c6a5da..12f5e00c7c8 100644
--- a/ctdb/server/ctdbd.c
+++ b/ctdb/server/ctdbd.c
@@ -242,6 +242,13 @@ int main(int argc, const char *argv[])
* Logging setup/options
*/
+
+ /*
+ * Do not use CTDB_TEST_MODE outside a test environment to
+ * attempt to (for example) improve installation flexibility.
+ * This is unsupported, may cause unwanted security issues and
+ * may break in future releases.
+ */
test_mode = getenv("CTDB_TEST_MODE");
/* Log to stderr (ignoring configuration) when running as interactive */
diff --git a/ctdb/tests/README b/ctdb/tests/README
index 80f3311b684..8a243c21703 100644
--- a/ctdb/tests/README
+++ b/ctdb/tests/README
@@ -98,7 +98,7 @@ Test and debugging variable options
PID file relative to CTDB_BASE.
When testing with multiple local daemons on a single
- machine this does 3 extra things:
+ machine this does some extra things:
* Disables checks related to public IP addresses
@@ -107,6 +107,14 @@ Test and debugging variable options
* Disables real-time scheduling
+ * Allows the CTDB_SOCKET environment variable to be used to
+ specify ctdbd's Unix domain socket location.
+
+ Do not use this variable outside a test environment to
+ attempt to (for example) improve installation flexibility.
+ This is unsupported, may cause unwanted security issues and
+ may break in future releases.
+
CTDB_DEBUG_HUNG_SCRIPT_LOGFILE=FILENAME
FILENAME specifies where log messages should go when
debugging hung eventscripts. This is a testing option. See
diff --git a/ctdb/utils/pmda/pmda_ctdb.c b/ctdb/utils/pmda/pmda_ctdb.c
index 7ac8a3b38d1..9df7f780652 100644
--- a/ctdb/utils/pmda/pmda_ctdb.c
+++ b/ctdb/utils/pmda/pmda_ctdb.c
@@ -28,6 +28,8 @@
#include "lib/util/time.h"
#include "lib/util/blocking.h"
+#include "common/path.h"
+
#include "client/client.h"
#include "client/client_sync.h"
@@ -49,9 +51,7 @@
* CTDB PMDA
*
* This PMDA connects to the locally running ctdbd daemon and pulls
- * statistics for export via PCP. The ctdbd Unix domain socket path can be
- * specified with the CTDB_SOCKET environment variable, otherwise the default
- * path is used.
+ * statistics for export via PCP.
*/
/*
@@ -191,7 +191,7 @@ pmda_ctdb_disconnected(void *args)
static int
pmda_ctdb_daemon_connect(void)
{
- const char *socket_name;
+ char *socket_name = NULL;
int ret;
ev = tevent_context_init(NULL);
@@ -200,9 +200,9 @@ pmda_ctdb_daemon_connect(void)
return -1;
}
- socket_name = getenv("CTDB_SOCKET");
+ socket_name = path_socket(ev, "ctdbd");
if (socket_name == NULL) {
- socket_name = CTDB_SOCKET;
+ goto err_ev;
}
ret = ctdb_client_init(ev, ev, socket_name, &client);
@@ -215,6 +215,7 @@ pmda_ctdb_daemon_connect(void)
ctdb_client_set_disconnect_callback(client, pmda_ctdb_disconnected,
NULL);
+ talloc_free(socket_name);
return 0;
err_ev:
diff --git a/python/samba/tests/dcerpc/dfs.py b/python/samba/tests/dcerpc/dfs.py
new file mode 100644
index 00000000000..0fcce324e55
--- /dev/null
+++ b/python/samba/tests/dcerpc/dfs.py
@@ -0,0 +1,48 @@
+#
+# Unix SMB/CIFS implementation.
+# Copyright Ralph Boehme <[email protected]> 2025
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+"""Tests for samba.dcerpc.dfs"""
+
+import os
+import logging
+import samba
+from samba.dcerpc import dfs
+from samba.tests import RpcInterfaceTestCase
+from samba.logger import get_samba_logger
+from samba.credentials import Credentials
+from samba.samba3 import libsmb_samba_internal as libsmb
+import samba.tests.libsmb
+from samba.samba3 import param as s3param
+
+logger = get_samba_logger(name=__name__)
+
+class DfsTests(samba.tests.libsmb.LibsmbTests):
+ def setUp(self):
+ super().setUp()
+ self.dfs = dfs.netdfs('ncacn_np:%s[/pipe/netdfs]' % self.server,
self.lp, self.creds)
+ self.c = libsmb.Conn(self.server_ip, "msdfs-share", self.lp,
self.creds)
+
+ def tearDown(self):
+ super().tearDown()
+
+ def test_dfs_reparse_tag(self):
+ self.dfs.Add('\\\\%s\\msdfs-share\\dfslink' % self.server,
self.server, 'tmp', 'comment', 0)
+ l = self.c.list('', info_level=libsmb.SMB2_FIND_ID_BOTH_DIRECTORY_INFO)
+ files = {i['name']: i for i in l}
+ self.assertEqual(files['dfslink']['reparse_tag'],
libsmb.IO_REPARSE_TAG_DFS)
+ self.dfs.Remove('\\\\%s\\msdfs-share\\dfslink' % self.server,
self.server, 'tmp')
diff --git a/python/samba/tests/libsmb.py b/python/samba/tests/libsmb.py
index cb632d0e3a7..11564d44b65 100644
--- a/python/samba/tests/libsmb.py
+++ b/python/samba/tests/libsmb.py
@@ -42,6 +42,7 @@ class LibsmbTests(samba.tests.TestCase):
server_conf_dir = os.path.dirname(server_conf)
self.global_inject = os.path.join(server_conf_dir,
"global_inject.conf")
+ self.server = samba.tests.env_get_var_value("SERVER")
self.server_ip = samba.tests.env_get_var_value("SERVER_IP")
def clean_file(self, conn, filename):
diff --git a/python/samba/tests/usage.py b/python/samba/tests/usage.py
index 3312bfe3746..afee5a5ebcd 100644
--- a/python/samba/tests/usage.py
+++ b/python/samba/tests/usage.py
@@ -73,6 +73,7 @@ EXCLUDE_USAGE = {
'lib/ldb/tests/python/api.py',
'source4/selftest/tests.py',
'buildtools/bin/waf',
+ 'testprogs/blackbox/wins_hook_test',
'selftest/tap2subunit',
'script/show_test_time',
'source4/scripting/bin/subunitrun',
@@ -89,6 +90,7 @@ EXCLUDE_HELP = {
'selftest/tap2subunit',
'wintest/test-s3.py',
'wintest/test-s4-howto.py',
+ 'testprogs/blackbox/wins_hook_test',
}
diff --git a/selftest/target/Samba.pm b/selftest/target/Samba.pm
index 15d7692b5d6..b5eee9a18dd 100644
--- a/selftest/target/Samba.pm
+++ b/selftest/target/Samba.pm
@@ -1017,6 +1017,7 @@ my @exported_envvars = (
"RESOLV_WRAPPER_HOSTS",
# ctdb stuff
+ "CTDB_TEST_MODE",
"CTDB_PREFIX",
"NUM_NODES",
"CTDB_BASE",
diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
index 6650690fbb7..e164dd9b085 100755
--- a/selftest/target/Samba3.pm
+++ b/selftest/target/Samba3.pm
@@ -4322,6 +4322,7 @@ sub provision_ctdb($$$$)
$ret{"CTDB_IFACE_IP_NODE${i}"} = $ip;
}
+ $ret{CTDB_TEST_MODE} = "yes";
$ret{CTDB_BASE} = $ret{CTDB_BASE_NODE0};
$ret{CTDB_SOCKET} = $ret{CTDB_SOCKET_NODE0};
$ret{CTDB_SERVER_NAME} = $ret{CTDB_SERVER_NAME_NODE0};
diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm
index 1a86f7a07d5..fb66268d603 100755
--- a/selftest/target/Samba4.pm
+++ b/selftest/target/Samba4.pm
@@ -1628,6 +1628,7 @@ sub provision_ad_dc_ntvfs($$$)
ldap server require strong auth =
allow_sasl_without_tls_channel_bindings
raw NTLMv2 auth = yes
lsa over netlogon = yes
+ wins hook = $ENV{SRCDIR_ABS}/testprogs/blackbox/wins_hook_test
rpc server port = 1027
auth event notification = true
dsdb event notification = true
diff --git a/source3/libsmb/pylibsmb.c b/source3/libsmb/pylibsmb.c
index 8dbef93834b..f41c18e8983 100644
--- a/source3/libsmb/pylibsmb.c
+++ b/source3/libsmb/pylibsmb.c
@@ -3140,6 +3140,7 @@ MODULE_INIT_FUNC(libsmb_samba_cwrapper)
ADD_STRING(SMB2_CREATE_TAG_APP_INSTANCE_ID);
ADD_STRING(SVHDX_OPEN_DEVICE_CONTEXT);
ADD_STRING(SMB2_CREATE_TAG_POSIX);
+ ADD_FLAGS(SMB2_FIND_ID_BOTH_DIRECTORY_INFO);
ADD_FLAGS(SMB2_FIND_POSIX_INFORMATION);
ADD_FLAGS(FILE_SUPERSEDE);
ADD_FLAGS(FILE_OPEN);
diff --git a/source3/modules/vfs_ceph_new.c b/source3/modules/vfs_ceph_new.c
index 4622d8659cd..d1b4c79d09d 100644
--- a/source3/modules/vfs_ceph_new.c
+++ b/source3/modules/vfs_ceph_new.c
@@ -2966,18 +2966,8 @@ static struct tevent_req *vfs_ceph_fsync_send(struct
vfs_handle_struct *handle,
0);
SMBPROFILE_BYTES_ASYNC_SET_IDLE(state->profile_bytes);
-#if HAVE_CEPH_ASYNCIO
- state->req = req;
- state->data = NULL;
- state->len = 0;
- state->off = 0;
- state->fsync = true;
- vfs_ceph_aio_submit(handle, req, ev);
- return req;
-#endif
-
vfs_ceph_aio_start(state);
- ret = vfs_ceph_ll_fsync(handle, state->cfh, false);
+ ret = vfs_ceph_ll_fsync(handle, state->cfh, 0);
vfs_ceph_aio_finish(state, ret);
if (ret != 0) {
/* ceph_fsync returns -errno on error. */
diff --git a/source3/modules/vfs_streams_xattr.c
b/source3/modules/vfs_streams_xattr.c
index 03ff6147cb0..4fb4f42baa0 100644
--- a/source3/modules/vfs_streams_xattr.c
+++ b/source3/modules/vfs_streams_xattr.c
@@ -959,15 +959,18 @@ static ssize_t streams_xattr_pwrite(vfs_handle_struct
*handle,
if ((offset + n) > ea.value.length-1) {
uint8_t *tmp;
+ size_t new_sz = offset + n + 1;
tmp = talloc_realloc(talloc_tos(), ea.value.data, uint8_t,
- offset + n + 1);
+ new_sz);
if (tmp == NULL) {
TALLOC_FREE(ea.value.data);
errno = ENOMEM;
return -1;
}
+
+ memset(tmp + ea.value.length, 0, new_sz - ea.value.length);
ea.value.data = tmp;
ea.value.length = offset + n + 1;
ea.value.data[offset+n] = 0;
diff --git a/source3/modules/vfs_xattr_tdb.c b/source3/modules/vfs_xattr_tdb.c
index 447d868924d..19331d0de4f 100644
--- a/source3/modules/vfs_xattr_tdb.c
+++ b/source3/modules/vfs_xattr_tdb.c
@@ -604,13 +604,12 @@ static int xattr_tdb_unlinkat(vfs_handle_struct *handle,
} else {
ret = SMB_VFS_NEXT_STAT(handle, full_fname);
if (ret == -1 && (errno == ENOENT || errno == ELOOP)) {
- if (VALID_STAT(smb_fname->st) &&
- S_ISLNK(smb_fname->st.st_ex_mode)) {
- /*
- * Original name was a link - Could be
- * trying to remove a dangling symlink.
- */
- ret = SMB_VFS_NEXT_LSTAT(handle, full_fname);
+ /*
+ * Could be trying to remove a dangling symlink.
+ */
+ ret = SMB_VFS_NEXT_LSTAT(handle, full_fname);
+ if (ret == 0 && !S_ISLNK(full_fname->st.st_ex_mode)) {
+ ret = -1;
}
}
}
diff --git a/source3/rpc_server/dfs/srv_dfs_nt.c
b/source3/rpc_server/dfs/srv_dfs_nt.c
index 8eaa59a8b0e..d8aeb76a1fb 100644
--- a/source3/rpc_server/dfs/srv_dfs_nt.c
+++ b/source3/rpc_server/dfs/srv_dfs_nt.c
@@ -97,7 +97,9 @@ WERROR _dfs_Add(struct pipes_struct *p, struct dfs_Add *r)
remote_address,
local_address,
jn, &consumedcnt, &self_ref);
- if(!NT_STATUS_IS_OK(status)) {
+ if(!NT_STATUS_IS_OK(status) &&
+ !NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_PATH_NOT_FOUND))
+ {
return ntstatus_to_werror(status);
}
diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py
index 86d660800dc..039231e67b6 100755
--- a/source3/selftest/tests.py
+++ b/source3/selftest/tests.py
@@ -1142,6 +1142,7 @@ nbt = ["nbt.dgram"]
vfs = [
"vfs.fruit",
"vfs.acl_xattr",
+ "vfs.streams_xattr",
"vfs.fruit_netatalk",
"vfs.fruit_file_id",
"vfs.fruit_timemachine",
@@ -1337,6 +1338,8 @@ for t in tests:
plansmbtorture4testsuite(t, "fileserver", '//$SERVER_IP/tmp
-U$USERNAME%$PASSWORD')
elif t == "vfs.acl_xattr":
plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp
-U$USERNAME%$PASSWORD')
+ elif t == "vfs.streams_xattr":
+ plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/vfs_wo_fruit
-U$USERNAME%$PASSWORD')
elif t == "smb2.compound_find":
plansmbtorture4testsuite(t, "fileserver", '//$SERVER/compound_find
-U$USERNAME%$PASSWORD')
plansmbtorture4testsuite(t, "fileserver", '//$SERVER_IP/tmp
-U$USERNAME%$PASSWORD')
diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c
index 76eb5756dc8..ba8164408b4 100644
--- a/source3/smbd/dir.c
+++ b/source3/smbd/dir.c
@@ -640,6 +640,8 @@ bool smbd_dirptr_get_entry(TALLOC_CTX *ctx,
smb_fname->st.st_ex_mode = (smb_fname->st.st_ex_mode &
~S_IFMT) |
S_IFDIR;
+ smb_fname->fsp->fsp_name->st.st_ex_mode =
+ smb_fname->st.st_ex_mode;
mode = dos_mode_msdfs(conn, dname, &smb_fname->st);
--
Samba Shared Repository