diff options
author | Nikola Pajkovsky <npajkovs@redhat.com> | 2009-11-03 12:15:55 +0100 |
---|---|---|
committer | Nikola Pajkovsky <npajkovs@redhat.com> | 2009-11-03 12:15:55 +0100 |
commit | e8eefb19c47a7f4e7481d1f6460f8632e09bd76e (patch) | |
tree | 35660112ef5fc041d5ad3719f91d36f9b24ba1c5 | |
parent | a5671452a511f992cd0e74c66da05e85c999d63f (diff) | |
download | abrt-e8eefb19c47a7f4e7481d1f6460f8632e09bd76e.tar.gz abrt-e8eefb19c47a7f4e7481d1f6460f8632e09bd76e.tar.xz abrt-e8eefb19c47a7f4e7481d1f6460f8632e09bd76e.zip |
kerneloop has uid = -1 new
-rw-r--r-- | lib/Plugins/SQLite3.cpp | 12 | ||||
-rw-r--r-- | lib/Utils/DebugDump.cpp | 4 | ||||
-rw-r--r-- | lib/Utils/DebugDump.h | 3 | ||||
-rw-r--r-- | src/Applet/Applet.cpp | 8 | ||||
-rw-r--r-- | src/Daemon/Daemon.cpp | 6 |
5 files changed, 16 insertions, 17 deletions
diff --git a/lib/Plugins/SQLite3.cpp b/lib/Plugins/SQLite3.cpp index 200a813..dc035d3 100644 --- a/lib/Plugins/SQLite3.cpp +++ b/lib/Plugins/SQLite3.cpp @@ -99,7 +99,7 @@ bool CSQLite3::Exist(const std::string& pUUID, const std::string& pUID) GetTable("SELECT "DATABASE_COLUMN_REPORTED" FROM "ABRT_TABLE" WHERE " DATABASE_COLUMN_UUID" = '"+pUUID+"' " "AND ("DATABASE_COLUMN_UID" = '"+pUID+"' " - "OR "DATABASE_COLUMN_UID" = '"+to_string(UINT_MAX)+"');" + "OR "DATABASE_COLUMN_UID" = '-1');" , table); if (table.empty()) { @@ -315,7 +315,7 @@ void CSQLite3::Delete(const std::string& pUUID, const std::string& pUID) Exec("DELETE FROM "ABRT_TABLE" " "WHERE "DATABASE_COLUMN_UUID" = '"+pUUID+"' " "AND "DATABASE_COLUMN_UID" = '"+pUID+"' " - "OR "DATABASE_COLUMN_UID" = '"+to_string(UINT_MAX)+"';"); + "OR "DATABASE_COLUMN_UID" = '-1';"); } else { @@ -340,12 +340,12 @@ void CSQLite3::SetReported(const std::string& pUUID, const std::string& pUID, co "SET "DATABASE_COLUMN_REPORTED" = 1 " "WHERE "DATABASE_COLUMN_UUID" = '"+pUUID+"' " "AND ("DATABASE_COLUMN_UID" = '"+pUID+"' " - "OR "DATABASE_COLUMN_UID" = '"+to_string(UINT_MAX)+"');"); + "OR "DATABASE_COLUMN_UID" = '-1');"); Exec("UPDATE "ABRT_TABLE" " "SET "DATABASE_COLUMN_MESSAGE" = '" + pMessage + "' " "WHERE "DATABASE_COLUMN_UUID" = '"+pUUID+"' " "AND ("DATABASE_COLUMN_UID" = '"+pUID+"' " - "OR "DATABASE_COLUMN_UID" = '"+to_string(UINT_MAX)+"');"); + "OR "DATABASE_COLUMN_UID" = '-1');"); } else { @@ -364,7 +364,7 @@ vector_database_rows_t CSQLite3::GetUIDData(const std::string& pUID) { GetTable("SELECT * FROM "ABRT_TABLE " WHERE "DATABASE_COLUMN_UID" = '"+pUID+"' " - "OR "DATABASE_COLUMN_UID" = '"+to_string(UINT_MAX)+"';", + "OR "DATABASE_COLUMN_UID" = '-1';", table); } return table; @@ -385,7 +385,7 @@ database_row_t CSQLite3::GetUUIDData(const std::string& pUUID, const std::string GetTable("SELECT * FROM "ABRT_TABLE" " "WHERE "DATABASE_COLUMN_UUID" = '"+pUUID+"' " "AND ("DATABASE_COLUMN_UID" = '"+pUID+"' " - "OR "DATABASE_COLUMN_UID" = '"+to_string(UINT_MAX)+"');", + "OR "DATABASE_COLUMN_UID" = '-1');", table); } diff --git a/lib/Utils/DebugDump.cpp b/lib/Utils/DebugDump.cpp index f5c7319..d5eeb77 100644 --- a/lib/Utils/DebugDump.cpp +++ b/lib/Utils/DebugDump.cpp @@ -208,7 +208,7 @@ void CDebugDump::UnLock() } } -void CDebugDump::Create(const std::string& pDir, uid_t uid) +void CDebugDump::Create(const std::string& pDir, uint64_t uid) { if (m_bOpened) { @@ -245,7 +245,7 @@ void CDebugDump::Create(const std::string& pDir, uid_t uid) perror_msg("can't change '%s' ownership to %u:%u", m_sDebugDumpDir.c_str(), (int)uid, (int)gid); } - SaveText(FILENAME_UID, ssprintf("%u", (int)uid)); + SaveText(FILENAME_UID, ssprintf("%li", uid)); SaveKernelArchitectureRelease(); SaveTime(); } diff --git a/lib/Utils/DebugDump.h b/lib/Utils/DebugDump.h index 687bac7..fae6420 100644 --- a/lib/Utils/DebugDump.h +++ b/lib/Utils/DebugDump.h @@ -25,6 +25,7 @@ #include <string> #include <dirent.h> +#include <stdint.h> #define FILENAME_ARCHITECTURE "architecture" #define FILENAME_KERNEL "kernel" @@ -60,7 +61,7 @@ class CDebugDump ~CDebugDump() { Close(); } void Open(const std::string& pDir); - void Create(const std::string& pDir, uid_t nUID); + void Create(const std::string& pDir, uint64_t uid); void Delete(); void Close(); diff --git a/src/Applet/Applet.cpp b/src/Applet/Applet.cpp index ea58b25..327e24f 100644 --- a/src/Applet/Applet.cpp +++ b/src/Applet/Applet.cpp @@ -67,12 +67,12 @@ static void Crash(DBusMessage* signal) // uid_t uid_num = atol(uid_str); char* endptr; - uid_t uid_num = (uid_t)strtoul(uid_str,&endptr, 10); + int64_t uid_num = strtoll(uid_str,&endptr, 10); - printf("%u:%s\n", uid_num, uid_str); - if ((uid_num != getuid()) && (uid_num != UINT_MAX)) + if ((uid_num != getuid()) && (uid_num != -1)) + { return; - + } const char* message = _("A crash in package %s has been detected"); //applet->AddEvent(uid, progname); applet->SetIconTooltip(message, progname); diff --git a/src/Daemon/Daemon.cpp b/src/Daemon/Daemon.cpp index 0e81dfd..ef78c6a 100644 --- a/src/Daemon/Daemon.cpp +++ b/src/Daemon/Daemon.cpp @@ -531,8 +531,7 @@ static gboolean handle_inotify_cb(GIOChannel *gio, GIOCondition condition, gpoin { // When Kerneloops comes it will be sent uid with -1 // Applet will detected and show normal user - std::cout << "New: package|kerneloops" << crashinfo[CD_PACKAGE][CD_CONTENT] << std::endl; - g_pCommLayer->Crash(crashinfo[CD_PACKAGE][CD_CONTENT], to_string(UINT_MAX)); + g_pCommLayer->Crash(crashinfo[CD_PACKAGE][CD_CONTENT], to_string("-1")); } else { @@ -547,8 +546,7 @@ static gboolean handle_inotify_cb(GIOChannel *gio, GIOCondition condition, gpoin { // When Kerneloops comes it will be sent uid with -1 // Applet will detected and show normal user - std::cout << "New: package|kerneloops" << crashinfo[CD_PACKAGE][CD_CONTENT] << std::endl; - g_pCommLayer->Crash(crashinfo[CD_PACKAGE][CD_CONTENT], to_string(UINT_MAX)); + g_pCommLayer->Crash(crashinfo[CD_PACKAGE][CD_CONTENT], to_string("-1")); } else { |