[SCM] Samba Shared Repository - branch v4-15-stable updated

Karolin Seeger kseeger at samba.org
Wed Sep 1 09:32:17 UTC 2021


The branch, v4-15-stable has been updated
       via  8a2c51f268b VERSION: Disable GIT_SNAPSHOT for the 4.15.0rc4 release.
       via  bf634d022cf WHATSNEW: Add release notes for Samba 4.15.0rc4.
       via  3f8db63d9bc util_sock: fix assignment of sa_socklen
       via  522fd7b38be WHATSNEW: Fix formatting.
       via  e0dc3168210 s3/rpc_server: track the number of policy handles with a talloc destructor
       via  1e56dc7dd19 selftest: add a test for the "deadtime" parameter
       via  068bdf8fbfb VERSION: Bump version up to Samba 4.15.0rc4...
      from  16a28116179 VERSION: Disable GIT_SNAPSHOT for the 4.15.0rc3 release.

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-15-stable


- Log -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 VERSION                               |  2 +-
 WHATSNEW.txt                          | 45 +++++++++++++----------
 source3/lib/util_sock.c               |  9 +++++
 source3/rpc_server/rpc_handles.c      | 20 +++++++++--
 source3/script/tests/test_deadtime.sh | 67 +++++++++++++++++++++++++++++++++++
 source3/selftest/tests.py             |  4 +++
 6 files changed, 126 insertions(+), 21 deletions(-)
 create mode 100755 source3/script/tests/test_deadtime.sh


Changeset truncated at 500 lines:

diff --git a/VERSION b/VERSION
index c529cb04f23..b185563e6ae 100644
--- a/VERSION
+++ b/VERSION
@@ -87,7 +87,7 @@ SAMBA_VERSION_PRE_RELEASE=
 # e.g. SAMBA_VERSION_RC_RELEASE=1                      #
 #  ->  "3.0.0rc1"                                      #
 ########################################################
-SAMBA_VERSION_RC_RELEASE=3
+SAMBA_VERSION_RC_RELEASE=4
 
 ########################################################
 # To mark SVN snapshots this should be set to 'yes'    #
diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index 0e6aeea6530..9b072788ad1 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -1,7 +1,7 @@
 Release Announcements
 =====================
 
-This is the third release candidate of Samba 4.15.  This is *not*
+This is the fourth release candidate of Samba 4.15.  This is *not*
 intended for production environments and is designed for testing
 purposes only.  Please report any defects via the Samba bug reporting
 system at https://bugzilla.samba.org/.
@@ -70,18 +70,19 @@ client that is in the allow list and NOT in the deny list.
 "server multi channel support" no longer experimental
 -----------------------------------------------------
 
-This option is enabled by default starting with to 4.15 (on Linux and FreeBSD).
+This option is enabled by default starting with 4.15 (on Linux and FreeBSD).
 Due to dependencies on kernel APIs of Linux or FreeBSD, it's only possible
 to use this feature on Linux and FreeBSD for now.
 
+
 samba-tool available without the ad-dc
 --------------------------------------
 
-The samba-tool command is now available when samba is configured
---without-ad-dc. Not all features will work, and some ad-dc specific options
-have been disabled. The samba-tool domain options, for example, are limited
+The 'samba-tool' command is now available when samba is configured
+"--without-ad-dc". Not all features will work, and some ad-dc specific options
+have been disabled. The 'samba-tool domain' options, for example, are limited
 when no ad-dc is present. Samba must still be built with ads in order to enable
-samba-tool.
+'samba-tool'.
 
 
 Improved command line user experience
@@ -98,7 +99,7 @@ simplified and provides better control for encryption, singing and kerberos.
 Also several command line options have a smb.conf variable to control the
 default now.
 
-All tools are logging to stderr by default. You can use --debug-stdout to
+All tools are logging to stderr by default. You can use "--debug-stdout" to
 change the behavior.
 
 ### Common parser:
@@ -158,23 +159,24 @@ to redirect ticket requests to the right DC. This is e.g. needed for one way
 trusts. The options `winbind use krb5 enterprise principals` and
 `winbind scan trusted domains` will be deprecated in one of the next releases.
 
+
 Support for Offline Domain Join (ODJ)
 -------------------------------------
 
 The net utility is now able to support the offline domain join feature
 as known from the Windows djoin.exe command for many years. Samba's
