diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-07-25 03:34:31 +0200 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-07-25 03:34:31 +0200 |
| commit | 8a163407875f2c73258e7f968b8f1e2d7f50a72c (patch) | |
| tree | 7a5e3209b9158b0c9becd3066070503f3d6ed3e5 | |
| parent | c659f8e2a6c4042ff4b7bf9cd70655cb2ff54fcd (diff) | |
Be more paranoid about /proc/.../core_pattern
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| -rw-r--r-- | lib/Plugins/CCpp.cpp | 17 | ||||
| -rw-r--r-- | src/Hooks/CCpp.cpp | 4 |
2 files changed, 21 insertions, 0 deletions
diff --git a/lib/Plugins/CCpp.cpp b/lib/Plugins/CCpp.cpp index fe6c56c..47bfceb 100644 --- a/lib/Plugins/CCpp.cpp +++ b/lib/Plugins/CCpp.cpp @@ -534,6 +534,23 @@ void CAnalyzerCCpp::Init() getline(fInCorePattern, m_sOldCorePattern); fInCorePattern.close(); } + if (m_sOldCorePattern[0] == '|') + { + if (m_sOldCorePattern == CORE_PATTERN) + { + fprintf(stderr, "warning: %s already contains %s, " + "did abrt daemon crash recently?\n", + CORE_PATTERN_IFACE, CORE_PATTERN); + /* There is no point in "restoring" CORE_PATTERN_IFACE + * to CORE_PATTERN on exit. Will restore to a default value: + */ + m_sOldCorePattern = "core"; + } + fprintf(stderr, "warning: %s was already set to run a crash analyser (%s), " + "abrt may interfere with it\b", + CORE_PATTERN_IFACE, CORE_PATTERN); + } + std::ofstream fOutCorePattern; fOutCorePattern.open(CORE_PATTERN_IFACE); if (fOutCorePattern.is_open()) diff --git a/src/Hooks/CCpp.cpp b/src/Hooks/CCpp.cpp index 27c813f..017ecc4 100644 --- a/src/Hooks/CCpp.cpp +++ b/src/Hooks/CCpp.cpp @@ -147,6 +147,10 @@ int main(int argc, char** argv) } if (!daemon_is_ok()) { + fprintf(stderr, "abrt daemon is not running. If it crashed, " + "/proc/sys/kernel/core_pattern contains a stale value, " + "consider resetting it to 'core'\n" + ); return 0; } |
