summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-07-19 20:27:56 +0200
committerVolker Lendecke <vl@samba.org>2008-07-19 20:27:56 +0200
commit2e7cb1a5ccf8ae513a432cef9ccebfcebe4241ac (patch)
tree109595ca3c7c7134931cf25555fbd6908eef9721 /source3/rpc_server
parent6fd4fedb3f81dbc256da57a0e943018d3a489d83 (diff)
downloadsamba-2e7cb1a5ccf8ae513a432cef9ccebfcebe4241ac.tar.gz
samba-2e7cb1a5ccf8ae513a432cef9ccebfcebe4241ac.tar.bz2
samba-2e7cb1a5ccf8ae513a432cef9ccebfcebe4241ac.zip
Introduce is_known_pipename
This scans the list of pipes registered via rpc_pipe_register_commands instead of using static tables. (This used to be commit 283e6039989adea1c8921b3600b410cb67b6492a)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_pipe.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/source3/rpc_server/srv_pipe.c b/source3/rpc_server/srv_pipe.c
index fa8fffa350..7b066d3830 100644
--- a/source3/rpc_server/srv_pipe.c
+++ b/source3/rpc_server/srv_pipe.c
@@ -1078,6 +1078,39 @@ NTSTATUS rpc_pipe_register_commands(int version, const char *clnt,
return NT_STATUS_OK;
}
+/**
+ * Is a named pipe known?
+ * @param[in] cli_filename The pipe name requested by the client
+ * @result Do we want to serve this?
+ */
+bool is_known_pipename(const char *cli_filename)
+{
+ const char *pipename = cli_filename;
+ int i;
+
+ if (strnequal(pipename, "\\PIPE\\", 6)) {
+ pipename += 5;
+ }
+
+ if (*pipename == '\\') {
+ pipename += 1;
+ }
+
+ if (lp_disable_spoolss() && strequal(pipename, "spoolss")) {
+ DEBUG(10, ("refusing spoolss access\n"));
+ return false;
+ }
+
+ for (i=0; i<rpc_lookup_size; i++) {
+ if (strequal(pipename, rpc_lookup[i].pipe.clnt)) {
+ return true;
+ }
+ }
+
+ DEBUG(10, ("is_known_pipename: %s unknown\n", cli_filename));
+ return false;
+}
+
/*******************************************************************
Handle a SPNEGO krb5 bind auth.
*******************************************************************/