The Samba-Bugzilla – Attachment 16727 Details for
Bug 14783
smbd "deadtime" parameter doesn't work anymore
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for 4.13, 4.14 and 4.15 cherry-picked from master
bug14783-v413,v414,v415.patch (text/plain), 5.84 KB, created by
Ralph Böhme
on 2021-08-11 15:33:36 UTC
(
hide
)
Description:
Patch for 4.13, 4.14 and 4.15 cherry-picked from master
Filename:
MIME Type:
Creator:
Ralph Böhme
Created:
2021-08-11 15:33:36 UTC
Size:
5.84 KB
patch
obsolete
>From 296614f5c3cb95ec07114d17026b0921a931fee5 Mon Sep 17 00:00:00 2001 >From: Ralph Boehme <slow@samba.org> >Date: Mon, 9 Aug 2021 12:31:07 +0200 >Subject: [PATCH 1/2] selftest: add a test for the "deadtime" parameter > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=14783 > >Signed-off-by: Ralph Boehme <slow@samba.org> >Reviewed-by: Samuel Cabrero <scabrero@samba.org> >Reviewed-by: Jeremy Allison <jra@samba.org> >(cherry picked from commit 39db53a1391769fc6476fa55b02add08f1b8cd75) >--- > selftest/knownfail.d/samba3.blackbox.deadtime | 1 + > source3/script/tests/test_deadtime.sh | 67 +++++++++++++++++++ > source3/selftest/tests.py | 4 ++ > 3 files changed, 72 insertions(+) > create mode 100644 selftest/knownfail.d/samba3.blackbox.deadtime > create mode 100755 source3/script/tests/test_deadtime.sh > >diff --git a/selftest/knownfail.d/samba3.blackbox.deadtime b/selftest/knownfail.d/samba3.blackbox.deadtime >new file mode 100644 >index 00000000000..99d00fdef58 >--- /dev/null >+++ b/selftest/knownfail.d/samba3.blackbox.deadtime >@@ -0,0 +1 @@ >+^samba3.blackbox.deadtime.deadtime.* >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 cf745907219..0b56aa2190c 100755 >--- a/source3/selftest/tests.py >+++ b/source3/selftest/tests.py >@@ -1092,6 +1092,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")]) > >-- >2.31.1 > > >From 2614f9a031d9fe171bbd7a3995a101179e999e0f Mon Sep 17 00:00:00 2001 >From: Ralph Boehme <slow@samba.org> >Date: Mon, 9 Aug 2021 15:12:31 +0200 >Subject: [PATCH 2/2] s3/rpc_server: track the number of policy handles with a > talloc destructor > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=14783 >RN: smbd "deadtime" parameter doesn't work anymore > >Signed-off-by: Ralph Boehme <slow@samba.org> >Reviewed-by: Samuel Cabrero <scabrero@samba.org> >Reviewed-by: Jeremy Allison <jra@samba.org> > >Autobuild-User(master): Jeremy Allison <jra@samba.org> >Autobuild-Date(master): Tue Aug 10 18:41:43 UTC 2021 on sn-devel-184 > >(cherry picked from commit 45a33b25c4e6b1db5d2dfa6297ccb390220a7c80) >--- > selftest/knownfail.d/samba3.blackbox.deadtime | 1 - > source3/rpc_server/rpc_handles.c | 20 +++++++++++++++++-- > 2 files changed, 18 insertions(+), 3 deletions(-) > delete mode 100644 selftest/knownfail.d/samba3.blackbox.deadtime > >diff --git a/selftest/knownfail.d/samba3.blackbox.deadtime b/selftest/knownfail.d/samba3.blackbox.deadtime >deleted file mode 100644 >index 99d00fdef58..00000000000 >--- a/selftest/knownfail.d/samba3.blackbox.deadtime >+++ /dev/null >@@ -1 +0,0 @@ >-^samba3.blackbox.deadtime.deadtime.* >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; > } > >-- >2.31.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
metze
:
review+
Actions:
View
Attachments on
bug 14783
: 16727