mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
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>
This commit is contained in:
parent
1723090d63
commit
5a794ece3d
@ -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;
|
||||
|
@ -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,7 +709,7 @@ test_bad_names()
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo "$out" | grep 'Domain=.*OS=.*Server='
|
||||
echo "$out" | grep '^ \. *D'
|
||||
ret=$?
|
||||
if [ $ret != 0 ] ; then
|
||||
echo "$out"
|
||||
@ -717,7 +717,7 @@ test_bad_names()
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo "$out" | grep '^ \. *D'
|
||||
echo "$out" | grep '^ \.\. *D'
|
||||
ret=$?
|
||||
if [ $ret != 0 ] ; then
|
||||
echo "$out"
|
||||
@ -725,7 +725,7 @@ test_bad_names()
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo "$out" | grep '^ \.\. *D'
|
||||
echo "$out" | grep '^ blank.txt *N'
|
||||
ret=$?
|
||||
if [ $ret != 0 ] ; then
|
||||
echo "$out"
|
||||
@ -733,7 +733,7 @@ test_bad_names()
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo "$out" | grep '^ blank.txt *N'
|
||||
echo "$out" | grep '^ *$'
|
||||
ret=$?
|
||||
if [ $ret != 0 ] ; then
|
||||
echo "$out"
|
||||
@ -741,19 +741,11 @@ test_bad_names()
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo "$out" | grep '^ *$'
|
||||
ret=$?
|
||||
if [ $ret != 0 ] ; then
|
||||
echo "$out"
|
||||
echo "failed listing \\badname-tmp - grep (5) failed with $ret"
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo "$out" | grep 'blocks of size.*blocks available'
|
||||
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,7 +769,7 @@ test_bad_names()
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo "$out" | grep 'Domain=.*OS=.*Server='
|
||||
echo "$out" | grep '^ \. *D'
|
||||
ret=$?
|
||||
if [ $ret != 0 ] ; then
|
||||
echo "$out"
|
||||
@ -785,7 +777,7 @@ test_bad_names()
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo "$out" | grep '^ \. *D'
|
||||
echo "$out" | grep '^ \.\. *D'
|
||||
ret=$?
|
||||
if [ $ret != 0 ] ; then
|
||||
echo "$out"
|
||||
@ -793,7 +785,7 @@ test_bad_names()
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo "$out" | grep '^ \.\. *D'
|
||||
echo "$out" | grep '^ blank.txt *N'
|
||||
ret=$?
|
||||
if [ $ret != 0 ] ; then
|
||||
echo "$out"
|
||||
@ -801,7 +793,7 @@ test_bad_names()
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo "$out" | grep '^ blank.txt *N'
|
||||
echo "$out" | grep '^ *$'
|
||||
ret=$?
|
||||
if [ $ret != 0 ] ; then
|
||||
echo "$out"
|
||||
@ -809,19 +801,11 @@ test_bad_names()
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo "$out" | grep '^ *$'
|
||||
ret=$?
|
||||
if [ $ret != 0 ] ; then
|
||||
echo "$out"
|
||||
echo "failed listing \\badname-tmp - SMB3 grep (5) failed with $ret"
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo "$out" | grep 'blocks of size.*blocks available'
|
||||
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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user