summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2005-12-06 17:42:04 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:47:09 -0500
commit2184ad5af7f354dfb5f8addcb99e69fa2f79df01 (patch)
tree47f40671201d7d73bfd69df1eaa8917f4be2260b /source4
parent6b1ee03c53223fb6adcd8f485808536942bad6b8 (diff)
downloadsamba-2184ad5af7f354dfb5f8addcb99e69fa2f79df01.tar.gz
samba-2184ad5af7f354dfb5f8addcb99e69fa2f79df01.tar.bz2
samba-2184ad5af7f354dfb5f8addcb99e69fa2f79df01.zip
r12101: revert my last commit, I breaks the build and I don't know why...
metze (This used to be commit dc664df873c208c57752e8288a82cef77bc61338)
Diffstat (limited to 'source4')
-rw-r--r--source4/librpc/rpc/dcerpc_connect.c36
1 files changed, 19 insertions, 17 deletions
diff --git a/source4/librpc/rpc/dcerpc_connect.c b/source4/librpc/rpc/dcerpc_connect.c
index 618e7f6df7..d98c296a3f 100644
--- a/source4/librpc/rpc/dcerpc_connect.c
+++ b/source4/librpc/rpc/dcerpc_connect.c
@@ -52,6 +52,7 @@ void continue_pipe_open_smb(struct composite_context *ctx)
c->status = dcerpc_pipe_open_smb_recv(ctx);
if (!NT_STATUS_IS_OK(c->status)) {
+
DEBUG(0,("Failed to open pipe %s - %s\n", s->io.pipe_name, nt_errstr(c->status)));
composite_error(c, c->status);
return;
@@ -71,6 +72,7 @@ void continue_smb_connect(struct composite_context *ctx)
c->status = smb_composite_connect_recv(ctx, c);
if (!NT_STATUS_IS_OK(c->status)) {
+
DEBUG(0,("Failed to connect to %s - %s\n", s->io.binding->host, nt_errstr(c->status)));
composite_error(c, c->status);
return;
@@ -80,6 +82,10 @@ void continue_smb_connect(struct composite_context *ctx)
s->io.pipe_name = s->io.binding->endpoint;
open_ctx = dcerpc_pipe_open_smb_send(s->io.pipe->conn, s->tree, s->io.pipe_name);
+ if (open_ctx == NULL) {
+ composite_error(c, NT_STATUS_NO_MEMORY);
+ return;
+ }
composite_continue(c, open_ctx, continue_pipe_open_smb, c);
}
@@ -98,26 +104,22 @@ struct composite_context *dcerpc_pipe_connect_ncacn_np_smb_send(TALLOC_CTX *tmp_
c = talloc_zero(tmp_ctx, struct composite_context);
if (c == NULL) return NULL;
- c->state = COMPOSITE_STATE_IN_PROGRESS;
- c->private_data = s;
- c->event_ctx = io->pipe->conn->event_ctx;
-
s = talloc_zero(c, struct pipe_np_smb_state);
if (s == NULL) {
- c->status = NT_STATUS_NO_MEMORY;
- goto failed;
+ composite_error(c, NT_STATUS_NO_MEMORY);
+ goto done;
}
+ c->state = COMPOSITE_STATE_IN_PROGRESS;
+ c->private_data = s;
+ c->event_ctx = io->pipe->conn->event_ctx;
+
s->io = *io;
conn = &s->conn;
conn->in.dest_host = s->io.binding->host;
conn->in.port = 0;
conn->in.called_name = strupper_talloc(tmp_ctx, s->io.binding->host);
- if (conn->in.called_name) {
- c->status = NT_STATUS_NO_MEMORY;
- goto failed;
- }
conn->in.service = "IPC$";
conn->in.service_type = NULL;
conn->in.fallback_to_anonymous = False;
@@ -128,28 +130,28 @@ struct composite_context *dcerpc_pipe_connect_ncacn_np_smb_send(TALLOC_CTX *tmp_
anon_creds = cli_credentials_init(tmp_ctx);
if (!anon_creds) {
- c->status = NT_STATUS_NO_MEMORY;
- goto failed;
+ composite_error(c, NT_STATUS_NO_MEMORY);
+ goto done;
}
cli_credentials_set_anonymous(anon_creds);
cli_credentials_guess(anon_creds);
s->conn.in.credentials = anon_creds;
+
} else {
s->conn.in.credentials = s->io.creds;
}
conn_req = smb_composite_connect_send(conn, s->io.pipe->conn, s->io.pipe->conn->event_ctx);
if (!conn_req) {
- c->status = NT_STATUS_NO_MEMORY;
- goto failed;
+ composite_error(c, NT_STATUS_NO_MEMORY);
+ goto done;
}
composite_continue(c, conn_req, continue_smb_connect, c);
- return c;
-failed:
- composite_trigger_error(c);
+
+done:
return c;
}