]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Move nt_status_np_pipe to smb2_ipc.c
authorDavid Mulder <dmulder@suse.com>
Fri, 11 Mar 2022 16:53:04 +0000 (09:53 -0700)
committerJeremy Allison <jra@samba.org>
Thu, 7 Apr 2022 17:37:29 +0000 (17:37 +0000)
Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/ipc.c
source3/smbd/proto.h
source3/smbd/smb2_ipc.c [new file with mode: 0644]
source3/wscript_build

index 46904b980a27de5180325f8d254cf5aa2d2976a1..47b2085c28b307808729f1f14b4a23c1ac105748 100644 (file)
@@ -80,17 +80,6 @@ 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.
  ****************************************************************************/
index e557092279cf77e08afccd26d3d5927d222c6ec1..a2b1c6d933d97c6ed7a0865b3d233959cffd1d34 100644 (file)
@@ -478,7 +478,6 @@ NTSTATUS parent_pathref(TALLOC_CTX *mem_ctx,
 
 /* 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,
@@ -487,6 +486,10 @@ void send_trans_reply(connection_struct *conn,
 void reply_trans(struct smb_request *req);
 void reply_transs(struct smb_request *req);
 
+/* The following definitions come from smbd/smb2_ipc.c  */
+
+NTSTATUS nt_status_np_pipe(NTSTATUS status);
+
 /* The following definitions come from smbd/mangle.c  */
 
 void mangle_reset_cache(void);
diff --git a/source3/smbd/smb2_ipc.c b/source3/smbd/smb2_ipc.c
new file mode 100644 (file)
index 0000000..fbe2233
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+   Unix SMB/CIFS implementation.
+   Inter-process communication and named pipe handling
+   Copyright (C) Andrew Tridgell 1992-1998
+
+   SMB Version handling
+   Copyright (C) John H Terpstra 1995-1998
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+   */
+/*
+   This file handles the named pipe and mailslot calls
+   in the SMBtrans protocol
+   */
+
+#include "includes.h"
+#include "smbd/smbd.h"
+#include "smbd/globals.h"
+
+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;
+}
index 415263089ca3839580c15eed709a6071333c924c..f1ad272cdabf3edece19add2d055d52c905ea1bf 100644 (file)
@@ -623,6 +623,7 @@ bld.SAMBA3_LIBRARY('smbd_base',
                           smbd/share_access.c
                           smbd/fileio.c
                           smbd/ipc.c
+                          smbd/smb2_ipc.c
                           smbd/negprot.c
                           smbd/nttrans.c
                           smbd/pipes.c