2 * Unix SMB/CIFS implementation.
3 * RPC Pipe client / server routines
4 * Almost completely rewritten by (C) Jeremy Allison 2005 - 2010
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, see <http://www.gnu.org/licenses/>.
20 /* this module apparently provides an implementation of DCE/RPC over a
21 * named pipe (IPC$ connection using SMBtrans). details of DCE/RPC
22 * documentation are available (in on-line form) from the X-Open group.
24 * this module should provide a level of abstraction between SMB
25 * and DCE/RPC, while minimising the amount of mallocs, unnecessary
26 * data copies, and network traffic.
31 #include "rpc_server.h"
32 #include "rpc_server/srv_pipe.h"
35 #define DBGC_CLASS DBGC_RPC_SRV
38 * Is a named pipe known?
39 * @param[in] dce_ctx The rpc server context
40 * @param[in] pipename Just the filename
41 * @param[out] endpoint The DCERPC endpoint serving the pipe name
42 * @result NT error code
44 NTSTATUS
is_known_pipename(struct dcesrv_context
*dce_ctx
,
46 struct dcesrv_endpoint
**ep
)
50 if (strchr(pipename
, '/')) {
51 DBG_WARNING("Refusing open on pipe %s\n", pipename
);
52 return NT_STATUS_OBJECT_NAME_NOT_FOUND
;
55 if (lp_disable_spoolss() && strequal(pipename
, "spoolss")) {
56 DBG_DEBUG("refusing spoolss access\n");
57 return NT_STATUS_OBJECT_NAME_NOT_FOUND
;
60 status
= dcesrv_endpoint_by_ncacn_np_name(dce_ctx
, pipename
, ep
);
61 if (NT_STATUS_IS_OK(status
)) {
65 status
= smb_probe_module("rpc", pipename
);
66 if (!NT_STATUS_IS_OK(status
)) {
67 DBG_DEBUG("Unknown pipe '%s'\n", pipename
);
68 return NT_STATUS_OBJECT_NAME_NOT_FOUND
;
70 DBG_DEBUG("'%s' loaded dynamically\n", pipename
);
73 * Scan the list again for the interface id
75 status
= dcesrv_endpoint_by_ncacn_np_name(dce_ctx
, pipename
, ep
);
76 if (NT_STATUS_IS_OK(status
)) {
80 DBG_DEBUG("pipe %s did not register itself!\n", pipename
);
82 return NT_STATUS_OBJECT_NAME_NOT_FOUND
;