From 764c3a1e4f21c635c565cf5c20c480dbf48d1599 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Tue, 19 Jan 2010 16:48:54 +0100 Subject: unify "crash data, "crash info" and "crash report" data types. they are the same Signed-off-by: Denys Vlasenko --- src/CLI/CLI.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/CLI/CLI.cpp') diff --git a/src/CLI/CLI.cpp b/src/CLI/CLI.cpp index bc8ddf6..2f3b404 100644 --- a/src/CLI/CLI.cpp +++ b/src/CLI/CLI.cpp @@ -47,12 +47,12 @@ enum OPT_DELETE }; -static void print_crash_infos(vector_crash_infos_t& pCrashInfos, int pMode) +static void print_crash_infos(vector_map_crash_data_t& pCrashInfos, int pMode) { unsigned int ii; for (ii = 0; ii < pCrashInfos.size(); ii++) { - map_crash_info_t& info = pCrashInfos[ii]; + map_crash_data_t& info = pCrashInfos[ii]; if (pMode == OPT_GET_LIST_FULL || info[CD_REPORTED][CD_CONTENT] != "1") { const char *timestr = info[CD_TIME][CD_CONTENT].c_str(); @@ -189,7 +189,7 @@ int main(int argc, char** argv) case OPT_GET_LIST: case OPT_GET_LIST_FULL: { - vector_crash_infos_t ci = call_GetCrashInfos(); + vector_map_crash_data_t ci = call_GetCrashInfos(); print_crash_infos(ci, op); break; } -- cgit From 1a3447c52fe47cca5d72d0a15cbbca9f6d18eb50 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 20 Jan 2010 20:26:28 +0100 Subject: use get_crash_data_item_content() accessor more widely Signed-off-by: Denys Vlasenko --- src/CLI/CLI.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/CLI/CLI.cpp') diff --git a/src/CLI/CLI.cpp b/src/CLI/CLI.cpp index 2f3b404..5b96d7c 100644 --- a/src/CLI/CLI.cpp +++ b/src/CLI/CLI.cpp @@ -53,9 +53,9 @@ static void print_crash_infos(vector_map_crash_data_t& pCrashInfos, int pMode) for (ii = 0; ii < pCrashInfos.size(); ii++) { map_crash_data_t& info = pCrashInfos[ii]; - if (pMode == OPT_GET_LIST_FULL || info[CD_REPORTED][CD_CONTENT] != "1") + if (pMode == OPT_GET_LIST_FULL || get_crash_data_item_content(info, CD_REPORTED) != "1") { - const char *timestr = info[CD_TIME][CD_CONTENT].c_str(); + const char *timestr = get_crash_data_item_content(info, CD_TIME).c_str(); long time = strtol(timestr, NULL, 10); if (time == 0) error_msg_and_die("Error while converting time string."); @@ -72,13 +72,13 @@ static void print_crash_infos(vector_map_crash_data_t& pCrashInfos, int pMode) "\tExecutable : %s\n" "\tCrash Time : %s\n" "\tCrash Count: %s\n"), - ii, - info[CD_UID][CD_CONTENT].c_str(), - info[CD_UUID][CD_CONTENT].c_str(), - info[CD_PACKAGE][CD_CONTENT].c_str(), - info[CD_EXECUTABLE][CD_CONTENT].c_str(), - timeloc, - info[CD_COUNT][CD_CONTENT].c_str() + ii, + get_crash_data_item_content(info, CD_UID).c_str(), + get_crash_data_item_content(info, CD_UUID).c_str(), + get_crash_data_item_content(info, CD_PACKAGE).c_str(), + get_crash_data_item_content(info, CD_EXECUTABLE).c_str(), + timeloc, + get_crash_data_item_content(info, CD_COUNT).c_str() ); } } -- cgit From 6443695f275167adb123070daf2a6b6ecc0bb371 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 21 Jan 2010 02:56:53 +0100 Subject: abrtd: fix Report() dbus call gaping security holes We were blindly trusting the values passed to us Signed-off-by: Denys Vlasenko --- src/CLI/CLI.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/CLI/CLI.cpp') diff --git a/src/CLI/CLI.cpp b/src/CLI/CLI.cpp index 5b96d7c..a8786e9 100644 --- a/src/CLI/CLI.cpp +++ b/src/CLI/CLI.cpp @@ -55,7 +55,7 @@ static void print_crash_infos(vector_map_crash_data_t& pCrashInfos, int pMode) map_crash_data_t& info = pCrashInfos[ii]; if (pMode == OPT_GET_LIST_FULL || get_crash_data_item_content(info, CD_REPORTED) != "1") { - const char *timestr = get_crash_data_item_content(info, CD_TIME).c_str(); + const char *timestr = get_crash_data_item_content(info, FILENAME_TIME).c_str(); long time = strtol(timestr, NULL, 10); if (time == 0) error_msg_and_die("Error while converting time string."); @@ -73,10 +73,10 @@ static void print_crash_infos(vector_map_crash_data_t& pCrashInfos, int pMode) "\tCrash Time : %s\n" "\tCrash Count: %s\n"), ii, - get_crash_data_item_content(info, CD_UID).c_str(), + get_crash_data_item_content(info, FILENAME_UID).c_str(), get_crash_data_item_content(info, CD_UUID).c_str(), - get_crash_data_item_content(info, CD_PACKAGE).c_str(), - get_crash_data_item_content(info, CD_EXECUTABLE).c_str(), + get_crash_data_item_content(info, FILENAME_PACKAGE).c_str(), + get_crash_data_item_content(info, FILENAME_EXECUTABLE).c_str(), timeloc, get_crash_data_item_content(info, CD_COUNT).c_str() ); -- cgit