Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(581)

Side by Side Diff: user_collector.cc

Issue 3121015: Move leave_core where similar files exist (Closed) Base URL: ssh://git@chromiumos-git//crash-reporter.git
Patch Set: Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <grp.h> // For struct group. 5 #include <grp.h> // For struct group.
6 #include <pwd.h> // For struct passwd. 6 #include <pwd.h> // For struct passwd.
7 #include <sys/types.h> // For getpwuid_r and getgrnam_r. 7 #include <sys/types.h> // For getpwuid_r and getgrnam_r.
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "base/file_util.h" 11 #include "base/file_util.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/string_util.h" 13 #include "base/string_util.h"
14 #include "crash-reporter/user_collector.h" 14 #include "crash-reporter/user_collector.h"
15 #include "metrics/metrics_library.h" 15 #include "metrics/metrics_library.h"
16 16
17 // This procfs file is used to cause kernel core file writing to 17 // This procfs file is used to cause kernel core file writing to
18 // instead pipe the core file into a user space process. See 18 // instead pipe the core file into a user space process. See
19 // core(5) man page. 19 // core(5) man page.
20 static const char kCorePatternFile[] = "/proc/sys/kernel/core_pattern"; 20 static const char kCorePatternFile[] = "/proc/sys/kernel/core_pattern";
21 static const char kCoreToMinidumpConverterPath[] = "/usr/bin/core2md"; 21 static const char kCoreToMinidumpConverterPath[] = "/usr/bin/core2md";
22 static const char kDefaultUserName[] = "chronos"; 22 static const char kDefaultUserName[] = "chronos";
23 static const char kLeaveCoreFile[] = "/etc/leave_core"; 23 static const char kLeaveCoreFile[] = "/root/.leave_core";
24 static const char kSystemCrashPath[] = "/var/spool/crash"; 24 static const char kSystemCrashPath[] = "/var/spool/crash";
25 static const char kUserCrashPath[] = "/home/chronos/user/crash"; 25 static const char kUserCrashPath[] = "/home/chronos/user/crash";
26 26
27 // Directory mode of the user crash spool directory. 27 // Directory mode of the user crash spool directory.
28 static const mode_t kUserCrashPathMode = 0755; 28 static const mode_t kUserCrashPathMode = 0755;
29 29
30 // Directory mode of the system crash spool directory. 30 // Directory mode of the system crash spool directory.
31 static const mode_t kSystemCrashPathMode = 01755; 31 static const mode_t kSystemCrashPathMode = 01755;
32 32
33 static const uid_t kRootOwner = 0; 33 static const uid_t kRootOwner = 0;
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 414
415 if (is_feedback_allowed_function_()) { 415 if (is_feedback_allowed_function_()) {
416 count_crash_function_(); 416 count_crash_function_();
417 } 417 }
418 418
419 if (generate_diagnostics_) { 419 if (generate_diagnostics_) {
420 return GenerateDiagnostics(pid, exec); 420 return GenerateDiagnostics(pid, exec);
421 } 421 }
422 return true; 422 return true;
423 } 423 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698