diff options
-rw-r--r-- | lib/CommLayer/DBusClientProxy.cpp | 7 | ||||
-rw-r--r-- | lib/CommLayer/DBusClientProxy.h | 2 | ||||
-rw-r--r-- | src/Applet/CCApplet.cpp | 9 | ||||
-rw-r--r-- | src/Applet/CCApplet.h | 2 | ||||
-rw-r--r-- | src/Daemon/CommLayerServer.h | 2 | ||||
-rw-r--r-- | src/Daemon/CommLayerServerDBus.cpp | 5 | ||||
-rw-r--r-- | src/Daemon/CommLayerServerDBus.h | 2 | ||||
-rw-r--r-- | src/Daemon/Daemon.cpp | 4 |
8 files changed, 20 insertions, 13 deletions
diff --git a/lib/CommLayer/DBusClientProxy.cpp b/lib/CommLayer/DBusClientProxy.cpp index 2cc00a5a..ccb48d53 100644 --- a/lib/CommLayer/DBusClientProxy.cpp +++ b/lib/CommLayer/DBusClientProxy.cpp @@ -209,7 +209,7 @@ map_crash_report_t CDBusClient_proxy::GetJobResult(uint64_t pJobID) /* signal handlers for this interface */ -void CDBusClient_proxy::Crash(std::string& value) +void CDBusClient_proxy::Crash(const std::string& progname, const std::string& uid) { } @@ -221,8 +221,9 @@ void CDBusClient_proxy::_Crash_stub(const ::DBus::SignalMessage &sig) { DBus::MessageIter ri = sig.reader(); - std::string value; ri >> value; - Crash(value); + std::string progname; ri >> progname; + std::string uid; ri >> uid; + Crash(progname, uid); } void CDBusClient_proxy::_JobDone_stub(const ::DBus::SignalMessage &sig) diff --git a/lib/CommLayer/DBusClientProxy.h b/lib/CommLayer/DBusClientProxy.h index 22dfcf16..e43805bf 100644 --- a/lib/CommLayer/DBusClientProxy.h +++ b/lib/CommLayer/DBusClientProxy.h @@ -96,7 +96,7 @@ public: public: /* signal handlers for this interface */ - virtual void Crash(std::string& value); + virtual void Crash(const std::string& progname, const std::string& uid); private: /* unmarshalers (to unpack the DBus message before calling the actual signal handler) diff --git a/src/Applet/CCApplet.cpp b/src/Applet/CCApplet.cpp index 8f01133e..187cce35 100644 --- a/src/Applet/CCApplet.cpp +++ b/src/Applet/CCApplet.cpp @@ -94,11 +94,16 @@ CApplet::~CApplet() } /* dbus related */ -void CApplet::Crash(std::string &value) +void CApplet::Crash(const std::string& progname, const std::string& uid ) { if (m_pCrashHandler) { - m_pCrashHandler(value.c_str()); + std::istringstream input_string(uid); + uid_t num; + input_string >> num; + + if( (num == getuid()) ) + m_pCrashHandler(progname.c_str()); } else { diff --git a/src/Applet/CCApplet.h b/src/Applet/CCApplet.h index faf89d10..ff6be8e5 100644 --- a/src/Applet/CCApplet.h +++ b/src/Applet/CCApplet.h @@ -73,7 +73,7 @@ class CApplet static void onHide_cb(GtkMenuItem *menuitem, gpointer applet); private: /* dbus stuff */ - void Crash(std::string &value); + void Crash(const std::string& progname, const std::string& uid); /* the real signal handler called to handle the signal */ void (*m_pCrashHandler)(const char *progname); diff --git a/src/Daemon/CommLayerServer.h b/src/Daemon/CommLayerServer.h index 0953c37d..67b7e89e 100644 --- a/src/Daemon/CommLayerServer.h +++ b/src/Daemon/CommLayerServer.h @@ -13,7 +13,7 @@ class CCommLayerServer { virtual ~CCommLayerServer(); /* just stubs to be called when not implemented in specific comm layer */ - virtual void Crash(const std::string& arg1) {} + virtual void Crash(const std::string& progname, const std::string& uid) {} virtual void AnalyzeComplete(const map_crash_report_t& arg1) {} virtual void Error(const std::string& arg1) {} virtual void Update(const std::string& pDest, const std::string& pMessage) {}; diff --git a/src/Daemon/CommLayerServerDBus.cpp b/src/Daemon/CommLayerServerDBus.cpp index 82b9c9c3..95c0586d 100644 --- a/src/Daemon/CommLayerServerDBus.cpp +++ b/src/Daemon/CommLayerServerDBus.cpp @@ -203,11 +203,12 @@ DBus::Message CCommLayerServerDBus::_UnRegisterPlugin_stub(const DBus::CallMessa */ /* Notify the clients (UI) about a new crash */ -void CCommLayerServerDBus::Crash(const std::string& arg1) +void CCommLayerServerDBus::Crash(const std::string& progname, const std::string& uid) { ::DBus::SignalMessage sig("Crash"); ::DBus::MessageIter wi = sig.writer(); - wi << arg1; + wi << progname; + wi << uid; emit_signal(sig); } diff --git a/src/Daemon/CommLayerServerDBus.h b/src/Daemon/CommLayerServerDBus.h index e51578e2..38450aa2 100644 --- a/src/Daemon/CommLayerServerDBus.h +++ b/src/Daemon/CommLayerServerDBus.h @@ -34,7 +34,7 @@ class CCommLayerServerDBus /* DBus signal senders */ public: - virtual void Crash(const std::string& arg1); + virtual void Crash(const std::string& progname, const std::string& uid); virtual void AnalyzeComplete(const map_crash_report_t& arg1); virtual void Error(const std::string& arg1); virtual void Update(const std::string& pDest, const std::string& pMessage); diff --git a/src/Daemon/Daemon.cpp b/src/Daemon/Daemon.cpp index 58970b05..f5b40b4a 100644 --- a/src/Daemon/Daemon.cpp +++ b/src/Daemon/Daemon.cpp @@ -467,13 +467,13 @@ static gboolean handle_event_cb(GIOChannel *gio, GIOCondition condition, gpointe log("New crash, saving..."); RunActionsAndReporters(crashinfo[CD_MWDDD][CD_CONTENT]); /* send message to dbus */ - g_pCommLayer->Crash(crashinfo[CD_PACKAGE][CD_CONTENT]); + g_pCommLayer->Crash(crashinfo[CD_PACKAGE][CD_CONTENT], crashinfo[CD_UID][CD_CONTENT]); break; case MW_REPORTED: case MW_OCCURED: /* send message to dbus */ log("Already saved crash, deleting..."); - g_pCommLayer->Crash(crashinfo[CD_PACKAGE][CD_CONTENT]); + g_pCommLayer->Crash(crashinfo[CD_PACKAGE][CD_CONTENT], crashinfo[CD_UID][CD_CONTENT]); DeleteDebugDumpDir(std::string(DEBUG_DUMPS_DIR) + "/" + name); break; case MW_BLACKLISTED: |