aboutsummaryrefslogtreecommitdiff
path: root/src/client/windows
diff options
context:
space:
mode:
authordoshimun <doshimun@4c0a9323-5329-0410-9bdc-e9ce6186880e>2008-04-12 00:00:34 +0000
committerdoshimun <doshimun@4c0a9323-5329-0410-9bdc-e9ce6186880e>2008-04-12 00:00:34 +0000
commit35c34d6bb9b1deb656bfe65741f2c4f8401045f4 (patch)
tree3c5b1f616e231fb673c06352afa5e6caeafa06ee /src/client/windows
parentSome cosmetic/style changes to conform to style guidelines. This time (diff)
downloadbreakpad-35c34d6bb9b1deb656bfe65741f2c4f8401045f4.tar.xz
Add a parameter to CrashGenerationServer to let the callers set the
security attributes on the pipe. This is useful when the process hosting the crash server wants to let processes from other users to connect to it and generate dumps for them. git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@258 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/client/windows')
-rw-r--r--src/client/windows/crash_generation/crash_generation_server.cc4
-rw-r--r--src/client/windows/crash_generation/crash_generation_server.h8
-rw-r--r--src/client/windows/tests/crash_generation_app/crash_generation_app.cc3
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,