Mike Frysinger | c087152 | 2013-09-16 14:07:27 -0400 | [diff] [blame] | 1 | // Copyright (c) 2013 The Chromium OS Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "crash_sender_tool.h" |
| 6 | |
| 7 | #include "process_with_id.h" |
| 8 | |
| 9 | namespace debugd { |
| 10 | |
| 11 | CrashSenderTool::CrashSenderTool() { } |
| 12 | |
| 13 | CrashSenderTool::~CrashSenderTool() { } |
| 14 | |
Ben Chan | a0011d8 | 2014-05-13 00:19:29 -0700 | [diff] [blame^] | 15 | void CrashSenderTool::UploadCrashes(DBus::Error* error) { |
Mike Frysinger | c087152 | 2013-09-16 14:07:27 -0400 | [diff] [blame] | 16 | ProcessWithId* p = CreateProcess(false); |
Mike Frysinger | bb1e8bc | 2014-05-23 15:55:51 -0400 | [diff] [blame] | 17 | // TODO(jorgelo): This mount namespace shuffling should be handled by |
| 18 | // minijail. See http://crbug.com/376987 for details. |
| 19 | p->AddArg("/usr/bin/nsenter"); |
| 20 | p->AddArg("--mount=/proc/1/ns/mnt"); |
| 21 | p->AddArg("--"); |
Mike Frysinger | c087152 | 2013-09-16 14:07:27 -0400 | [diff] [blame] | 22 | p->AddArg("/sbin/crash_sender"); |
| 23 | p->AddStringOption("-e", "SECONDS_SEND_SPREAD=1"); |
| 24 | p->Run(); |
| 25 | } |
| 26 | |
Ben Chan | a0011d8 | 2014-05-13 00:19:29 -0700 | [diff] [blame^] | 27 | } // namespace debugd |