blob: 36d69f1bc30a030c6923fa905b2e6c972a9ffb8c [file] [log] [blame]
Mike Frysingerc0871522013-09-16 14:07:27 -04001// 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
9namespace debugd {
10
11CrashSenderTool::CrashSenderTool() { }
12
13CrashSenderTool::~CrashSenderTool() { }
14
Ben Chana0011d82014-05-13 00:19:29 -070015void CrashSenderTool::UploadCrashes(DBus::Error* error) {
Mike Frysingerc0871522013-09-16 14:07:27 -040016 ProcessWithId* p = CreateProcess(false);
Mike Frysingerbb1e8bc2014-05-23 15:55:51 -040017 // 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 Frysingerc0871522013-09-16 14:07:27 -040022 p->AddArg("/sbin/crash_sender");
23 p->AddStringOption("-e", "SECONDS_SEND_SPREAD=1");
24 p->Run();
25}
26
Ben Chana0011d82014-05-13 00:19:29 -070027} // namespace debugd