The Samba-Bugzilla – Attachment 14163 Details for
Bug 13407
NetSessEnum returning stale sessions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
git-am fix for 4.8.next. Cherry-picked from master.
bug-13407-4.8.patch (text/plain), 5.96 KB, created by
Jeremy Allison
on 2018-04-26 23:31:43 UTC
(
hide
)
Description:
git-am fix for 4.8.next. Cherry-picked from master.
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2018-04-26 23:31:43 UTC
Size:
5.96 KB
patch
obsolete
>From 8d1db555441efe29b7984b1586c4f248699befdf Mon Sep 17 00:00:00 2001 >From: Christof Schmitt <cs@samba.org> >Date: Tue, 24 Apr 2018 12:18:49 -0700 >Subject: [PATCH 1/3] rpcclient: Print number of entries for NetSessEnum > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=13407 > >Signed-off-by: Christof Schmitt <cs@samba.org> >Reviewed-by: Jeremy Allison <jra@samba.org> >(cherry picked from commit 501819fa9e7926c2f54cb92d508ac0e8437fd476) >--- > source3/rpcclient/cmd_srvsvc.c | 2 ++ > 1 file changed, 2 insertions(+) > >diff --git a/source3/rpcclient/cmd_srvsvc.c b/source3/rpcclient/cmd_srvsvc.c >index e7929e7259c..f78fb9a135d 100644 >--- a/source3/rpcclient/cmd_srvsvc.c >+++ b/source3/rpcclient/cmd_srvsvc.c >@@ -883,6 +883,8 @@ static WERROR cmd_srvsvc_net_sess_enum(struct rpc_pipe_client *cli, > goto done; > } > >+ d_printf("Received %d entries.\n", total_entries); >+ > done: > return result; > } >-- >2.17.0.484.g0c8726318c-goog > > >From f400be93d96b31095994d4fa7fb314337040edbd Mon Sep 17 00:00:00 2001 >From: Christof Schmitt <cs@samba.org> >Date: Tue, 24 Apr 2018 13:52:59 -0700 >Subject: [PATCH 2/3] selftest: Add testcase for querying sessions after smbd > crash > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=13407 > >Signed-off-by: Christof Schmitt <cs@samba.org> >Reviewed-by: Jeremy Allison <jra@samba.org> >(cherry picked from commit e04846c7df8e3eec1f3dbb2fc5eaf47ceb1c44d2) >--- > selftest/knownfail | 1 + > .../tests/test_rpcclient_netsessenum.sh | 55 +++++++++++++++++++ > source3/selftest/tests.py | 6 ++ > 3 files changed, 62 insertions(+) > create mode 100755 source3/script/tests/test_rpcclient_netsessenum.sh > >diff --git a/selftest/knownfail b/selftest/knownfail >index 710fd33894e..f6589fa066f 100644 >--- a/selftest/knownfail >+++ b/selftest/knownfail >@@ -343,3 +343,4 @@ > # Disabling NTLM means you can't use samr to change the password > ^samba.tests.ntlmdisabled.python\(ktest\).ntlmdisabled.NtlmDisabledTests.test_samr_change_password\(ktest\) > ^samba.tests.ntlmdisabled.python\(ad_dc_no_ntlm\).ntlmdisabled.NtlmDisabledTests.test_ntlm_connection\(ad_dc_no_ntlm\) >+^samba3.blackbox.rpcclient_netsessenum.count2\(ad_member\) >diff --git a/source3/script/tests/test_rpcclient_netsessenum.sh b/source3/script/tests/test_rpcclient_netsessenum.sh >new file mode 100755 >index 00000000000..9abb3ae3db5 >--- /dev/null >+++ b/source3/script/tests/test_rpcclient_netsessenum.sh >@@ -0,0 +1,55 @@ >+#!/bin/sh >+# >+# Blackbox tests for the rpcclient srvsvc commands >+# >+# Copyright (C) 2018 Christof Schmitt >+ >+if [ $# -lt 6 ]; then >+cat <<EOF >+Usage: $0 DOMAIN ADMIN_USER ADMIN_PASSWORD SERVER RPCCLIENT SMBTORTURE3 SHARE >+EOF >+exit 1; >+fi >+ >+DOMAIN="$1" >+ADMIN_USER="$2" >+ADMIN_PASSWORD="$3" >+SERVER="$4" >+RPCCLIENT="$5" >+SMBTORTURE3="$6" >+SHARE="$7" >+ >+USERPASS="-U$DOMAIN/$ADMIN_USER%$ADMIN_PASSWORD" >+RPCCLIENTCMD="$RPCCLIENT $SERVER $USERPASS" >+ >+incdir=$(dirname $0)/../../../testprogs/blackbox >+. $incdir/subunit.sh >+ >+failed=0 >+ >+# >+# Verify initial number of sessions. >+# >+$RPCCLIENTCMD -c NetSessEnum | grep Received >+RC=$? >+testit "netsessenum" test $RC = 0 || failed=$(expr $failed + 1) >+ >+OUT=$($RPCCLIENTCMD -c NetSessEnum | grep Received) >+test "$OUT" = "Received 1 entries." >+RC=$? >+testit "count1" test $RC -eq 0 || failed=$(expr $failed + 1) >+ >+# >+# Inject smbd crash >+# >+$SMBTORTURE3 //"$SERVER"/"$SHARE" "$USERPASS" CLEANUP1 >+ >+# >+# Verify number of sessions after crash >+# >+OUT=$($RPCCLIENTCMD -c NetSessEnum | grep Received) >+test "$OUT" = "Received 1 entries." >+RC=$? >+testit "count2" test $RC -eq 0 || failed=$(expr $failed + 1) >+ >+testok $0 $failed >diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py >index 092605d50e2..172d3300463 100755 >--- a/source3/selftest/tests.py >+++ b/source3/selftest/tests.py >@@ -631,6 +631,12 @@ plantestsuite("samba3.blackbox.smbclient.encryption_off", "simpleserver", > "$USERNAME", "$PASSWORD", "$SERVER", > smbclient3]) > >+plantestsuite("samba3.blackbox.rpcclient_netsessenum", "ad_member", >+ [os.path.join(samba3srcdir, >+ "script/tests/test_rpcclient_netsessenum.sh"), >+ "$DOMAIN", "$DC_USERNAME", "$DC_PASSWORD", "$SERVER", >+ os.path.join(bindir(), "rpcclient"), smbtorture3, "tmp"]) >+ > # The ktest environment uses: > # server min protocol = SMB3_00 > # client max protocol = SMB3 >-- >2.17.0.484.g0c8726318c-goog > > >From 45a705ac3a087cb13c712863975e0463c5205a7a Mon Sep 17 00:00:00 2001 >From: Christof Schmitt <cs@samba.org> >Date: Tue, 24 Apr 2018 13:53:41 -0700 >Subject: [PATCH 3/3] rpc_server: Fix NetSessEnum with stale sessions > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=13407 > >Signed-off-by: Christof Schmitt <cs@samba.org> >Reviewed-by: Jeremy Allison <jra@samba.org> > >Autobuild-User(master): Jeremy Allison <jra@samba.org> >Autobuild-Date(master): Wed Apr 25 22:49:07 CEST 2018 on sn-devel-144 > >(cherry picked from commit a6fade4e10760284ef56abf45d3fa70038091cbe) >--- > selftest/knownfail | 1 - > source3/smbd/session.c | 4 ++++ > 2 files changed, 4 insertions(+), 1 deletion(-) > >diff --git a/selftest/knownfail b/selftest/knownfail >index f6589fa066f..710fd33894e 100644 >--- a/selftest/knownfail >+++ b/selftest/knownfail >@@ -343,4 +343,3 @@ > # Disabling NTLM means you can't use samr to change the password > ^samba.tests.ntlmdisabled.python\(ktest\).ntlmdisabled.NtlmDisabledTests.test_samr_change_password\(ktest\) > ^samba.tests.ntlmdisabled.python\(ad_dc_no_ntlm\).ntlmdisabled.NtlmDisabledTests.test_ntlm_connection\(ad_dc_no_ntlm\) >-^samba3.blackbox.rpcclient_netsessenum.count2\(ad_member\) >diff --git a/source3/smbd/session.c b/source3/smbd/session.c >index 4ddb856930d..8b4c6609304 100644 >--- a/source3/smbd/session.c >+++ b/source3/smbd/session.c >@@ -139,6 +139,10 @@ static int gather_sessioninfo(const char *key, struct sessionid *session, > return 0; > } > >+ if (!process_exists(session->pid)) { >+ return 0; >+ } >+ > sesslist->sessions = talloc_realloc( > sesslist->mem_ctx, sesslist->sessions, struct sessionid, > sesslist->count+1); >-- >2.17.0.484.g0c8726318c-goog >
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:
cs
:
review+
Actions:
View
Attachments on
bug 13407
: 14163 |
14164