Compare commits
195 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0baf939494 | ||
|
|
fb86abde3b | ||
|
|
b36cf8c499 | ||
|
|
ba57e0bbb5 | ||
|
|
54bdc1243f | ||
|
|
026c727cd2 | ||
|
|
3e192a597d | ||
|
|
ea69665c75 | ||
|
|
b8a18969b7 | ||
|
|
3063be65d9 | ||
|
|
c76a737f5a | ||
|
|
67fc5aa756 | ||
|
|
1bb8628644 | ||
|
|
d48adf4500 | ||
|
|
e5b49f4be8 | ||
|
|
66812b6c92 | ||
|
|
af451300aa | ||
|
|
202231f9cb | ||
|
|
e8f18508da | ||
|
|
58c69f3384 | ||
|
|
7fea67f0ed | ||
|
|
7eebe59cc3 | ||
|
|
f1adb64577 | ||
|
|
32054b4681 | ||
|
|
bbc9c5edc4 | ||
|
|
e76a84e22d | ||
|
|
7073ad4346 | ||
|
|
1f0eac990d | ||
|
|
e65ab2c3e6 | ||
|
|
8c7bdb1523 | ||
|
|
e73a64df97 | ||
|
|
50a321fe1d | ||
|
|
a20ba81e1d | ||
|
|
c8a122775e | ||
|
|
4f63977e6d | ||
|
|
534292e248 | ||
|
|
d3f14892f8 | ||
|
|
1e992dd7d9 | ||
|
|
f144023834 | ||
|
|
3f24d62289 | ||
|
|
f9fd407b73 | ||
|
|
fcc2f68d2d | ||
|
|
15bea33e03 | ||
|
|
0302f37126 | ||
|
|
88895e18b5 | ||
|
|
1c9f6e51cf | ||
|
|
810fcb1911 | ||
|
|
1b8bae307a | ||
|
|
7c6ec28dde | ||
|
|
d99ab08e76 | ||
|
|
e3d620d8fc | ||
|
|
1d49502fa7 |
||
|
|
4f59333992 | ||
|
|
61c2c079e0 | ||
|
|
f99a7f835a | ||
|
|
a4e0effc61 | ||
|
|
094983af73 | ||
|
|
81ec67df39 | ||
|
|
26627dbec3 | ||
|
|
126031c321 | ||
|
|
a1c9e8ff22 | ||
|
|
074ab8b76c | ||
|
|
7e13959917 | ||
|
|
dacf4e649a | ||
|
|
003b0187a1 | ||
|
|
82eb0a22c3 | ||
|
|
511e6ce6d4 | ||
|
|
1ab9d3859f | ||
|
|
00422605f4 | ||
|
|
3de7b9d0b7 | ||
|
|
5e37f50192 | ||
|
|
92ab2eb5b3 | ||
|
|
935456c7d9 | ||
|
|
d8a4ccc6c2 | ||
|
|
a2bcded0dc | ||
|
|
18305b2c50 | ||
|
|
438b4b73c7 | ||
|
|
9f7a213711 | ||
|
|
bf7b8afe4a | ||
|
|
61c6c411a8 | ||
|
|
e161563d64 | ||
|
|
400b28eb78 | ||
|
|
c84c5d2738 | ||
|
|
5f74b5e407 |
||
|
|
10288b9c6d |
||
|
|
2bb52e3881 |
||
|
|
68a77d6ad6 | ||
|
|
8f4c491a4b | ||
|
|
c7d2242d98 | ||
|
|
4d76ca5e3a | ||
|
|
0c014bfd3a | ||
|
|
507c1e9e86 | ||
|
|
cbad6eeeab | ||
|
|
ac861159ca | ||
|
|
f182793f33 | ||
|
|
9e6bef580f | ||
|
|
df2a70c73b | ||
|
|
3e5d6a98ef | ||
|
|
a2c5fdd9e8 | ||
|
|
6b11b1ff26 | ||
|
|
f9e6665820 |
||
|
|
17aa2db63d |
||
|
|
1ee4720bca | ||
|
|
67f63a5ca4 | ||
|
|
5dfc50845c | ||
|
|
c7b20eb399 | ||
|
|
ebf644594c | ||
|
|
eadff202bc |
||
|
|
9d7d233bf9 | ||
|
|
8086e64036 | ||
|
|
509bd67e3d | ||
|
|
895d076624 | ||
|
|
50039757c0 | ||
|
|
8dd747fded | ||
|
|
92d1203917 | ||
|
|
bcfb1b554d | ||
|
|
d26d504519 |
||
|
|
c6814312f9 |
||
|
|
4ac8f5f7a9 | ||
|
|
a09a33c9f5 | ||
|
|
3c2253dc6d | ||
|
|
042464a929 | ||
|
|
dcab69a1fb | ||
|
|
2c14e84f08 | ||
|
|
81b08b87c0 | ||
|
|
437b080e9a | ||
|
|
c9a0a107d9 | ||
|
|
4f98a322c2 | ||
|
|
648b4c8601 |
||
|
|
fa6bf827b2 | ||
|
|
22482fb18b |
||
|
|
dc422cf7ed | ||
|
|
e06dcb57e7 | ||
|
|
6b7ef25742 | ||
|
|
7b19a66f3c |
||
|
|
09e4addde4 | ||
|
|
4684ea4866 | ||
|
|
d663542b40 | ||
|
|
37ad20102e |
||
|
|
85802ca9d7 | ||
|
|
a074333d28 | ||
|
|
6a0f0e431a | ||
|
|
d2918af2e6 | ||
|
|
49b1bc1549 | ||
|
|
afd3ea3bea | ||
|
|
f36c5ca8dc | ||
|
|
2fe9ae6400 | ||
|
|
baf8fefda7 | ||
|
|
9b73a80599 | ||
|
|
248ea8cdf4 | ||
|
|
5349e70f0a | ||
|
|
7ef5a567fa | ||
|
|
7de0bef650 | ||
|
|
253f3b5e24 | ||
|
|
e8a62759b3 | ||
|
|
a170e2f896 | ||
|
|
3c50298685 | ||
|
|
ba27e114c2 | ||
|
|
d5ced8a4cf | ||
|
|
bdca143d24 | ||
|
|
345ed6c98e | ||
|
|
540f6e7795 | ||
|
|
a96f20b524 | ||
|
|
21561ba82c | ||
|
|
c649b7d724 | ||
|
|
e2f4733fc4 | ||
|
|
168feccb11 | ||
|
|
cd3efeaff4 | ||
|
|
a22abdb1f3 | ||
|
|
ba94a9992a | ||
|
|
04b13c6fc9 | ||
|
|
ba52311fcb | ||
|
|
ee087b960d | ||
|
|
61650c58f2 | ||
|
|
55488e54c7 | ||
|
|
46dc322c41 | ||
|
|
820caf519c | ||
|
|
52400fcf42 | ||
|
|
58ac8d6e9a | ||
|
|
ef5d23d3b1 | ||
|
|
b52e1a767a | ||
|
|
a6a1fceb2c | ||
|
|
d01f0fa520 | ||
|
|
66b169ccf2 | ||
|
|
207cb13ae3 | ||
|
|
9705d07480 | ||
|
|
071dfeb34c | ||
|
|
9d664f2339 | ||
|
|
a8bf279ba2 | ||
|
|
34dad7f6af | ||
|
|
b72e3399f7 | ||
|
|
91cb6cb2c1 | ||
|
|
bc96715ec7 | ||
|
|
f986ffa0b7 | ||
|
|
6d542d86f0 |
22 changed files with 1559 additions and 162492 deletions
1
.fmf/version
Normal file
1
.fmf/version
Normal file
|
|
@ -0,0 +1 @@
|
|||
1
|
||||
49
.gitignore
vendored
49
.gitignore
vendored
|
|
@ -38,3 +38,52 @@ abrt-1.1.13.tar.gz
|
|||
/abrt-2.2.1.tar.gz
|
||||
/abrt-2.2.2.tar.gz
|
||||
/abrt-2.3.0.tar.gz
|
||||
/abrt-2.4.0.tar.gz
|
||||
/abrt-2.5.0.tar.gz
|
||||
/abrt-2.5.1.tar.gz
|
||||
/abrt-2.6.0.tar.gz
|
||||
/abrt-2.6.1.tar.gz
|
||||
/abrt-2.6.2.tar.gz
|
||||
/abrt-2.7.0.tar.gz
|
||||
/abrt-2.7.1.tar.gz
|
||||
/abrt-2.7.2.tar.gz
|
||||
/abrt-2.8.0.tar.gz
|
||||
/abrt-2.8.1.tar.gz
|
||||
/abrt-2.8.2.tar.gz
|
||||
/abrt-2.9.0.tar.gz
|
||||
/abrt-2.10.0.tar.gz
|
||||
/abrt-2.10.1.tar.gz
|
||||
/abrt-2.10.2.tar.gz
|
||||
/abrt-2.10.3.tar.gz
|
||||
/abrt-2.10.4.tar.gz
|
||||
/abrt-2.10.5.tar.gz
|
||||
/abrt-2.10.6.tar.gz
|
||||
/abrt-2.10.7.tar.gz
|
||||
/abrt-2.10.8.tar.gz
|
||||
/abrt-2.10.9.tar.gz
|
||||
/abrt-2.10.10.tar.gz
|
||||
/abrt-2.11.0.tar.gz
|
||||
/abrt-2.11.1.tar.gz
|
||||
/abrt-2.12.0.tar.gz
|
||||
/abrt-2.12.1.tar.gz
|
||||
/abrt-2.12.2.tar.gz
|
||||
/abrt-2.13.0.tar.gz
|
||||
/abrt-2.14.0.tar.gz
|
||||
/abrt-2.14.1.tar.gz
|
||||
/abrt-2.14.2.tar.gz
|
||||
/abrt-2.14.3.tar.gz
|
||||
/abrt-2.14.4.tar.gz
|
||||
/abrt-2.14.5.tar.gz
|
||||
/abrt-2.14.6.tar.gz
|
||||
/abrt-2.15.0.tar.gz
|
||||
/abrt-2.15.1.tar.gz
|
||||
/abrt-2.16.0.tar.gz
|
||||
/abrt-2.16.1.tar.gz
|
||||
/abrt-2.17.0.tar.gz
|
||||
/abrt-2.17.1.tar.gz
|
||||
/abrt-2.17.2.tar.gz
|
||||
/abrt-2.17.4.tar.gz
|
||||
/abrt-2.17.5.tar.gz
|
||||
/abrt-2.17.6.tar.gz
|
||||
/abrt-2.17.7.tar.gz
|
||||
/abrt-2.17.8.tar.gz
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1,48 +0,0 @@
|
|||
From b7332b068c11ec16c190472684334944abb3607b Mon Sep 17 00:00:00 2001
|
||||
From: Jakub Filak <jfilak@redhat.com>
|
||||
Date: Thu, 9 Oct 2014 16:28:12 +0200
|
||||
Subject: [PATCH] console-notifications: use return instead of exit
|
||||
|
||||
Thanks Ray Strode [halfline] <rstrode@redhat.com>
|
||||
|
||||
Related to rhbz#1150169
|
||||
|
||||
Signed-off-by: Jakub Filak <jfilak@redhat.com>
|
||||
---
|
||||
src/cli/abrt-console-notification.sh | 10 +++++-----
|
||||
1 file changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/cli/abrt-console-notification.sh b/src/cli/abrt-console-notification.sh
|
||||
index 849273c..38de7bb 100755
|
||||
--- a/src/cli/abrt-console-notification.sh
|
||||
+++ b/src/cli/abrt-console-notification.sh
|
||||
@@ -1,13 +1,13 @@
|
||||
-# If shell is not connect to a terminal, exit immediately, because this script
|
||||
+# If shell is not connect to a terminal, return immediately, because this script
|
||||
# should print out ABRT's status and it is senseless to continue without
|
||||
# terminal.
|
||||
-tty -s || exit 0
|
||||
+tty -s || return 0
|
||||
|
||||
# If $HOME is not set, a non human user is logging in to shell but this script
|
||||
-# should provide information to human users, therefore exiting immediately
|
||||
+# should provide information to human users, therefore returning immediately
|
||||
# without showing the notification.
|
||||
if [ -z "$HOME" ]; then
|
||||
- exit 0
|
||||
+ return 0
|
||||
fi
|
||||
|
||||
if [ -z "$ABRT_DEBUG_LOG" ]; then
|
||||
@@ -19,7 +19,7 @@ SINCEFILE="$LPATHDIR/lastnotification"
|
||||
|
||||
if [ ! -f "$LPATHDIR" ]; then
|
||||
# It might happen that user doesn't have write access on his home.
|
||||
- mkdir -p "$LPATHDIR" >"$ABRT_DEBUG_LOG" 2>&1 || exit 0
|
||||
+ mkdir -p "$LPATHDIR" >"$ABRT_DEBUG_LOG" 2>&1 || return 0
|
||||
fi
|
||||
|
||||
TMPPATH=`mktemp --tmpdir="$LPATHDIR" lastnotification.XXXXXXXX 2> "$ABRT_DEBUG_LOG"`
|
||||
--
|
||||
2.1.0
|
||||
|
||||
|
|
@ -1,85 +0,0 @@
|
|||
From 9ef1d95f9556db4fdf02b283e1602b9e63b693c8 Mon Sep 17 00:00:00 2001
|
||||
From: Jakub Filak <jfilak@redhat.com>
|
||||
Date: Thu, 9 Oct 2014 10:24:42 +0200
|
||||
Subject: [PATCH] ureport: attach contact email if configured
|
||||
|
||||
Related to rhbz#1150389
|
||||
|
||||
Signed-off-by: Jakub Filak <jfilak@redhat.com>
|
||||
---
|
||||
src/plugins/abrt-action-ureport | 35 ++++++++++++++++++++++++++++++++---
|
||||
1 file changed, 32 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/plugins/abrt-action-ureport b/src/plugins/abrt-action-ureport
|
||||
index 1abe7b3..df5f3d3 100755
|
||||
--- a/src/plugins/abrt-action-ureport
|
||||
+++ b/src/plugins/abrt-action-ureport
|
||||
@@ -8,6 +8,7 @@
|
||||
import sys
|
||||
import os
|
||||
import getopt
|
||||
+import augeas
|
||||
|
||||
from report import dd_opendir, DD_FAIL_QUIETLY_ENOENT, run_event_state
|
||||
from reportclient import set_verbosity, error_msg_and_die, error_msg, log1, log
|
||||
@@ -33,12 +34,30 @@ def init_gettext():
|
||||
gettext.textdomain(GETTEXT_PROGNAME)
|
||||
|
||||
|
||||
-def spawn_and_wait(prog):
|
||||
+def get_augeas(module, file_path):
|
||||
+ """
|
||||
+ A function for efficient configuration of Augeas.
|
||||
+ Augeas modules are placed in /usr/share/augeas/lenses/dist
|
||||
+ """
|
||||
+
|
||||
+ aug_obj = augeas.Augeas(flags=augeas.Augeas.NO_MODL_AUTOLOAD)
|
||||
+ aug_obj.set("/augeas/load/{0}/lens".format(module), "{0}.lns".format(module))
|
||||
+ aug_obj.set("/augeas/load/{0}/incl".format(module), file_path)
|
||||
+ aug_obj.load()
|
||||
+ return aug_obj
|
||||
+
|
||||
+
|
||||
+def spawn_and_wait(prog, args=None):
|
||||
+ if args is None:
|
||||
+ args = [prog]
|
||||
+ else:
|
||||
+ args.insert(0, prog)
|
||||
+
|
||||
try:
|
||||
- return os.spawnlp(os.P_WAIT, prog, prog)
|
||||
+ return os.spawnvpe(os.P_WAIT, prog, args, os.environ)
|
||||
except OSError as err:
|
||||
error_msg(_("Unable to start '%s', error message was: '%s'"),
|
||||
- prog, err)
|
||||
+ " ".join(args), err)
|
||||
return -1
|
||||
|
||||
def try_parse_number(dd, filename):
|
||||
@@ -92,6 +111,7 @@ if __name__ == "__main__":
|
||||
verbose += 1
|
||||
|
||||
set_verbosity(verbose)
|
||||
+ os.environ["ABRT_VERBOSE"] = str(verbose)
|
||||
|
||||
# getcwd might fail if cwd was deleted
|
||||
try:
|
||||
@@ -159,6 +179,15 @@ if __name__ == "__main__":
|
||||
log(_("Adding you to CC List of the existing bugzilla bug"))
|
||||
run_event("watch_Bugzilla", dirname)
|
||||
|
||||
+ email = os.getenv("uReport_ContactEmail")
|
||||
+ if not email:
|
||||
+ augeas = get_augeas("libreport", "/etc/libreport/plugins/ureport.conf")
|
||||
+ email = augeas.get("/files/etc/libreport/plugins/ureport.conf/ContactEmail")
|
||||
+
|
||||
+ if email:
|
||||
+ log1("Attaching ContactEmail: " + email)
|
||||
+ spawn_and_wait("reporter-ureport", ["-A", "-E"])
|
||||
+
|
||||
sys.exit(exitcode)
|
||||
else:
|
||||
error_msg_and_die(_("reporter-ureport failed with exit code %d" % exitcode))
|
||||
--
|
||||
2.1.0
|
||||
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
From ad9e9d1609fd9e1365bf558f15c62ecb21304911 Mon Sep 17 00:00:00 2001
|
||||
From: Jakub Filak <jfilak@redhat.com>
|
||||
Date: Fri, 10 Oct 2014 11:18:51 +0200
|
||||
Subject: [PATCH] applet: don't show duphash instead of component
|
||||
|
||||
Related to rhbz#1084031
|
||||
|
||||
Signed-off-by: Jakub Filak <jfilak@redhat.com>
|
||||
---
|
||||
src/applet/applet.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/applet/applet.c b/src/applet/applet.c
|
||||
index 0ae8c72..90c5b0d 100644
|
||||
--- a/src/applet/applet.c
|
||||
+++ b/src/applet/applet.c
|
||||
@@ -1331,7 +1331,7 @@ static void Crash(DBusMessage* signal)
|
||||
if (duphash != NULL && duphash[0] != '\0')
|
||||
problem_data_add_text_noteditable(pi->problem_data, FILENAME_DUPHASH, duphash);
|
||||
if (package_name != NULL && package_name[0] != '\0')
|
||||
- problem_data_add_text_noteditable(pi->problem_data, FILENAME_COMPONENT, duphash);
|
||||
+ problem_data_add_text_noteditable(pi->problem_data, FILENAME_COMPONENT, package_name);
|
||||
pi->foreign = foreign_problem;
|
||||
show_problem_notification(pi, flags);
|
||||
}
|
||||
--
|
||||
2.1.0
|
||||
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
From ab46bc9d85331fca923853353663c0ce0edc3716 Mon Sep 17 00:00:00 2001
|
||||
From: Jakub Filak <jfilak@redhat.com>
|
||||
Date: Sat, 11 Oct 2014 00:05:07 +0200
|
||||
Subject: [PATCH] console-notifications: skip non-interactive shells
|
||||
|
||||
Related to rhbz#1141485
|
||||
Related to rhbz#1139001
|
||||
|
||||
Signed-off-by: Jakub Filak <jfilak@redhat.com>
|
||||
---
|
||||
src/cli/abrt-console-notification.sh | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/src/cli/abrt-console-notification.sh b/src/cli/abrt-console-notification.sh
|
||||
index 38de7bb..976dfc3 100755
|
||||
--- a/src/cli/abrt-console-notification.sh
|
||||
+++ b/src/cli/abrt-console-notification.sh
|
||||
@@ -3,6 +3,9 @@
|
||||
# terminal.
|
||||
tty -s || return 0
|
||||
|
||||
+# Skip all for noninteractive shells for the same reason as above.
|
||||
+[ -z "$PS1" ] && return 0
|
||||
+
|
||||
# If $HOME is not set, a non human user is logging in to shell but this script
|
||||
# should provide information to human users, therefore returning immediately
|
||||
# without showing the notification.
|
||||
--
|
||||
2.1.0
|
||||
|
||||
|
|
@ -1,158 +0,0 @@
|
|||
From 2e74ca0f15d6d25568f5af1cc9cd30b4b01aa849 Mon Sep 17 00:00:00 2001
|
||||
From: Jakub Filak <jfilak@redhat.com>
|
||||
Date: Tue, 14 Oct 2014 03:15:28 +0200
|
||||
Subject: [PATCH] journal-oops: use the length result of sd_journal_get_data()
|
||||
|
||||
journald doesn't guarantee NULL terminated strings returned from
|
||||
sd_journal_get_data(). It usually works but not always.
|
||||
|
||||
This patch fixes the issue by using the length of field data instead of
|
||||
assuming that string is NULL terminated.
|
||||
|
||||
Resolves: #1141549
|
||||
|
||||
Signed-off-by: Jakub Filak <jfilak@redhat.com>
|
||||
---
|
||||
src/plugins/abrt-dump-journal-oops.c | 13 ++++++-----
|
||||
src/plugins/abrt-journal.c | 43 ++++++++++++++++++++++--------------
|
||||
src/plugins/abrt-journal.h | 8 ++++---
|
||||
3 files changed, 40 insertions(+), 24 deletions(-)
|
||||
|
||||
diff --git a/src/plugins/abrt-dump-journal-oops.c b/src/plugins/abrt-dump-journal-oops.c
|
||||
index 3f1f419..0ff9fe0 100644
|
||||
--- a/src/plugins/abrt-dump-journal-oops.c
|
||||
+++ b/src/plugins/abrt-dump-journal-oops.c
|
||||
@@ -38,8 +38,8 @@ static GList* abrt_journal_extract_kernel_oops(abrt_journal_t *journal)
|
||||
|
||||
do
|
||||
{
|
||||
- const char *line = NULL;
|
||||
- if (abrt_journal_get_log_line(journal, &line) < 0)
|
||||
+ char *line = abrt_journal_get_log_line(journal);
|
||||
+ if (line == NULL)
|
||||
error_msg_and_die(_("Cannot read journal data."));
|
||||
|
||||
if (lines_info_count == lines_info_size)
|
||||
@@ -48,10 +48,13 @@ static GList* abrt_journal_extract_kernel_oops(abrt_journal_t *journal)
|
||||
lines_info = xrealloc(lines_info, lines_info_size * sizeof(lines_info[0]));
|
||||
}
|
||||
|
||||
- lines_info[lines_info_count].level = koops_line_skip_level(&line);
|
||||
- koops_line_skip_jiffies(&line);
|
||||
+ char *orig_line = line;
|
||||
+ lines_info[lines_info_count].level = koops_line_skip_level((const char **)&line);
|
||||
+ koops_line_skip_jiffies((const char **)&line);
|
||||
|
||||
- lines_info[lines_info_count].ptr = xstrdup(line);
|
||||
+ memmove(orig_line, line, strlen(line) + 1);
|
||||
+
|
||||
+ lines_info[lines_info_count].ptr = orig_line;
|
||||
|
||||
++lines_info_count;
|
||||
}
|
||||
diff --git a/src/plugins/abrt-journal.c b/src/plugins/abrt-journal.c
|
||||
index 89c8393..e0ae159 100644
|
||||
--- a/src/plugins/abrt-journal.c
|
||||
+++ b/src/plugins/abrt-journal.c
|
||||
@@ -23,6 +23,12 @@
|
||||
|
||||
#include <systemd/sd-journal.h>
|
||||
|
||||
+/*
|
||||
+ * http://www.freedesktop.org/software/systemd/man/sd_journal_get_data.html
|
||||
+ * sd_journal_set_data_threshold() : This threshold defaults to 64K by default.
|
||||
+ */
|
||||
+#define JOURNALD_MAX_FIELD_SIZE (64*1024)
|
||||
+
|
||||
|
||||
struct abrt_journal
|
||||
{
|
||||
@@ -84,33 +90,38 @@ int abrt_journal_get_field(abrt_journal_t *journal, const char *field, const voi
|
||||
return 0;
|
||||
}
|
||||
|
||||
-int abrt_journal_get_string_field(abrt_journal_t *journal, const char *field, const char **value)
|
||||
+char *abrt_journal_get_string_field(abrt_journal_t *journal, const char *field, char *value)
|
||||
{
|
||||
- size_t value_len;
|
||||
- const int r = abrt_journal_get_field(journal, field, (const void **)value, &value_len);
|
||||
+ size_t data_len;
|
||||
+ const char *data;
|
||||
+ const int r = abrt_journal_get_field(journal, field, (const void **)&data, &data_len);
|
||||
if (r < 0)
|
||||
{
|
||||
- return r;
|
||||
+ log_notice("Cannot read journal data");
|
||||
+ return NULL;
|
||||
}
|
||||
|
||||
const size_t pfx_len = strlen(field) + 1;
|
||||
- if (value_len < pfx_len)
|
||||
+ if (data_len < pfx_len)
|
||||
{
|
||||
error_msg("Invalid data format from journal: field data are not prefixed with field name");
|
||||
- return -EBADMSG;
|
||||
+ return NULL;
|
||||
}
|
||||
|
||||
- *value += pfx_len;
|
||||
- return 0;
|
||||
+ const size_t len = data_len - pfx_len;
|
||||
+ if (value == NULL)
|
||||
+ return xstrndup(data + pfx_len, len);
|
||||
+ /*else*/
|
||||
+
|
||||
+ strncpy(value, data + pfx_len, len);
|
||||
+ /* journal data are not NULL terminated strings, so terminate the string */
|
||||
+ value[len] = '\0';
|
||||
+ return value;
|
||||
}
|
||||
|
||||
-int abrt_journal_get_log_line(abrt_journal_t *journal, const char **line)
|
||||
+char *abrt_journal_get_log_line(abrt_journal_t *journal)
|
||||
{
|
||||
- const int r = abrt_journal_get_string_field(journal, "MESSAGE", line);
|
||||
- if (r < 0)
|
||||
- log_notice("Cannot read journal data. Exiting");
|
||||
-
|
||||
- return r;
|
||||
+ return abrt_journal_get_string_field(journal, "MESSAGE", NULL);
|
||||
}
|
||||
|
||||
int abrt_journal_get_cursor(abrt_journal_t *journal, char **cursor)
|
||||
@@ -272,9 +283,9 @@ void abrt_journal_watch_notify_strings(abrt_journal_watch_t *watch, void *data)
|
||||
{
|
||||
struct abrt_journal_watch_notify_strings *conf = (struct abrt_journal_watch_notify_strings *)data;
|
||||
|
||||
- const char *message = NULL;
|
||||
+ char message[JOURNALD_MAX_FIELD_SIZE + 1];
|
||||
|
||||
- if (abrt_journal_get_string_field(abrt_journal_watch_get_journal(watch), "MESSAGE", &message) < 0)
|
||||
+ if (abrt_journal_get_string_field(abrt_journal_watch_get_journal(watch), "MESSAGE", (char *)message) == NULL)
|
||||
error_msg_and_die("Cannot read journal data.");
|
||||
|
||||
GList *cur = conf->strings;
|
||||
diff --git a/src/plugins/abrt-journal.h b/src/plugins/abrt-journal.h
|
||||
index 219cf60..d509d96 100644
|
||||
--- a/src/plugins/abrt-journal.h
|
||||
+++ b/src/plugins/abrt-journal.h
|
||||
@@ -40,11 +40,13 @@ int abrt_journal_get_field(abrt_journal_t *journal,
|
||||
const void **value,
|
||||
size_t *value_len);
|
||||
|
||||
-int abrt_journal_get_string_field(abrt_journal_t *journal,
|
||||
+/* Returns allocated memory if value is NULL; otherwise makes copy of journald
|
||||
+ * field to memory pointed by value arg. */
|
||||
+char *abrt_journal_get_string_field(abrt_journal_t *journal,
|
||||
const char *field,
|
||||
- const char **value);
|
||||
+ char *value);
|
||||
|
||||
-int abrt_journal_get_log_line(abrt_journal_t *journal, const char **line);
|
||||
+char *abrt_journal_get_log_line(abrt_journal_t *journal);
|
||||
|
||||
int abrt_journal_get_cursor(abrt_journal_t *journal, char **cursor);
|
||||
|
||||
--
|
||||
2.1.0
|
||||
|
||||
|
|
@ -1,102 +0,0 @@
|
|||
From 105aab5e018efa7d68e06ff648d0dc9e434e20d2 Mon Sep 17 00:00:00 2001
|
||||
From: Jakub Filak <jfilak@redhat.com>
|
||||
Date: Wed, 15 Oct 2014 13:33:51 +0200
|
||||
Subject: [PATCH] make ABRT quieter
|
||||
|
||||
Related: #1048384, #1147664
|
||||
|
||||
Signed-off-by: Jakub Filak <jfilak@redhat.com>
|
||||
---
|
||||
src/daemon/abrtd.c | 7 +++++--
|
||||
src/hooks/abrt-hook-ccpp.c | 10 +++++-----
|
||||
src/plugins/abrt-action-generate-core-backtrace.c | 2 +-
|
||||
3 files changed, 11 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/src/daemon/abrtd.c b/src/daemon/abrtd.c
|
||||
index b8426dd..cce49eb 100644
|
||||
--- a/src/daemon/abrtd.c
|
||||
+++ b/src/daemon/abrtd.c
|
||||
@@ -626,7 +626,7 @@ int main(int argc, char** argv)
|
||||
s_signal_pipe_write = s_signal_pipe[1];
|
||||
|
||||
/* Enter the event loop */
|
||||
- log("Init complete, entering main loop");
|
||||
+ log_debug("Init complete, entering main loop");
|
||||
run_main_loop(pMainloop);
|
||||
|
||||
cleanup:
|
||||
@@ -652,7 +652,10 @@ int main(int argc, char** argv)
|
||||
/* Exiting */
|
||||
if (s_sig_caught && s_sig_caught != SIGALRM && s_sig_caught != SIGCHLD)
|
||||
{
|
||||
- error_msg("Got signal %d, exiting", s_sig_caught);
|
||||
+ /* We use TERM to stop abrtd, so not printing out error message. */
|
||||
+ if (s_sig_caught != SIGTERM)
|
||||
+ error_msg("Got signal %d, exiting", s_sig_caught);
|
||||
+
|
||||
signal(s_sig_caught, SIG_DFL);
|
||||
raise(s_sig_caught);
|
||||
}
|
||||
diff --git a/src/hooks/abrt-hook-ccpp.c b/src/hooks/abrt-hook-ccpp.c
|
||||
index 8e141d4..6f471e9 100644
|
||||
--- a/src/hooks/abrt-hook-ccpp.c
|
||||
+++ b/src/hooks/abrt-hook-ccpp.c
|
||||
@@ -184,13 +184,13 @@ static char* get_executable(pid_t pid, int *fd_p)
|
||||
if (deleted > executable && strcmp(deleted, " (deleted)") == 0)
|
||||
{
|
||||
*deleted = '\0';
|
||||
- log("File '%s' seems to be deleted", executable);
|
||||
+ log_info("File '%s' seems to be deleted", executable);
|
||||
}
|
||||
/* find and cut off prelink suffixes from the path */
|
||||
char *prelink = executable + strlen(executable) - strlen(".#prelink#.XXXXXX");
|
||||
if (prelink > executable && strncmp(prelink, ".#prelink#.", strlen(".#prelink#.")) == 0)
|
||||
{
|
||||
- log("File '%s' seems to be a prelink temporary file", executable);
|
||||
+ log_info("File '%s' seems to be a prelink temporary file", executable);
|
||||
*prelink = '\0';
|
||||
}
|
||||
return executable;
|
||||
@@ -649,7 +649,7 @@ int main(int argc, char** argv)
|
||||
* but it does not log file name */
|
||||
error_msg_and_die("Error saving '%s'", path);
|
||||
}
|
||||
- log("Saved core dump of pid %lu (%s) to %s (%llu bytes)", (long)pid, executable, path, (long long)core_size);
|
||||
+ log_notice("Saved core dump of pid %lu (%s) to %s (%llu bytes)", (long)pid, executable, path, (long long)core_size);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -836,7 +836,7 @@ int main(int argc, char** argv)
|
||||
strcpy(path, newpath);
|
||||
free(newpath);
|
||||
|
||||
- log("Saved core dump of pid %lu (%s) to %s (%llu bytes)", (long)pid, executable, path, (long long)core_size);
|
||||
+ log_notice("Saved core dump of pid %lu (%s) to %s (%llu bytes)", (long)pid, executable, path, (long long)core_size);
|
||||
|
||||
notify_new_path(path);
|
||||
|
||||
@@ -874,7 +874,7 @@ int main(int argc, char** argv)
|
||||
unlink(core_basename);
|
||||
return 1;
|
||||
}
|
||||
- log("Saved core dump of pid %lu to %s (%llu bytes)", (long)pid, full_core_basename, (long long)core_size);
|
||||
+ log_notice("Saved core dump of pid %lu to %s (%llu bytes)", (long)pid, full_core_basename, (long long)core_size);
|
||||
}
|
||||
|
||||
return 0;
|
||||
diff --git a/src/plugins/abrt-action-generate-core-backtrace.c b/src/plugins/abrt-action-generate-core-backtrace.c
|
||||
index a992a5b..791af83 100644
|
||||
--- a/src/plugins/abrt-action-generate-core-backtrace.c
|
||||
+++ b/src/plugins/abrt-action-generate-core-backtrace.c
|
||||
@@ -61,7 +61,7 @@ int main(int argc, char **argv)
|
||||
sr_debug_parser = true;
|
||||
|
||||
/* Let user know what's going on */
|
||||
- log(_("Generating core_backtrace"));
|
||||
+ log_notice(_("Generating core_backtrace"));
|
||||
|
||||
char *error_message = NULL;
|
||||
bool success;
|
||||
--
|
||||
2.1.0
|
||||
|
||||
|
|
@ -1,128 +0,0 @@
|
|||
From 0a0f129a6622fd7099de8cec6a1d95a4189a91d1 Mon Sep 17 00:00:00 2001
|
||||
From: Jakub Filak <jfilak@redhat.com>
|
||||
Date: Tue, 21 Oct 2014 14:57:10 +0200
|
||||
Subject: [PATCH] applet: ensure writable dump directory before reporting
|
||||
|
||||
Related to rhbz#1084027
|
||||
|
||||
Signed-off-by: Jakub Filak <jfilak@redhat.com>
|
||||
---
|
||||
src/applet/applet.c | 62 ++++++++++++++++++++++++++++++++++-------------------
|
||||
1 file changed, 40 insertions(+), 22 deletions(-)
|
||||
|
||||
diff --git a/src/applet/applet.c b/src/applet/applet.c
|
||||
index 90c5b0d..644da60 100644
|
||||
--- a/src/applet/applet.c
|
||||
+++ b/src/applet/applet.c
|
||||
@@ -307,6 +307,7 @@ typedef struct problem_info {
|
||||
bool incomplete;
|
||||
bool reported;
|
||||
bool was_announced;
|
||||
+ bool is_writable;
|
||||
} problem_info_t;
|
||||
|
||||
static void push_to_deferred_queue(problem_info_t *pi)
|
||||
@@ -324,6 +325,36 @@ static void problem_info_set_dir(problem_info_t *pi, const char *dir)
|
||||
problem_data_add_text_noteditable(pi->problem_data, CD_DUMPDIR, dir);
|
||||
}
|
||||
|
||||
+static bool problem_info_ensure_writable(problem_info_t *pi)
|
||||
+{
|
||||
+ if (pi->is_writable)
|
||||
+ return true;
|
||||
+
|
||||
+ /* chown the directory in any case, because kernel oopses are not foreign */
|
||||
+ /* but their dump directories are not writable without chowning them or */
|
||||
+ /* stealing them. The stealing is deprecated as it breaks the local */
|
||||
+ /* duplicate search and root cannot see them */
|
||||
+ const int res = chown_dir_over_dbus(problem_info_get_dir(pi));
|
||||
+ if (pi->foreign && res != 0)
|
||||
+ {
|
||||
+ error_msg(_("Can't take ownership of '%s'"), problem_info_get_dir(pi));
|
||||
+ return false;
|
||||
+ }
|
||||
+ pi->foreign = false;
|
||||
+
|
||||
+ struct dump_dir *dd = open_directory_for_writing(problem_info_get_dir(pi), /* don't ask */ NULL);
|
||||
+ if (!dd)
|
||||
+ {
|
||||
+ error_msg(_("Can't open directory for writing '%s'"), problem_info_get_dir(pi));
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ problem_info_set_dir(pi, dd->dd_dirname);
|
||||
+ pi->is_writable = true;
|
||||
+ dd_close(dd);
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
static problem_info_t *problem_info_new(const char *dir)
|
||||
{
|
||||
problem_info_t *pi = xzalloc(sizeof(*pi));
|
||||
@@ -610,8 +641,13 @@ static pid_t spawn_event_handler_child(const char *dump_dir_name, const char *ev
|
||||
return child;
|
||||
}
|
||||
|
||||
-static void run_report_from_applet(const char *dirname)
|
||||
+static void run_report_from_applet(problem_info_t *pi)
|
||||
{
|
||||
+ if (!problem_info_ensure_writable(pi))
|
||||
+ return;
|
||||
+
|
||||
+ const char *dirname = problem_info_get_dir(pi);
|
||||
+
|
||||
fflush(NULL); /* paranoia */
|
||||
pid_t pid = fork();
|
||||
if (pid < 0)
|
||||
@@ -649,7 +685,7 @@ static void action_report(NotifyNotification *notification, gchar *action, gpoin
|
||||
{
|
||||
if (strcmp(A_REPORT_REPORT, action) == 0)
|
||||
{
|
||||
- run_report_from_applet(problem_info_get_dir(pi));
|
||||
+ run_report_from_applet(pi);
|
||||
problem_info_free(pi);
|
||||
}
|
||||
else
|
||||
@@ -1118,7 +1154,7 @@ static gboolean handle_event_output_cb(GIOChannel *gio, GIOCondition condition,
|
||||
if (pi->known || !(state->flags & REPORT_UNKNOWN_PROBLEM_IMMEDIATELY))
|
||||
notify_problem(pi);
|
||||
else
|
||||
- run_report_from_applet(problem_info_get_dir(pi));
|
||||
+ run_report_from_applet(pi);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1179,29 +1215,11 @@ static void export_event_configuration(const char *event_name)
|
||||
|
||||
static void run_event_async(problem_info_t *pi, const char *event_name, int flags)
|
||||
{
|
||||
- /* chown the directory in any case, because kernel oopses are not foreign */
|
||||
- /* but their dump directories are not writable without chowning them or */
|
||||
- /* stealing them. The stealing is deprecated as it breaks the local */
|
||||
- /* duplicate search and root cannot see them */
|
||||
- const int res = chown_dir_over_dbus(problem_info_get_dir(pi));
|
||||
- if (pi->foreign && res != 0)
|
||||
+ if (!problem_info_ensure_writable(pi))
|
||||
{
|
||||
- error_msg(_("Can't take ownership of '%s'"), problem_info_get_dir(pi));
|
||||
problem_info_free(pi);
|
||||
return;
|
||||
}
|
||||
- pi->foreign = false;
|
||||
-
|
||||
- struct dump_dir *dd = open_directory_for_writing(problem_info_get_dir(pi), /* don't ask */ NULL);
|
||||
- if (!dd)
|
||||
- {
|
||||
- error_msg(_("Can't open directory for writing '%s'"), problem_info_get_dir(pi));
|
||||
- problem_info_free(pi);
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- problem_info_set_dir(pi, dd->dd_dirname);
|
||||
- dd_close(dd);
|
||||
|
||||
export_event_configuration(event_name);
|
||||
|
||||
--
|
||||
2.1.0
|
||||
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
From 2fa193aba3cb1dd630faa65385a92e11d92806d1 Mon Sep 17 00:00:00 2001
|
||||
From: Jakub Filak <jfilak@redhat.com>
|
||||
Date: Tue, 26 Aug 2014 20:37:34 +0200
|
||||
Subject: [PATCH] a-a-s-p-d: add firefox on the package blacklist
|
||||
|
||||
And drop the path to plugins-container from the path blacklist because:
|
||||
- the path belongs to firefox package
|
||||
- the path is invalid, the correct path is:
|
||||
/usr/lib(64)/firefox/plugin-container
|
||||
|
||||
Resolves rhbz#1132018
|
||||
|
||||
Signed-off-by: Jakub Filak <jfilak@redhat.com>
|
||||
---
|
||||
src/daemon/abrt-action-save-package-data.conf | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/daemon/abrt-action-save-package-data.conf b/src/daemon/abrt-action-save-package-data.conf
|
||||
index 3d35bb6..cac3c7c 100644
|
||||
--- a/src/daemon/abrt-action-save-package-data.conf
|
||||
+++ b/src/daemon/abrt-action-save-package-data.conf
|
||||
@@ -7,7 +7,7 @@ OpenGPGCheck = yes
|
||||
|
||||
# Blacklisted packages
|
||||
#
|
||||
-BlackList = nspluginwrapper, valgrind, strace, mono-core
|
||||
+BlackList = nspluginwrapper, valgrind, strace, mono-core, firefox
|
||||
|
||||
# Process crashes in executables which do not belong to any package?
|
||||
#
|
||||
@@ -15,7 +15,7 @@ ProcessUnpackaged = no
|
||||
|
||||
# Blacklisted executable paths (shell patterns)
|
||||
#
|
||||
-BlackListedPaths = /usr/share/doc/*, */example*, /usr/bin/nspluginviewer, /usr/lib/xulrunner-*/plugin-container
|
||||
+BlackListedPaths = /usr/share/doc/*, */example*, /usr/bin/nspluginviewer
|
||||
|
||||
# interpreters names
|
||||
Interpreters = python2, python2.7, python, python3, python3.3, perl, perl5.16.2
|
||||
--
|
||||
2.1.0
|
||||
|
||||
|
|
@ -1,212 +0,0 @@
|
|||
From aa503cf6722fffa2dbf3d400a4e2bbeac2f78d65 Mon Sep 17 00:00:00 2001
|
||||
From: Jakub Filak <jfilak@redhat.com>
|
||||
Date: Thu, 23 Oct 2014 16:37:14 +0200
|
||||
Subject: [PATCH] a-a-g-machine-id: add systemd's machine id
|
||||
|
||||
The dmidecode based algorithm may not work on all architectures.
|
||||
|
||||
man machine-id
|
||||
|
||||
Related to rhbz#1140044
|
||||
|
||||
Signed-off-by: Jakub Filak <jfilak@redhat.com>
|
||||
---
|
||||
src/plugins/abrt-action-generate-machine-id | 165 ++++++++++++++++++++++++++--
|
||||
1 file changed, 153 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/src/plugins/abrt-action-generate-machine-id b/src/plugins/abrt-action-generate-machine-id
|
||||
index 0aea787..b2de822 100644
|
||||
--- a/src/plugins/abrt-action-generate-machine-id
|
||||
+++ b/src/plugins/abrt-action-generate-machine-id
|
||||
@@ -1,14 +1,47 @@
|
||||
#!/usr/bin/python
|
||||
+
|
||||
+## Copyright (C) 2014 ABRT team <abrt-devel-list@redhat.com>
|
||||
+## Copyright (C) 2014 Red Hat, Inc.
|
||||
+
|
||||
+## This program is free software; you can redistribute it and/or modify
|
||||
+## it under the terms of the GNU General Public License as published by
|
||||
+## the Free Software Foundation; either version 2 of the License, or
|
||||
+## (at your option) any later version.
|
||||
+
|
||||
+## This program is distributed in the hope that it will be useful,
|
||||
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+## GNU General Public License for more details.
|
||||
+
|
||||
+## You should have received a copy of the GNU General Public License
|
||||
+## along with this program; if not, write to the Free Software
|
||||
+## Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
|
||||
+
|
||||
+"""This module provides algorithms for generating Machine IDs.
|
||||
+"""
|
||||
+
|
||||
+import sys
|
||||
from argparse import ArgumentParser
|
||||
+import logging
|
||||
|
||||
-import dmidecode
|
||||
import hashlib
|
||||
|
||||
+def generate_machine_id_dmidecode():
|
||||
+ """Generate a machine_id based off dmidecode fields
|
||||
|
||||
-# Generate a machine_id based off dmidecode fields
|
||||
-def generate_machine_id():
|
||||
- dmixml = dmidecode.dmidecodeXML()
|
||||
+ The function generates the same result as sosreport-uploader
|
||||
+
|
||||
+ Returns a machine ID as string or throws RuntimeException
|
||||
+
|
||||
+ """
|
||||
|
||||
+ try:
|
||||
+ import dmidecode
|
||||
+ except ImportError as ex:
|
||||
+ raise RuntimeError("Could not import dmidecode module: {0}"
|
||||
+ .format(str(ex)))
|
||||
+
|
||||
+ dmixml = dmidecode.dmidecodeXML()
|
||||
# Fetch all DMI data into a libxml2.xmlDoc object
|
||||
dmixml.SetResultType(dmidecode.DMIXML_DOC)
|
||||
xmldoc = dmixml.QuerySection('all')
|
||||
@@ -38,20 +71,128 @@ def generate_machine_id():
|
||||
return machine_id.hexdigest()
|
||||
|
||||
|
||||
-if __name__ == "__main__":
|
||||
- CMDARGS = ArgumentParser(description = "Generate a machine_id based off dmidecode fields")
|
||||
- CMDARGS.add_argument('-o', '--output', type=str, help='Output file')
|
||||
+def generate_machine_id_systemd():
|
||||
+ """Generate a machine_id equals to a one generated by systemd
|
||||
+
|
||||
+ This function returns contents of /etc/machine-id
|
||||
+
|
||||
+ Returns a machine ID as string or throws RuntimeException.
|
||||
+
|
||||
+ """
|
||||
+
|
||||
+ try:
|
||||
+ with open('/etc/machine-id', 'r') as midf:
|
||||
+ return "".join((l.strip() for l in midf))
|
||||
+ except IOError as ex:
|
||||
+ raise RuntimeError("Could not use systemd's machine-id: {0}"
|
||||
+ .format(str(ex)))
|
||||
+
|
||||
+
|
||||
+GENERATORS = { 'sosreport_uploader-dmidecode' : generate_machine_id_dmidecode,
|
||||
+ 'systemd' : generate_machine_id_systemd }
|
||||
+
|
||||
+
|
||||
+def generate_machine_id(generators):
|
||||
+ """Generates all requested machine id with all required generators
|
||||
+
|
||||
+ Keyword arguments:
|
||||
+ generators -- a list of generator names
|
||||
+
|
||||
+ Returns a dictionary where keys are generators and associated values are
|
||||
+ products of those generators.
|
||||
+
|
||||
+ """
|
||||
+
|
||||
+ ids = {}
|
||||
+ workers = GENERATORS
|
||||
+ for sd in generators:
|
||||
+ try:
|
||||
+ ids[sd] = workers[sd]()
|
||||
+ except RuntimeError as ex:
|
||||
+ logging.error("Machine-ID generator '{0}' failed: {1}"
|
||||
+ .format(sd, ex.message))
|
||||
+
|
||||
+ return ids
|
||||
+
|
||||
+
|
||||
+def print_result(ids, outfile, prefixed):
|
||||
+ """Writes a dictionary of machine ids to a file
|
||||
+
|
||||
+ Each dictionary entry is written on a single line and the last line does
|
||||
+ not have new line character. The new line character is omitted as it is a
|
||||
+ common approach in ABRT.
|
||||
+
|
||||
+ Keyword arguments:
|
||||
+ ids -- a dictionary [generator name: machine ids]
|
||||
+ outfile -- output file
|
||||
+ prefixed -- use 'generator name=' prefix or not
|
||||
+ """
|
||||
+
|
||||
+ fmt = '{0}={1}' if prefixed else '{1}'
|
||||
+
|
||||
+ items_iter = ids.iteritems()
|
||||
+ try:
|
||||
+ sd, mid = items_iter.next()
|
||||
+ outfile.write(fmt.format(sd, mid))
|
||||
+ except StopIteration:
|
||||
+ return
|
||||
+
|
||||
+ fmt = '\n' + fmt
|
||||
+ for sd, mid in items_iter:
|
||||
+ outfile.write(fmt.format(sd,mid))
|
||||
+
|
||||
+
|
||||
+def print_generators(outfile=None):
|
||||
+ """Prints requested generators
|
||||
+
|
||||
+ Keyword arguments:
|
||||
+ outfile -- output file (default: sys.stdout)
|
||||
+
|
||||
+ """
|
||||
+ if outfile is None:
|
||||
+ outfile = sys.stdout
|
||||
+
|
||||
+ for sd in GENERATORS.iterkeys():
|
||||
+ outfile.write("{0}\n".format(sd))
|
||||
+
|
||||
+
|
||||
+if __name__ == '__main__':
|
||||
+ CMDARGS = ArgumentParser(description = "Generate a machine_id")
|
||||
+ CMDARGS.add_argument('-o', '--output', type=str,
|
||||
+ help="Output file")
|
||||
+ CMDARGS.add_argument('-g', '--generators', nargs='+', type=str,
|
||||
+ help="Use given generators only")
|
||||
+ CMDARGS.add_argument('-l', '--list-generators', action='store_true',
|
||||
+ default=False, help="Print out a list of usable generators")
|
||||
+ CMDARGS.add_argument('-n', '--noprefix', action='store_true',
|
||||
+ default=False, help="Do not use generator name as prefix for IDs")
|
||||
|
||||
OPTIONS = CMDARGS.parse_args()
|
||||
ARGS = vars(OPTIONS)
|
||||
|
||||
- machineid = generate_machine_id()
|
||||
+ logging.basicConfig(format='%(message)s')
|
||||
+
|
||||
+ if ARGS['list_generators']:
|
||||
+ print_generators()
|
||||
+ sys.exit(0)
|
||||
+
|
||||
+ requested_generators = None
|
||||
+ if ARGS['generators']:
|
||||
+ requested_generators = ARGS['generators']
|
||||
+ else:
|
||||
+ requested_generators = GENERATORS.keys()
|
||||
+
|
||||
+ machineids = generate_machine_id(requested_generators)
|
||||
|
||||
if ARGS['output']:
|
||||
try:
|
||||
- with open(ARGS['output'], 'w') as outfile:
|
||||
- outfile.write(machineid)
|
||||
+ with open(ARGS['output'], 'w') as fout:
|
||||
+ print_result(machineids, fout, not ARGS['noprefix'])
|
||||
except IOError as ex:
|
||||
- print ex
|
||||
+ logging.error("Could not open output file: {0}".format(str(ex)))
|
||||
+ sys.exit(1)
|
||||
else:
|
||||
- print machineid
|
||||
+ print_result(machineids, sys.stdout, not ARGS['noprefix'])
|
||||
+ sys.stdout.write('\n')
|
||||
+
|
||||
+ sys.exit(len(requested_generators) - len(machineids.keys()))
|
||||
--
|
||||
2.1.0
|
||||
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
From 35e52c1820a84da2623a7cf4c71baf9fa6f2e12e Mon Sep 17 00:00:00 2001
|
||||
From: Jakub Filak <jfilak@redhat.com>
|
||||
Date: Fri, 24 Oct 2014 15:50:02 +0200
|
||||
Subject: [PATCH] a-a-g-machine-id: suppress its failures in abrt_event.conf
|
||||
|
||||
If an event script exits with a non-zero code, abrtd deletes entire dump
|
||||
directory.
|
||||
|
||||
Failures of a-a-g-machine-id must not lead to the deletion of a dump
|
||||
directory.
|
||||
|
||||
Related to rhbz#1140044
|
||||
|
||||
Signed-off-by: Jakub Filak <jfilak@redhat.com>
|
||||
---
|
||||
src/daemon/abrt_event.conf | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/daemon/abrt_event.conf b/src/daemon/abrt_event.conf
|
||||
index 4597627..3322a81 100644
|
||||
--- a/src/daemon/abrt_event.conf
|
||||
+++ b/src/daemon/abrt_event.conf
|
||||
@@ -92,7 +92,7 @@ EVENT=post-create runlevel=
|
||||
|
||||
# Example: if you want to include *machineid* in dump directories:
|
||||
#EVENT=post-create
|
||||
- /usr/libexec/abrt-action-generate-machine-id -o $DUMP_DIR/machineid
|
||||
+ /usr/libexec/abrt-action-generate-machine-id -o $DUMP_DIR/machineid || :
|
||||
|
||||
# Example:
|
||||
# if you want to upload data immediately at the moment of a crash to
|
||||
--
|
||||
2.1.0
|
||||
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
From 301fe7c65ba4431833ad8a9df7a4366eda889682 Mon Sep 17 00:00:00 2001
|
||||
From: Jakub Filak <jfilak@redhat.com>
|
||||
Date: Fri, 31 Oct 2014 23:00:10 +0100
|
||||
Subject: [PATCH] a-a-g-machine-id: omit trailing new-line for one-liners only
|
||||
|
||||
Signed-off-by: Jakub Filak <jfilak@redhat.com>
|
||||
---
|
||||
src/plugins/abrt-action-generate-machine-id | 21 +++++++++------------
|
||||
1 file changed, 9 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/src/plugins/abrt-action-generate-machine-id b/src/plugins/abrt-action-generate-machine-id
|
||||
index b2de822..6f43258 100644
|
||||
--- a/src/plugins/abrt-action-generate-machine-id
|
||||
+++ b/src/plugins/abrt-action-generate-machine-id
|
||||
@@ -118,9 +118,9 @@ def generate_machine_id(generators):
|
||||
def print_result(ids, outfile, prefixed):
|
||||
"""Writes a dictionary of machine ids to a file
|
||||
|
||||
- Each dictionary entry is written on a single line and the last line does
|
||||
- not have new line character. The new line character is omitted as it is a
|
||||
- common approach in ABRT.
|
||||
+ Each dictionary entry is written on a single line. The function does not
|
||||
+ print trailing new-line if the dictionary contains only one item as it is
|
||||
+ common format of one-liners placed in a dump directory.
|
||||
|
||||
Keyword arguments:
|
||||
ids -- a dictionary [generator name: machine ids]
|
||||
@@ -130,15 +130,10 @@ def print_result(ids, outfile, prefixed):
|
||||
|
||||
fmt = '{0}={1}' if prefixed else '{1}'
|
||||
|
||||
- items_iter = ids.iteritems()
|
||||
- try:
|
||||
- sd, mid = items_iter.next()
|
||||
- outfile.write(fmt.format(sd, mid))
|
||||
- except StopIteration:
|
||||
- return
|
||||
+ if len(ids) > 1:
|
||||
+ fmt += '\n'
|
||||
|
||||
- fmt = '\n' + fmt
|
||||
- for sd, mid in items_iter:
|
||||
+ for sd, mid in ids.iteritems():
|
||||
outfile.write(fmt.format(sd,mid))
|
||||
|
||||
|
||||
@@ -193,6 +188,8 @@ if __name__ == '__main__':
|
||||
sys.exit(1)
|
||||
else:
|
||||
print_result(machineids, sys.stdout, not ARGS['noprefix'])
|
||||
- sys.stdout.write('\n')
|
||||
+ # print_results() omits new-line for one-liners
|
||||
+ if len(machineids) == 1:
|
||||
+ sys.stdout.write('\n')
|
||||
|
||||
sys.exit(len(requested_generators) - len(machineids.keys()))
|
||||
--
|
||||
2.1.0
|
||||
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
From 77fd4057c1364edc7a1815b73bb980229c8b9d65 Mon Sep 17 00:00:00 2001
|
||||
From: Jakub Filak <jfilak@redhat.com>
|
||||
Date: Fri, 31 Oct 2014 23:01:07 +0100
|
||||
Subject: [PATCH] a-a-g-machine-id: do not print any error from the event
|
||||
handler
|
||||
|
||||
It is expected that dmidecode-less systems will print an error message
|
||||
related to the fact that dmidecode doesn't work, hence forwarding of
|
||||
STDOUT and STDERR to 'event_log' file.
|
||||
|
||||
Signed-off-by: Jakub Filak <jfilak@redhat.com>
|
||||
---
|
||||
src/daemon/abrt_event.conf | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/daemon/abrt_event.conf b/src/daemon/abrt_event.conf
|
||||
index 3322a81..feb02a3 100644
|
||||
--- a/src/daemon/abrt_event.conf
|
||||
+++ b/src/daemon/abrt_event.conf
|
||||
@@ -92,7 +92,7 @@ EVENT=post-create runlevel=
|
||||
|
||||
# Example: if you want to include *machineid* in dump directories:
|
||||
#EVENT=post-create
|
||||
- /usr/libexec/abrt-action-generate-machine-id -o $DUMP_DIR/machineid || :
|
||||
+ /usr/libexec/abrt-action-generate-machine-id -o $DUMP_DIR/machineid >>event_log 2>&1 || :
|
||||
|
||||
# Example:
|
||||
# if you want to upload data immediately at the moment of a crash to
|
||||
--
|
||||
2.1.0
|
||||
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
From f5e65811d450c9117fa036bd82d161e5f936d5a0 Mon Sep 17 00:00:00 2001
|
||||
From: Jakub Filak <jfilak@redhat.com>
|
||||
Date: Fri, 31 Oct 2014 23:02:57 +0100
|
||||
Subject: [PATCH] sos: use all valuable plugins
|
||||
|
||||
This commit mirrors the state of rhel7
|
||||
|
||||
Signed-off-by: Jakub Filak <jfilak@redhat.com>
|
||||
---
|
||||
src/daemon/abrt_event.conf | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/daemon/abrt_event.conf b/src/daemon/abrt_event.conf
|
||||
index feb02a3..1153cc0 100644
|
||||
--- a/src/daemon/abrt_event.conf
|
||||
+++ b/src/daemon/abrt_event.conf
|
||||
@@ -69,11 +69,13 @@ EVENT=post-create runlevel=
|
||||
# if you would rather perform this collection later):
|
||||
#EVENT=post-create
|
||||
nice sosreport --tmp-dir "$DUMP_DIR" --batch \
|
||||
- --only=anaconda --only=bootloader --only=devicemapper \
|
||||
+ --only=anaconda --only=boot --only=devicemapper \
|
||||
--only=filesys --only=hardware --only=kernel --only=libraries \
|
||||
--only=memory --only=networking --only=nfsserver --only=pam \
|
||||
--only=process --only=rpm -k rpm.rpmva=off --only=ssh \
|
||||
--only=startup --only=yum --only=general --only=x11 \
|
||||
+ --only=cups --only=logs --only=grub2 --only=cron --only=pci \
|
||||
+ --only=auditd --only=selinux --only=lvm2 --only=sar \
|
||||
>sosreport.log 2>&1 \
|
||||
&& {
|
||||
rm sosreport.log
|
||||
--
|
||||
2.1.0
|
||||
|
||||
|
|
@ -1,58 +0,0 @@
|
|||
From 1fc0e782d56af4df3f21560929176a09103923ad Mon Sep 17 00:00:00 2001
|
||||
From: Martin Milata <mmilata@redhat.com>
|
||||
Date: Tue, 4 Nov 2014 16:51:24 +0100
|
||||
Subject: [PATCH] koops: improve 'reason' text for page faults
|
||||
|
||||
Current : 'general protection fault: 4000 [#1] SMP'
|
||||
Improved: 'general protection fault in i915_gem_do_execbuffer'
|
||||
|
||||
Resolves rhbz#998887.
|
||||
|
||||
Signed-off-by: Martin Milata <mmilata@redhat.com>
|
||||
---
|
||||
src/plugins/oops-utils.c | 22 ++++++++++++++++++++--
|
||||
1 file changed, 20 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/plugins/oops-utils.c b/src/plugins/oops-utils.c
|
||||
index 9e2355e..ea6c639 100644
|
||||
--- a/src/plugins/oops-utils.c
|
||||
+++ b/src/plugins/oops-utils.c
|
||||
@@ -12,6 +12,8 @@
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
+#include <satyr/stacktrace.h>
|
||||
+
|
||||
#include "oops-utils.h"
|
||||
#include "libabrt.h"
|
||||
|
||||
@@ -242,8 +244,24 @@ void abrt_oops_save_data_in_dump_dir(struct dump_dir *dd, char *oops, const char
|
||||
|
||||
// TODO: add "Kernel oops: " prefix, so that all oopses have recognizable FILENAME_REASON?
|
||||
// kernel oops 1st line may look quite puzzling otherwise...
|
||||
- strchrnul(second_line, '\n')[0] = '\0';
|
||||
- dd_save_text(dd, FILENAME_REASON, second_line);
|
||||
+ char *reason_pretty = NULL;
|
||||
+ char *error = NULL;
|
||||
+ struct sr_stacktrace *trace = sr_stacktrace_parse(SR_REPORT_KERNELOOPS, second_line, &error);
|
||||
+ if (trace)
|
||||
+ {
|
||||
+ reason_pretty = sr_stacktrace_get_reason(trace);
|
||||
+ sr_stacktrace_free(trace);
|
||||
+ }
|
||||
+ else
|
||||
+ free(error);
|
||||
+
|
||||
+ if (reason_pretty)
|
||||
+ {
|
||||
+ dd_save_text(dd, FILENAME_REASON, reason_pretty);
|
||||
+ free(reason_pretty);
|
||||
+ }
|
||||
+ else
|
||||
+ dd_save_text(dd, FILENAME_REASON, second_line);
|
||||
}
|
||||
|
||||
int abrt_oops_signaled_sleep(int seconds)
|
||||
--
|
||||
2.1.0
|
||||
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
From 1ef034096efe367af85f568bc982af969124003b Mon Sep 17 00:00:00 2001
|
||||
From: rpm-build <rpm-build>
|
||||
Date: Mon, 10 Feb 2014 09:39:07 +0100
|
||||
Subject: [PATCH] disable OpenGPGCheck in Fedora Rawhide
|
||||
|
||||
Packages in Fedora Rawhide are not signed.
|
||||
---
|
||||
src/daemon/abrt-action-save-package-data.conf | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/daemon/abrt-action-save-package-data.conf b/src/daemon/abrt-action-save-package-data.conf
|
||||
index 3d35bb6..e3f724a 100644
|
||||
--- a/src/daemon/abrt-action-save-package-data.conf
|
||||
+++ b/src/daemon/abrt-action-save-package-data.conf
|
||||
@@ -3,7 +3,7 @@
|
||||
# the list of public keys used to check the signature is
|
||||
# in the file gpg_keys
|
||||
#
|
||||
-OpenGPGCheck = yes
|
||||
+OpenGPGCheck = no
|
||||
|
||||
# Blacklisted packages
|
||||
#
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
15
gating.yaml
Normal file
15
gating.yaml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
--- !Policy
|
||||
product_versions:
|
||||
- fedora-*
|
||||
decision_context: bodhi_update_push_testing
|
||||
subject_type: koji_build
|
||||
rules:
|
||||
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}
|
||||
|
||||
--- !Policy
|
||||
product_versions:
|
||||
- fedora-*
|
||||
decision_context: bodhi_update_push_stable
|
||||
subject_type: koji_build
|
||||
rules:
|
||||
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}
|
||||
2
sources
2
sources
|
|
@ -1 +1 @@
|
|||
faa666301f4512723486300212cd7e58 abrt-2.3.0.tar.gz
|
||||
SHA512 (abrt-2.17.8.tar.gz) = 90b74229412e0186bfa109ee940a60c9f3c0f7ce8c1216acad6f05619a1bb591e7f0bae87363143a05034312c9f14fe5ace341b84f680780ceb93a1e624705b3
|
||||
|
|
|
|||
10
tests/smoke.fmf
Normal file
10
tests/smoke.fmf
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
summary: Basic smoke test for abrt
|
||||
prepare:
|
||||
how: install
|
||||
# Do not attempt to install conflicting subpackages.
|
||||
exclude:
|
||||
- abrt-atomic
|
||||
- abrt-java-connector-container
|
||||
- python3-abrt-container-addon
|
||||
execute:
|
||||
script: abrt-action-notify --help
|
||||
Loading…
Add table
Add a link
Reference in a new issue