summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2012-07-03 13:01:47 +0200
committerAndreas Schneider <asn@cryptomilk.org>2012-07-06 10:00:57 +0200
commita866dcc4f6696ed409a219b5cdd1baf56ccb2ff0 (patch)
treef12fd21cca69ad4bc51899d5decbb4a70bda30bd /source3
parentfae6091f1df9ae77f96743f6467b20386f6db404 (diff)
downloadsamba-a866dcc4f6696ed409a219b5cdd1baf56ccb2ff0.tar.gz
samba-a866dcc4f6696ed409a219b5cdd1baf56ccb2ff0.tar.bz2
samba-a866dcc4f6696ed409a219b5cdd1baf56ccb2ff0.zip
s3-rpc: Return the correct ntstatus depending on the transport.
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_client/rpc_transport_tstream.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/source3/rpc_client/rpc_transport_tstream.c b/source3/rpc_client/rpc_transport_tstream.c
index 01e7a5edc8..11cd8d44eb 100644
--- a/source3/rpc_client/rpc_transport_tstream.c
+++ b/source3/rpc_client/rpc_transport_tstream.c
@@ -186,7 +186,11 @@ static struct tevent_req *rpc_tstream_read_send(TALLOC_CTX *mem_ctx,
return NULL;
}
if (!rpc_tstream_is_connected(transp)) {
- tevent_req_nterror(req, NT_STATUS_CONNECTION_DISCONNECTED);
+ NTSTATUS status = NT_STATUS_CONNECTION_DISCONNECTED;
+ if (tstream_is_cli_np(transp->stream)) {
+ status = NT_STATUS_PIPE_DISCONNECTED;
+ }
+ tevent_req_nterror(req, status);
return tevent_req_post(req, ev);
}
state->transp = transp;
@@ -270,7 +274,11 @@ static struct tevent_req *rpc_tstream_write_send(TALLOC_CTX *mem_ctx,
return NULL;
}
if (!rpc_tstream_is_connected(transp)) {
- tevent_req_nterror(req, NT_STATUS_CONNECTION_DISCONNECTED);
+ NTSTATUS status = NT_STATUS_CONNECTION_DISCONNECTED;
+ if (tstream_is_cli_np(transp->stream)) {
+ status = NT_STATUS_PIPE_DISCONNECTED;
+ }
+ tevent_req_nterror(req, status);
return tevent_req_post(req, ev);
}
state->ev = ev;
@@ -366,7 +374,11 @@ static struct tevent_req *rpc_tstream_trans_send(TALLOC_CTX *mem_ctx,
}
if (!rpc_tstream_is_connected(transp)) {
- tevent_req_nterror(req, NT_STATUS_CONNECTION_DISCONNECTED);
+ NTSTATUS status = NT_STATUS_CONNECTION_DISCONNECTED;
+ if (tstream_is_cli_np(transp->stream)) {
+ status = NT_STATUS_PIPE_DISCONNECTED;
+ }
+ tevent_req_nterror(req, status);
return tevent_req_post(req, ev);
}
state->ev = ev;