summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-04-23 10:39:20 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:51:32 -0500
commitd7b01752491b0cd4389d1f29f1a17c1ab4394357 (patch)
tree594f03f079880369030c2665a32e76ba128950a3
parent3d4c4c5fa3596646e98fa50f8f735ffc1cbe8240 (diff)
downloadsamba-d7b01752491b0cd4389d1f29f1a17c1ab4394357.tar.gz
samba-d7b01752491b0cd4389d1f29f1a17c1ab4394357.tar.bz2
samba-d7b01752491b0cd4389d1f29f1a17c1ab4394357.zip
r22485: don't crash when the main dcerpc code haven't setup
transport.recv_data yet also return always a usefull error metze (This used to be commit 0a8b4c328dfac972186564d2a4e1757d5135ec47)
-rw-r--r--source4/librpc/rpc/dcerpc_smb.c12
-rw-r--r--source4/librpc/rpc/dcerpc_smb2.c12
-rw-r--r--source4/librpc/rpc/dcerpc_sock.c2
3 files changed, 23 insertions, 3 deletions
diff --git a/source4/librpc/rpc/dcerpc_smb.c b/source4/librpc/rpc/dcerpc_smb.c
index 55fc37d84f..5100eb60f2 100644
--- a/source4/librpc/rpc/dcerpc_smb.c
+++ b/source4/librpc/rpc/dcerpc_smb.c
@@ -39,7 +39,17 @@ struct smb_private {
*/
static void pipe_dead(struct dcerpc_connection *c, NTSTATUS status)
{
- c->transport.recv_data(c, NULL, status);
+ if (NT_STATUS_EQUAL(NT_STATUS_UNSUCCESSFUL, status)) {
+ status = NT_STATUS_UNEXPECTED_NETWORK_ERROR;
+ }
+
+ if (NT_STATUS_EQUAL(NT_STATUS_OK, status)) {
+ status = NT_STATUS_END_OF_FILE;
+ }
+
+ if (c->transport.recv_data) {
+ c->transport.recv_data(c, NULL, status);
+ }
}
diff --git a/source4/librpc/rpc/dcerpc_smb2.c b/source4/librpc/rpc/dcerpc_smb2.c
index d2ab47898e..385cb00919 100644
--- a/source4/librpc/rpc/dcerpc_smb2.c
+++ b/source4/librpc/rpc/dcerpc_smb2.c
@@ -41,7 +41,17 @@ struct smb2_private {
*/
static void pipe_dead(struct dcerpc_connection *c, NTSTATUS status)
{
- c->transport.recv_data(c, NULL, status);
+ if (NT_STATUS_EQUAL(NT_STATUS_UNSUCCESSFUL, status)) {
+ status = NT_STATUS_UNEXPECTED_NETWORK_ERROR;
+ }
+
+ if (NT_STATUS_EQUAL(NT_STATUS_OK, status)) {
+ status = NT_STATUS_END_OF_FILE;
+ }
+
+ if (c->transport.recv_data) {
+ c->transport.recv_data(c, NULL, status);
+ }
}
diff --git a/source4/librpc/rpc/dcerpc_sock.c b/source4/librpc/rpc/dcerpc_sock.c
index fd54a20afc..e1ba2d769d 100644
--- a/source4/librpc/rpc/dcerpc_sock.c
+++ b/source4/librpc/rpc/dcerpc_sock.c
@@ -76,7 +76,7 @@ static void sock_dead(struct dcerpc_connection *p, NTSTATUS status)
status = NT_STATUS_END_OF_FILE;
}
- if (!NT_STATUS_IS_OK(status)) {
+ if (p->transport.recv_data) {
p->transport.recv_data(p, NULL, status);
}
}