The Samba-Bugzilla – Attachment 14260 Details for
Bug 13485
Add --quiet option to smbclient
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch for 4.8
v4-8-test-smbclient-quiet.patch (text/plain), 4.31 KB, created by
Andreas Schneider
on 2018-06-27 14:20:44 UTC
(
hide
)
Description:
patch for 4.8
Filename:
MIME Type:
Creator:
Andreas Schneider
Created:
2018-06-27 14:20:44 UTC
Size:
4.31 KB
patch
obsolete
>From a922e4e22c470fbfc7ef1b1ac1645a81f59d1846 Mon Sep 17 00:00:00 2001 >From: Justin Stephenson <jstephen@redhat.com> >Date: Mon, 25 Jun 2018 09:58:56 -0400 >Subject: [PATCH 1/2] s3:client: Add --quiet option to smbclient >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Add quiet command-line argument to allow suppressing the help log >message printed automatically after establishing a smbclient connection > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=13485 > >Signed-off-by: Justin Stephenson <jstephen@redhat.com> >Reviewed-by: Andreas Schneider <asn@samba.org> >Reviewed-by: Björn Baumbach <bb@sernet.de> >(cherry picked from commit 89a8b3ecd47b6d9a33e66f22d2786f0ae3b4cb72) >--- > source3/client/client.c | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > >diff --git a/source3/client/client.c b/source3/client/client.c >index 2c1c76036f7..c836e5a0477 100644 >--- a/source3/client/client.c >+++ b/source3/client/client.c >@@ -52,6 +52,7 @@ static int port = 0; > static char *service; > static char *desthost; > static bool grepable = false; >+static bool quiet = false; > static char *cmdstr = NULL; > const char *cmd_ptr = NULL; > >@@ -6059,7 +6060,9 @@ static int process_stdin(void) > { > int rc = 0; > >- d_printf("Try \"help\" to get a list of possible commands.\n"); >+ if (!quiet) { >+ d_printf("Try \"help\" to get a list of possible commands.\n"); >+ } > > while (!finished) { > TALLOC_CTX *frame = talloc_stackframe(); >@@ -6329,6 +6332,7 @@ int main(int argc,char *argv[]) > { "timeout", 't', POPT_ARG_INT, &io_timeout, 'b', "Changes the per-operation timeout", "SECONDS" }, > { "port", 'p', POPT_ARG_INT, &port, 'p', "Port to connect to", "PORT" }, > { "grepable", 'g', POPT_ARG_NONE, NULL, 'g', "Produce grepable output" }, >+ { "quiet", 'q', POPT_ARG_NONE, NULL, 'q', "Suppress help message" }, > { "browse", 'B', POPT_ARG_NONE, NULL, 'B', "Browse SMB servers using DNS" }, > POPT_COMMON_SAMBA > POPT_COMMON_CONNECTION >@@ -6451,6 +6455,9 @@ int main(int argc,char *argv[]) > case 'g': > grepable=true; > break; >+ case 'q': >+ quiet=true; >+ break; > case 'e': > smb_encrypt=true; > break; >-- >2.17.1 > > >From b11493ebaf08ea3d12b496ca97de9d55fa7337a8 Mon Sep 17 00:00:00 2001 >From: Justin Stephenson <jstephen@redhat.com> >Date: Mon, 25 Jun 2018 10:29:28 -0400 >Subject: [PATCH 2/2] s3:tests: Add test for smbclient --quiet >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=13485 > >Signed-off-by: Justin Stephenson <jstephen@redhat.com> >Reviewed-by: Andreas Schneider <asn@samba.org> >Reviewed-by: Björn Baumbach <bb@sernet.de> > >Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> >Autobuild-Date(master): Tue Jun 26 20:29:19 CEST 2018 on sn-devel-144 > >(cherry picked from commit f90f434e041461fbea2e101066c79ec8caf35cce) >--- > source3/script/tests/test_smbclient_s3.sh | 34 +++++++++++++++++++++++ > 1 file changed, 34 insertions(+) > >diff --git a/source3/script/tests/test_smbclient_s3.sh b/source3/script/tests/test_smbclient_s3.sh >index 706023b7d19..264f483ff34 100755 >--- a/source3/script/tests/test_smbclient_s3.sh >+++ b/source3/script/tests/test_smbclient_s3.sh >@@ -1598,6 +1598,36 @@ EOF > return 0 > } > >+test_server_quiet_message() >+{ >+ tmpfile=$PREFIX/smbclient_interactive_prompt_commands >+ cat > $tmpfile <<EOF >+ls >+quit >+EOF >+ cmd='CLI_FORCE_INTERACTIVE=yes $SMBCLIENT "$@" -U$USERNAME%$PASSWORD //$SERVER/tmp -I $SERVER_IP $ADDARGS --quiet < $tmpfile 2>&1' >+ eval echo "$cmd" >+ out=`eval $cmd` >+ ret=$? >+ rm -f $tmpfile >+ >+ if [ $ret -ne 0 ] ; then >+ echo "$out" >+ echo "failed to connect error $ret" >+ return 1 >+ fi >+ >+ echo "$out" | grep 'Try "help" to get a list of possible commands.' >+ ret=$? >+ if [ $ret -eq 0 ] ; then >+ echo "$out" >+ echo 'failed - quiet should skip this message.' >+ return 1 >+ fi >+ >+ return 0 >+} >+ > # Test xattr_stream correctly reports mode. > # BUG: https://bugzilla.samba.org/show_bug.cgi?id=13380 > >@@ -1789,6 +1819,10 @@ testit "server os message" \ > test_server_os_message || \ > failed=`expr $failed + 1` > >+testit "test server quiet message" \ >+ test_server_quiet_message || \ >+ failed=`expr $failed + 1` >+ > testit "setmode test" \ > test_setmode || \ > failed=`expr $failed + 1` >-- >2.17.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:
ab
:
review+
Actions:
View
Attachments on
bug 13485
: 14260