summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-05-23 15:21:28 +0200
committerStefan Metzmacher <metze@samba.org>2012-05-23 20:03:08 +0200
commitd869f0260c7f9c30712b7a4d8fb13de4124868c5 (patch)
treec5bed65a523cb76113babc12e450581b186ad7fa /source3
parentdcfb34fbb4b7484bdaa70fbe9ae9fd84738ab469 (diff)
downloadsamba-d869f0260c7f9c30712b7a4d8fb13de4124868c5.tar.gz
samba-d869f0260c7f9c30712b7a4d8fb13de4124868c5.tar.bz2
samba-d869f0260c7f9c30712b7a4d8fb13de4124868c5.zip
s3:smbd: add nt_status_np_pipe()
This mapps between NT_STATUS_CONNECTION_* to NT_STATUS_PIPE_* metze
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/ipc.c11
-rw-r--r--source3/smbd/proto.h1
2 files changed, 12 insertions, 0 deletions
diff --git a/source3/smbd/ipc.c b/source3/smbd/ipc.c
index 36c29164f0..c795d289ea 100644
--- a/source3/smbd/ipc.c
+++ b/source3/smbd/ipc.c
@@ -79,6 +79,17 @@ static void copy_trans_params_and_data(char *outbuf, int align,
memcpy(copy_into, &rdata[data_offset], data_len);
}
+NTSTATUS nt_status_np_pipe(NTSTATUS status)
+{
+ if (NT_STATUS_EQUAL(status, NT_STATUS_CONNECTION_DISCONNECTED)) {
+ status = NT_STATUS_PIPE_DISCONNECTED;
+ } else if (NT_STATUS_EQUAL(status, NT_STATUS_CONNECTION_RESET)) {
+ status = NT_STATUS_PIPE_BROKEN;
+ }
+
+ return status;
+}
+
/****************************************************************************
Send a trans reply.
****************************************************************************/
diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h
index 4a3bd2d334..3005e6ac85 100644
--- a/source3/smbd/proto.h
+++ b/source3/smbd/proto.h
@@ -396,6 +396,7 @@ NTSTATUS fsp_set_smb_fname(struct files_struct *fsp,
/* The following definitions come from smbd/ipc.c */
+NTSTATUS nt_status_np_pipe(NTSTATUS status);
void send_trans_reply(connection_struct *conn,
struct smb_request *req,
char *rparam, int rparam_len,