diff options
3 files changed, 13 insertions, 2 deletions
diff --git a/src/client/windows/crash_generation/crash_generation_server.cc b/src/client/windows/crash_generation/crash_generation_server.cc index c462a462..b49f3774 100644 --- a/src/client/windows/crash_generation/crash_generation_server.cc +++ b/src/client/windows/crash_generation/crash_generation_server.cc @@ -91,6 +91,7 @@ static bool IsClientRequestValid(const ProtocolMessage& msg) { CrashGenerationServer::CrashGenerationServer( const std::wstring& pipe_name, + SECURITY_ATTRIBUTES* pipe_sec_attrs, OnClientConnectedCallback connect_callback, void* connect_context, OnClientDumpRequestCallback dump_callback, @@ -100,6 +101,7 @@ CrashGenerationServer::CrashGenerationServer( bool generate_dumps, const std::wstring* dump_path) : pipe_name_(pipe_name), + pipe_sec_attrs_(pipe_sec_attrs), pipe_(NULL), pipe_wait_handle_(NULL), server_alive_handle_(NULL), @@ -217,7 +219,7 @@ bool CrashGenerationServer::Start() { kOutBufferSize, kInBufferSize, 0, - NULL); + pipe_sec_attrs_); if (!pipe_) { return false; } diff --git a/src/client/windows/crash_generation/crash_generation_server.h b/src/client/windows/crash_generation/crash_generation_server.h index 6bf55672..4568f111 100644 --- a/src/client/windows/crash_generation/crash_generation_server.h +++ b/src/client/windows/crash_generation/crash_generation_server.h @@ -61,6 +61,10 @@ class CrashGenerationServer { // Creates an instance with the given parameters. // // Parameter pipe_name: Name of the Windows named pipe + // Parameter pipe_sec_attrs Security attributes to set on the pipe. Pass + // NULL to use default security on the pipe. By default, the pipe created + // allows Local System, Administrators and the Creator full control and + // the Everyone group read access on the pipe. // Parameter connect_callback: Callback for a new client connection. // Parameter connect_context: Context for client connection callback. // Parameter crash_callback: Callback for a client crash dump request. @@ -74,6 +78,7 @@ class CrashGenerationServer { // Parameter dump_path: Path for generating dumps; required only if true is // passed for generateDumps parameter; NULL can be passed otherwise. CrashGenerationServer(const std::wstring& pipe_name, + SECURITY_ATTRIBUTES* pipe_sec_attrs, OnClientConnectedCallback connect_callback, void* connect_context, OnClientDumpRequestCallback dump_callback, @@ -195,6 +200,9 @@ class CrashGenerationServer { // Pipe name. std::wstring pipe_name_; + // Pipe security attributes + SECURITY_ATTRIBUTES* pipe_sec_attrs_; + // Handle to the pipe used for handshake with clients. HANDLE pipe_; diff --git a/src/client/windows/tests/crash_generation_app/crash_generation_app.cc b/src/client/windows/tests/crash_generation_app/crash_generation_app.cc index af4aaa29..129cdb24 100644 --- a/src/client/windows/tests/crash_generation_app/crash_generation_app.cc +++ b/src/client/windows/tests/crash_generation_app/crash_generation_app.cc @@ -35,7 +35,7 @@ namespace google_breakpad { const int kMaxLoadString = 100; -const wchar_t kPipeName[] = L"\\\\.\\pipe\\GoogleCrashServices"; +const wchar_t kPipeName[] = L"\\\\.\\pipe\\GoogleCrashServices\\S-1-5-21-39260824-743453154-142223018-195347"; const DWORD kEditBoxStyles = WS_CHILD | WS_VISIBLE | @@ -236,6 +236,7 @@ void CrashServerStart() { std::wstring dump_path = L"C:\\Dumps\\"; crash_server = new CrashGenerationServer(kPipeName, + NULL, ShowClientConnected, NULL, ShowClientCrashed, |