diff options
| author | Zdenek Prikryl <zprikryl@redhat.com> | 2009-06-10 10:06:37 +0200 |
|---|---|---|
| committer | Zdenek Prikryl <zprikryl@redhat.com> | 2009-06-10 10:06:37 +0200 |
| commit | 5b80ac3bd83483cf937b13b222b55a0980ffdc39 (patch) | |
| tree | ec7cb1d37cbf740b41263d4e2c6dd14c78f9a229 /src/Daemon/CrashWatcher.cpp | |
| parent | 9eab929557ef4228b3335f4908dd6b4acf9251dc (diff) | |
| download | abrt-5b80ac3bd83483cf937b13b222b55a0980ffdc39.tar.gz abrt-5b80ac3bd83483cf937b13b222b55a0980ffdc39.tar.xz abrt-5b80ac3bd83483cf937b13b222b55a0980ffdc39.zip | |
abrt can take reporter's configuration file from reporting users's $HOME/.abrt/ directory
Diffstat (limited to 'src/Daemon/CrashWatcher.cpp')
| -rw-r--r-- | src/Daemon/CrashWatcher.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/Daemon/CrashWatcher.cpp b/src/Daemon/CrashWatcher.cpp index 113fc50..9dd4232 100644 --- a/src/Daemon/CrashWatcher.cpp +++ b/src/Daemon/CrashWatcher.cpp @@ -23,6 +23,7 @@ #include <climits> #include <cstdlib> #include <sys/types.h> +#include <pwd.h> #include <sys/stat.h> #include <fcntl.h> #include <cstring> @@ -668,7 +669,7 @@ map_crash_report_t CCrashWatcher::CreateReport(const std::string &pUUID,const st return crashReport; } -bool CCrashWatcher::Report(map_crash_report_t pReport) +bool CCrashWatcher::Report(map_crash_report_t pReport, const std::string& pUID) { //#define FIELD(X) crashReport.m_s##X = pReport[#X]; //crashReport.m_sUUID = pReport["UUID"]; @@ -679,7 +680,24 @@ bool CCrashWatcher::Report(map_crash_report_t pReport) //} try { - m_pMW->Report(pReport); + std::string home = ""; + struct passwd* pw; + while (( pw = getpwent()) != NULL) + { + if (pw->pw_uid == atoi(pUID.c_str())) + { + home = pw->pw_dir; + } + } + setpwent(); + if (home != "") + { + m_pMW->Report(pReport, home + "/.abrt/"); + } + else + { + m_pMW->Report(pReport); + } } catch (CABRTException& e) { |
