summaryrefslogtreecommitdiff
path: root/source3/torture
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2002-08-17 15:04:57 +0000
committerJelmer Vernooij <jelmer@samba.org>2002-08-17 15:04:57 +0000
commit287d49bb5da3a0eece5501910aef30328f63e30a (patch)
tree42c7629e4ae6832ff535801639d7c90a0978dfa9 /source3/torture
parentf0255b38bc17f4da9a63b2be4c3ce505688e933e (diff)
downloadsamba-287d49bb5da3a0eece5501910aef30328f63e30a.tar.gz
samba-287d49bb5da3a0eece5501910aef30328f63e30a.tar.bz2
samba-287d49bb5da3a0eece5501910aef30328f63e30a.zip
Sync 3.0 branch with HEAD
(This used to be commit d3599b446ed1c8ccd7c9e161ecfa5d52d6066c22)
Diffstat (limited to 'source3/torture')
-rw-r--r--source3/torture/locktest.c2
-rw-r--r--source3/torture/locktest2.c70
2 files changed, 8 insertions, 64 deletions
diff --git a/source3/torture/locktest.c b/source3/torture/locktest.c
index c34b4c1ad2..a62f7af1ad 100644
--- a/source3/torture/locktest.c
+++ b/source3/torture/locktest.c
@@ -136,7 +136,7 @@ static void show_locks(void)
/*****************************************************
return a connection to a server
*******************************************************/
-struct cli_state *connect_one(char *share, int snum)
+static struct cli_state *connect_one(char *share, int snum)
{
struct cli_state *c;
struct nmb_name called, calling;
diff --git a/source3/torture/locktest2.c b/source3/torture/locktest2.c
index 3c24cfaa4a..58817bbd36 100644
--- a/source3/torture/locktest2.c
+++ b/source3/torture/locktest2.c
@@ -149,15 +149,14 @@ static void print_brl(SMB_DEV_T dev, SMB_INO_T ino, int pid,
/*****************************************************
return a connection to a server
*******************************************************/
-struct cli_state *connect_one(char *share)
+static struct cli_state *connect_one(char *share)
{
struct cli_state *c;
- struct nmb_name called, calling;
char *server_n;
fstring server;
- struct in_addr ip;
fstring myname;
static int count;
+ NTSTATUS nt_status;
fstrcpy(server,share+2);
share = strchr_m(server,'\\');
@@ -167,40 +166,6 @@ struct cli_state *connect_one(char *share)
server_n = server;
- zero_ip(&ip);
-
- slprintf(myname,sizeof(myname), "lock-%u-%u", getpid(), count++);
-
- make_nmb_name(&calling, myname, 0x0);
- make_nmb_name(&called , server, 0x20);
-
- again:
- zero_ip(&ip);
-
- /* have to open a new connection */
- if (!(c=cli_initialise(NULL)) || !cli_connect(c, server_n, &ip)) {
- DEBUG(0,("Connection to %s failed\n", server_n));
- return NULL;
- }
-
- if (!cli_session_request(c, &calling, &called)) {
- DEBUG(0,("session request to %s failed\n", called.name));
- cli_shutdown(c);
- if (strcmp(called.name, "*SMBSERVER")) {
- make_nmb_name(&called , "*SMBSERVER", 0x20);
- goto again;
- }
- return NULL;
- }
-
- DEBUG(4,(" session request ok\n"));
-
- if (!cli_negprot(c)) {
- DEBUG(0,("protocol negotiation failed\n"));
- cli_shutdown(c);
- return NULL;
- }
-
if (!got_pass) {
char *pass = getpass("Password: ");
if (pass) {
@@ -208,37 +173,16 @@ struct cli_state *connect_one(char *share)
}
}
- if (!cli_session_setup(c, username,
- password, strlen(password),
- password, strlen(password),
- lp_workgroup())) {
- DEBUG(0,("session setup failed: %s\n", cli_errstr(c)));
- return NULL;
- }
+ slprintf(myname,sizeof(myname), "lock-%u-%u", getpid(), count++);
- /*
- * These next two lines are needed to emulate
- * old client behaviour for people who have
- * scripts based on client output.
- * QUESTION ? Do we want to have a 'client compatibility
- * mode to turn these on/off ? JRA.
- */
-
- if (*c->server_domain || *c->server_os || *c->server_type)
- DEBUG(1,("Domain=[%s] OS=[%s] Server=[%s]\n",
- c->server_domain,c->server_os,c->server_type));
-
- DEBUG(4,(" session setup ok\n"));
+ nt_status = cli_full_connection(&c, myname, server_n, NULL, 0, share, "?????",
+ username, lp_workgroup(), password, 0);
- if (!cli_send_tconX(c, share, "?????",
- password, strlen(password)+1)) {
- DEBUG(0,("tree connect failed: %s\n", cli_errstr(c)));
- cli_shutdown(c);
+ if (!NT_STATUS_IS_OK(nt_status)) {
+ DEBUG(0, ("cli_full_connection failed with error %s\n", nt_errstr(nt_status)));
return NULL;
}
- DEBUG(4,(" tconx ok\n"));
-
c->use_oplocks = use_oplocks;
return c;