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 | |
| 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')
| -rw-r--r-- | src/Daemon/CrashWatcher.cpp | 22 | ||||
| -rw-r--r-- | src/Daemon/CrashWatcher.h | 3 | ||||
| -rw-r--r-- | src/TUI/ABRTSocket.cpp | 4 | ||||
| -rw-r--r-- | src/TUI/ABRTSocket.h | 2 | ||||
| -rw-r--r-- | src/TUI/Cmd.cpp | 7 |
5 files changed, 28 insertions, 10 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 */ diff --git a/src/TUI/ABRTSocket.cpp b/src/TUI/ABRTSocket.cpp index dac690a..a699bbd 100644 --- a/src/TUI/ABRTSocket.cpp +++ b/src/TUI/ABRTSocket.cpp @@ -1,6 +1,6 @@ #include "ABRTSocket.h" #include "ABRTException.h" -#include "SocketCrashTypes.h" +#include "CrashTypesSocket.h" #include <string.h> #include <sys/types.h> @@ -16,7 +16,7 @@ CABRTSocket::~CABRTSocket() { DisConnect(); } -#include <iostream> + void CABRTSocket::Send(const std::string& pMessage) { int ret = 0; diff --git a/src/TUI/ABRTSocket.h b/src/TUI/ABRTSocket.h index ef255ac..6e8a777 100644 --- a/src/TUI/ABRTSocket.h +++ b/src/TUI/ABRTSocket.h @@ -21,7 +21,7 @@ class CABRTSocket void DisConnect(); vector_crash_infos_t GetCrashInfos(); - map_crash_report_t CreateReport(const std::string &pUUID); + map_crash_report_t CreateReport(const std::string& pUUID); void Report(map_crash_report_t pReport); void DeleteDebugDump(const std::string& pUUID); }; diff --git a/src/TUI/Cmd.cpp b/src/TUI/Cmd.cpp index e9c2787..0700ebf 100644 --- a/src/TUI/Cmd.cpp +++ b/src/TUI/Cmd.cpp @@ -4,7 +4,6 @@ #include <string.h> - #define SOCKET_PATH "/tmp/abrt.socket" typedef enum {HELP, @@ -12,11 +11,11 @@ typedef enum {HELP, GET_LIST_FULL, REPORT, REPORT_ALWAYS, - DELETE} mode_t; + DELETE} param_mode_t; typedef struct param_s { - mode_t m_Mode; + param_mode_t m_Mode; char* m_sUUID; } param_t; @@ -82,7 +81,7 @@ void parse_args(int argc, char** argv, param_t& param) } void print_crash_infos(const vector_crash_infos_t& pCrashInfos, - const mode_t& pMode) + const param_mode_t& pMode) { unsigned int ii; for (ii = 0; ii < pCrashInfos.size(); ii++) |
