diff options
author | Volker Lendecke <vl@samba.org> | 2008-07-19 20:27:56 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2008-07-19 20:27:56 +0200 |
commit | 2e7cb1a5ccf8ae513a432cef9ccebfcebe4241ac (patch) | |
tree | 109595ca3c7c7134931cf25555fbd6908eef9721 /source3/rpc_server/srv_pipe.c | |
parent | 6fd4fedb3f81dbc256da57a0e943018d3a489d83 (diff) | |
download | samba-2e7cb1a5ccf8ae513a432cef9ccebfcebe4241ac.tar.gz samba-2e7cb1a5ccf8ae513a432cef9ccebfcebe4241ac.tar.xz 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/srv_pipe.c')
-rw-r--r-- | source3/rpc_server/srv_pipe.c | 33 |
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. *******************************************************************/ |