On Fri, 2010-11-19 at 12:45 +0100, Denys Vlasenko wrote:
This patch removes sqlite database.
Database was used to find dump dirs by [UID:]UUID.
This patch uses more natural way: dump dirs are addressed by their
directory names.
DB was also used to produce a list of dump dirs.
Now it is done by iterating over the /var/spool/abrt directory.
How fast is it?
I created 5000 crashes (by copying the same crash dump dir),
then ran:
# time abrt-cli -lf
...
...
...
5001.
UID : 0
UUID : 9352c1ebea321985e6e937a7255c4ddc1b0587b9
Package : coreutils-8.4-9.fc13
Executable : /bin/sleep
Crash Time : Fri 19 Nov 2010 11:51:14 AM CET
Crash Count: 2
Hostname :
dhcp-25-227.brq.redhat.com
real 0m9.816s
user 0m0.901s
sys 0m0.286s
And finally, DB was also used to find duplicate UUIDs.
Now it is done by iterating over the /var/spool/abrt directory.
Crash count, "inform all" and reporting result message are moved
from DB field to a file in dump dir.
"Reported" DB field is deleted -
if message != "", then this dump was reported.
Patch is run-tested.
Slightly updated patch is attached:
* s/CD_COUNT/FILENAME_COUNT/g etc, to make field names consistent
* dd_load_text() converts files which contain just "foo\n"
to "foo" (that is, trims \n), making it possible, for example,
to use "echo 1 >inform_all_users" in abrt_event.conf.
Mutli-line files are not affected.
--
vda
diff -urp abrt.2/abrt.spec abrt.3/abrt.spec
--- abrt.2/abrt.spec 2010-11-15 15:10:45.000000000 +0100
+++ abrt.3/abrt.spec 2010-11-18 06:29:52.899044375 +0100
@@ -32,7 +32,6 @@ BuildRequires: dbus-devel
BuildRequires: gtk2-devel
BuildRequires: curl-devel
BuildRequires: rpm-devel >= 4.6
-BuildRequires: sqlite-devel > 3.0
BuildRequires: desktop-file-utils
#BuildRequires: nss-devel
BuildRequires: libnotify-devel
@@ -350,9 +349,6 @@ fi
%{_mandir}/man7/%{name}-plugins.7.gz
%{_datadir}/polkit-1/actions/org.fedoraproject.abrt.policy
%{_datadir}/dbus-1/system-services/com.redhat.abrt.service
-%config(noreplace) %{_sysconfdir}/%{name}/plugins/SQLite3.conf
-%{_libdir}/%{name}/libSQLite3.so*
-%{_mandir}/man7/%{name}-SQLite3.7.gz
%files libs
%defattr(-,root,root,-)
diff -urp abrt.2/configure.ac abrt.3/configure.ac
--- abrt.2/configure.ac 2010-11-16 17:55:59.000000000 +0100
+++ abrt.3/configure.ac 2010-11-18 06:29:07.749899314 +0100
@@ -37,7 +37,6 @@ if test -z "$PYTHON"; then
exit 1
fi
-PKG_CHECK_MODULES([SQLITE3], [sqlite3])
PKG_CHECK_MODULES([GTK], [gtk+-2.0])
PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.21])
PKG_CHECK_MODULES([DBUS], [dbus-1])
diff -urp abrt.2/po/POTFILES.in abrt.3/po/POTFILES.in
--- abrt.2/po/POTFILES.in 2010-11-12 18:18:55.000000000 +0100
+++ abrt.3/po/POTFILES.in 2010-11-18 06:27:35.772650342 +0100
@@ -6,7 +6,6 @@ lib/plugins/Kerneloops.cpp
lib/plugins/KerneloopsScanner.cpp
lib/plugins/KerneloopsSysLog.cpp
lib/plugins/Python.cpp
-lib/plugins/SQLite3.cpp
lib/plugins/Bugzilla.glade
lib/plugins/KerneloopsReporter.glade
lib/plugins/Logger.glade
diff -urp abrt.2/src/cli/CLI.cpp abrt.3/src/cli/CLI.cpp
--- abrt.2/src/cli/CLI.cpp 2010-11-10 00:12:48.000000000 +0100
+++ abrt.3/src/cli/CLI.cpp 2010-11-19 13:18:59.941469926 +0100
@@ -50,12 +50,12 @@ static void print_crash(const map_crash_
"\tExecutable : %s\n"
"\tCrash Time : %s\n"
"\tCrash Count: %s\n"),
- get_crash_data_item_content(crash, CD_UID).c_str(),
- get_crash_data_item_content(crash, CD_UUID).c_str(),
+ get_crash_data_item_content(crash, FILENAME_UID).c_str(),
+ get_crash_data_item_content(crash, FILENAME_UUID).c_str(),
get_crash_data_item_content(crash, FILENAME_PACKAGE).c_str(),
get_crash_data_item_content(crash, FILENAME_EXECUTABLE).c_str(),
timeloc,
- get_crash_data_item_content(crash, CD_COUNT).c_str());
+ get_crash_data_item_content(crash, FILENAME_COUNT).c_str());
free((void *)timeloc);
@@ -75,7 +75,7 @@ static void print_crash_list(const vecto
for (unsigned i = 0; i < crash_list.size(); ++i)
{
const map_crash_data_t& crash = crash_list[i];
- if (get_crash_data_item_content(crash, CD_REPORTED) == "1" &&
!include_reported)
+ if (get_crash_data_item_content(crash, FILENAME_MESSAGE) != ""
&& !include_reported)
continue;
printf("%u.\n", i);
@@ -100,8 +100,8 @@ static void print_crash_info(const map_c
"Executable: %s\n"
"System: %s, kernel %s\n"
"Reason: %s\n"),
- get_crash_data_item_content(crash, CD_UID).c_str(),
- get_crash_data_item_content(crash, CD_UUID).c_str(),
+ get_crash_data_item_content(crash, FILENAME_UID).c_str(),
+ get_crash_data_item_content(crash, FILENAME_UUID).c_str(),
timeloc,
get_crash_data_item_content(crash, FILENAME_ANALYZER).c_str(),
get_crash_data_item_content(crash, FILENAME_COMPONENT).c_str(),
@@ -166,8 +166,8 @@ static char *guess_crash_id(const char *
error_msg_and_die("There are only %u crash infos",
num_crashinfos);
map_crash_data_t& info = ci[position];
return xasprintf("%s:%s",
- 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, FILENAME_UID).c_str(),
+ get_crash_data_item_content(info, FILENAME_UUID).c_str()
);
}
@@ -177,13 +177,13 @@ static char *guess_crash_id(const char *
for (ii = 0; ii < num_crashinfos; ii++)
{
map_crash_data_t& info = ci[ii];
- const char *this_uuid = get_crash_data_item_content(info, CD_UUID).c_str();
+ const char *this_uuid = get_crash_data_item_content(info,
FILENAME_UUID).c_str();
if (strncmp(str, this_uuid, len) == 0)
{
if (result)
error_msg_and_die("Crash prefix '%s' is not unique",
str);
result = xasprintf("%s:%s",
- get_crash_data_item_content(info, CD_UID).c_str(),
+ get_crash_data_item_content(info, FILENAME_UID).c_str(),
this_uuid
);
}
diff -urp abrt.2/src/daemon/abrt.conf abrt.3/src/daemon/abrt.conf
--- abrt.2/src/daemon/abrt.conf 2010-11-15 18:00:08.000000000 +0100
+++ abrt.3/src/daemon/abrt.conf 2010-11-18 06:27:50.352900267 +0100
@@ -18,10 +18,6 @@ ProcessUnpackaged = no
#
BlackListedPaths = /usr/share/doc/*, */example*
-# Which database plugin to use
-#
-Database = SQLite3
-
# Enable this if you want abrtd to auto-unpack crashdump tarballs which appear
# in this directory (for example, uploaded via ftp, scp etc).
# Note: you must ensure that whatever directory you specify here exists
diff -urp abrt.2/src/daemon/abrt.conf.5 abrt.3/src/daemon/abrt.conf.5
--- abrt.2/src/daemon/abrt.conf.5 2010-11-10 00:12:48.000000000 +0100
+++ abrt.3/src/daemon/abrt.conf.5 2010-11-18 17:27:56.881052695 +0100
@@ -35,11 +35,6 @@ will ignore packages in this list and wi
will ignore crashes in executables whose absolute path matches
one of specified patterns.
.TP
-.B Database = \fIdatabasePlugin\fP
-This specifies which database plugin
-.I abrt
-uses to store metadata about the crash.
-.TP
.B MaxCrashReportsSize = \fInumber\fP
The maximum disk space (specified in megabytes) that
.I abrt
diff -urp abrt.2/src/daemon/abrt_event.conf abrt.3/src/daemon/abrt_event.conf
--- abrt.2/src/daemon/abrt_event.conf 2010-11-12 11:59:22.000000000 +0100
+++ abrt.3/src/daemon/abrt_event.conf 2010-11-19 13:19:48.499470071 +0100
@@ -30,6 +30,8 @@ EVENT=post-create
EVENT=post-create analyzer=CCpp abrt-action-analyze-c
EVENT=post-create analyzer=Python abrt-action-analyze-python
EVENT=post-create analyzer=Kerneloops abrt-action-analyze-oops
+# If you want all users (not just root) to be able to see oopses:
+#EVENT=post-create analyzer=Kerneloops echo 1 >inform_all_users
# If you want behavior similar to one provided by kerneloops daemon
# distributed by
kerneloops.org - that is, if you want
# oopses to be reported automatically and immediately without
diff -urp abrt.2/src/daemon/abrt-server.c abrt.3/src/daemon/abrt-server.c
--- abrt.2/src/daemon/abrt-server.c 2010-11-10 00:12:48.000000000 +0100
+++ abrt.3/src/daemon/abrt-server.c 2010-11-19 13:16:04.365469857 +0100
@@ -134,7 +134,7 @@ static void create_debug_dump()
/* Store id of the user whose application crashed. */
char uid_str[sizeof(long) * 3 + 2];
sprintf(uid_str, "%lu", (long)client_uid);
- dd_save_text(dd, CD_UID, uid_str);
+ dd_save_text(dd, FILENAME_UID, uid_str);
dd_close(dd);
diff -urp abrt.2/src/daemon/Daemon.cpp abrt.3/src/daemon/Daemon.cpp
--- abrt.2/src/daemon/Daemon.cpp 2010-11-18 06:45:52.667044835 +0100
+++ abrt.3/src/daemon/Daemon.cpp 2010-11-19 13:16:00.860219809 +0100
@@ -360,86 +360,6 @@ static int SetUpCron()
return 0;
}
-static void FindNewDumps(const char* pPath)
-{
- /* Get all debugdump directories in the pPath directory */
- GList *dirs = NULL;
- DIR *dp = opendir(pPath);
- if (dp == NULL)
- {
- perror_msg("Can't open directory '%s'", pPath);
- return;
- }
- struct dirent *ep;
- while ((ep = readdir(dp)))
- {
- if (dot_or_dotdot(ep->d_name))
- continue; /* skip "." and ".." */
- char *dname = concat_path_file(pPath, ep->d_name);
- struct stat stats;
- if (lstat(dname, &stats) == 0)
- {
- if (S_ISDIR(stats.st_mode))
- {
- VERB1 log("Will check directory '%s'", ep->d_name);
- dirs = g_list_append(dirs, dname);
- continue;
- }
- }
- free(dname);
- }
- closedir(dp);
-
- unsigned size = g_list_length(dirs);
- if (size == 0)
- return;
- log("Checking for unsaved crashes (dirs to check:%u)", size);
-
- /* Get potentially non-processed debugdumps */
- for (GList *li = dirs; li != NULL; li = g_list_next(li))
- {
- try
- {
- const char *dir_name = (char*)dirs->data;
- map_crash_data_t crashinfo;
- mw_result_t res = SaveDebugDump(dir_name, crashinfo);
- switch (res)
- {
- case MW_OK:
- /* Not VERB1: this is new, unprocessed crash dump.
- * Last abrtd somehow missed it - need to inform user */
- log("Non-processed crash in %s, saving into database",
dir_name);
- break;
- case MW_IN_DB:
- /* This debugdump was found in DB, nothing else was done
- * by SaveDebugDump or needs to be done by us */
- VERB1 log("%s is already saved in database", dir_name);
- break;
- case MW_REPORTED: /* already reported dup */
- case MW_OCCURRED: /* not-yet-reported dup */
- VERB1 log("Duplicate crash %s, deleting", dir_name);
- delete_debug_dump_dir(dir_name);
- break;
- default:
- log("Corrupted or bad crash %s (res:%d), deleting",
dir_name, (int)res);
- delete_debug_dump_dir(dir_name);
- break;
- }
- }
- catch (CABRTException& e)
- {
- error_msg("%s", e.what());
- }
- }
-
- for (GList *li = dirs; li != NULL; li = g_list_next(li))
- free(li->data);
-
- g_list_free(dirs);
-
- log("Done checking for unsaved crashes");
-}
-
static int CreatePidFile()
{
int fd;
@@ -616,7 +536,7 @@ static gboolean handle_inotify_cb(GIOCha
char *d = concat_path_file(DEBUG_DUMPS_DIR, worst_dir);
free(worst_dir);
worst_dir = NULL;
- DeleteDebugDump_by_dir(d);
+ delete_debug_dump_dir(d);
free(d);
}
}
@@ -625,38 +545,37 @@ static gboolean handle_inotify_cb(GIOCha
try
{
fullname = concat_path_file(DEBUG_DUMPS_DIR, name);
- /* Note: SaveDebugDump does not save crashinfo, it _fetches_ crashinfo */
map_crash_data_t crashinfo;
- mw_result_t res = SaveDebugDump(fullname, crashinfo);
+ mw_result_t res = LoadDebugDump(fullname, crashinfo);
switch (res)
{
case MW_OK:
log("New crash %s, processing", fullname);
/* Fall through */
- case MW_REPORTED: /* already reported dup */
- case MW_OCCURRED: /* not-yet-reported dup */
+ case MW_OCCURRED: /* dup */
{
if (res != MW_OK)
{
- const char *first = get_crash_data_item_content(crashinfo,
CD_DUMPDIR).c_str();
+ const char *first =
get_crash_data_item_content_or_NULL(crashinfo, CD_DUMPDIR);
log("Deleting crash %s (dup of %s), sending dbus
signal",
strrchr(fullname, '/') + 1,
strrchr(first, '/') + 1);
delete_debug_dump_dir(fullname);
}
- const char *analyzer = get_crash_data_item_content(crashinfo,
FILENAME_ANALYZER).c_str();
- const char *uid_str = get_crash_data_item_content(crashinfo,
CD_UID).c_str();
+ const char *analyzer = get_crash_data_item_content_or_NULL(crashinfo,
FILENAME_ANALYZER);
+ const char *uid_str = get_crash_data_item_content_or_NULL(crashinfo,
FILENAME_UID);
+ const char *inform_all =
get_crash_data_item_content_or_NULL(crashinfo, FILENAME_INFORMALL);
- /* Send dbus signal */
- //if (analyzer_has_InformAllUsers(analyzer))
- // uid_str = NULL;
+ if (inform_all && string_to_bool(inform_all))
+ uid_str = NULL;
char *crash_id = xasprintf("%s:%s",
- get_crash_data_item_content(crashinfo,
CD_UID).c_str(),
- get_crash_data_item_content(crashinfo,
CD_UUID).c_str()
+ get_crash_data_item_content_or_NULL(crashinfo,
FILENAME_UID),
+ get_crash_data_item_content_or_NULL(crashinfo,
FILENAME_UUID)
);
- g_pCommLayer->Crash(get_crash_data_item_content(crashinfo,
FILENAME_PACKAGE).c_str(),
+ /* Send dbus signal */
+ g_pCommLayer->Crash(get_crash_data_item_content_or_NULL(crashinfo,
FILENAME_PACKAGE),
crash_id,
fullname,
uid_str
@@ -664,9 +583,6 @@ static gboolean handle_inotify_cb(GIOCha
free(crash_id);
break;
}
- case MW_IN_DB:
- log("Huh, this crash is already in db?! Nothing to do");
- break;
case MW_CORRUPTED:
case MW_GPG_ERROR:
default:
@@ -984,8 +900,6 @@ int main(int argc, char** argv)
/* Enter the event loop */
try
{
- /* This may take a while, therefore we don't do it in init section */
- FindNewDumps(DEBUG_DUMPS_DIR);
log("Init complete, entering main loop");
run_main_loop(pMainloop);
}
diff -urp abrt.2/src/daemon/MiddleWare.cpp abrt.3/src/daemon/MiddleWare.cpp
--- abrt.2/src/daemon/MiddleWare.cpp 2010-11-18 14:03:34.251816116 +0100
+++ abrt.3/src/daemon/MiddleWare.cpp 2010-11-19 13:18:52.854469841 +0100
@@ -37,16 +37,27 @@ CPluginManager* g_pPluginManager;
/**
+ * Get one crash info. If getting is successful,
+ * then crash info is filled.
+ * @param pUUID A local UUID of a crash.
+ * @param pUID An UID of an user.
+ * @param pCrashData A crash info.
+ * @return It return results of operation. See mw_result_t.
+ */
+static mw_result_t FillCrashInfo(const char *crash_id,
+ map_crash_data_t& pCrashData);
+
+/**
* Transforms a debugdump directory to inner crash
* report form. This form is used for later reporting.
* @param pDebugDumpDir A debugdump dir containing all necessary data.
* @param pCrashData A created crash report.
*/
-static bool DebugDumpToCrashReport(const char *pDebugDumpDir, map_crash_data_t&
pCrashData)
+static bool DebugDumpToCrashReport(const char *dump_dir_name, map_crash_data_t&
pCrashData)
{
- VERB3 log(" DebugDumpToCrashReport('%s')", pDebugDumpDir);
+ VERB3 log(" DebugDumpToCrashReport('%s')", dump_dir_name);
- struct dump_dir *dd = dd_opendir(pDebugDumpDir, /*flags:*/ 0);
+ struct dump_dir *dd = dd_opendir(dump_dir_name, /*flags:*/ 0);
if (!dd)
return false;
@@ -56,7 +67,7 @@ static bool DebugDumpToCrashReport(const
if (!dd_exist(dd, *v))
{
dd_close(dd);
- log("Important file '%s/%s' is missing", pDebugDumpDir,
*v);
+ log("Important file '%s/%s' is missing", dump_dir_name,
*v);
return false;
}
v++;
@@ -69,6 +80,8 @@ static bool DebugDumpToCrashReport(const
add_to_crash_data_ext(pCrashData, CD_EVENTS, CD_SYS, CD_ISNOTEDITABLE, events);
free(events);
+ add_to_crash_data_ext(pCrashData, CD_DUMPDIR, CD_SYS, CD_ISNOTEDITABLE,
dump_dir_name);
+
return true;
}
@@ -84,43 +97,44 @@ static char *do_log_and_update_client(ch
* (1) by StartJob dbus call -> CreateReportThread(), in the thread
* (2) by CreateReport dbus call
*/
-mw_result_t CreateCrashReport(const char *crash_id,
+mw_result_t CreateCrashReport(const char *dump_dir_name,
long caller_uid,
int force,
map_crash_data_t& pCrashData)
{
- VERB2 log("CreateCrashReport('%s',%ld,result)", crash_id,
caller_uid);
+ VERB2 log("CreateCrashReport('%s',%ld,result)", dump_dir_name,
caller_uid);
- CDatabase* database = g_pPluginManager->GetDatabase(g_settings_sDatabase);
- database->Connect();
- struct db_row *row = database->GetRow(crash_id);
- database->DisConnect();
- if (!row)
- {
- error_msg("crash '%s' is not in database", crash_id);
- return MW_IN_DB_ERROR;
- }
+ struct dump_dir *dd = dd_opendir(dump_dir_name, /*flags:*/ 0);
+ if (!dd)
+ return MW_NOENT_ERROR;
mw_result_t r = MW_OK;
- if (caller_uid != 0 /* not called by root */
- && row->db_inform_all[0] != '1'
- ) {
+ if (caller_uid != 0) /* not called by root */
+ {
char caller_uid_str[sizeof(long) * 3 + 2];
sprintf(caller_uid_str, "%ld", caller_uid);
- if (strcmp(caller_uid_str, row->db_uid) != 0)
+
+ char *uid = dd_load_text(dd, FILENAME_UID);
+ if (strcmp(uid, caller_uid_str) != 0)
{
- error_msg("crash '%s' can't be accessed by user with uid
%ld", crash_id, caller_uid);
- r = MW_IN_DB_ERROR;
- goto ret;
+ char *inform_all = dd_load_text(dd, FILENAME_INFORMALL);
+ if (!string_to_bool(inform_all))
+ {
+ dd_close(dd);
+ error_msg("crash '%s' can't be accessed by user with uid
%ld", dump_dir_name, caller_uid);
+ r = MW_PERM_ERROR;
+ goto ret;
+ }
}
}
+ dd_close(dd);
try
{
struct run_event_state *run_state = new_run_event_state();
run_state->logging_callback = do_log_and_update_client;
- int res = run_event(run_state, row->db_dump_dir, force ? "reanalyze"
: "analyze");
+ int res = run_event(run_state, dump_dir_name, force ? "reanalyze" :
"analyze");
free_run_event_state(run_state);
if (res != 0 && res != -1) /* -1 is "nothing was done", here it
is ok */
{
@@ -131,7 +145,7 @@ mw_result_t CreateCrashReport(const char
/* Do a load_crash_data_from_debug_dump from (possibly updated)
* crash dump dir
*/
- if (!DebugDumpToCrashReport(row->db_dump_dir, pCrashData))
+ if (!DebugDumpToCrashReport(dump_dir_name, pCrashData))
{
error_msg("Error loading crash data");
r = MW_ERROR;
@@ -149,7 +163,6 @@ mw_result_t CreateCrashReport(const char
}
ret:
- db_row_free(row);
VERB3 log("CreateCrashReport() returns %d", r);
return r;
}
@@ -197,17 +210,16 @@ report_status_t Report(const map_crash_d
long caller_uid)
{
// Get ID fields
- const char *UID = get_crash_data_item_content_or_NULL(client_report, CD_UID);
- const char *UUID = get_crash_data_item_content_or_NULL(client_report, CD_UUID);
- if (!UID || !UUID)
+ const char *UID = get_crash_data_item_content_or_NULL(client_report, FILENAME_UID);
+ const char *dump_dir_name = get_crash_data_item_content_or_NULL(client_report,
CD_DUMPDIR);
+ if (!UID || !dump_dir_name)
{
- throw CABRTException(EXCEP_ERROR, "Report(): UID or UUID is missing in
client's report data");
+ throw CABRTException(EXCEP_ERROR, "Report(): UID or DUMPDIR is missing in
client's report data");
}
- string crash_id = ssprintf("%s:%s", UID, UUID);
// Retrieve corresponding stored record
map_crash_data_t stored_report;
- mw_result_t r = FillCrashInfo(crash_id.c_str(), stored_report);
+ mw_result_t r = FillCrashInfo(dump_dir_name, stored_report);
if (r != MW_OK)
{
return report_status_t();
@@ -215,15 +227,13 @@ report_status_t Report(const map_crash_d
// Is it allowed for this user to report?
if (caller_uid != 0 // not called by root
- && get_crash_data_item_content(stored_report, CD_INFORMALL) !=
"1"
+ && 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",
- caller_uid, crash_id.c_str());
+ caller_uid, dump_dir_name);
}
- const char *dump_dir_name = get_crash_data_item_content_or_NULL(stored_report,
CD_DUMPDIR);
-
// Save comment, "how to reproduce", backtrace
//TODO: we should iterate through stored_report and modify all
//modifiable fields which have new data in client_report
@@ -353,136 +363,102 @@ report_status_t Report(const map_crash_d
}
g_list_free(env_list);
- // Save reporting results to database
+ // Save reporting results
if (at_least_one_reporter_succeeded)
{
- CDatabase* database = g_pPluginManager->GetDatabase(g_settings_sDatabase);
- database->Connect();
report_status_t::iterator ret_it = ret.begin();
while (ret_it != ret.end())
{
- const string &event = ret_it->first;
- const vector_string_t &v = ret_it->second;
- if (v[REPORT_STATUS_IDX_FLAG] == "1")
- {
- database->SetReportedPerReporter(crash_id.c_str(), event.c_str(),
v[REPORT_STATUS_IDX_MSG].c_str());
- }
+// const string &event = ret_it->first;
+// const vector_string_t &v = ret_it->second;
+// if (v[REPORT_STATUS_IDX_FLAG] == "1")
+// {
+// TODO: append to a log of reports done
+// database->SetReportedPerReporter(dump_dir_name, event.c_str(),
v[REPORT_STATUS_IDX_MSG].c_str());
+// }
ret_it++;
}
- database->SetReported(crash_id.c_str(), message.c_str());
- database->DisConnect();
+ /* Was: database->SetReported(dump_dir_name, message.c_str()); */
+ struct dump_dir *dd = dd_opendir(dump_dir_name, /*flags:*/ 0);
+ if (dd)
+ {
+ dd_save_text(dd, FILENAME_MESSAGE, message.c_str());
+ dd_close(dd);
+ }
}
return ret;
#undef client_report
}
-/**
- * Check whether particular debugdump directory is saved in database.
- * @param debug_dump_dir
- * A debugdump dir containing all necessary data.
- * @return
- * It returns true if debugdump dir is already saved, otherwise
- * it returns false.
- */
-static bool is_debug_dump_saved(const char *debug_dump_dir)
-{
- CDatabase* database = g_pPluginManager->GetDatabase(g_settings_sDatabase);
- database->Connect();
- struct db_row *row = database->GetRow_by_dir(debug_dump_dir);
- database->DisConnect();
-
- db_row_free(row);
- return row != NULL;
-}
-
-/**
- * Save a debugdump into database. If saving is
- * successful, then crash info is filled. Otherwise the crash info is
- * not changed.
- * @param pUUID A local UUID of a crash.
- * @param pUID An UID of an user.
- * @param pTime Time when a crash occurs.
- * @param pDebugDumpPath A debugdump path.
- * @param pCrashData A filled crash info.
- * @return It return results of operation. See mw_result_t.
- */
-static mw_result_t SaveDebugDumpToDatabase(const char *crash_id,
- bool inform_all_users,
- const char *pTime,
- const char *pDebugDumpDir,
- map_crash_data_t& pCrashData)
-{
- CDatabase* database = g_pPluginManager->GetDatabase(g_settings_sDatabase);
- database->Connect();
- /* note: if [UUID,UID] record exists, pDebugDumpDir is not updated in the record */
- database->Insert_or_Update(crash_id, inform_all_users, pDebugDumpDir, pTime);
-
- struct db_row *row = database->GetRow(crash_id);
- database->DisConnect();
-
- mw_result_t res = FillCrashInfo(crash_id, pCrashData);
- if (res == MW_OK)
- {
- const char *first = get_crash_data_item_content(pCrashData, CD_DUMPDIR).c_str();
- if (row && row->db_reported[0] == '1')
- {
- log("Crash is in database already (dup of %s) and is reported",
first);
- db_row_free(row);
- return MW_REPORTED;
- }
- if (row && xatou(row->db_count) > 1)
- {
- db_row_free(row);
- log("Crash is in database already (dup of %s)", first);
- return MW_OCCURRED;
- }
- }
- db_row_free(row);
- return res;
-}
-
-/* We need to share some data between SaveDebugDump and is_crash_id_in_db: */
+/* We need to share some data between LoadDebugDump and is_crash_a_dup: */
struct cdump_state {
- char *uid; /* filled by SaveDebugDump */
- char *crash_id; /* filled by is_crash_id_in_db */
- int crash_id_is_in_db; /* filled by is_crash_id_in_db */
+ char *uid; /* filled by LoadDebugDump */
+ char *uuid; /* filled by is_crash_a_dup */
+ char *crash_dump_dup_name; /* filled by is_crash_a_dup */
};
-static int is_crash_id_in_db(const char *dump_dir_name, void *param)
+static int is_crash_a_dup(const char *dump_dir_name, void *param)
{
struct cdump_state *state = (struct cdump_state *)param;
- if (state->crash_id)
+ if (state->uuid)
return 0; /* we already checked it, don't do it again */
struct dump_dir *dd = dd_opendir(dump_dir_name, /*flags:*/ 0);
if (!dd)
return 0; /* wtf? (error, but will be handled elsewhere later) */
- char *uuid = dd_load_text_ext(dd, CD_UUID,
+ state->uuid = dd_load_text_ext(dd, FILENAME_UUID,
DD_FAIL_QUIETLY + DD_LOAD_TEXT_RETURN_NULL_ON_FAILURE
);
dd_close(dd);
- if (!uuid)
+ if (!state->uuid)
{
return 0; /* no uuid (yet), "run_event, please continue iterating" */
}
- state->crash_id = xasprintf("%s:%s", state->uid, uuid);
- free(uuid);
- CDatabase* database = g_pPluginManager->GetDatabase(g_settings_sDatabase);
- database->Connect();
- struct db_row *row = database->GetRow(state->crash_id);
- database->DisConnect();
-
- if (!row) /* Crash id is not in db - this crash wasn't seen before */
- return 0; /* "run_event, please continue iterating" */
-
- /* Crash id is in db */
- db_row_free(row);
- state->crash_id_is_in_db = 1;
- /* "run_event, please stop iterating": */
- return 1;
+ /* Scan crash dumps looking for a dup */
+//TODO: explain why this is safe wrt concurrent runs
+ DIR *dir = opendir(DEBUG_DUMPS_DIR);
+ if (dir != NULL)
+ {
+ struct dirent *dent;
+ while ((dent = readdir(dir)) != NULL)
+ {
+ if (dot_or_dotdot(dent->d_name))
+ continue; /* skip "." and ".." */
+
+ int different;
+ char *uid, *uuid;
+ char *dump_dir_name2 = concat_path_file(DEBUG_DUMPS_DIR, dent->d_name);
+
+ if (strcmp(dump_dir_name, dump_dir_name2) == 0)
+ goto next; /* we are never a dup of ourself */
+
+ dd = dd_opendir(dump_dir_name2, /*flags:*/ 0);
+ if (!dd)
+ goto next;
+ uid = dd_load_text(dd, FILENAME_UID);
+ uuid = dd_load_text(dd, FILENAME_UUID);
+ dd_close(dd);
+ different = strcmp(state->uid, uid) || strcmp(state->uuid, uuid);
+ free(uid);
+ free(uuid);
+ if (different)
+ goto next;
+
+ state->crash_dump_dup_name = dump_dir_name2;
+ /* "run_event, please stop iterating": */
+ return 1;
+
+ next:
+ free(dump_dir_name2);
+ }
+ closedir(dir);
+ }
+
+ /* No dup found */
+ return 0; /* "run_event, please continue iterating" */
}
static char *do_log(char *log_line, void *param)
@@ -492,92 +468,110 @@ static char *do_log(char *log_line, void
return log_line;
}
-mw_result_t SaveDebugDump(const char *dump_dir_name,
+mw_result_t LoadDebugDump(const char *dump_dir_name,
map_crash_data_t& pCrashData)
{
mw_result_t res;
- if (is_debug_dump_saved(dump_dir_name))
- return MW_IN_DB;
-
struct dump_dir *dd = dd_opendir(dump_dir_name, /*flags:*/ 0);
if (!dd)
return MW_ERROR;
- struct cdump_state state = { NULL, NULL, false }; /* uid, crash_id, crash_id_is_in_db
*/
- state.uid = dd_load_text(dd, CD_UID);
- char *time = dd_load_text(dd, FILENAME_TIME);
+ struct cdump_state state;
+ state.uid = dd_load_text(dd, FILENAME_UID);
+ state.uuid = NULL;
+ state.crash_dump_dup_name = NULL;
char *analyzer = dd_load_text(dd, FILENAME_ANALYZER);
dd_close(dd);
res = MW_ERROR;
+ /* Run post-create event handler(s) */
struct run_event_state *run_state = new_run_event_state();
- run_state->post_run_callback = is_crash_id_in_db;
+ run_state->post_run_callback = is_crash_a_dup;
run_state->post_run_param = &state;
run_state->logging_callback = do_log;
int r = run_event(run_state, dump_dir_name, "post-create");
free_run_event_state(run_state);
- /* Is crash id in db? (In this case, is_crash_id_in_db() should have
+//TODO: consider this case:
+// new dump is created, post-create detects that it is a dup,
+// but then FillCrashInfo(dup_name) *FAILS*.
+// In this case, we later delete damaged dup_name (right?)
+// but new dump never gets its FILENAME_COUNT set!
+
+ /* Is crash a dup? (In this case, is_crash_a_dup() should have
* aborted "post-create" event processing as soon as it saw uuid
- * such that uid:uuid (=crash_id) is in database, and set
- * the state.crash_id_is_in_db flag)
+ * and determined that there is another crash with same uuid.
+ * In this case it sets state.crash_dump_dup_name)
*/
- if (!state.crash_id_is_in_db)
+ if (!state.crash_dump_dup_name)
{
/* No. Was there error on one of processing steps in run_event? */
if (r != 0)
goto ret; /* yes */
- /* Was uuid created after all? (In this case, is_crash_id_in_db()
- * should have fetched it and created state.crash_id)
+ /* Was uuid created after all? (In this case, is_crash_a_dup()
+ * should have fetched it and created state.uuid)
*/
- if (!state.crash_id)
+ if (!state.uuid)
{
/* no */
log("Dump directory '%s' has no UUID element",
dump_dir_name);
goto ret;
}
}
+ else
+ {
+ dump_dir_name = state.crash_dump_dup_name;
+ }
/* Loads pCrashData (from the *first debugdump dir* if this one is a dup)
* Returns:
- * MW_REPORTED: "the crash is flagged as reported in DB" (which also means
it's a dup)
* MW_OCCURRED: "crash count is != 1" (iow: it is > 1 - dup)
* MW_OK: "crash count is 1" (iow: this is a new crash, not a dup)
* else: an error code
*/
- res = SaveDebugDumpToDatabase(state.crash_id,
- true, /*analyzer_has_InformAllUsers(analyzer),*/
- time,
- dump_dir_name,
- pCrashData);
+ {
+ dd = dd_opendir(dump_dir_name, /*flags:*/ 0);
+ if (!dd)
+ {
+ res = MW_ERROR;
+ goto ret;
+ }
+ char *count_str = dd_load_text_ext(dd, FILENAME_COUNT, DD_FAIL_QUIETLY);
+ unsigned long count = strtoul(count_str, NULL, 10);
+ count++;
+ char new_count_str[sizeof(long)*3 + 2];
+ sprintf(new_count_str, "%lu", count);
+ dd_save_text(dd, FILENAME_COUNT, new_count_str);
+ dd_close(dd);
+
+ res = FillCrashInfo(dump_dir_name, pCrashData);
+ if (res == MW_OK)
+ {
+ if (count > 1)
+ {
+ log("Crash dump is a duplicate of %s", dump_dir_name);
+ res = MW_OCCURRED;
+ }
+ }
+ }
+
ret:
- free(state.crash_id);
+ free(state.uuid);
free(state.uid);
- free(time);
+ free(state.crash_dump_dup_name);
free(analyzer);
return res;
}
-mw_result_t FillCrashInfo(const char *crash_id,
+static mw_result_t FillCrashInfo(const char *dump_dir_name,
map_crash_data_t& pCrashData)
{
- CDatabase* database = g_pPluginManager->GetDatabase(g_settings_sDatabase);
- database->Connect();
- struct db_row *row = database->GetRow(crash_id);
- database->DisConnect();
-
- if (!row)
- return MW_ERROR;
-
- struct dump_dir *dd = dd_opendir(row->db_dump_dir, /*flags:*/ 0);
+ struct dump_dir *dd = dd_opendir(dump_dir_name, /*flags:*/ 0);
if (!dd)
- {
- db_row_free(row);
return MW_ERROR;
- }
load_crash_data_from_debug_dump(dd, pCrashData);
char *events = list_possible_events(dd, NULL, "");
@@ -586,76 +580,85 @@ mw_result_t FillCrashInfo(const char *cr
add_to_crash_data_ext(pCrashData, CD_EVENTS, CD_SYS, CD_ISNOTEDITABLE, events);
free(events);
-//TODO: we _never_ use CD_SYS, perhaps we should use it here?
- add_to_crash_data(pCrashData, CD_UID , row->db_uid );
- add_to_crash_data(pCrashData, CD_UUID , row->db_uuid );
- add_to_crash_data(pCrashData, CD_INFORMALL , row->db_inform_all );
- add_to_crash_data(pCrashData, CD_COUNT , row->db_count );
- add_to_crash_data(pCrashData, CD_REPORTED , row->db_reported );
- add_to_crash_data(pCrashData, CD_MESSAGE , row->db_message );
- add_to_crash_data(pCrashData, CD_DUMPDIR , row->db_dump_dir );
- add_to_crash_data(pCrashData, FILENAME_TIME , row->db_time );
-
- db_row_free(row);
+ add_to_crash_data_ext(pCrashData, CD_DUMPDIR, CD_SYS, CD_ISNOTEDITABLE,
dump_dir_name);
return MW_OK;
}
-static void GetUUIDsOfCrash(long caller_uid, vector_string_t &result)
-{
- CDatabase* database = g_pPluginManager->GetDatabase(g_settings_sDatabase);
- database->Connect();
- GList *rows = database->GetUIDData(caller_uid);
- database->DisConnect();
-
- for (GList *li = rows; li != NULL; li = g_list_next(li))
- {
- struct db_row *row = (struct db_row*)li->data;
- string crash_id = ssprintf("%s:%s", row->db_uid, row->db_uuid);
- result.push_back(crash_id);
- }
-
- // TODO: return GList
- db_list_free(rows);
-}
-
vector_map_crash_data_t GetCrashInfos(long caller_uid)
{
vector_map_crash_data_t retval;
log("Getting crash infos...");
- try
+
+ DIR *dir = opendir(DEBUG_DUMPS_DIR);
+ if (dir != NULL)
{
- vector_string_t crash_ids;
-//TODO: it looks strange that we select UUIDs
-//olny in order to find which directories to read!
-//Should we simply retrieve list of *directories*, not *uuids*?
- GetUUIDsOfCrash(caller_uid, crash_ids);
-
- unsigned int ii;
- for (ii = 0; ii < crash_ids.size(); ii++)
- {
- const char *crash_id = crash_ids[ii].c_str();
-
- map_crash_data_t info;
- mw_result_t res = FillCrashInfo(crash_id, info);
- switch (res)
+ try
+ {
+ struct dirent *dent;
+ while ((dent = readdir(dir)) != NULL)
{
- case MW_OK:
- retval.push_back(info);
- break;
- case MW_ERROR:
- error_msg("Dump directory for crash_id %s doesn't exist or
misses crucial files, deleting", crash_id);
- /* Deletes both DB record and dump dir */
- DeleteDebugDump(crash_id, /*caller_uid:*/ 0);
- break;
- default:
- break;
+ if (dot_or_dotdot(dent->d_name))
+ continue; /* skip "." and ".." */
+
+ char *dump_dir_name = concat_path_file(DEBUG_DUMPS_DIR,
dent->d_name);
+
+ struct stat statbuf;
+ if (stat(dump_dir_name, &statbuf) != 0
+ || !S_ISDIR(statbuf.st_mode)
+ ) {
+ goto next; /* not a dir, skip */
+ }
+
+ /* Skip directories which are not for this uid */
+ if (caller_uid != 0) /* not called by root? */
+ {
+ char *uid;
+ char caller_uid_str[sizeof(long) * 3 + 2];
+
+ struct dump_dir *dd = dd_opendir(dump_dir_name, /*flags:*/ 0);
+ if (!dd)
+ goto next;
+
+ sprintf(caller_uid_str, "%ld", 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))
+ {
+ dd_close(dd);
+ goto next;
+ }
+ }
+ dd_close(dd);
+ }
+
+ {
+ map_crash_data_t info;
+ mw_result_t res = FillCrashInfo(dump_dir_name, info);
+ switch (res)
+ {
+ case MW_OK:
+ retval.push_back(info);
+ break;
+ case MW_ERROR:
+ error_msg("Dump directory %s doesn't exist or misses
crucial files, deleting", dump_dir_name);
+ delete_debug_dump_dir(dump_dir_name);
+ break;
+ default:
+ break;
+ }
+ }
+ next:
+ free(dump_dir_name);
}
}
- }
- catch (CABRTException& e)
- {
- error_msg("%s", e.what());
+ catch (CABRTException& e)
+ {
+ error_msg("%s", e.what());
+ }
+ closedir(dir);
}
return retval;
@@ -671,19 +674,18 @@ vector_map_crash_data_t GetCrashInfos(lo
*/
void CreateReport(const char* crash_id, long caller_uid, int force, map_crash_data_t&
crashReport)
{
- /* FIXME: starting from here, any shared data must be protected with a mutex.
- * For example, CreateCrashReport does:
- * g_pPluginManager->GetDatabase(g_settings_sDatabase);
- * which is unsafe wrt concurrent updates to g_pPluginManager state.
- */
+ /* FIXME: starting from here, any shared data must be protected with a mutex. */
mw_result_t res = CreateCrashReport(crash_id, caller_uid, force, crashReport);
switch (res)
{
case MW_OK:
VERB2 log_map_crash_data(crashReport, "crashReport");
break;
- case MW_IN_DB_ERROR:
- error_msg("Can't find crash with id %s in database",
crash_id);
+ case MW_NOENT_ERROR:
+ error_msg("Can't find crash with id '%s'", crash_id);
+ break;
+ case MW_PERM_ERROR:
+ error_msg("Can't find crash with id '%s'", crash_id);
break;
case MW_PLUGIN_ERROR:
error_msg("Particular analyzer plugin isn't loaded or there is an
error within plugin(s)");
@@ -760,63 +762,34 @@ int CreateReportThread(const char* crash
}
-/* Remove dump dir and its DB record */
-int DeleteDebugDump(const char *crash_id, long caller_uid)
+/* Remove dump dir */
+int DeleteDebugDump(const char *dump_dir_name, long caller_uid)
{
- try
- {
- CDatabase* database = g_pPluginManager->GetDatabase(g_settings_sDatabase);
- database->Connect();
- struct db_row *row = database->GetRow(crash_id);
- if (!row)
- {
- database->DisConnect();
- return ENOENT;
- }
+ struct dump_dir *dd = dd_opendir(dump_dir_name, /*flags:*/ 0);
+ if (!dd)
+ return MW_NOENT_ERROR;
+ if (caller_uid != 0) /* not called by root */
+ {
char caller_uid_str[sizeof(long) * 3 + 2];
- sprintf(caller_uid_str, "%li", caller_uid);
+ sprintf(caller_uid_str, "%ld", caller_uid);
- if (caller_uid != 0 /* not called by root */
- && row->db_inform_all[0] != '1'
- && strcmp(caller_uid_str, row->db_uid) != 0
- ) {
- database->DisConnect();
- db_row_free(row);
- return EPERM;
- }
- database->DeleteRow(crash_id);
- database->DisConnect();
- if (row->db_dump_dir[0] != '\0')
- {
- delete_debug_dump_dir(row->db_dump_dir);
- db_row_free(row);
- return 0; /* success */
+ 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))
+ {
+ dd_close(dd);
+ error_msg("crash '%s' can't be accessed by user with uid
%ld", dump_dir_name, caller_uid);
+ return 1;
+ }
}
- db_row_free(row);
- }
- catch (CABRTException& e)
- {
- error_msg("%s", e.what());
}
- return EIO; /* generic failure code */
-}
-void DeleteDebugDump_by_dir(const char *dump_dir)
-{
- try
- {
- CDatabase* database = g_pPluginManager->GetDatabase(g_settings_sDatabase);
- database->Connect();
- database->DeleteRows_by_dir(dump_dir);
- database->DisConnect();
+ dd_delete(dd);
- delete_debug_dump_dir(dump_dir);
- }
- catch (CABRTException& e)
- {
- error_msg("%s", e.what());
- }
+ return 0; /* success */
}
void GetPluginsInfo(map_map_string_t &map_of_plugin_info)
diff -urp abrt.2/src/daemon/MiddleWare.h abrt.3/src/daemon/MiddleWare.h
--- abrt.2/src/daemon/MiddleWare.h 2010-11-18 14:03:30.059566327 +0100
+++ abrt.3/src/daemon/MiddleWare.h 2010-11-19 11:46:33.535900743 +0100
@@ -30,13 +30,12 @@
*/
typedef enum {
MW_OK, /**< No error.*/
- MW_OCCURRED, /**< A not-yet-reported dup.*/
- MW_REPORTED, /**< A reported dup.*/
+ MW_OCCURRED, /**< No error, but thus dump is a dup.*/
MW_ERROR, /**< Common error.*/
+ MW_NOENT_ERROR,
+ MW_PERM_ERROR,
MW_CORRUPTED, /**< Debugdump directory is corrupted.*/
MW_GPG_ERROR, /**< Package is not signed properly.*/
- MW_IN_DB, /**< Debugdump directory is already saved in a database.*/
- MW_IN_DB_ERROR, /**< Error while working with a database.*/
MW_PLUGIN_ERROR, /**< plugin wasn't found or error within plugin*/
} mw_result_t;
@@ -56,7 +55,7 @@ typedef enum {
* @param pCrashData A filled crash report.
* @return It return results of operation. See mw_result_t.
*/
-mw_result_t CreateCrashReport(const char *crash_id,
+mw_result_t CreateCrashReport(const char *dump_dir_name,
long caller_uid,
int force,
map_crash_data_t& pCrashData);
@@ -91,33 +90,20 @@ report_status_t Report(const map_crash_d
const map_map_string_t& settings,
long caller_uid);
/**
- * Adds package name and description to debugdump dir.
- * Saves debugdump into database.
- * Detects whether it's a duplicate crash.
+ * Detects whether it's a duplicate crash dump.
* Fills crash info.
* Note that if it's a dup, loads _first crash_ info, not this one's.
- * @param pDebugDumpDir A debugdump directory.
+ * @param dump_dir_name A debugdump directory.
* @param pCrashData A crash info.
* @return It return results of operation. See mw_result_t.
*/
-mw_result_t SaveDebugDump(const char *pDebugDumpDir,
- map_crash_data_t& pCrashData);
-/**
- * Get one crash info. If getting is successful,
- * then crash info is filled.
- * @param pUUID A local UUID of a crash.
- * @param pUID An UID of an user.
- * @param pCrashData A crash info.
- * @return It return results of operation. See mw_result_t.
- */
-mw_result_t FillCrashInfo(const char *crash_id,
+mw_result_t LoadDebugDump(const char *dump_dir_name,
map_crash_data_t& pCrashData);
vector_map_crash_data_t GetCrashInfos(long caller_uid);
-int CreateReportThread(const char* crash_id, long caller_uid, int force, const char*
pSender);
-void CreateReport(const char* crash_id, long caller_uid, int force,
map_crash_data_t&);
-int DeleteDebugDump(const char *crash_id, long caller_uid);
-void DeleteDebugDump_by_dir(const char *dump_dir);
+int CreateReportThread(const char* dump_dir_name, long caller_uid, int force, const
char* pSender);
+void CreateReport(const char* dump_dir_name, long caller_uid, int force,
map_crash_data_t&);
+int DeleteDebugDump(const char *dump_dir_name, long caller_uid);
void GetPluginsInfo(map_map_string_t &map_of_plugin_info);
void GetPluginSettings(const char *plugin_name, map_plugin_settings_t
&plugin_settings);
diff -urp abrt.2/src/daemon/PluginManager.cpp abrt.3/src/daemon/PluginManager.cpp
--- abrt.2/src/daemon/PluginManager.cpp 2010-11-17 22:23:53.000000000 +0100
+++ abrt.3/src/daemon/PluginManager.cpp 2010-11-18 06:25:37.743666918 +0100
@@ -277,20 +277,6 @@ CAction* CPluginManager::GetAction(const
return (CAction*)plugin;
}
-CDatabase* CPluginManager::GetDatabase(const char *pName)
-{
- CPlugin *plugin = LoadPlugin(pName);
- if (!plugin)
- {
- throw CABRTException(EXCEP_PLUGIN, "Plugin '%s' is not
registered", pName);
- }
- if (m_mapLoadedModules[pName]->GetType() != DATABASE)
- {
- throw CABRTException(EXCEP_PLUGIN, "Plugin '%s' is not a database
plugin", pName);
- }
- return (CDatabase*)plugin;
-}
-
plugin_type_t CPluginManager::GetPluginType(const char *pName)
{
CPlugin *plugin = LoadPlugin(pName);
diff -urp abrt.2/src/daemon/PluginManager.h abrt.3/src/daemon/PluginManager.h
--- abrt.2/src/daemon/PluginManager.h 2010-11-17 22:23:53.000000000 +0100
+++ abrt.3/src/daemon/PluginManager.h 2010-11-18 06:26:39.684899712 +0100
@@ -25,7 +25,6 @@
#include "abrt_types.h"
#include "plugin.h"
#include "analyzer.h"
-#include "database.h"
#include "action.h"
class CLoadedModule; /* opaque */
@@ -104,12 +103,6 @@ class CPluginManager
*/
CAction* GetAction(const char *pName, bool silent = false);
/**
- * A method, which returns instance of particular database plugin.
- * @param pName A plugin name.
- * @return A database plugin.
- */
- CDatabase* GetDatabase(const char *pName);
- /**
* A method, which returns type of particular plugin.
* @param pName A plugin name.
* @return A plugin type.
diff -urp abrt.2/src/daemon/Settings.cpp abrt.3/src/daemon/Settings.cpp
--- abrt.2/src/daemon/Settings.cpp 2010-11-18 07:04:11.361794149 +0100
+++ abrt.3/src/daemon/Settings.cpp 2010-11-18 17:27:01.043063025 +0100
@@ -51,7 +51,6 @@ bool g_settings_bOpenGPGCheck =
GList *g_settings_setOpenGPGPublicKeys = NULL;
GList *g_settings_setBlackListedPkgs = NULL;
GList *g_settings_setBlackListedPaths = NULL;
-char *g_settings_sDatabase = NULL;
char *g_settings_sWatchCrashdumpArchiveDir = NULL;
unsigned int g_settings_nMaxCrashReportsSize = 1000;
bool g_settings_bProcessUnpackaged = false;
@@ -201,17 +200,6 @@ static int ParseCommon()
{
g_settings_setBlackListedPaths = parse_list(it->second.c_str());
}
- it = s_mapSectionCommon.find("Database");
- if (it != end)
- {
- if (it->second.empty())
- error_msg_and_die(_("Database plugin not specified. Please check abrtd
settings."));
-
- g_settings_sDatabase = xstrdup(it->second.c_str());
- }
- else
- error_msg_and_die(_("Database plugin not specified. Please check abrtd
settings."));
-
it = s_mapSectionCommon.find("WatchCrashdumpArchiveDir");
if (it != end)
{
@@ -478,9 +466,6 @@ void settings_free()
g_list_free(g_settings_setBlackListedPaths);
g_settings_setBlackListedPaths = NULL;
- free(g_settings_sDatabase);
- g_settings_sDatabase = NULL;
-
free(g_settings_sWatchCrashdumpArchiveDir);
g_settings_sWatchCrashdumpArchiveDir = NULL;
}
diff -urp abrt.2/src/daemon/Settings.h abrt.3/src/daemon/Settings.h
--- abrt.2/src/daemon/Settings.h 2010-11-18 06:45:28.023045307 +0100
+++ abrt.3/src/daemon/Settings.h 2010-11-18 17:27:15.202053183 +0100
@@ -31,7 +31,6 @@ extern GList *g_settings_setBlackListedP
extern unsigned int g_settings_nMaxCrashReportsSize;
extern bool g_settings_bOpenGPGCheck;
extern bool g_settings_bProcessUnpackaged;
-extern char *g_settings_sDatabase;
extern char *g_settings_sWatchCrashdumpArchiveDir;
extern map_cron_t g_settings_mapCron;
diff -urp abrt.2/src/gui/CCDumpList.py abrt.3/src/gui/CCDumpList.py
--- abrt.2/src/gui/CCDumpList.py 2010-11-10 00:12:48.000000000 +0100
+++ abrt.3/src/gui/CCDumpList.py 2010-11-19 12:00:46.382252978 +0100
@@ -30,8 +30,7 @@ class DumpList(list):
def getDumpByCrashID(self, crashid):
for dump in self:
- # crashid can be either hash or uid:hash
- if crashid in (dump.getUUID(),dump.getUID()+":"+dump.getUUID()):
+ if crashid == dump.getDumpDir():
return dump
__PFList = None
diff -urp abrt.2/src/gui/CCDump.py abrt.3/src/gui/CCDump.py
--- abrt.2/src/gui/CCDump.py 2010-11-15 18:00:08.000000000 +0100
+++ abrt.3/src/gui/CCDump.py 2010-11-19 13:19:04.053475939 +0100
@@ -35,13 +35,13 @@ FILENAME_RATING = "rating"
FILENAME_HOSTNAME = "hostname"
FILENAME_REMOTE = "remote"
-CD_UID = "uid"
-CD_UUID = "uuid"
-CD_INFORMALL = "InformAll"
+FILENAME_UID = "uid"
+FILENAME_UUID = "uuid"
+FILENAME_INFORMALL = "inform_all_users"
+FILENAME_COUNT = "count"
+FILENAME_MESSAGE = "message"
+
CD_DUMPDIR = "DumpDir"
-CD_COUNT = "Count"
-CD_REPORTED = "Reported"
-CD_MESSAGE = "Message"
CD_EVENTS = "Events"
# FIXME - create method or smth that returns type|editable|content
@@ -52,7 +52,7 @@ REPORT_EVENT_PREFIX = "report_"
class Dump():
"""Class for mapping the debug dump to python
object"""
- not_required_fields = ["comment", "Message"]
+ not_required_fields = [FILENAME_COMMENT, FILENAME_MESSAGE]
def __init__(self):
# we set all attrs dynamically, so no need to have it in init
for field in self.not_required_fields:
@@ -79,8 +79,11 @@ class Dump():
def getUID(self):
return self.uid
+ def getDumpDir(self):
+ return self.DumpDir
+
def getCount(self):
- return int(self.Count)
+ return int(self.count)
def getExecutable(self):
try:
@@ -96,14 +99,11 @@ class Dump():
def getPackage(self):
return self.package
- def isReported(self):
- return self.Reported == "1"
-
def getMessage(self):
- if not self.Message:
+ if not self.message:
return "" #[]
- #return self.Message[CD_CONTENT].split('\n')
- return self.Message
+ #return self.message[CD_CONTENT].split('\n')
+ return self.message
def getTime(self, fmt=None):
if self.time:
diff -urp abrt.2/src/gui/CCMainWindow.py abrt.3/src/gui/CCMainWindow.py
--- abrt.2/src/gui/CCMainWindow.py 2010-11-10 00:12:48.000000000 +0100
+++ abrt.3/src/gui/CCMainWindow.py 2010-11-19 12:03:15.832002099 +0100
@@ -184,7 +184,7 @@ class MainWindow():
# so we shouldn't continue..
sys.exit()
for entry in dumplist[::-1]:
- n =
self.dumpsListStore.append([["gtk-no","gtk-yes"][entry.isReported()],
+ n =
self.dumpsListStore.append([["gtk-no","gtk-yes"][entry.getMessage() !=
""],
entry.getExecutable(),
entry.get_hostname(),
entry.getTime("%c"),
@@ -276,7 +276,7 @@ class MainWindow():
#move this to Dump class
hb_reports = self.wTree.get_widget("hb_reports")
lReported = self.wTree.get_widget("l_message")
- if dump.isReported():
+ if dump.getMessage() != "":
hb_reports.show()
report_label_raw = ""
report_label = ""
@@ -296,10 +296,10 @@ class MainWindow():
else:
hb_reports.hide()
- def mark_last_selected_row(self, dump_list_store, path, iter, last_selected_uuid):
+ def mark_last_selected_row(self, dump_list_store, path, iter,
last_selected_DumpDir):
# Get dump object from list (in our list it's in last col)
dump = dump_list_store.get_value(iter, dump_list_store.get_n_columns()-1)
- if dump.getUUID() == last_selected_uuid:
+ if dump.getDumpDir() == last_selected_DumpDir:
self.dlist.set_cursor(dump_list_store.get_path(iter)[0])
return True # done, stop iteration
return False
@@ -315,11 +315,11 @@ class MainWindow():
if next_iter:
last_dump = dumpsListStore.get_value(next_iter,
dumpsListStore.get_n_columns()-1)
try:
- self.ccdaemon.DeleteDebugDump("%s:%s" % (dump.getUID(),
dump.getUUID()))
+ self.ccdaemon.DeleteDebugDump(dump.getDumpDir())
self.hydrate()
if last_dump:
# we deleted the selected line, so we want to select the next one
- dumpsListStore.foreach(self.mark_last_selected_row, last_dump.getUUID())
+ dumpsListStore.foreach(self.mark_last_selected_row,
last_dump.getDumpDir())
treeview.emit("cursor-changed")
except Exception, ex:
print ex
@@ -363,8 +363,7 @@ class MainWindow():
self.hydrate()
if last_dump:
# re-select the line that was selected before a new crash happened
- dumpsListStore.foreach(self.mark_last_selected_row, last_dump.getUUID())
-
+ dumpsListStore.foreach(self.mark_last_selected_row, last_dump.getDumpDir())
def on_bReport_clicked(self, button):
dumpsListStore, path = self.dumplist_get_selected()
diff -urp abrt.2/src/gui/CCReporterDialog.py abrt.3/src/gui/CCReporterDialog.py
--- abrt.2/src/gui/CCReporterDialog.py 2010-11-10 00:12:48.000000000 +0100
+++ abrt.3/src/gui/CCReporterDialog.py 2010-11-19 13:17:39.658220307 +0100
@@ -543,7 +543,7 @@ class ReporterSelector():
# show the report window with selected report
try:
- self.daemon.start_job("%s:%s" % (report[CD_UID][CD_CONTENT],
report[CD_UUID][CD_CONTENT]), force=1)
+ self.daemon.start_job(report[CD_DUMPDIR][CD_CONTENT], force=1)
except Exception, ex:
# FIXME #3 dbus.exceptions.DBusException:
org.freedesktop.DBus.Error.NoReply: Did not receive a reply
# do this async and wait for yum to end with debuginfoinstal
@@ -564,7 +564,7 @@ class ReporterSelector():
# when getReport is done it emits "analyze-complete" and
on_analyze_complete_cb is called
# FIXME: does it make sense to change it to use callback rather then signal
emitting?
try:
- self.daemon.start_job("%s:%s" % (self.dump.getUID(),
self.dump.getUUID()))
+ self.daemon.start_job(self.dump.getDumpDir())
except Exception, ex:
# FIXME #3 dbus.exceptions.DBusException:
org.freedesktop.DBus.Error.NoReply: Did not receive a reply
# do this async and wait for yum to end with debuginfoinstal
diff -urp abrt.2/src/gui/CReporterAssistant.py abrt.3/src/gui/CReporterAssistant.py
--- abrt.2/src/gui/CReporterAssistant.py 2010-11-15 18:00:08.000000000 +0100
+++ abrt.3/src/gui/CReporterAssistant.py 2010-11-19 12:01:08.048252845 +0100
@@ -1019,7 +1019,7 @@ class ReporterAssistant():
# when getReport is done it emits "analyze-complete" and
on_analyze_complete_cb is called
# FIXME: does it make sense to change it to use callback rather then signal
emitting?
try:
- self.daemon.start_job("%s:%s" % (self.report.getUID(),
self.report.getUUID()), force)
+ self.daemon.start_job(self.report.getDumpDir(), force)
except Exception, ex:
# FIXME #3 dbus.exceptions.DBusException:
org.freedesktop.DBus.Error.NoReply: Did not receive a reply
# do this async and wait for yum to end with debuginfoinstal
diff -urp abrt.2/src/include/crash_types.h abrt.3/src/include/crash_types.h
--- abrt.2/src/include/crash_types.h 2010-11-10 00:12:48.000000000 +0100
+++ abrt.3/src/include/crash_types.h 2010-11-19 13:19:08.196470024 +0100
@@ -37,7 +37,7 @@
// Name of the function where the application crashed.
// Optional.
#define FILENAME_CRASH_FUNCTION "crash_function"
-// filled by CDebugDump::Create() (which also fills CD_UID):
+// filled by CDebugDump::Create() (which also fills FILENAME_UID):
#define FILENAME_ARCHITECTURE "architecture"
#define FILENAME_KERNEL "kernel"
#define FILENAME_TIME "time"
@@ -54,22 +54,16 @@
#define FILENAME_REMOTE "remote"
// TODO: TicketUploader also has open-coded "TICKET", "CUSTOMER"
files
-// Apart from CD_UID, which is also stored as a file in dump directory,
-// these items only exist in db. (CD_UID is also a file because
-// dump directory is created before its DB entry, and DB has to learn
-// CD_UID from _somewhere_ in order to be able to store it in DB record,
-// right?)
-#define CD_UID "uid"
-// Now uuid also is saved as a file (but is still stored in database too):
-#define CD_UUID "uuid"
-#define CD_INFORMALL "InformAll"
-#define CD_DUMPDIR "DumpDir"
-#define CD_COUNT "Count"
-#define CD_REPORTED "Reported"
-#define CD_MESSAGE "Message"
+#define FILENAME_UID "uid"
+#define FILENAME_UUID "uuid"
+#define FILENAME_INFORMALL "inform_all_users"
+#define FILENAME_COUNT "count"
+#define FILENAME_MESSAGE "message"
+// Not stored as files, added "on the fly":
+#define CD_DUMPDIR "DumpDir"
// "Which events are possible (make sense) on this crash dump?"
// (a string with "\n" terminated event names)
-#define CD_EVENTS "Events"
+#define CD_EVENTS "Events"
// Crash data is a map of 3-element vectors of strings: type, editable, content
Only in abrt.2/src/include: database.h
diff -urp abrt.2/src/include/Makefile.am abrt.3/src/include/Makefile.am
--- abrt.2/src/include/Makefile.am 2010-11-17 22:23:53.000000000 +0100
+++ abrt.3/src/include/Makefile.am 2010-11-18 06:26:44.066650154 +0100
@@ -8,7 +8,6 @@ HEADER_FILES = \
dump_dir.h \
observer.h \
plugin.h \
- database.h \
action.h \
analyzer.h \
xfuncs.h
Only in abrt.2/src/lib: database.c
diff -urp abrt.2/src/lib/dump_dir.c abrt.3/src/lib/dump_dir.c
--- abrt.2/src/lib/dump_dir.c 2010-11-18 06:58:29.339043070 +0100
+++ abrt.3/src/lib/dump_dir.c 2010-11-19 13:21:27.973219625 +0100
@@ -311,7 +311,7 @@ struct dump_dir *dd_create(const char *d
char long_str[sizeof(long) * 3 + 2];
sprintf(long_str, "%lu", (long)uid);
- dd_save_text(dd, CD_UID, long_str);
+ dd_save_text(dd, FILENAME_UID, long_str);
struct utsname buf;
uname(&buf); /* never fails */
@@ -378,16 +378,26 @@ static char *load_text_file(const char *
}
struct strbuf *buf_content = strbuf_new();
+ int oneline = 0;
int ch;
while ((ch = fgetc(fp)) != EOF)
{
+ if (ch == '\n')
+ oneline = (oneline << 1) | 1;
if (ch == '\0')
- strbuf_append_char(buf_content, ' ');
- else if (isspace(ch) || (isascii(ch) && !iscntrl(ch)))
+ ch = ' ';
+ if (isspace(ch) || (isascii(ch) && !iscntrl(ch)))
strbuf_append_char(buf_content, ch);
}
fclose(fp);
+ /* If file contains exactly one '\n' and it is at the end, remove it.
+ * This enables users to use simple "echo blah >file" in order to
create
+ * short string items in dump dirs.
+ */
+ if (oneline == 1 && buf_content->buf[buf_content->len - 1] ==
'\n')
+ buf_content->buf[--buf_content->len] = '\0';
+
return strbuf_free_nobuf(buf_content);
}
diff -urp abrt.2/src/lib/make_descr.cpp abrt.3/src/lib/make_descr.cpp
--- abrt.2/src/lib/make_descr.cpp 2010-11-10 00:12:48.000000000 +0100
+++ abrt.3/src/lib/make_descr.cpp 2010-11-19 13:19:14.647470379 +0100
@@ -67,13 +67,11 @@ static const char *const blacklisted_ite
FILENAME_DESCRIPTION, /* package description - basically useless */
FILENAME_HOSTNAME ,
FILENAME_DUPHASH ,
- CD_UUID ,
- CD_INFORMALL ,
- FILENAME_DUPHASH ,
+ FILENAME_UUID ,
+ FILENAME_INFORMALL,
CD_DUMPDIR ,
- CD_COUNT ,
- CD_REPORTED ,
- CD_MESSAGE ,
+ FILENAME_COUNT ,
+ FILENAME_MESSAGE ,
NULL
};
diff -urp abrt.2/src/lib/Makefile.am abrt.3/src/lib/Makefile.am
--- abrt.2/src/lib/Makefile.am 2010-11-15 15:18:53.000000000 +0100
+++ abrt.3/src/lib/Makefile.am 2010-11-18 16:00:34.104816859 +0100
@@ -38,7 +38,6 @@ libABRTUtils_la_SOURCES = \
run_event.c \
abrt_packages.c abrt_packages.h \
hooklib.c hooklib.h \
- database.c \
parse_options.c parse_options.h
libABRTUtils_la_CPPFLAGS = \
-Wall -Werror \
diff -urp abrt.2/src/lib/test.cpp abrt.3/src/lib/test.cpp
--- abrt.2/src/lib/test.cpp 2010-11-10 00:12:48.000000000 +0100
+++ abrt.3/src/lib/test.cpp 2010-11-19 13:19:18.951470476 +0100
@@ -83,14 +83,14 @@ int main(int argc, char** argv)
std::cout << "Application Crashed! " <<
crashInfo[FILENAME_PACKAGE][CD_CONTENT] << ", "
<<
crashInfo[FILENAME_EXECUTABLE][CD_CONTENT] << ",
" <<
- crashInfo[CD_COUNT][CD_CONTENT] << ", " <<
std::endl;
+ crashInfo[FILENAME_COUNT][CD_CONTENT] << ", "
<< std::endl;
/* Get Report, so user can change data (remove private stuff)
* If we do not want user interaction, just send data immediately
*/
map_crash_data_t crashReport;
middleWare.CreateCrashReport(crashInfo[FILENAME_DUPHASH][CD_CONTENT],
- crashInfo[CD_UID][CD_CONTENT],
+ crashInfo[FILENAME_UID][CD_CONTENT],
crashReport);
/* Report crash */
middleWare.Report(crashReport);
diff -urp abrt.2/src/plugins/abrt-action-analyze-c.c
abrt.3/src/plugins/abrt-action-analyze-c.c
--- abrt.2/src/plugins/abrt-action-analyze-c.c 2010-11-11 09:27:28.000000000 +0100
+++ abrt.3/src/plugins/abrt-action-analyze-c.c 2010-11-19 13:15:55.837469754 +0100
@@ -50,7 +50,7 @@ static char *run_unstrip_n(const char *d
struct dump_dir *dd = dd_opendir(dump_dir_name, /*flags:*/ 0);
if (!dd)
return NULL;
- char *uid_str = dd_load_text(dd, CD_UID);
+ char *uid_str = dd_load_text(dd, FILENAME_UID);
dd_close(dd);
unsigned uid = xatoi_u(uid_str);
free(uid_str);
@@ -231,7 +231,7 @@ int main(int argc, char **argv)
create_hash(hash_str, string_to_hash);
/*free(hash_str);*/
- dd_save_text(dd, CD_UUID, hash_str);
+ dd_save_text(dd, FILENAME_UUID, hash_str);
dd_close(dd);
return 0;
diff -urp abrt.2/src/plugins/abrt-action-analyze-oops.c
abrt.3/src/plugins/abrt-action-analyze-oops.c
--- abrt.2/src/plugins/abrt-action-analyze-oops.c 2010-11-11 09:27:28.000000000 +0100
+++ abrt.3/src/plugins/abrt-action-analyze-oops.c 2010-11-19 13:15:47.821469795 +0100
@@ -167,7 +167,7 @@ int main(int argc, char **argv)
hash &= 0x7FFFFFFF;
char hash_str[sizeof(int)*3 + 2];
sprintf(hash_str, "%u", hash);
- dd_save_text(dd, CD_UUID, hash_str);
+ dd_save_text(dd, FILENAME_UUID, hash_str);
dd_save_text(dd, FILENAME_DUPHASH, hash_str);
dd_close(dd);
diff -urp abrt.2/src/plugins/abrt-action-analyze-python.c
abrt.3/src/plugins/abrt-action-analyze-python.c
--- abrt.2/src/plugins/abrt-action-analyze-python.c 2010-11-11 09:27:28.000000000 +0100
+++ abrt.3/src/plugins/abrt-action-analyze-python.c 2010-11-19 13:15:44.909219821 +0100
@@ -111,7 +111,7 @@ int main(int argc, char **argv)
}
*d = '\0';
- dd_save_text(dd, CD_UUID, hash_str);
+ dd_save_text(dd, FILENAME_UUID, hash_str);
dd_save_text(dd, FILENAME_DUPHASH, hash_str);
dd_close(dd);
diff -urp abrt.2/src/plugins/abrt-action-generate-backtrace.c
abrt.3/src/plugins/abrt-action-generate-backtrace.c
--- abrt.2/src/plugins/abrt-action-generate-backtrace.c 2010-11-11 09:27:28.000000000
+0100
+++ abrt.3/src/plugins/abrt-action-generate-backtrace.c 2010-11-19 13:15:51.086470581
+0100
@@ -130,7 +130,7 @@ static char* exec_vp(char **args, uid_t
static char *get_backtrace(struct dump_dir *dd)
{
- char *uid_str = dd_load_text(dd, CD_UID);
+ char *uid_str = dd_load_text(dd, FILENAME_UID);
uid_t uid = xatoi_u(uid_str);
free(uid_str);
char *executable = dd_load_text(dd, FILENAME_EXECUTABLE);
diff -urp abrt.2/src/plugins/abrt-action-install-debuginfo
abrt.3/src/plugins/abrt-action-install-debuginfo
--- abrt.2/src/plugins/abrt-action-install-debuginfo 2010-11-11 09:27:28.000000000 +0100
+++ abrt.3/src/plugins/abrt-action-install-debuginfo 2010-11-19 12:32:59.002231518 +0100
@@ -25,7 +25,8 @@
#
# Exitcodes:
# 0 - all debuginfos are installed
-# 1 - not all debuginfos are installed
+# 0 - not all debuginfos are installed
+# (was 1, but this scares event processing)
# 2+ - serious problem
#
# Algorithm:
@@ -413,6 +414,8 @@ done
cleanup_and_report_missing
-test x"$missing_build_ids" != x"" && exit 1
+# Was exiting with 1, but this stops event processing.
+test x"$missing_build_ids" != x"" && exit 0
+
echo "All needed debuginfos are present"
exit 0
diff -urp abrt.2/src/plugins/abrt-action-mailx.cpp
abrt.3/src/plugins/abrt-action-mailx.cpp
--- abrt.2/src/plugins/abrt-action-mailx.cpp 2010-11-12 18:18:55.000000000 +0100
+++ abrt.3/src/plugins/abrt-action-mailx.cpp 2010-11-19 13:15:39.980220361 +0100
@@ -115,7 +115,7 @@ static void create_and_send_email(
args = append_str_to_vector(args, arg_size, email_to);
log(_("Sending an email..."));
- const char *uid_str = get_crash_data_item_content_or_NULL(pCrashData, CD_UID);
+ const char *uid_str = get_crash_data_item_content_or_NULL(pCrashData, FILENAME_UID);
exec_and_feed_input(xatoi_u(uid_str), dsc, args);
free(dsc);
diff -urp abrt.2/src/plugins/abrt-action-rhtsupport.cpp
abrt.3/src/plugins/abrt-action-rhtsupport.cpp
--- abrt.2/src/plugins/abrt-action-rhtsupport.cpp 2010-11-11 09:27:28.000000000 +0100
+++ abrt.3/src/plugins/abrt-action-rhtsupport.cpp 2010-11-19 13:18:45.803229980 +0100
@@ -130,11 +130,10 @@ static void report_to_rhtsupport(
map_crash_data_t::const_iterator it = pCrashData.begin();
for (; it != pCrashData.end(); it++)
{
- if (it->first == CD_COUNT) continue;
+ if (it->first == FILENAME_COUNT) continue;
if (it->first == CD_DUMPDIR) continue;
- if (it->first == CD_INFORMALL) continue;
- if (it->first == CD_REPORTED) continue;
- if (it->first == CD_MESSAGE) continue; // plugin's status message (if
we already reported it yesterday)
+ if (it->first == FILENAME_INFORMALL) continue;
+ if (it->first == FILENAME_MESSAGE) continue; // plugin's status
message (if we already reported it yesterday)
if (it->first == FILENAME_DESCRIPTION) continue; // package description
const char *content = it->second[CD_CONTENT].c_str();
diff -urp abrt.2/src/plugins/abrt-action-upload.cpp
abrt.3/src/plugins/abrt-action-upload.cpp
--- abrt.2/src/plugins/abrt-action-upload.cpp 2010-11-11 20:23:00.000000000 +0100
+++ abrt.3/src/plugins/abrt-action-upload.cpp 2010-11-19 13:18:48.455220476 +0100
@@ -166,11 +166,10 @@ static int create_and_upload_archive(
char *short_name, *full_name;
while (dd_get_next_file(dd, &short_name, &full_name))
{
- if (strcmp(short_name, CD_COUNT) == 0) goto next;
+ if (strcmp(short_name, FILENAME_COUNT) == 0) goto next;
if (strcmp(short_name, CD_DUMPDIR) == 0) goto next;
- if (strcmp(short_name, CD_INFORMALL) == 0) goto next;
- if (strcmp(short_name, CD_REPORTED) == 0) goto next;
- if (strcmp(short_name, CD_MESSAGE) == 0) goto next; // plugin's status
message (if we already reported it yesterday)
+ if (strcmp(short_name, FILENAME_INFORMALL) == 0) goto next;
+ if (strcmp(short_name, FILENAME_MESSAGE) == 0) goto next; // plugin's
status message (if we already reported it yesterday)
if (strcmp(short_name, FILENAME_DESCRIPTION) == 0) goto next; // package
description
// dd_get_next_file guarantees this:
//struct stat stbuf;
diff -urp abrt.2/src/plugins/abrt-plugins.7 abrt.3/src/plugins/abrt-plugins.7
--- abrt.2/src/plugins/abrt-plugins.7 2010-11-11 09:27:28.000000000 +0100
+++ abrt.3/src/plugins/abrt-plugins.7 2010-11-18 06:28:11.001899537 +0100
@@ -31,12 +31,11 @@ stored in the \fI/etc/abrt/plugins\fP di
.IR abrt (8),
.IR abrt.conf (5),
.IR abrt-Bugzilla (7),
-.IR abrt-FileTransfer (7),
+.IR abrt-Upload (7),
.IR abrt-KerneloopsReporter (7),
.IR abrt-KerneloopsScanner (7),
.IR abrt-Logger (7),
.IR abrt-Mailx (7),
-.IR abrt-SQLite3 (7)
.SH AUTHOR
\fIabrt\fP written by Zdeněk Přikryl <zprikryl(a)redhat.com> and
Jiří Moskovčák <jmoskovc(a)redhat.com>. Manual page written by Daniel
Only in abrt.2/src/plugins: abrt-SQLite3.7
diff -urp abrt.2/src/plugins/Makefile.am abrt.3/src/plugins/Makefile.am
--- abrt.2/src/plugins/Makefile.am 2010-11-15 15:27:14.000000000 +0100
+++ abrt.3/src/plugins/Makefile.am 2010-11-18 06:28:40.597900735 +0100
@@ -7,8 +7,7 @@ libexec_SCRIPTS = \
pluginslib_LTLIBRARIES = \
libCCpp.la \
- libKerneloopsScanner.la \
- libSQLite3.la
+ libKerneloopsScanner.la
dist_pluginslib_DATA = \
Logger.glade \
@@ -27,8 +26,7 @@ dist_pluginsconf_DATA = \
Kerneloops.conf \
Bugzilla.conf \
RHTSupport.conf \
- Upload.conf \
- SQLite3.conf
+ Upload.conf
man_MANS = \
abrt-Bugzilla.7 \
@@ -37,7 +35,6 @@ man_MANS = \
abrt-Logger.7 \
abrt-Mailx.7 \
abrt-Upload.7 \
- abrt-SQLite3.7 \
abrt-plugins.7
EXTRA_DIST = $(man_MANS) abrt-action-install-debuginfo
@@ -47,7 +44,6 @@ $(DESTDIR)/$(DEBUG_INFO_DIR):
install-data-hook: $(DESTDIR)/$(DEBUG_INFO_DIR)
sed 's: = /var/: = $(localstatedir)/:g' -i \
- $(DESTDIR)$(sysconfdir)/abrt/plugins/SQLite3.conf \
$(DESTDIR)$(sysconfdir)/abrt/plugins/Logger.conf
# CCpp
@@ -66,12 +62,6 @@ libKerneloopsScanner_la_SOURCES = Kernel
libKerneloopsScanner_la_LDFLAGS = -avoid-version $(GLIB_LIBS)
libKerneloopsScanner_la_CPPFLAGS = -I$(INC_PATH) -I$(UTILS_PATH)
-DDEBUG_DUMPS_DIR=\"$(DEBUG_DUMPS_DIR)\" $(GLIB_CFLAGS)
-# SQLite3
-libSQLite3_la_SOURCES = SQLite3.cpp SQLite3.h
-libSQLite3_la_LDFLAGS = -avoid-version
-libSQLite3_la_LIBADD = $(SQLITE3_LIBS) $(GLIB_LIBS)
-libSQLite3_la_CPPFLAGS = -I$(INC_PATH) -I$(UTILS_PATH) $(SQLITE3_CFLAGS)
-DLOCALSTATEDIR='"$(localstatedir)"' $(GLIB_CFLAGS)
-
libexec_PROGRAMS = \
abrt-action-analyze-c \
abrt-action-analyze-python \
Only in abrt.2/src/plugins: SQLite3.conf
Only in abrt.2/src/plugins: SQLite3.cpp
Only in abrt.2/src/plugins: SQLite3.h