summaryrefslogtreecommitdiffstats
path: root/src/daemon/MiddleWare.cpp
Commit message (Collapse)AuthorAgeFilesLines
* get rid of FILENAME_DESCRIPTION, rename "release" to "os_release"Denys Vlasenko2011-02-101-1/+1
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* use run_state->children_count == 0 check for "event not conf'd" conditionDenys Vlasenko2011-02-011-2/+3
| | | | | | | | | | | | run_event_on_FOO() was returning -1 when it found that not even one program was run on the requested event. Which is not a very natural return value: in many cases this isn't an error. This change makes it return 0 in this case. It is ok since now we have run_state->children_count member which can be checked for 0 by those callers which want to detect this condition. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* preparatory changes for abrt-cli local processing changeDenys Vlasenko2011-01-271-2/+2
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* remove CCommLayerServer[DBus] classesDenys Vlasenko2011-01-211-3/+2
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* remove plugin.h, move its only macro into into only userDenys Vlasenko2011-01-201-2/+1
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* remove old plugin machinery. -10k and -1 library dependence in abrtdDenys Vlasenko2011-01-191-21/+1
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* fix a SEGV caused by returning NULL instead of empty hash tableDenys Vlasenko2011-01-131-0/+2
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* extend run_event() to run_event_on_dir_name() and run_event_on_crash_data()Denys Vlasenko2010-12-221-6/+6
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* *: rename *crash_dump.* -> *crash_data.*Denys Vlasenko2010-12-221-3/+3
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Rename foo_crash_dump_dir -> foo_dump_dirDenys Vlasenko2010-12-151-4/+4
| | | | | | | | | | | | | To be exact, these three functions are renamed: load_crash_data_from_crash_dump_dir create_crash_dump_dir delete_crash_dump_dir Rationale: data structure is called "struct dump_dir", not "struct crash_dump_dir" Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* removal of C++isms from libabrt, part 2Denys Vlasenko2010-12-081-12/+16
| | | | | | This patch rewrites a few places where we use C++ strings Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* removal of C++isms from libabrt, part 1Denys Vlasenko2010-12-081-108/+81
| | | | | | | | | | | | | This patch converts libabrt usage of C++ map<string, string> to a glib-based container, GHashTable. It is typedef-ed to map_string_h. We can't typedef it to map_string_t, since other parts of ABRT (daemon, cli) still use that name for C++ container. Also, exceptions are removed everywhere. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* This patch changes crash data to use C structures.Denys Vlasenko2010-12-061-65/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The smallest data element is: struct crash_item { char *content; unsigned flags; }; where content is, eh, content, and flags is a bit flag field. crash_data_t is a map of crash_item's, implemented as a pointer to heap-allocated GHashTable. vector_of_crash_data_t is a vector of crash_data_t's, implemented as a pointer to heap-allocated GPtrArray. Most operations have light wrappers around them to hide the nature of the containers. For example, to free vector_of_crash_data, you need to use free_vector_of_crash_data(ptr) instead of open-coding g_ptr_array_free. The wrapper is thin. The goal is not so much to hide the implementation, but more to make it easier to use the correct function. dbus (un)marshalling functions convert crash_item to three-element array of strings, in order to keep compatibility with abrt-gui (python). This can be changed later to use native representation. crash_data_t and vector_of_crash_data_t are represented in "natural" way, no funny stuff there. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* preparatory patch: add -v to abrt-cli; remove unused func; make func staticDenys Vlasenko2010-12-031-1/+11
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* factor out headers so that "report lib" API is separated out of abrt APIDenys Vlasenko2010-12-011-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch minimally affects code per se - it adds create_crash_dump_dir() function which takes in-memory representation of the dump (map_crash_data_t object) and creates an on-disk representation. Then it returns pointer to struct dump_dir. With this function, it is possible to run an event on a user-constructed map_crash_data_t: map_crash_data_t cd; add_to_crash_data(cd, "foo", "bar"); struct dump_dir *dd = create_crash_dump_dir(cd); char *dir_name = strdup(dd->dd_dir); dd_close(dd); run_event(run_state, dir_name, event); delete_crash_dump_dir(dir_name); which is, basically, what report library is about. The biggest part of the patch is reshuffling of header files, with the following result: three header files which are not cluttered by other ABRT stuff, and expose the following API each: crash_dump.h - in-memory crash dump data structs and ops dump_dir.h - on-disk crash dump data structs and ops run_event.h - run_event() and friends These is a test application, test_report.cpp.cpp, which demonstrates (and tests) usage of these headers. (grep for "test-report" and enable it in build system if you want it to be built). It creates a temporary dump in /var/run/abrt/tmp-NNNN-NNNNN and runs "report" event. Deleting of temp dump is disabled for testing purposes - you might want to see the contents. Here is how the binary looks like: text data bss dec hex filename 3730 668 48 4446 115e /usr/bin/test-report linux-vdso.so.1 => (0x00007ffffa80f000) libabrt.so.0 => /usr/lib64/libabrt.so.0 (0x00007fad1f35e000) libglib-2.0.so.0 => /lib64/libglib-2.0.so.0 (0x0000003c1f200000) libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x0000003c2c200000) libm.so.6 => /lib64/libm.so.6 (0x00007fad1f0da000) libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000003c28e00000) libc.so.6 => /lib64/libc.so.6 (0x00007fad1ed5b000) /lib64/ld-linux-x86-64.so.2 (0x00007fad1f570000) Next step would be to clean up the namespace, then rename libabrt.so into libreport.so, then split it into a separate package so that we can install it without installing other two abrt .so files. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* preparatory patch for future factoring out of headers for reportlibDenys Vlasenko2010-11-261-4/+4
| | | | | | Some files and functions are renamed, no logic changes. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* abrtd: suppress spurious warning about missing coredump and inform_allDenys Vlasenko2010-11-251-7/+12
| | | | | | Also plugs two memory leaks Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* remove sqlite DBDenys Vlasenko2010-11-231-281/+243
| | | | | | | | | | | | | | | | | | | | | | This change 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. 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. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* preraratory patch for database removalDenys Vlasenko2010-11-221-6/+16
| | | | | | | I splitted bits from a large "database removal" patch which are simple and non-contentiouns. They are in this change. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Cleanup. Remove last vestiges of AnalyzerActionsAndReporters.Denys Vlasenko2010-11-181-16/+1
| | | | | | Also: made one function static, made dd_delete() call dd_close(). Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* abrtd/gui: remove [AnalyzerActionsAndReporters], migrate to event-based ↵Denys Vlasenko2010-11-151-15/+14
| | | | | | processing Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* abrtd: do not panic on "nothing was done" result for [re]analyze eventsDenys Vlasenko2010-11-151-1/+1
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Make "abrt-handle-crashdump -e BOGUS_EVENT" fail (also fail if asked over dbus)Denys Vlasenko2010-11-151-3/+7
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* remove "old" Bugzilla and RHTSupport pluginsDenys Vlasenko2010-11-111-4/+2
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Decouple settings handling from old-style pluginsDenys Vlasenko2010-11-101-15/+68
| | | | | | | | The breakage was discovered when i removed Logger class. it turned out the fix is somewhat involved. This change implements it as discussed with the rest of the team. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Move some functions from CrashWatcher to MiddleWareDenys Vlasenko2010-11-091-0/+201
| | | | | | They have nothing to do with CrashWatcher class. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* abrtd: remove support for ActionsAndReporters, abrt_event.conf supersedes itDenys Vlasenko2010-11-081-49/+0
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* make #includes simplerDenys Vlasenko2010-11-051-1/+0
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* make DebugDumpToCrashReport() fill CD_EVENTSDenys Vlasenko2010-11-051-8/+14
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* use proper "Python" instead of "python" in abrt_event.confDenys Vlasenko2010-11-041-4/+4
| | | | | | Also, suppress yet another too agressive warning Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* supply CD_EVENTS element in crash dump structures passed to GUIDenys Vlasenko2010-11-041-0/+5
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* abrtd: convert reporting step to run_action, part 1 (main)Denys Vlasenko2010-11-031-78/+77
| | | | | | | | | | There are a few things which are missing in this commit: for example, the list of possible reporting "paths" is not extracted from abrt_event.conf yet. Part 2 will deal with it. Tested: reporting thru bugzilla and thru logger. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* reinstate lost feature of "refresh backtrace" in GUIDenys Vlasenko2010-11-031-1/+1
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* switch "analyze" step processing to abrt_event.conf-driven wayDenys Vlasenko2010-11-031-129/+10
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* abrtd: make CreateCrashReport() more understandableDenys Vlasenko2010-11-021-28/+24
| | | | | | | Sort of preparatory patch: will soon convert it to abrt_action.conf use... Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* remove AutoReportUIDs supportDenys Vlasenko2010-11-021-41/+0
| | | | | | | | abrt_action.conf provides a way to configure that behaviour. This change adds a commented-out example how to do it for kerneloops. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* abrt-handle-crashdump: new semi-debug utility to run abrt actions for a ↵Denys Vlasenko2010-11-011-147/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | specified event Some reworking of run_action() API was needed to make it possible to put it into libABRT. abrt-handle-crashdump has no -l option yet: $ abrt-handle-crashdump Usage: abrt-handle-crashdump [-vs] -d DIR -e EVENT Handle crash dump according to rules in abrt_action.conf -v, --verbose be verbose -s Log to syslog -d DIR Crash dump directory -e EVENT Event Can (will) extend it later. Run-tested: performed "analyze" step by hand with abrt-handle-crashdump -e analyze -d CRASH_DUMP_DIR Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* introduce abrt_action.conf; use it for post-create stepDenys Vlasenko2010-11-011-31/+227
| | | | | | | | | | | | | | | | | | | | | | | | This patch replaces only the post-create step with new logic (the step which happens when abrtd detects fresh crash dump dir and needs to decide what to do with it), but it turns out this step is one of hard ones: it needs special handling of UUID. So a good chunk of hard-ish stuff is already in this patch. It also contains logic to collect the log from actions, even though so far it is simply logged. Other steps (like reporting step) will pipe it to clients. post-create step simply has no client to pipe output to. But the code is there already. GetLocalUUID() members in all plugins are unused now and are deleted from all classes. Next patches will move run_event() function into libABRT, so that it can be used from e.g. abrt-handle-crashdump utility if/when we will write it, from clients directly and so on. For now, it lives in MiddleWare.cpp since it is only used there. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* abrtd: prepearatory patch: is_debug_dump_saved shouldn't need uidDenys Vlasenko2010-11-011-62/+22
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* change dd_opendir API to return dd pointer (no need to dd_init it separately)Denys Vlasenko2010-10-151-11/+11
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* move load_crash_data_from_debug_dump from MiddleWare to CrashTypesDenys Vlasenko2010-10-111-123/+0
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* s/CD_DUPHASH/FILENAME_DUPHASH/gDenys Vlasenko2010-10-111-2/+2
| | | | | | | This is needed to make duplicate hash visible for separate programs looking at crash dumps. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* g_settings_sDatabase uses char*Nikola Pajkovsky2010-09-241-9/+6
| | | | Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com>
* This patch splits off abrtd's package/component/descriptionDenys Vlasenko2010-09-221-253/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | generation into a separate tool: abrt-action-save-package-data: invalid option -- 'z' Usage: abrt-action-save-package-data -d DIR [-vs] Query package database and save package name, component, and description Options: -d DIR Crash dump directory -v Verbose -s Log to syslog This also allows for debugging and regression testing of abrt-action-save-package-data - it can be simply run from command-line. Also it provides a better fault isolation - crash in abrt-action-save-package-data does not take down abrtd. Same goes for isolation of memory leaks - old code actually had leaks on a rarely used error path. New code doesn't, but if it would have, it wouldn't matter, since the process is short-lived. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* add two flags to dd_opendir()Nikola Pajkovsky2010-09-221-29/+18
| | | | | | | | | | | | | | | | | | | DD_CLOSE_ON_OPEN_ERR - free dump_dir structure when opening dump_dir does not exist DD_FAIL_QUIETLY - suppress message when dump directory does not exist VERB1 log(_("Unable to open debug dump '%s'"), pDebugDumpDir); is all removed because there is error_msg("'%s' does not exist", dd->dd_dir); in dd_opendir() which sometimes we don't want to print(DD_FAIL_QUIETLY) example: crash dump directory trimming code running concurrently. Second process may try to delete a directory which is already gone. it should not complain that it is missing. Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com> Acked-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* eliminate LoadOpenGPGPublicKey wrapperDenys Vlasenko2010-09-221-7/+1
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* fix a small memory leakDenys Vlasenko2010-09-211-1/+3
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* unhide dump_dir structure from typedefNikola Pajkovsky2010-09-201-8/+8
| | | | | | no other code changes Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com>
* MiddleWare.cpp: remove unused variablesNikola Pajkovsky2010-09-081-5/+0
| | | | Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com>
* add forgotten database disconnect on error pathDenys Vlasenko2010-09-081-7/+4
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>