mirror of
https://github.com/yuzu-emu/breakpad.git
synced 2024-11-28 03:14:22 +01:00
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
This commit is contained in:
parent
05ec557277
commit
35c34d6bb9
@ -91,6 +91,7 @@ static bool IsClientRequestValid(const ProtocolMessage& msg) {
|
|||||||
|
|
||||||
CrashGenerationServer::CrashGenerationServer(
|
CrashGenerationServer::CrashGenerationServer(
|
||||||
const std::wstring& pipe_name,
|
const std::wstring& pipe_name,
|
||||||
|
SECURITY_ATTRIBUTES* pipe_sec_attrs,
|
||||||
OnClientConnectedCallback connect_callback,
|
OnClientConnectedCallback connect_callback,
|
||||||
void* connect_context,
|
void* connect_context,
|
||||||
OnClientDumpRequestCallback dump_callback,
|
OnClientDumpRequestCallback dump_callback,
|
||||||
@ -100,6 +101,7 @@ CrashGenerationServer::CrashGenerationServer(
|
|||||||
bool generate_dumps,
|
bool generate_dumps,
|
||||||
const std::wstring* dump_path)
|
const std::wstring* dump_path)
|
||||||
: pipe_name_(pipe_name),
|
: pipe_name_(pipe_name),
|
||||||
|
pipe_sec_attrs_(pipe_sec_attrs),
|
||||||
pipe_(NULL),
|
pipe_(NULL),
|
||||||
pipe_wait_handle_(NULL),
|
pipe_wait_handle_(NULL),
|
||||||
server_alive_handle_(NULL),
|
server_alive_handle_(NULL),
|
||||||
@ -217,7 +219,7 @@ bool CrashGenerationServer::Start() {
|
|||||||
kOutBufferSize,
|
kOutBufferSize,
|
||||||
kInBufferSize,
|
kInBufferSize,
|
||||||
0,
|
0,
|
||||||
NULL);
|
pipe_sec_attrs_);
|
||||||
if (!pipe_) {
|
if (!pipe_) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -61,6 +61,10 @@ class CrashGenerationServer {
|
|||||||
// Creates an instance with the given parameters.
|
// Creates an instance with the given parameters.
|
||||||
//
|
//
|
||||||
// Parameter pipe_name: Name of the Windows named pipe
|
// 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_callback: Callback for a new client connection.
|
||||||
// Parameter connect_context: Context for client connection callback.
|
// Parameter connect_context: Context for client connection callback.
|
||||||
// Parameter crash_callback: Callback for a client crash dump request.
|
// 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
|
// Parameter dump_path: Path for generating dumps; required only if true is
|
||||||
// passed for generateDumps parameter; NULL can be passed otherwise.
|
// passed for generateDumps parameter; NULL can be passed otherwise.
|
||||||
CrashGenerationServer(const std::wstring& pipe_name,
|
CrashGenerationServer(const std::wstring& pipe_name,
|
||||||
|
SECURITY_ATTRIBUTES* pipe_sec_attrs,
|
||||||
OnClientConnectedCallback connect_callback,
|
OnClientConnectedCallback connect_callback,
|
||||||
void* connect_context,
|
void* connect_context,
|
||||||
OnClientDumpRequestCallback dump_callback,
|
OnClientDumpRequestCallback dump_callback,
|
||||||
@ -195,6 +200,9 @@ class CrashGenerationServer {
|
|||||||
// Pipe name.
|
// Pipe name.
|
||||||
std::wstring pipe_name_;
|
std::wstring pipe_name_;
|
||||||
|
|
||||||
|
// Pipe security attributes
|
||||||
|
SECURITY_ATTRIBUTES* pipe_sec_attrs_;
|
||||||
|
|
||||||
// Handle to the pipe used for handshake with clients.
|
// Handle to the pipe used for handshake with clients.
|
||||||
HANDLE pipe_;
|
HANDLE pipe_;
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
namespace google_breakpad {
|
namespace google_breakpad {
|
||||||
|
|
||||||
const int kMaxLoadString = 100;
|
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 |
|
const DWORD kEditBoxStyles = WS_CHILD |
|
||||||
WS_VISIBLE |
|
WS_VISIBLE |
|
||||||
@ -236,6 +236,7 @@ void CrashServerStart() {
|
|||||||
|
|
||||||
std::wstring dump_path = L"C:\\Dumps\\";
|
std::wstring dump_path = L"C:\\Dumps\\";
|
||||||
crash_server = new CrashGenerationServer(kPipeName,
|
crash_server = new CrashGenerationServer(kPipeName,
|
||||||
|
NULL,
|
||||||
ShowClientConnected,
|
ShowClientConnected,
|
||||||
NULL,
|
NULL,
|
||||||
ShowClientCrashed,
|
ShowClientCrashed,
|
||||||
|
Loading…
Reference in New Issue
Block a user