s3:utils: Use cli_cm_force_encryption() instead of cli_force_encryption()
authorStefan Metzmacher <metze@samba.org>
Thu, 3 Nov 2016 14:11:29 +0000 (15:11 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Mon, 19 Dec 2016 12:41:15 +0000 (13:41 +0100)
This allows SMB3 encryption instead of returning NT_STATUS_NOT_SUPPORTED.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Dec 19 13:41:15 CET 2016 on sn-devel-144

source3/utils/net_util.c

index cc65457b766a9c02a950ce7e6baa7fab0751b583..86a46672f56afed4cef5ff86cb91019ba2506b97 100644 (file)
@@ -155,29 +155,11 @@ NTSTATUS connect_to_service(struct net_context *c,
        }
 
        if (c->smb_encrypt) {
-               nt_status = cli_force_encryption(*cli_ctx,
-                                       c->opt_user_name,
-                                       c->opt_password,
-                                       c->opt_workgroup);
-
-               if (NT_STATUS_EQUAL(nt_status,NT_STATUS_NOT_SUPPORTED)) {
-                       d_printf(_("Encryption required and "
-                               "server that doesn't support "
-                               "UNIX extensions - failing connect\n"));
-               } else if (NT_STATUS_EQUAL(nt_status,NT_STATUS_UNKNOWN_REVISION)) {
-                       d_printf(_("Encryption required and "
-                               "can't get UNIX CIFS extensions "
-                               "version from server.\n"));
-               } else if (NT_STATUS_EQUAL(nt_status,NT_STATUS_UNSUPPORTED_COMPRESSION)) {
-                       d_printf(_("Encryption required and "
-                               "share %s doesn't support "
-                               "encryption.\n"), service_name);
-               } else if (!NT_STATUS_IS_OK(nt_status)) {
-                       d_printf(_("Encryption required and "
-                               "setup failed with error %s.\n"),
-                               nt_errstr(nt_status));
-               }
-
+               nt_status = cli_cm_force_encryption(*cli_ctx,
+                                                   c->opt_user_name,
+                                                   c->opt_password,
+                                                   c->opt_workgroup,
+                                                   service_name);
                if (!NT_STATUS_IS_OK(nt_status)) {
                        cli_shutdown(*cli_ctx);
                        *cli_ctx = NULL;