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 | |
| 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')
| -rw-r--r-- | src/Daemon/CrashWatcher.cpp | 22 | ||||
| -rw-r--r-- | src/Daemon/CrashWatcher.h | 3 |
2 files changed, 22 insertions, 3 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) { diff --git a/src/Daemon/CrashWatcher.h b/src/Daemon/CrashWatcher.h index f42608f..ec463ee 100644 --- a/src/Daemon/CrashWatcher.h +++ b/src/Daemon/CrashWatcher.h @@ -31,6 +31,7 @@ //FIXME remove when it gets to autoconf #include "CommLayerServerDBus.h" +//#include "CommLayerServerSocket.h" #ifdef HAVE_DBUS #include "CommLayerServerDBus.h" #elif HAVE_SOCKET @@ -106,7 +107,7 @@ class CCrashWatcher public: virtual vector_crash_infos_t GetCrashInfos(const std::string &pUID); virtual map_crash_report_t CreateReport(const std::string &pUUID,const std::string &pUID); - virtual bool Report(map_crash_report_t pReport); + virtual bool Report(map_crash_report_t pReport, const std::string &pUID); virtual bool DeleteDebugDump(const std::string& pUUID, const std::string& pUID); /* Observer methods */ |
