OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |