resolved
https://bugzilla.redhat.com/show_bug.cgi?id=518420
diff --git a/lib/CommLayer/DBusClientProxy.cpp
b/lib/CommLayer/DBusClientProxy.cpp
index 2cc00a5..ccb48d5 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 22dfcf1..e43805b 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 8f01133..bdc2293 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 faf89d1..ff6be8e 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 76af62b..8730d01 100644
--- a/src/Daemon/CommLayerServer.h
+++ b/src/Daemon/CommLayerServer.h
@@ -26,7 +26,7 @@ class CCommLayerServer {
virtual bool DeleteDebugDump(const std::string& pUUID, const
std::string& pSender) = 0;
/* 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& arg1, const std::string&
arg2) {}
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 db78cd3..e58e33f 100644
--- a/src/Daemon/CommLayerServerDBus.cpp
+++ b/src/Daemon/CommLayerServerDBus.cpp
@@ -244,11 +244,12 @@ void CCommLayerServerDBus::UnRegisterPlugin(const
std::string& pName)
*/
/* Notify the clients (UI) about a new crash */
-void CCommLayerServerDBus::Crash(const std::string& arg1)
+void CCommLayerServerDBus::Crash(const std::string& arg1, const
std::string& arg2)
{
::DBus::SignalMessage sig("Crash");
::DBus::MessageIter wi = sig.writer();
wi << arg1;
+ wi << arg2;
emit_signal(sig);
}
diff --git a/src/Daemon/CommLayerServerDBus.h
b/src/Daemon/CommLayerServerDBus.h
index bbc0c3d..5f5ed57 100644
--- a/src/Daemon/CommLayerServerDBus.h
+++ b/src/Daemon/CommLayerServerDBus.h
@@ -47,7 +47,7 @@ class CCommLayerServerDBus
/* DBus signal senders */
public:
- virtual void Crash(const std::string& arg1);
+ virtual void Crash(const std::string& arg1, const std::string&
arg2);
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/CommLayerServerSocket.cpp
b/src/Daemon/CommLayerServerSocket.cpp
index 734c5a1..99afd8c 100644
--- a/src/Daemon/CommLayerServerSocket.cpp
+++ b/src/Daemon/CommLayerServerSocket.cpp
@@ -234,7 +234,7 @@ bool CCommLayerServerSocket::DeleteDebugDump(const
std::string& pUUID, const std
return true;
}
-void CCommLayerServerSocket::Crash(const std::string& arg1)
+void CCommLayerServerSocket::Crash(const std::string& arg1, const
std::string& arg2)
{
//Send("(CRASH)New Crash Detected: " + arg1);
}
diff --git a/src/Daemon/CommLayerServerSocket.h
b/src/Daemon/CommLayerServerSocket.h
index e0b7478..a998ae6 100644
--- a/src/Daemon/CommLayerServerSocket.h
+++ b/src/Daemon/CommLayerServerSocket.h
@@ -30,7 +30,7 @@ class CCommLayerServerSocket : public CCommLayerServer
virtual report_status_t Report(const map_crash_report_t&
pReport, const std::string& pSender);
virtual bool DeleteDebugDump(const std::string& pUUID, const
std::string& pSender);
- virtual void Crash(const std::string& arg1);
+ virtual void Crash(const std::string& arg1, const std::string&
arg2);
virtual void AnalyzeComplete(const map_crash_report_t& arg1);
virtual void Error(const std::string& arg1);
};
diff --git a/src/Daemon/Daemon.cpp b/src/Daemon/Daemon.cpp
index 81484d1..c36876d 100644
--- a/src/Daemon/Daemon.cpp
+++ b/src/Daemon/Daemon.cpp
@@ -468,13 +468,13 @@ static gboolean handle_event_cb(GIOChannel *gio,
GIOCondition condition, gpointe
g_cw->Debug("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 */
g_cw->Debug("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: