From: Stefan Metzmacher Date: Mon, 19 Jun 2017 19:53:49 +0000 (+0200) Subject: s3:torture: make use of smb_protocol_types_string() in run_smb2_negprot() X-Git-Tag: tevent-0.9.32~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5be4d6d50e35b4fec440bdd092c3ba87a6fa7669;p=thirdparty%2Fsamba.git s3:torture: make use of smb_protocol_types_string() in run_smb2_negprot() Signed-off-by: Stefan Metzmacher Reviewed-by: Jeremy Allison --- diff --git a/source3/torture/test_smb2.c b/source3/torture/test_smb2.c index 9368ab3264d..297c3abca9f 100644 --- a/source3/torture/test_smb2.c +++ b/source3/torture/test_smb2.c @@ -246,40 +246,12 @@ bool run_smb2_negprot(int dummy) } protocol = smbXcli_conn_protocol(cli->conn); + name = smb_protocol_types_string(protocol); - switch (protocol) { - case PROTOCOL_SMB2_02: - name = "SMB2_02"; - break; - case PROTOCOL_SMB2_10: - name = "SMB2_10"; - break; - case PROTOCOL_SMB2_22: - name = "SMB2_22"; - break; - case PROTOCOL_SMB2_24: - name = "SMB2_24"; - break; - case PROTOCOL_SMB3_00: - name = "SMB3_00"; - break; - case PROTOCOL_SMB3_02: - name = "SMB3_02"; - break; - case PROTOCOL_SMB3_10: - name = "SMB3_10"; - break; - case PROTOCOL_SMB3_11: - name = "SMB3_11"; - break; - default: - break; - } - - if (name) { + if (protocol >= PROTOCOL_SMB2_02) { printf("Server supports %s\n", name); } else { - printf("Server DOES NOT support SMB2\n"); + printf("Server DOES NOT support SMB2, only %s\n", name); return false; }