summaryrefslogtreecommitdiffstats
path: root/lib/utils
Commit message (Collapse)AuthorAgeFilesLines
* move inc/ and lib/ to src/. No code changesDenys Vlasenko2010-11-1551-7099/+0
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Decouple settings handling from old-style pluginsDenys Vlasenko2010-11-103-15/+23
| | | | | | | | 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>
* remove RunApp plugin, abrt-event.conf superseded itDenys Vlasenko2010-11-081-2/+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>
* suppress open error message in one case when it isn't unexpectedDenys Vlasenko2010-11-042-9/+18
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* fix a simple bug in run_event() - was truncating command at first wordDenys Vlasenko2010-11-041-2/+5
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* supply CD_EVENTS element in crash dump structures passed to GUIDenys Vlasenko2010-11-041-8/+12
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* fix a simple bug in run_event() - was truncating command at first wordDenys Vlasenko2010-11-041-2/+5
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* list_possible_events(): do not forget to unlock the dir!Denys Vlasenko2010-11-031-6/+5
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* extend list_possible_events() to be able to return list _for a specified dir_Denys Vlasenko2010-11-031-33/+65
| | | | | | | | | | | | | | | | | | | | | Example: post-create analyze reanalyze report report_Bugzilla report_Logger post-create reanalyze report_Bugzilla report_Logger Note that "analyze" and "report" steps arent't listed for TEST_DIR because there is not a single matching rule for them. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* rename abrt_action.conf -> abrt_event.confDenys Vlasenko2010-11-021-5/+5
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* abrt-handle-crashdump: add -l[pfx] option to list possible eventsDenys Vlasenko2010-11-023-7/+84
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* abrt-handle-crashdump: new semi-debug utility to run abrt actions for a ↵Denys Vlasenko2010-11-012-1/+170
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* reduce usage of daemon's library in non-daemon partsDenys Vlasenko2010-10-252-3/+1
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Splitting web-related functions into libABRT_web_utils.soDenys Vlasenko2010-10-251-9/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Was: linux-vdso.so.1 => (0x00007fff4e4a0000) libABRTUtils.so.0 => /usr/lib64/libABRTUtils.so.0 (0x00007f64316c0000) libABRTdUtils.so.0 => /usr/lib64/libABRTdUtils.so.0 (0x00007f64314b6000) libpolkit-gobject-1.so.0 => /usr/lib64/libpolkit-gobject-1.so.0 (0x0000003c2c600000) libgio-2.0.so.0 => /lib64/libgio-2.0.so.0 (0x0000003c20a00000) libgobject-2.0.so.0 => /lib64/libgobject-2.0.so.0 (0x0000003c1f600000) libgmodule-2.0.so.0 => /lib64/libgmodule-2.0.so.0 (0x0000003c20600000) libgthread-2.0.so.0 => /lib64/libgthread-2.0.so.0 (0x0000003c1fa00000) libglib-2.0.so.0 => /lib64/libglib-2.0.so.0 (0x0000003c1f200000) libxml2.so.2 => /usr/lib64/libxml2.so.2 (0x0000003c28200000) libdl.so.2 => /lib64/libdl.so.2 (0x00007f64312b2000) libdbus-1.so.3 => /lib64/libdbus-1.so.3 (0x0000003c1fe00000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f6431096000) librt.so.1 => /lib64/librt.so.1 (0x00007f6430e8e000) libxmlrpc.so.3 => /usr/lib64/libxmlrpc.so.3 (0x0000003c22e00000) libxmlrpc_util.so.3 => /usr/lib64/libxmlrpc_util.so.3 (0x0000003c23600000) libxmlrpc_client.so.3 => /usr/lib64/libxmlrpc_client.so.3 (0x0000003c23a00000) libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x0000003c2c200000) libm.so.6 => /lib64/libm.so.6 (0x00007f6430c0a000) libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000003c28e00000) libc.so.6 => /lib64/libc.so.6 (0x00007f643088b000) libeggdbus-1.so.0 => /usr/lib64/libeggdbus-1.so.0 (0x0000003c30200000) libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f6430671000) libz.so.1 => /lib64/libz.so.1 (0x0000003c1e600000) libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f6430452000) /lib64/ld-linux-x86-64.so.2 (0x00007f64318d0000) libcurl.so.4 => /usr/lib64/libcurl.so.4 (0x00007f64301f6000) libdbus-glib-1.so.2 => /usr/lib64/libdbus-glib-1.so.2 (0x00007f642ffd3000) libidn.so.11 => /lib64/libidn.so.11 (0x0000003c21200000) liblber-2.4.so.2 => /usr/lib64/liblber-2.4.so.2 (0x00007f642fdc5000) libldap-2.4.so.2 => /usr/lib64/libldap-2.4.so.2 (0x00007f642fb80000) libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007f642f951000) libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007f642f694000) libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00007f642f468000) libcom_err.so.2 => /lib64/libcom_err.so.2 (0x0000003c29200000) libssl3.so => /usr/lib64/libssl3.so (0x00007f642f234000) libsmime3.so => /usr/lib64/libsmime3.so (0x00007f642f009000) libnss3.so => /usr/lib64/libnss3.so (0x00007f642eccf000) libnssutil3.so => /usr/lib64/libnssutil3.so (0x00007f642eab0000) libplds4.so => /lib64/libplds4.so (0x00007f642e8ad000) libplc4.so => /lib64/libplc4.so (0x00007f642e6a9000) libnspr4.so => /lib64/libnspr4.so (0x00007f642e46c000) libssh2.so.1 => /usr/lib64/libssh2.so.1 (0x0000003c21600000) libsasl2.so.2 => /usr/lib64/libsasl2.so.2 (0x0000003c34e00000) libssl.so.10 => /usr/lib64/libssl.so.10 (0x0000003c2d600000) libcrypto.so.10 => /lib64/libcrypto.so.10 (0x0000003c29a00000) libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00007f642e263000) libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x0000003c2aa00000) libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007f642e02c000) libfreebl3.so => /lib64/libfreebl3.so (0x00007f642ddcf000) Now: linux-vdso.so.1 => (0x00007fff187ff000) libABRTUtils.so.0 => /usr/lib64/libABRTUtils.so.0 (0x00007fb12b24e000) libdbus-1.so.3 => /lib64/libdbus-1.so.3 (0x0000003c1fe00000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fb12b032000) libABRTdUtils.so.0 => /usr/lib64/libABRTdUtils.so.0 (0x00007fb12ae2b000) libpolkit-gobject-1.so.0 => /usr/lib64/libpolkit-gobject-1.so.0 (0x0000003c2c600000) libgio-2.0.so.0 => /lib64/libgio-2.0.so.0 (0x0000003c20a00000) libgobject-2.0.so.0 => /lib64/libgobject-2.0.so.0 (0x0000003c1f600000) libgmodule-2.0.so.0 => /lib64/libgmodule-2.0.so.0 (0x0000003c20600000) libgthread-2.0.so.0 => /lib64/libgthread-2.0.so.0 (0x0000003c1fa00000) librt.so.1 => /lib64/librt.so.1 (0x00007fb12ac23000) libglib-2.0.so.0 => /lib64/libglib-2.0.so.0 (0x0000003c1f200000) libdl.so.2 => /lib64/libdl.so.2 (0x00007fb12aa1f000) libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x0000003c2c200000) libm.so.6 => /lib64/libm.so.6 (0x00007fb12a79b000) libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000003c28e00000) libc.so.6 => /lib64/libc.so.6 (0x00007fb12a41c000) /lib64/ld-linux-x86-64.so.2 (0x00007fb12b45e000) libeggdbus-1.so.0 => /usr/lib64/libeggdbus-1.so.0 (0x0000003c30200000) libresolv.so.2 => /lib64/libresolv.so.2 (0x00007fb12a202000) libz.so.1 => /lib64/libz.so.1 (0x0000003c1e600000) libselinux.so.1 => /lib64/libselinux.so.1 (0x00007fb129fe3000) libdbus-glib-1.so.2 => /usr/lib64/libdbus-glib-1.so.2 (0x00007fb129dc0000) Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* moving files around, no code changesDenys Vlasenko2010-10-253-574/+48
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* firgot to "git add stdio_helpers.c"Denys Vlasenko2010-10-252-0/+70
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* introduce and use xmalloc_fgets/fgetlineDenys Vlasenko2010-10-222-26/+30
| | | | | | | This fixes problems of having long lines truncated - and we do have very long lines sometimes - curl errors with HTML, list of debuginfos etc. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* slightly more efficient strbuf codeDenys Vlasenko2010-10-221-27/+31
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* dump_dir: make open fail if there is no "analyzer" file.Denys Vlasenko2010-10-211-3/+20
| | | | | | | | | Also adjusts abrt-action-print to return better error message: '/tmp' is not a crash dump directory 1 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-28/+27
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* change dd_create API to return dd pointer (no need to dd_init it separately)Denys Vlasenko2010-10-151-26/+21
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Before this patch, dd_opendir(".") was creatingDenys Vlasenko2010-10-151-13/+40
| | | | | | | | | | | | | | | | | lock file "..lock", which is obviously wrong. This patch makes dd_opendir use realpath(dir_name). This makes dd_opendir(".") and similar cases correctly determine what is its parent directory and therefore use correct lock file name. dd_create can't use realpath, since it will always return NULL on not-yet existing directory. But this is not a problem, since dd_create(".") isn't a sane operation. So we continue to use old code. I only added a sanity check to refuse names ending in . and .. - just in case. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* mve md5 hash from Python plugin to abrtlibDenys Vlasenko2010-10-155-1/+475
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* btparser initial integrationKarel Klic2010-10-144-1686/+0
|
* various small fixes to dd usageDenys Vlasenko2010-10-141-49/+26
| | | | | | | | | | | KerneloopsScanner: dd leak on error path in save_oops_to_debug_dump() dump_dir: remove superfluous exist_file_dir check in dd_opendir, dd_create, delete_file_dir; use perror_msg instead of error_msg; correct some sligtly wrong log/error messages; make delete_file_dir return void, since return value is never checked. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* dump_dir.c: reorder functions within the file without changing them.Denys Vlasenko2010-10-141-64/+61
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* parse_options was not handling long options properly. fix it.Denys Vlasenko2010-10-121-14/+29
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Return a bitmask of found options from parse_opts()Denys Vlasenko2010-10-122-3/+9
| | | | | | | | | | | | | This patch makes it easier to analyze "bool" type options - now they are all just bits in a single return value, no need to have an integer variable for each option. The previous behavior is retained too: it is useful for "cumulative" options like -vvv. The patch also removes all OPT_GROUPs. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* move load_crash_data_from_debug_dump from MiddleWare to CrashTypesDenys Vlasenko2010-10-111-0/+123
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* s/CD_DUPHASH/FILENAME_DUPHASH/gDenys Vlasenko2010-10-112-5/+5
| | | | | | | This is needed to make duplicate hash visible for separate programs looking at crash dumps. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* trivial: remove unused option_index'sDenys Vlasenko2010-10-081-2/+1
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Remove arrays in usage text, use a single string insteadDenys Vlasenko2010-10-082-9/+5
| | | | | | | | | | | | | | | | | | | | | | | | Currently, usage is an array of pointers to string. It is meant to support this: usage: foo --bar or: foo --baz or: foo -z The patch removes this and makes usage just a string: usage: foo --bar Why remove this? (1) We can achieve old format by using the usage string with many lines: usage = "foo --bar\n" " or: foo --baz\n" " or: foo -z"; (2) We don't use multi-line usage anyway. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* add --help option in parse_opts(), not at every call site.Denys Vlasenko2010-10-083-18/+26
| | | | | | | This patch removes the need to add --help option to every program. It is added (and handled) by parse_opts(). Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* add more logging about settings, and make it possible to load them from stdinDenys Vlasenko2010-10-071-4/+29
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* add a new helper function, full_write_str(fd,str)Denys Vlasenko2010-10-072-0/+7
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* add OPT_GROUP optionNikola Pajkovsky2010-10-052-1/+14
| | | | Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com>
* add OPT__HELP macroNikola Pajkovsky2010-10-051-0/+1
| | | | Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com>
* add OPT__VERBOSE macroNikola Pajkovsky2010-10-051-0/+2
| | | | Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com>
* fix INTEGER optionNikola Pajkovsky2010-10-051-2/+1
| | | | Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com>
* remove < > around argument helpNikola Pajkovsky2010-10-051-1/+1
| | | | Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com>
* add INTEGER optionNikola Pajkovsky2010-10-052-0/+7
| | | | Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com>
* parse_options.c: add argument helpNikola Pajkovsky2010-10-052-2/+13
| | | | Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com>
* new args parserNikola Pajkovsky2010-10-043-1/+169
| | | | Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com>
* xfunc.c: add new funtion xcallocNikola Pajkovsky2010-10-041-0/+8
| | | | Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com>
* add two flags to dd_opendir()Nikola Pajkovsky2010-09-221-16/+10
| | | | | | | | | | | | | | | | | | | 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>
* unhide dump_dir structure from typedefNikola Pajkovsky2010-09-201-17/+17
| | | | | | no other code changes Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com>
* dump_dir: added TODO comment. no code changesDenys Vlasenko2010-09-151-0/+20
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* fixing two instances of dd->gid which I forgot to convertDenys Vlasenko2010-09-141-2/+2
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* dump_dir: use dd_ prefix on uid/gid fieldsDenys Vlasenko2010-09-141-8/+8
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>