summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenys Vlasenko <dvlasenk@redhat.com>2010-11-25 13:29:51 +0100
committerDenys Vlasenko <dvlasenk@redhat.com>2010-11-25 13:29:51 +0100
commitfbfc0388531050aea764e68640e07ca776448aa1 (patch)
tree52c078aa2aea913c5f30abfddee657f17fdee31b
parentdcbb7fbe48c77998857e4ccd70d2fb29f41974f0 (diff)
downloadabrt-fbfc0388531050aea764e68640e07ca776448aa1.tar.gz
abrt-fbfc0388531050aea764e68640e07ca776448aa1.tar.xz
abrt-fbfc0388531050aea764e68640e07ca776448aa1.zip
abrtd: suppress spurious warning about missing coredump and inform_all
Also plugs two memory leaks Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
-rw-r--r--src/daemon/Daemon.cpp2
-rw-r--r--src/daemon/MiddleWare.cpp19
-rw-r--r--src/lib/run_event.c2
3 files changed, 14 insertions, 9 deletions
diff --git a/src/daemon/Daemon.cpp b/src/daemon/Daemon.cpp
index 225a7372..f0f9dee8 100644
--- a/src/daemon/Daemon.cpp
+++ b/src/daemon/Daemon.cpp
@@ -575,7 +575,7 @@ static gboolean handle_inotify_cb(GIOChannel *gio, GIOCondition condition, gpoin
);
/* Send dbus signal */
g_pCommLayer->Crash(get_crash_data_item_content_or_NULL(crashinfo, FILENAME_PACKAGE),
- crash_id,
+ crash_id, //TODO: stop passing this param, it is unused
fullname,
uid_str
);
diff --git a/src/daemon/MiddleWare.cpp b/src/daemon/MiddleWare.cpp
index 43844d82..27fd8fcf 100644
--- a/src/daemon/MiddleWare.cpp
+++ b/src/daemon/MiddleWare.cpp
@@ -117,8 +117,10 @@ mw_result_t CreateCrashReport(const char *dump_dir_name,
char *uid = dd_load_text(dd, FILENAME_UID);
if (strcmp(uid, caller_uid_str) != 0)
{
- char *inform_all = dd_load_text(dd, FILENAME_INFORMALL);
- if (!string_to_bool(inform_all))
+ char *inform_all = dd_load_text_ext(dd, FILENAME_INFORMALL, DD_FAIL_QUIETLY);
+ bool for_all = string_to_bool(inform_all);
+ free(inform_all);
+ if (!for_all)
{
dd_close(dd);
error_msg("crash '%s' can't be accessed by user with uid %ld", dump_dir_name, caller_uid);
@@ -226,10 +228,11 @@ report_status_t Report(const map_crash_data_t& client_report,
// Is it allowed for this user to report?
if (caller_uid != 0 // not called by root
- && get_crash_data_item_content(stored_report, FILENAME_INFORMALL) != "1"
&& strcmp(to_string(caller_uid).c_str(), UID) != 0
) {
- throw CABRTException(EXCEP_ERROR, "Report(): user with uid %ld can't report crash %s",
+ const char *inform_all = get_crash_data_item_content_or_NULL(stored_report, FILENAME_INFORMALL);
+ if (!inform_all || !string_to_bool(inform_all))
+ throw CABRTException(EXCEP_ERROR, "Report(): user with uid %ld can't report crash %s",
caller_uid, dump_dir_name);
}
@@ -623,8 +626,10 @@ vector_map_crash_data_t GetCrashInfos(long caller_uid)
uid = dd_load_text(dd, FILENAME_UID);
if (strcmp(uid, caller_uid_str) != 0)
{
- char *inform_all = dd_load_text(dd, FILENAME_INFORMALL);
- if (!string_to_bool(inform_all))
+ char *inform_all = dd_load_text_ext(dd, FILENAME_INFORMALL, DD_FAIL_QUIETLY);
+ bool for_all = string_to_bool(inform_all);
+ free(inform_all);
+ if (!for_all)
{
dd_close(dd);
goto next;
@@ -776,7 +781,7 @@ int DeleteDebugDump(const char *dump_dir_name, long caller_uid)
char *uid = dd_load_text(dd, FILENAME_UID);
if (strcmp(uid, caller_uid_str) != 0)
{
- char *inform_all = dd_load_text(dd, FILENAME_INFORMALL);
+ char *inform_all = dd_load_text_ext(dd, FILENAME_INFORMALL, DD_FAIL_QUIETLY);
if (!string_to_bool(inform_all))
{
dd_close(dd);
diff --git a/src/lib/run_event.c b/src/lib/run_event.c
index 90b7b2f2..4ff1070d 100644
--- a/src/lib/run_event.c
+++ b/src/lib/run_event.c
@@ -235,7 +235,7 @@ char *list_possible_events(struct dump_dir *dd, const char *dump_dir_name, const
if (!dd)
goto stop; /* error (note: dd_opendir logged error msg) */
}
- char *real_val = dd_load_text(dd, p);
+ char *real_val = dd_load_text_ext(dd, p, DD_FAIL_QUIETLY);
/* Does VAL match? */
if (strcmp(real_val, line_val) != 0)
{