diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-03-04 16:19:31 +0100 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-03-04 16:19:31 +0100 |
| commit | afb30fe1502e9c45b722da3b5c09e292d589aa7f (patch) | |
| tree | 8f0429ccc50987a34e73899c0a724ff6e0205c93 /lib/Utils | |
| parent | 892b7fde75cafca50a18dcb8620ddc22b2e74688 (diff) | |
| download | abrt-afb30fe1502e9c45b722da3b5c09e292d589aa7f.tar.gz abrt-afb30fe1502e9c45b722da3b5c09e292d589aa7f.tar.xz abrt-afb30fe1502e9c45b722da3b5c09e292d589aa7f.zip | |
*: UID:UUID -> crash_id conversion
This fixes at least three instances where we did not check whether
user is even allowed to report or delete a crash.
Also fixes a few cases when root might inadvertently act on (e.g. delete)
mote than one crash.
Renamed FILENAME_UID to CD_UID - makes more sense this way.
Added COL_INFORMALL and CD_INFORMALL. Nuked UID == -1 hacks.
Renamed getReport() to start_job on Python side.
Dropped a few unused parameters from server -> client dbus signals.
Fixed CLI's way of reverencing crashes (see updated help text).
Run-tested (GUI and CLI).
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Acked-by: Nikola Pajkovsky <npajkovs@redhat.com>
Diffstat (limited to 'lib/Utils')
| -rw-r--r-- | lib/Utils/CommLayerInner.cpp | 4 | ||||
| -rw-r--r-- | lib/Utils/Database.h | 19 | ||||
| -rw-r--r-- | lib/Utils/DebugDump.cpp | 2 | ||||
| -rw-r--r-- | lib/Utils/Observer.h | 4 | ||||
| -rw-r--r-- | lib/Utils/make_descr.cpp | 6 | ||||
| -rw-r--r-- | lib/Utils/test.cpp | 2 |
6 files changed, 18 insertions, 19 deletions
diff --git a/lib/Utils/CommLayerInner.cpp b/lib/Utils/CommLayerInner.cpp index bde3a71..9512019 100644 --- a/lib/Utils/CommLayerInner.cpp +++ b/lib/Utils/CommLayerInner.cpp @@ -42,7 +42,7 @@ static void warn_client(const char *msg) pthread_mutex_unlock(&s_map_mutex); if (peer) - s_pObs->Warning(msg, peer, key); + s_pObs->Warning(msg, peer); } void init_daemon_logging(CObserver *pObs) @@ -89,6 +89,6 @@ void update_client(const char *fmt, ...) char *msg = xvasprintf(fmt, p); va_end(p); - s_pObs->Status(msg, peer, key); + s_pObs->Status(msg, peer); free(msg); } diff --git a/lib/Utils/Database.h b/lib/Utils/Database.h index 6d7613b..a698bcb 100644 --- a/lib/Utils/Database.h +++ b/lib/Utils/Database.h @@ -40,6 +40,7 @@ typedef struct database_row_t { std::string m_sUUID; /**< A local UUID.*/ std::string m_sUID; /**< An UID of an user.*/ + std::string m_sInformAll; std::string m_sDebugDumpDir; /**< A debugdump directory of a crash.*/ std::string m_sCount; /**< Crash rate.*/ std::string m_sReported; /**< Is a row reported?*/ @@ -73,8 +74,8 @@ class CDatabase : public CPlugin * @param pDebugDumpPath A debugdump path. * @param pTime Time when a crash occurs. */ - virtual void Insert_or_Update(const char *pUUID, - const char *pUID, + virtual void Insert_or_Update(const char *crash_id, + bool inform_all_users, const char *pDebugDumpPath, const char *pTime) = 0; /** @@ -82,8 +83,7 @@ class CDatabase : public CPlugin * @param pUUID A lodal UUID of a crash. * @param pUID An UID of an user. */ - virtual void DeleteRow(const char *pUUID, - const char *pUID) = 0; + virtual void DeleteRow(const char *crash_id) = 0; virtual void DeleteRows_by_dir(const char *dump_dir) = 0; /** * A method, which sets that particular row was reported. @@ -92,11 +92,9 @@ class CDatabase : public CPlugin * @param pMessage A text explanation of reported problem * (where it is stored etc)... */ - virtual void SetReported(const char *pUUID, - const char *pUID, + virtual void SetReported(const char *crash_id, const char *pMessage) = 0; - virtual void SetReportedPerReporter(const char *pUUID, - const char *pUID, + virtual void SetReportedPerReporter(const char *crash_id, const char *reporter, const char *pMessage) = 0; /** @@ -106,7 +104,7 @@ class CDatabase : public CPlugin * @param pUID An UID of an user. * @return A vector of matched rows. */ - virtual vector_database_rows_t GetUIDData(const char *pUID) = 0; + virtual vector_database_rows_t GetUIDData(long caller_uid) = 0; /** * A method, which returns one row accordind to UUID of a crash and * UID of an user. If there are no row, empty row is returned. @@ -114,8 +112,7 @@ class CDatabase : public CPlugin * @param pUID An UID of an user. * @return A matched row. */ - virtual database_row_t GetRow(const char *pUUID, - const char *pUID) = 0; + virtual database_row_t GetRow(const char *crash_id) = 0; }; #endif diff --git a/lib/Utils/DebugDump.cpp b/lib/Utils/DebugDump.cpp index b8f8827..97c387c 100644 --- a/lib/Utils/DebugDump.cpp +++ b/lib/Utils/DebugDump.cpp @@ -319,7 +319,7 @@ void CDebugDump::Create(const char *pDir, uid_t uid) (long)m_uid, (long)m_gid); } - SaveText(FILENAME_UID, to_string(uid).c_str()); + SaveText(CD_UID, to_string(uid).c_str()); SaveKernelArchitectureRelease(); time_t t = time(NULL); SaveText(FILENAME_TIME, to_string(t).c_str()); diff --git a/lib/Utils/Observer.h b/lib/Utils/Observer.h index adf6844..ec7dfa7 100644 --- a/lib/Utils/Observer.h +++ b/lib/Utils/Observer.h @@ -26,8 +26,8 @@ class CObserver { public: virtual ~CObserver() {} - virtual void Status(const char *pMessage, const char* peer, uint64_t pDest) = 0; - virtual void Warning(const char *pMessage, const char* peer, uint64_t pDest) = 0; + virtual void Status(const char *pMessage, const char* peer) = 0; + virtual void Warning(const char *pMessage, const char* peer) = 0; }; #endif diff --git a/lib/Utils/make_descr.cpp b/lib/Utils/make_descr.cpp index 8019896..a2f0c03 100644 --- a/lib/Utils/make_descr.cpp +++ b/lib/Utils/make_descr.cpp @@ -68,14 +68,16 @@ static void add_content(bool &was_multiline, string& description, const char *he } } +/* Items we don't want to include */ static const char *const blacklisted_items_bz[] = { FILENAME_TIME , - FILENAME_UID , FILENAME_ANALYZER , FILENAME_COREDUMP , FILENAME_DESCRIPTION, /* package description - basically useless */ - CD_DUPHASH , + CD_UID , CD_UUID , + CD_INFORMALL , + CD_DUPHASH , CD_DUMPDIR , CD_COUNT , CD_REPORTED , diff --git a/lib/Utils/test.cpp b/lib/Utils/test.cpp index 24a6276..35edb0c 100644 --- a/lib/Utils/test.cpp +++ b/lib/Utils/test.cpp @@ -92,7 +92,7 @@ int main(int argc, char** argv) */ map_crash_data_t crashReport; middleWare.CreateCrashReport(crashInfo[CD_DUPHASH][CD_CONTENT], - crashInfo[FILENAME_UID][CD_CONTENT], + crashInfo[CD_UID][CD_CONTENT], crashReport); /* Report crash */ middleWare.Report(crashReport); |