-implementation is accessible via the "net offlinejoin" subcommand. It
+implementation is accessible via the 'net offlinejoin' subcommand. It
 can provision computers and request offline joining for both Windows
 and Unix machines. It is also possible to provision computers from
-Windows (using djoin.exe) and use the generated data in Samba's net
+Windows (using djoin.exe) and use the generated data in Samba's 'net'
 utility. The existing options for the provisioning and joining steps
 are documented in the net(8) manpage.
 
 
-samba-tool dns zoneoptions for aging control
---------------------------------------------
+'samba-tool dns zoneoptions' for aging control
+----------------------------------------------
 
-The samba-tool dns zoneoptions command can be used to turn aging on
+The 'samba-tool dns zoneoptions' command can be used to turn aging on
 and off, alter the refresh and no-refresh periods, and manipulate the
 timestamps of existing records.
 
@@ -193,8 +195,8 @@ step process will help prevent the temporary loss of dynamic records
 if scavenging happens before their first renewal.
 
 
-Marking old records as static or dynamic with samba-tool
---------------------------------------------------------
+Marking old records as static or dynamic with 'samba-tool'
+----------------------------------------------------------
 
 A bug in Samba versions prior to 4.9 meant records that were meant to
 be static were marked as dynamic and vice versa. To fix the timestamps
@@ -205,7 +207,7 @@ preferably before turning aging on.
    --mark-records-dynamic-regex
    --mark-records-static-regex
 
-The --mark-old-records-static option will make records older than the
+The "--mark-old-records-static" option will make records older than the
 specified date static (that is, with a zero timestamp). For example,
 if you upgraded to Samba 4.9 in November 2018, you could use ensure no
 old records will be mistakenly interpreted as dynamic using the
@@ -226,7 +228,7 @@ These options are deliberately long and cumbersome to type, so people
 have a chance to think before they get to the end. You can make a
 mess if you get it wrong.
 
-All samba-tool dns zoneoptions modes can be given a --dry-run/-n
+All 'samba-tool dns zoneoptions' modes can be given a "--dry-run/-n"
 argument that allows you to inspect the likely results before going
 ahead.
 
@@ -262,13 +264,13 @@ where aging was enabled (and hence tombstone timestamps were used).
 samba-tool dns update and RPC changes
 -------------------------------------
 
-The dnsserver DCERPC pipe can be used by samba-tool and Windows tools
+The dnsserver DCERPC pipe can be used by 'samba-tool' and Windows tools
 to manipulate dns records on the remote server. A bug in Samba meant
 it was not possible to update an existing DNS record to change the
 TTL. The general behaviour of RPC updates is now closer to that of
 Windows.
 
-samba-tool dns update is now a bit more careful in rejecting and
+'samba-tool dns update' is now a bit more careful in rejecting and
 warning you about malformed IPv4 and IPv6 addresses.
 
 
@@ -313,6 +315,13 @@ smb.conf changes
   winbind scan trusted domains            Changed         No
 
 
+CHANGES SINCE 4.15.0rc3
+=======================
+
+o  Bjoern Jacke <bj at sernet.de>
+   * BUG 14800: util_sock: fix assignment of sa_socklen.
+
+
 CHANGES SINCE 4.15.0rc2
 =======================
 
diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c
index 2dbb572a974..85dc3efbe15 100644
--- a/source3/lib/util_sock.c
+++ b/source3/lib/util_sock.c
@@ -254,6 +254,15 @@ int open_socket_in(
 	int val = rebind ? 1 : 0;
 	bool ok;
 
+	switch (addr.u.sa.sa_family) {
+	case AF_INET6:
+		addr.sa_socklen = sizeof(struct sockaddr_in6);
+		break;
+	case AF_INET:
+		addr.sa_socklen = sizeof(struct sockaddr_in);
+		break;
+	}
+
 	ok = samba_sockaddr_set_port(&addr, port);
 	if (!ok) {
 		ret = -EINVAL;
diff --git a/source3/rpc_server/rpc_handles.c b/source3/rpc_server/rpc_handles.c
index 9ef93231466..745ea4dd6ef 100644
--- a/source3/rpc_server/rpc_handles.c
+++ b/source3/rpc_server/rpc_handles.c
@@ -103,18 +103,36 @@ size_t num_pipe_handles(void)
   data_ptr is TALLOC_FREE()'ed
 ****************************************************************************/
 
+struct hnd_cnt {
+	bool _dummy;
+};
+
+static int hnd_cnt_destructor(struct hnd_cnt *cnt)
+{
+	num_handles--;
+	return 0;
+}
+
 bool create_policy_hnd(struct pipes_struct *p,
 		       struct policy_handle *hnd,
 		       uint8_t handle_type,
 		       void *data_ptr)
 {
 	struct dcesrv_handle *rpc_hnd = NULL;
+	struct hnd_cnt *cnt = NULL;
 
 	rpc_hnd = dcesrv_handle_create(p->dce_call, handle_type);
 	if (rpc_hnd == NULL) {
 		return false;
 	}
 
+	cnt = talloc_zero(rpc_hnd, struct hnd_cnt);
+	if (cnt == NULL) {
+		TALLOC_FREE(rpc_hnd);
+		return false;
+	}
+	talloc_set_destructor(cnt, hnd_cnt_destructor);
+
 	if (data_ptr != NULL) {
 		rpc_hnd->data = talloc_move(rpc_hnd, &data_ptr);
 	}
@@ -205,8 +223,6 @@ bool close_policy_hnd(struct pipes_struct *p,
 
 	TALLOC_FREE(rpc_hnd);
 
-	num_handles--;
-
 	return true;
 }
 
diff --git a/source3/script/tests/test_deadtime.sh b/source3/script/tests/test_deadtime.sh
new file mode 100755
index 00000000000..68703008f02
--- /dev/null
+++ b/source3/script/tests/test_deadtime.sh
@@ -0,0 +1,67 @@
+#!/usr/bin/env bash
+#
+# Test deadtime parameter
+#
+
+if [ $# -lt 1 ]; then
+    echo Usage: test_deadtime.sh IP
+    exit 1
+fi
+
+server=$1
+
+incdir=`dirname $0`/../../../testprogs/blackbox
+. $incdir/subunit.sh
+. $incdir/common_test_fns.inc
+
+failed=0
+
+smbclient="$BINDIR/smbclient"
+smbcontrol="$BINDIR/smbcontrol"
+
+global_inject_conf=$(dirname $SMB_CONF_PATH)/global_inject.conf
+
+echo "deadtime = 1" > $global_inject_conf
+$smbcontrol smbd reload-config
+
+cd $SELFTEST_TMPDIR || exit 1
+
+# Create the smbclient communication pipes.
+rm -f smbclient-stdin smbclient-stdout smbclient-stderr
+mkfifo smbclient-stdin smbclient-stdout smbclient-stderr
+
+export CLI_FORCE_INTERACTIVE=1
+export SAMBA_DEPRECATED_SUPPRESS=1
+
+# This gets inherited by smbclient and is required to smbclient doesn't get
+# killed by an unhandled SIGPIPE when writing an SMB2 KEEPALIVE packet to the
+# connection fd that was already closed by the server.
+trap "" SIGPIPE
+
+$smbclient //$server/tmp -U${USER}%${PASSWORD} \
+	     < smbclient-stdin > smbclient-stdout 2>smbclient-stderr &
+client_pid=$!
+
+sleep 1
+
+exec 100>smbclient-stdin  101<smbclient-stdout 102<smbclient-stderr
+
+# consume the smbclient startup message
+head -n 1 <&101
+
+sleep 70
+
+err=$(head -n 1 <&102)
+echo "err: $err"
+
+kill $client_pid
+
+echo "$err" | grep NT_STATUS_CONNECTION_DISCONNECTED
+testit "deadtime" test $? -eq 0 || failed=$(expr $failed + 1)
+
+echo "" > $global_inject_conf
+$smbcontrol smbd reload-config
+
+rm -f smbclient-stdin smbclient-stdout smbclient-stderr
+
+testok $0 $failed
diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py
index 687a9d9e875..d7f383a0e05 100755
--- a/source3/selftest/tests.py
+++ b/source3/selftest/tests.py
@@ -1097,6 +1097,10 @@ plantestsuite("samba3.blackbox.aio-outstanding", "simpleserver:local",
                '$SERVER_IP',
                "aio_delay_inject"])
 
+plantestsuite("samba3.blackbox.deadtime", "simpleserver:local",
+              [os.path.join(samba3srcdir, "script/tests/test_deadtime.sh"),
+               '$SERVER_IP'])
+
 plantestsuite("samba3.blackbox.smbd_error", "simpleserver:local",
               [os.path.join(samba3srcdir, "script/tests/test_smbd_error.sh")])
 


-- 
Samba Shared Repository



More information about the samba-cvs mailing list