UploadCrashes: run in the main mount namespace

When debugd launches, it places itself into a new mount namespace at
boot time.  That means that any tools it invokes won't have access to
all the user mounts.  Normally this is a good thing, but this makes
sending crashes a lot less useful to the end user as they often want
to trigger user crashes in addition to system crashes.

For now, wrap the crash_sender call with nsenter so that we run in
the same mount namespace as init (which should be the same namespace
that user mounts are made in).  We probably want this logic to get
merged into minijail in some way.

TEST=generated a chrome crash; invoked new crash_sender via debugd; saw user crash get uploaded
TEST=`cbuildbot x86-generic-full` works

Change-Id: I9a3e2673ed285daab16dcc301b069f7fccd8769a
Reviewed-on: https://chromium-review.googlesource.com/201374
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
diff --git a/src/crash_sender_tool.cc b/src/crash_sender_tool.cc
index a4391f1..400a433 100644
--- a/src/crash_sender_tool.cc
+++ b/src/crash_sender_tool.cc
@@ -14,6 +14,11 @@
 void CrashSenderTool::UploadCrashes(DBus::Error& error) {  // NOLINT
   ProcessWithId* p = CreateProcess(false);
+  // TODO(jorgelo): This mount namespace shuffling should be handled by
+  // minijail.  See http://crbug.com/376987 for details.
+  p->AddArg("/usr/bin/nsenter");
+  p->AddArg("--mount=/proc/1/ns/mnt");
+  p->AddArg("--");
   p->AddStringOption("-e", "SECONDS_SEND_SPREAD=1");