summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNikola Pajkovsky <npajkovs@redhat.com>2009-08-26 15:35:50 +0200
committerNikola Pajkovsky <npajkovs@redhat.com>2009-08-26 15:35:50 +0200
commit556a4b3df4f116965e8dc46c08ac5e720834022e (patch)
tree863dd4d67b2ace8b6b95e2157cce8b2be3076763 /src
parentde7e5c9866603aed5f7b9c3ba6986a7ff1d37028 (diff)
downloadabrt-556a4b3df4f116965e8dc46c08ac5e720834022e.tar.gz
abrt-556a4b3df4f116965e8dc46c08ac5e720834022e.tar.xz
abrt-556a4b3df4f116965e8dc46c08ac5e720834022e.zip
resolved: Bug 518420 - ordinary user's abrt-applet shows up for root owned crashes
Diffstat (limited to 'src')
-rw-r--r--src/Applet/CCApplet.cpp9
-rw-r--r--src/Applet/CCApplet.h2
-rw-r--r--src/Daemon/CommLayerServer.h2
-rw-r--r--src/Daemon/CommLayerServerDBus.cpp5
-rw-r--r--src/Daemon/CommLayerServerDBus.h2
-rw-r--r--src/Daemon/Daemon.cpp4
6 files changed, 15 insertions, 9 deletions
diff --git a/src/Applet/CCApplet.cpp b/src/Applet/CCApplet.cpp
index 8f01133..187cce3 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 0953c37..67b7e89 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 82b9c9c..95c0586 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 e51578e..38450aa 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 58970b0..f5b40b4 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: