From 5b80ac3bd83483cf937b13b222b55a0980ffdc39 Mon Sep 17 00:00:00 2001 From: Zdenek Prikryl Date: Wed, 10 Jun 2009 10:06:37 +0200 Subject: abrt can take reporter's configuration file from reporting users's $HOME/.abrt/ directory --- src/Daemon/CrashWatcher.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'src/Daemon/CrashWatcher.cpp') 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 #include #include +#include #include #include #include @@ -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) { -- cgit