s3:torture: create a global 'torture_creds' cli_credentials structure
authorStefan Metzmacher <metze@samba.org>
Fri, 28 Oct 2016 10:43:44 +0000 (12:43 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Tue, 15 Nov 2016 10:00:29 +0000 (11:00 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/torture/torture.c

index f31d2cc27b20393caf235018f08a8e8af22b16e3..275f1d391563420592c7cb95c1ea62106f0f1c42 100644 (file)
@@ -48,6 +48,7 @@ extern char *optarg;
 extern int optind;
 
 fstring host, workgroup, share, password, username, myname;
+struct cli_credentials *torture_creds;
 static const char *sockops="TCP_NODELAY";
 int torture_nprocs=1;
 static int port_to_use=0;
@@ -10793,6 +10794,20 @@ static void usage(void)
        printf("host=%s share=%s user=%s myname=%s\n", 
               host, share, username, myname);
 
+       torture_creds = cli_session_creds_init(frame,
+                                              username,
+                                              workgroup,
+                                              NULL, /* realm */
+                                              password,
+                                              use_kerberos,
+                                              false, /* fallback_after_kerberos */
+                                              false, /* use_ccache */
+                                              false); /* password_is_nt_hash */
+       if (torture_creds == NULL) {
+               d_printf("cli_session_creds_init() failed.\n");
+               exit(1);
+       }
+
        if (argc == optind) {
                correct = run_test("ALL");
        } else {