summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2017-06-23 16:58:42 +0200
committerStefan Metzmacher <metze@samba.org>2017-06-27 16:57:47 +0200
commit5a794ece3d2c5b8dbb5d6e71ad25784a370230d4 (patch)
treeea6be2cf3f6605d82397fd9f10b643f275f90655 /source3
parent1723090d63fd5a48fb5f2b3a281b99f097b2368d (diff)
downloadsamba-5a794ece3d2c5b8dbb5d6e71ad25784a370230d4.tar.gz
s3:smbclient: remove unreliable Domain=[...] OS=[Windows 6.1] Server=[...] banner
On interactive sessions we print the following instead now: Try "help" do get a list of possible commands. smb: > The reason for this is that we don't get these information via SMB2 and the we only get the domain name via some layering violations from the NTLMSSP state. It's better to remove this consitently for all SMB and auth protocol combinations. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/client/client.c12
-rwxr-xr-xsource3/script/tests/test_smbclient_s3.sh44
2 files changed, 21 insertions, 35 deletions
diff --git a/source3/client/client.c b/source3/client/client.c
index 375d9e3e4d9..df36028a78e 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -5155,7 +5155,7 @@ static int process_command_string(const char *cmd_in)
status = cli_cm_open(talloc_tos(), NULL,
have_ip ? dest_ss_str : desthost,
service, popt_get_cmdline_auth_info(),
- true, smb_encrypt,
+ false, smb_encrypt,
max_protocol, port, name_type,
&cli);
if (!NT_STATUS_IS_OK(status)) {
@@ -5521,6 +5521,8 @@ static int process_stdin(void)
{
int rc = 0;
+ d_printf("Try \"help\" do get a list of possible commands.\n");
+
while (!finished) {
TALLOC_CTX *frame = talloc_stackframe();
char *tok = NULL;
@@ -5584,7 +5586,7 @@ static int process(const char *base_directory)
status = cli_cm_open(talloc_tos(), NULL,
have_ip ? dest_ss_str : desthost,
service, popt_get_cmdline_auth_info(),
- true, smb_encrypt, max_protocol, port,
+ false, smb_encrypt, max_protocol, port,
name_type, &cli);
if (!NT_STATUS_IS_OK(status)) {
return 1;
@@ -5621,7 +5623,7 @@ static int do_host_query(const char *query_host)
status = cli_cm_open(talloc_tos(), NULL,
have_ip ? dest_ss_str : query_host,
"IPC$", popt_get_cmdline_auth_info(),
- true, smb_encrypt, max_protocol, port,
+ false, smb_encrypt, max_protocol, port,
name_type, &cli);
if (!NT_STATUS_IS_OK(status)) {
return 1;
@@ -5660,7 +5662,7 @@ static int do_host_query(const char *query_host)
status = cli_cm_open(talloc_tos(), NULL,
have_ip ? dest_ss_str : query_host,
"IPC$", popt_get_cmdline_auth_info(),
- true, smb_encrypt, max_proto,
+ false, smb_encrypt, max_proto,
NBT_SMB_PORT, name_type, &cli);
if (!NT_STATUS_IS_OK(status)) {
cli = NULL;
@@ -5696,7 +5698,7 @@ static int do_tar_op(const char *base_directory)
status = cli_cm_open(talloc_tos(), NULL,
have_ip ? dest_ss_str : desthost,
service, popt_get_cmdline_auth_info(),
- true, smb_encrypt, max_protocol,
+ false, smb_encrypt, max_protocol,
port, name_type, &cli);
if (!NT_STATUS_IS_OK(status)) {
ret = 1;
diff --git a/source3/script/tests/test_smbclient_s3.sh b/source3/script/tests/test_smbclient_s3.sh
index 19ae6d02e52..4cfd054b018 100755
--- a/source3/script/tests/test_smbclient_s3.sh
+++ b/source3/script/tests/test_smbclient_s3.sh
@@ -701,7 +701,7 @@ test_bad_names()
return 1
fi
- echo "$out" | wc -l 2>&1 | grep 6
+ echo "$out" | wc -l 2>&1 | grep 5
ret=$?
if [ $ret != 0 ] ; then
echo "$out"
@@ -709,19 +709,11 @@ test_bad_names()
return 1
fi
- echo "$out" | grep 'Domain=.*OS=.*Server='
- ret=$?
- if [ $ret != 0 ] ; then
- echo "$out"
- echo "failed listing \\badname-tmp - grep (1) failed with $ret"
- return 1
- fi
-
echo "$out" | grep '^ \. *D'
ret=$?
if [ $ret != 0 ] ; then
echo "$out"
- echo "failed listing \\badname-tmp - grep (2) failed with $ret"
+ echo "failed listing \\badname-tmp - grep (1) failed with $ret"
return 1
fi
@@ -729,7 +721,7 @@ test_bad_names()
ret=$?
if [ $ret != 0 ] ; then
echo "$out"
- echo "failed listing \\badname-tmp - grep (3) failed with $ret"
+ echo "failed listing \\badname-tmp - grep (2) failed with $ret"
return 1
fi
@@ -737,7 +729,7 @@ test_bad_names()
ret=$?
if [ $ret != 0 ] ; then
echo "$out"
- echo "failed listing \\badname-tmp - grep (4) failed with $ret"
+ echo "failed listing \\badname-tmp - grep (3) failed with $ret"
return 1
fi
@@ -745,7 +737,7 @@ test_bad_names()
ret=$?
if [ $ret != 0 ] ; then
echo "$out"
- echo "failed listing \\badname-tmp - grep (5) failed with $ret"
+ echo "failed listing \\badname-tmp - grep (4) failed with $ret"
return 1
fi
@@ -753,7 +745,7 @@ test_bad_names()
ret=$?
if [ $ret != 0 ] ; then
echo "$out"
- echo "failed listing \\badname-tmp - grep (6) failed with $ret"
+ echo "failed listing \\badname-tmp - grep (5) failed with $ret"
return 1
fi
@@ -769,7 +761,7 @@ test_bad_names()
return 1
fi
- echo "$out" | wc -l 2>&1 | grep 6
+ echo "$out" | wc -l 2>&1 | grep 5
ret=$?
if [ $ret != 0 ] ; then
echo "$out"
@@ -777,19 +769,11 @@ test_bad_names()
return 1
fi
- echo "$out" | grep 'Domain=.*OS=.*Server='
- ret=$?
- if [ $ret != 0 ] ; then
- echo "$out"
- echo "failed listing \\badname-tmp - SMB3 grep (1) failed with $ret"
- return 1
- fi
-
echo "$out" | grep '^ \. *D'
ret=$?
if [ $ret != 0 ] ; then
echo "$out"
- echo "failed listing \\badname-tmp - SMB3 grep (2) failed with $ret"
+ echo "failed listing \\badname-tmp - SMB3 grep (1) failed with $ret"
return 1
fi
@@ -797,7 +781,7 @@ test_bad_names()
ret=$?
if [ $ret != 0 ] ; then
echo "$out"
- echo "failed listing \\badname-tmp - SMB3 grep (3) failed with $ret"
+ echo "failed listing \\badname-tmp - SMB3 grep (2) failed with $ret"
return 1
fi
@@ -805,7 +789,7 @@ test_bad_names()
ret=$?
if [ $ret != 0 ] ; then
echo "$out"
- echo "failed listing \\badname-tmp - SMB3 grep (4) failed with $ret"
+ echo "failed listing \\badname-tmp - SMB3 grep (3) failed with $ret"
return 1
fi
@@ -813,7 +797,7 @@ test_bad_names()
ret=$?
if [ $ret != 0 ] ; then
echo "$out"
- echo "failed listing \\badname-tmp - SMB3 grep (5) failed with $ret"
+ echo "failed listing \\badname-tmp - SMB3 grep (4) failed with $ret"
return 1
fi
@@ -821,7 +805,7 @@ test_bad_names()
ret=$?
if [ $ret != 0 ] ; then
echo "$out"
- echo "failed listing \\badname-tmp - SMB3 grep (6) failed with $ret"
+ echo "failed listing \\badname-tmp - SMB3 grep (5) failed with $ret"
return 1
fi
}
@@ -1224,11 +1208,11 @@ EOF
return 1
fi
- echo "$out" | grep "Domain=\[[a-zA-Z][a-zA-Z0-9.-]*\] OS=\[Windows [0-9]\.[0-9]\] Server=\[Samba"
+ echo "$out" | grep 'Try "help" do get a list of possible commands.'
ret=$?
if [ $ret -ne 0 ] ; then
echo "$out"
- echo "failed - should get: Domain=[...] OS=[Windows 6.1] Server=..."
+ echo 'failed - should get: Try "help" do get a list of possible commands.'
return 1
fi