Fix -e for smbcquotas.
authorJeremy Allison <jra@samba.org>
Sat, 5 Jan 2008 08:50:03 +0000 (00:50 -0800)
committerJeremy Allison <jra@samba.org>
Sat, 5 Jan 2008 08:50:03 +0000 (00:50 -0800)
Jeremy.
(This used to be commit f97b1247c1053f47aef64be95ab9b3c3d8702c8a)

source3/utils/smbcquotas.c

index e6aa5e86cf21d9c3f2a4c7333add4881dfe937d6..508a2dc8ca625dc2d49ed466f786454ff2997890 100644 (file)
@@ -380,20 +380,33 @@ static struct cli_state *connect_one(const char *share)
                }
        }
 
-       if (NT_STATUS_IS_OK(nt_status = cli_full_connection(&c, global_myname(), server, 
-                                                   &ss, 0,
-                                                   share, "?????",
-                                                   get_cmdline_auth_info_username(),
-                                                   lp_workgroup(),
-                                                   get_cmdline_auth_info_password(),
-                                                   0,
-                                                   get_cmdline_auth_info_signing_state(),
-                                                   NULL))) {
-               return c;
-       } else {
+       nt_status = cli_full_connection(&c, global_myname(), server, 
+                                           &ss, 0,
+                                           share, "?????",
+                                           get_cmdline_auth_info_username(),
+                                           lp_workgroup(),
+                                           get_cmdline_auth_info_password(),
+                                           0,
+                                           get_cmdline_auth_info_signing_state(),
+                                           NULL);
+       if (!NT_STATUS_IS_OK(nt_status)) {
                DEBUG(0,("cli_full_connection failed! (%s)\n", nt_errstr(nt_status)));
                return NULL;
        }
+
+       if (get_cmdline_auth_info_smb_encrypt()) {
+               nt_status = cli_cm_force_encryption(c,
+                                       get_cmdline_auth_info_username(),
+                                       get_cmdline_auth_info_password(),
+                                       lp_workgroup(),
+                                       share);
+               if (!NT_STATUS_IS_OK(nt_status)) {
+                       cli_shutdown(c);
+                       return NULL;
+               }
+       }
+
+       return c;
 }
 
 /****************************************************************************