From dcc282590b34537fc1ead61c3300172528273b44 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 3 Jan 2008 17:22:12 -0600 Subject: r26654: libcli/smb_composite: Rather than specifying each of the gazillion options for SMB individually, just specify the smbcli_options struct. (This used to be commit 8a97886e24a4b969aa91409c06f423b71a45f6eb) --- source4/torture/locktest2.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'source4/torture/locktest2.c') diff --git a/source4/torture/locktest2.c b/source4/torture/locktest2.c index db323e1391..0fe3725385 100644 --- a/source4/torture/locktest2.c +++ b/source4/torture/locktest2.c @@ -136,7 +136,8 @@ static bool try_unlock(struct smbcli_state *c, int fstype, /***************************************************** return a connection to a server *******************************************************/ -static struct smbcli_state *connect_one(char *share, const char **ports) +static struct smbcli_state *connect_one(char *share, const char **ports, + struct smb_options *options) { struct smbcli_state *c; char *server_n; @@ -163,8 +164,9 @@ static struct smbcli_state *connect_one(char *share, const char **ports) slprintf(myname,sizeof(myname), "lock-%u-%u", getpid(), count++); nt_status = smbcli_full_connection(NULL, - &c, myname, server_n, ports, share, NULL, - username, lp_workgroup(), password, NULL); + &c, myname, server_n, ports, share, NULL, + username, lp_workgroup(), password, NULL, + options); if (!NT_STATUS_IS_OK(nt_status)) { DEBUG(0, ("smbcli_full_connection failed with error %s\n", nt_errstr(nt_status))); return NULL; @@ -180,6 +182,7 @@ static void reconnect(struct smbcli_state *cli[NSERVERS][NCONNECTIONS], char *nfs[NSERVERS], int fnum[NSERVERS][NUMFSTYPES][NCONNECTIONS][NFILES], const char **ports, + struct smbcli_options *options, char *share1, char *share2) { int server, conn, f, fstype; @@ -198,7 +201,7 @@ static void reconnect(struct smbcli_state *cli[NSERVERS][NCONNECTIONS], smbcli_ulogoff(cli[server][conn]); talloc_free(cli[server][conn]); } - cli[server][conn] = connect_one(share[server], ports); + cli[server][conn] = connect_one(share[server], ports, options); if (!cli[server][conn]) { DEBUG(0,("Failed to connect to %s\n", share[server])); exit(1); @@ -344,7 +347,7 @@ static int retest(struct smbcli_state *cli[NSERVERS][NCONNECTIONS], we then do random locking ops in tamdem on the 4 fnums from each server and ensure that the results match */ -static void test_locks(char *share1, char *share2, char *nfspath1, char *nfspath2, const char **ports) +static void test_locks(char *share1, char *share2, char *nfspath1, char *nfspath2, const char **ports, struct smbcli_options *options) { struct smbcli_state *cli[NSERVERS][NCONNECTIONS]; char *nfs[NSERVERS]; @@ -373,7 +376,7 @@ static void test_locks(char *share1, char *share2, char *nfspath1, char *nfspath recorded[n].needed = true; } - reconnect(cli, nfs, fnum, share1, share2, ports); + reconnect(cli, nfs, fnum, ports, options, share1, share2); open_files(cli, nfs, fnum); n = retest(cli, nfs, fnum, numops); @@ -384,7 +387,7 @@ static void test_locks(char *share1, char *share2, char *nfspath1, char *nfspath n1 = n; close_files(cli, nfs, fnum); - reconnect(cli, nfs, fnum, share1, share2, ports); + reconnect(cli, nfs, fnum, ports, options, share1, share2); open_files(cli, nfs, fnum); for (i=0;i