[SATYR PATCH 1/5] libunwind: make adding wrong backing segment non-fatal
by Martin Milata
Signed-off-by: Martin Milata <mmilata(a)redhat.com>
---
lib/core_unwind_libunwind.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/lib/core_unwind_libunwind.c b/lib/core_unwind_libunwind.c
index 9f295b1..f9b346e 100644
--- a/lib/core_unwind_libunwind.c
+++ b/lib/core_unwind_libunwind.c
@@ -494,9 +494,14 @@ sr_parse_coredump(const char *core_file,
{
if (_UCD_add_backing_file_at_vaddr(ui, s->start, s->filename) < 0)
{
- set_error("Can't add backing file '%s' at addr 0x%jx",
- s->filename, (uintmax_t)s->start);
- goto fail_destroy_ui;
+ /* Sometimes produces:
+ * >_UCD_add_backing_file_at_segment:
+ * Error reading from '/usr/lib/modules/3.6.9-2.fc17.x86_64/vdso/vdso.so'
+ * Ignore errors for now & fail later.
+ */
+ warn("Can't add backing file '%s' at addr 0x%jx", s->filename,
+ (uintmax_t)s->start);
+ /* goto fail_destroy_ui; */
}
}
--
1.7.11.7
10 years, 9 months
[LIBREPORT PATCH 1/7] spec: install only documentation files
by Jakub Filak
libreport-devel's api/doc/ directory contains Makefile and co
Related to rhbz#881305
Signed-off-by: Jakub Filak <jfilak(a)redhat.com>
---
libreport.spec.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libreport.spec.in b/libreport.spec.in
index 087b0f0..6b93838 100644
--- a/libreport.spec.in
+++ b/libreport.spec.in
@@ -375,7 +375,7 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%files devel
%defattr(-,root,root,-)
# Public api headers:
-%doc apidoc/html/*
+%doc apidoc/html/*.{html,png,css,js}
%{_includedir}/libreport/libreport_types.h
%{_includedir}/libreport/client.h
%{_includedir}/libreport/dump_dir.h
--
1.8.3.1
10 years, 9 months
[GNOME-ABRT PATCH] Skip inotify events for sub folders in dump location watcher
by Jakub Filak
Closes rhbz#975069
Signed-off-by: Jakub Filak <jfilak(a)redhat.com>
---
src/gnome_abrt/directory_problems.py | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/gnome_abrt/directory_problems.py b/src/gnome_abrt/directory_problems.py
index 56bbbe2..29a7ed0 100644
--- a/src/gnome_abrt/directory_problems.py
+++ b/src/gnome_abrt/directory_problems.py
@@ -131,12 +131,17 @@ class INOTIFYSourceHandler(ProcessEvent):
#pylint: disable=E1101
MASK = pyinotify.IN_MOVED_TO
- def __init__(self, source):
+ def __init__(self, source, directory):
super(INOTIFYSourceHandler, self).__init__()
self.source = source
+ self.directory = directory
#pylint: disable=C0103
def process_IN_MOVED_TO(self, event):
+ if self.directory != event.path:
+ logging.debug("Something has been moved to a child directory")
+ return
+
try:
self.source.process_new_problem_id(
os.path.join(event.path, event.name))
@@ -160,7 +165,7 @@ class INOTIFYWatcher:
self._wm = WatchManager()
try:
- ihndlr = INOTIFYSourceHandler(self._source)
+ ihndlr = INOTIFYSourceHandler(self._source, self._directory)
self._gsource = INOTIFYGlibSource(self._wm,
self._directory, ihndlr)
except OSError as ex:
--
1.8.3.1
10 years, 9 months
[ABRT PATCH] testsuite: recognize uReport2
by Martin Milata
Changes in ureport validator were backported from faf master, including
the support for uReport version 2.
Signed-off-by: Martin Milata <mmilata(a)redhat.com>
---
tests/runtests/ureport/ureport-valid.py | 188 +++++++++++++++++++++++++++++++-
1 file changed, 186 insertions(+), 2 deletions(-)
diff --git a/tests/runtests/ureport/ureport-valid.py b/tests/runtests/ureport/ureport-valid.py
index 7eaba05..d039121 100755
--- a/tests/runtests/ureport/ureport-valid.py
+++ b/tests/runtests/ureport/ureport-valid.py
@@ -9,13 +9,15 @@ import sys
ABRT_VERSION_PARSER = re.compile("^([0-9]+)\.([0-9]+)\.([0-9]+)(\..*)?$")
RE_ARCH = re.compile("^[0-9a-zA-Z_]+$")
-RE_EXEC = re.compile("^[0-9a-zA-Z/_\.\-\+]+$")
+RE_EXEC = re.compile("^[0-9a-zA-Z<>/_\.\-\+]+$")
RE_FUNCHASH = re.compile("^[a-zA-Z0-9\;\_\:\,\?]+$")
RE_HEX = re.compile("^(0[xX])?[0-9a-fA-F]+$")
RE_NONEMPTY = re.compile("^.+$")
RE_PACKAGE = re.compile("^[0-9a-zA-Z_\.\+\-~]+$")
RE_PHRASE = re.compile("^[0-9a-zA-Z_<>:\*\+=~@\?\!\ &(),\/\|\`\'\^\-\.\[\]\$\#]+$")
RE_PROJNAME = re.compile("^[0-9a-zA-Z \+\-\)\(\._~]+$")
+# 17, 12.2, 6.4, 7.0 Alpha3, 6.4 Beta, Rawhide, Tumbleweed
+RE_OSVERSION = re.compile("^[0-9a-zA-Z]+(\.[0-9]+)?( (Alpha|Beta)[0-9]*)?$")
RE_SEPOL = re.compile("^[a-zA-Z0-9_\.\-]+(:[a-zA-Z0-9_\.\-]+){3,4}$")
RE_TAINT = re.compile("^[A-Z ]+$")
@@ -68,6 +70,11 @@ PROC_LIMITS_CHECKER = {
}
+OS_CHECKER = {
+ "name": { "mand": True, "type": basestring, "re": RE_PROJNAME, "maxlen": 255 },
+ "version": { "mand": True, "type": basestring, "re": RE_OSVERSION, "maxlen": 255 }
+}
+
OS_STATE_CHECKER = {
"suspend": { "mand": True, "type": basestring, "re": re.compile("^(yes|no)$", re.IGNORECASE) },
"boot": { "mand": True, "type": basestring, "re": re.compile("^(yes|no)$", re.IGNORECASE) },
@@ -86,7 +93,7 @@ UREPORT_CHECKER = {
"installed_package": { "mand": True, "type": dict, "checker": PACKAGE_CHECKER },
"running_package": { "mand": False, "type": dict, "checker": PACKAGE_CHECKER },
"related_packages": { "mand": True, "type": list, "checker": RELATED_PACKAGES_CHECKER },
- "os": { "mand": True, "type": dict, "checker": NV_CHECKER },
+ "os": { "mand": True, "type": dict, "checker": OS_CHECKER },
"architecture": { "mand": True, "type": basestring, "re": RE_ARCH, "maxlen": 255 },
"reporter": { "mand": True, "type": dict, "checker": NV_CHECKER },
"crash_thread": { "mand": True, "type": int },
@@ -107,7 +114,184 @@ ATTACHMENT_CHECKER = {
"data": { "mand": True, "type": basestring, "re": RE_PHRASE, "maxlen": 1024 },
}
+def ureport2to1(ureport2):
+ if "ureport_version" not in ureport2 or ureport2["ureport_version"] != 2:
+ raise ValueError, "uReport2 is required"
+
+ ureport1 = { "ureport_version": 1, }
+
+ if "reporter" in ureport2:
+ reporter = ureport2["reporter"]
+
+ ureport1["reporter"] = {}
+ if "name" in reporter:
+ ureport1["reporter"]["name"] = reporter["name"]
+
+ if "version" in reporter:
+ ureport1["reporter"]["version"] = reporter["version"]
+
+ if "os" in ureport2:
+ opsys = ureport2["os"]
+
+ ureport1["os"] = {}
+ if "name" in opsys:
+ ureport1["os"]["name"] = opsys["name"].capitalize()
+
+ if "version" in opsys:
+ ureport1["os"]["version"] = opsys["version"]
+
+ if "architecture" in opsys:
+ ureport1["architecture"] = opsys["architecture"]
+
+ if "packages" in ureport2:
+ ureport1["related_packages"] = []
+
+ for package in ureport2["packages"]:
+ pkg1 = {}
+ if "name" in package:
+ pkg1["name"] = package["name"]
+
+ if "epoch" in package:
+ pkg1["epoch"] = package["epoch"]
+
+ if "version" in package:
+ pkg1["version"] = package["version"]
+
+ if "release" in package:
+ pkg1["release"] = package["release"]
+
+ if "architecture" in package:
+ pkg1["architecture"] = package["architecture"]
+
+ if ("package_role" in package and
+ package["package_role"] == "affected"):
+ ureport1["installed_package"] = pkg1
+ else:
+ ureport1["related_packages"].append({"installed_package": pkg1})
+
+ if "problem" in ureport2:
+ prob = ureport2["problem"]
+ if "type" in prob:
+ if prob["type"].lower() == "core":
+ ureport1["type"] = "userspace"
+ else:
+ ureport1["type"] = prob["type"]
+
+ if "component" in prob:
+ ureport1["component"] = prob["component"]
+
+ if "executable" in prob:
+ ureport1["executable"] = prob["executable"]
+
+ if "user" in prob:
+ user = prob["user"]
+
+ if "root" in user and user["root"]:
+ ureport1["user_type"] = "root"
+ elif "local" in user and not user["local"]:
+ ureport1["user_type"] = "remote"
+ else:
+ ureport1["user_type"] = "local"
+
+ if "stacktrace" in prob or "frames" in prob:
+ ureport1["core_backtrace"] = []
+
+ if ureport1["type"] == "userspace":
+ threads = prob["stacktrace"]
+ elif ureport1["type"] == "kerneloops":
+ threads = [{ "crash_thread": True,
+ "frames": prob["frames"], }]
+ else:
+ threads = [{ "crash_thread": True,
+ "frames": prob["stacktrace"], }]
+
+ tid = 0
+ for thread in threads:
+ tid += 1
+
+ if "crash_thread" in thread and thread["crash_thread"]:
+ ureport1["crash_thread"] = tid
+
+ fid = 0
+ for frame in thread["frames"]:
+ fid += 1
+
+ new_frame = { "thread": tid, "frame": fid, }
+
+ if ureport1["type"] == "userspace":
+ if "build_id" in frame:
+ new_frame["buildid"] = frame["build_id"]
+
+ if "build_id_offset" in frame:
+ new_frame["offset"] = frame["build_id_offset"]
+
+ if "file_name" in frame:
+ new_frame["path"] = frame["file_name"]
+
+ if "fingerprint" in frame:
+ new_frame["funchash"] = frame["fingerprint"]
+
+ if "function_name" in frame:
+ new_frame["funcname"] = frame["function_name"]
+ else:
+ new_frame["funcname"] = "??"
+ elif ureport1["type"] == "kerneloops":
+ new_frame["buildid"] = ("{0}-{1}.{2}"
+ .format(ureport1["installed_package"]["version"],
+ ureport1["installed_package"]["release"],
+ ureport1["installed_package"]["architecture"]))
+
+ if ureport1["installed_package"]["name"].startswith("kernel-"):
+ new_frame["buildid"] += (".{0}"
+ .format(ureport1["installed_package"]["name"][7:]))
+
+ if "function_name" in frame:
+ new_frame["funcname"] = frame["function_name"]
+
+ if "reliable" in frame and not frame["reliable"]:
+ new_frame["funchash"] = "?"
+
+ if "function_offset" in frame:
+ new_frame["offset"] = frame["function_offset"]
+
+ if "module_name" in frame:
+ new_frame["path"] = frame["module_name"]
+ else:
+ new_frame["path"] = "vmlinux"
+ elif ureport1["type"] == "python":
+ if "file_name" in frame:
+ new_frame["path"] = frame["file_name"]
+
+ if "special_file" in frame:
+ new_frame["path"] = ("<{0}>"
+ .format(frame["special_file"]))
+
+ if "file_line" in frame:
+ new_frame["offset"] = frame["file_line"]
+
+ if "function_name" in frame:
+ new_frame["funcname"] = frame["function_name"]
+
+ if "special_function" in frame:
+ new_frame["funcname"] = ("<{0}>"
+ .format(frame["special_function"]))
+ else:
+ raise ValueError, ("type '{0}' is not supported"
+ .format(ureport1["type"]))
+
+ ureport1["core_backtrace"].append(new_frame)
+
+ if "reason" in ureport2:
+ ureport1["reason"] = ureport2["reason"]
+
+ return ureport1
+
def validate(obj, checker=UREPORT_CHECKER):
+ if (checker == UREPORT_CHECKER and
+ "ureport_version" in obj and
+ obj["ureport_version"] == 2):
+ obj = ureport2to1(obj)
+
expected = dict
if "type" in checker and isinstance(checker["type"], type):
expected = checker["type"]
--
1.7.11.7
10 years, 9 months
[ABRT PATCH] a-handle-event: check if satyr supports the analyzer
by Jakub Filak
Closes #675
Signed-off-by: Jakub Filak <jfilak(a)redhat.com>
---
src/daemon/abrt-handle-event.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/daemon/abrt-handle-event.c b/src/daemon/abrt-handle-event.c
index eadb058..812d460 100644
--- a/src/daemon/abrt-handle-event.c
+++ b/src/daemon/abrt-handle-event.c
@@ -144,10 +144,17 @@ static void dup_corebt_init(const struct dump_dir *dd)
if (!corebt_text)
return; /* no backtrace */
+ enum sr_report_type report_type = sr_abrt_type_from_analyzer(analyzer);
+ if (report_type == SR_REPORT_INVALID)
+ {
+ VERB1 log("Can't load stacktrace because of unsupported analyzer: %s",
+ analyzer);
+ return;
+ }
+
/* sr_stacktrace_parse moves the pointer */
char *error_message;
- corebt = sr_stacktrace_parse(sr_abrt_type_from_analyzer(analyzer),
- corebt_text, &error_message);
+ corebt = sr_stacktrace_parse(report_type, corebt_text, &error_message);
if (!corebt)
{
VERB1 log("Failed to load core stacktrace: %s", error_message);
--
1.8.3.1
10 years, 9 months
[ABRT PATCH] moved parse_list to the shared library in libreport - related to rhbz#803772
by Jiri Moskovcak
Signed-off-by: Jiri Moskovcak <jmoskovc(a)redhat.com>
---
src/daemon/abrt-action-save-package-data.c | 30 ------------------------------
1 file changed, 30 deletions(-)
diff --git a/src/daemon/abrt-action-save-package-data.c b/src/daemon/abrt-action-save-package-data.c
index c209c4b..9165ef3 100644
--- a/src/daemon/abrt-action-save-package-data.c
+++ b/src/daemon/abrt-action-save-package-data.c
@@ -27,36 +27,6 @@ static GList *settings_setBlackListedPaths = NULL;
static bool settings_bProcessUnpackaged = false;
static GList *settings_Interpreters = NULL;
-static GList *parse_list(const char* list)
-{
- struct strbuf *item = strbuf_new();
- GList *l = NULL;
-
- char *trim_item = NULL;
-
- for (unsigned ii = 0; list[ii]; ii++)
- {
- if (list[ii] == ',')
- {
- trim_item = strtrim(item->buf);
- l = g_list_append(l, xstrdup(trim_item));
- strbuf_clear(item);
- }
- else
- strbuf_append_char(item, list[ii]);
- }
-
- if (item->len > 0)
- {
- trim_item = strtrim(item->buf);
- l = g_list_append(l, xstrdup(trim_item));
- }
-
- strbuf_free(item);
-
- return l;
-}
-
static void ParseCommon(map_string_t *settings, const char *conf_filename)
{
const char *value;
--
1.8.3.1
10 years, 9 months
[LIBREPORT PATCH] added options to create private bz tickets rhbz#803772
by Jiri Moskovcak
Signed-off-by: Jiri Moskovcak <jmoskovc(a)redhat.com>
---
src/include/internal_libreport.h | 2 ++
src/lib/Makefile.am | 3 ++-
src/lib/libreport_glib.c | 45 ++++++++++++++++++++++++++++++++++++++
src/plugins/bugzilla.conf | 4 ++++
src/plugins/report_Bugzilla.xml.in | 11 ++++++++++
src/plugins/reporter-bugzilla.c | 24 +++++++++++++++-----
src/plugins/rhbz.c | 21 +++++++++++++-----
src/plugins/rhbz.h | 1 +
8 files changed, 98 insertions(+), 13 deletions(-)
create mode 100644 src/lib/libreport_glib.c
diff --git a/src/include/internal_libreport.h b/src/include/internal_libreport.h
index 1d1d204..afedc73 100644
--- a/src/include/internal_libreport.h
+++ b/src/include/internal_libreport.h
@@ -709,6 +709,8 @@ file_obj_t *new_file_obj(const char* fullpath, const char* filename);
void free_file_obj(file_obj_t *f);
#define load_workflow_config_data libreport_load_workflow_config_data
GHashTable *load_workflow_config_data(const char* path);
+#define parse_list libreport_parse_list
+GList *parse_list(const char* list);
/* Connect to abrtd over unix domain socket, issue DELETE command */
int delete_dump_dir_possibly_using_abrtd(const char *dump_dir_name);
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index 92287bc..fd996de 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -53,7 +53,8 @@ libreport_la_SOURCES = \
workflow.c \
workflow_xml_parser.c \
config_item_info.c \
- xml_parser.c
+ xml_parser.c \
+ libreport_glib.c
libreport_la_CPPFLAGS = \
-I$(srcdir)/../include \
-DLOCALSTATEDIR='"$(localstatedir)"' \
diff --git a/src/lib/libreport_glib.c b/src/lib/libreport_glib.c
new file mode 100644
index 0000000..525548d
--- /dev/null
+++ b/src/lib/libreport_glib.c
@@ -0,0 +1,45 @@
+/*
+ Copyright (C) 2013 ABRT team
+ Copyright (C) 2013 RedHat 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, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
+#include "internal_libreport.h"
+
+#define LIST_DELIMITER ","
+
+/*
+ * Parser comma separated list of strings to Glist
+ *
+ * @param list comma separated list of strings
+ * @returns GList or null if the list is empty
+ */
+GList *parse_list(const char* list)
+{
+ GList *l = NULL;
+
+ char *saved_ptr = NULL;
+ char *tmp_list = xstrdup(list);
+ char *item = strtok_r(tmp_list, LIST_DELIMITER, &saved_ptr);
+ while (item)
+ {
+ l = g_list_append(l, strtrim(xstrdup(item)));
+ item = strtok_r(NULL, LIST_DELIMITER, &saved_ptr);
+ }
+
+ free(tmp_list);
+ return l;
+}
diff --git a/src/plugins/bugzilla.conf b/src/plugins/bugzilla.conf
index 7c15f62..0fb3794 100644
--- a/src/plugins/bugzilla.conf
+++ b/src/plugins/bugzilla.conf
@@ -15,3 +15,7 @@ Password =
# (If you need to add more, the syntax is: "component[,component...]")
#
DontMatchComponents = selinux-policy
+
+# for more info about these settings see: https://github.com/abrt/abrt/wiki/FAQ#creating-private-bugzilla-tickets
+# CreatePrivate = no
+# PrivateGroups = group_218
diff --git a/src/plugins/report_Bugzilla.xml.in b/src/plugins/report_Bugzilla.xml.in
index 18382d4..d1516ba 100644
--- a/src/plugins/report_Bugzilla.xml.in
+++ b/src/plugins/report_Bugzilla.xml.in
@@ -34,6 +34,11 @@
<_description>Check SSL key validity</_description>
<default-value>yes</default-value>
</option>
+ <option type="bool" name="Bugzilla_CreatePrivate">
+ <_label>Restrict access</_label>
+ <_description>Restrict access to the created bugzilla ticket allowing only users from specified groups to view it (see advanced settings for more details)</_description>
+ <default-value>no</default-value>
+ </option>
<advanced-options>
<option type="text" name="Bugzilla_Product">
<_label>Bugzilla product</_label>
@@ -55,6 +60,12 @@
<allow-empty>yes</allow-empty>
<_note-html>Sets the proxy server to use for HTTPS</_note-html>
</option>
+ <option type="text" name="Bugzilla_PrivateGroups">
+ <_label>Groups</_label>
+ <allow-empty>yes</allow-empty>
+ <default-value>group_218</default-value>
+ <_note-html>Restrict the access to specified groups <a href="https://github.com/abrt/abrt/wiki/FAQ#creating-private-bugzilla-tickets">?</a></_note-html>
+ </option>
</advanced-options>
</options>
</event>
diff --git a/src/plugins/reporter-bugzilla.c b/src/plugins/reporter-bugzilla.c
index 972a1f0..965faf4 100644
--- a/src/plugins/reporter-bugzilla.c
+++ b/src/plugins/reporter-bugzilla.c
@@ -679,6 +679,8 @@ struct bugzilla_struct {
char *b_product_version;
const char *b_DontMatchComponents;
int b_ssl_verify;
+ int b_create_private;
+ GList *b_private_groups;
};
static void set_settings(struct bugzilla_struct *b, map_string_t *settings)
@@ -734,6 +736,14 @@ static void set_settings(struct bugzilla_struct *b, map_string_t *settings)
environ = getenv("Bugzilla_DontMatchComponents");
b->b_DontMatchComponents = environ ? environ : get_map_string_item_or_empty(settings, "DontMatchComponents");
+
+ environ = getenv("Bugzilla_CreatePrivate");
+ b->b_create_private = string_to_bool(environ ? environ : get_map_string_item_or_empty(settings, "Bugzilla_CreatePrivate"));
+ VERB1 log("create private bz ticket: '%s'", b->b_create_private ? "YES": "NO");
+
+ environ = getenv("Bugzilla_PrivateGroups");
+ b->b_private_groups = parse_list(environ ? environ : get_map_string_item_or_empty(settings, "Bugzilla_CreatePrivate"));
+ VERB1 log("groups: '%p'", b->b_private_groups);
}
static
@@ -887,7 +897,7 @@ int main(int argc, char **argv)
char *abrt_hash = NULL;
char *ticket_no = NULL;
char *debug_str = NULL;
- GList *group = NULL;
+ struct bugzilla_struct rhbz = { 0 };
/* Keep enum above and order of options below in sync! */
struct options program_options[] = {
OPT__VERBOSE(&g_verbose),
@@ -900,7 +910,7 @@ int main(int argc, char **argv)
OPT_BOOL( 'f', NULL, NULL, _("Force reporting even if this problem is already reported")),
OPT_BOOL( 'w', NULL, NULL, _("Add bugzilla user to CC list [of bug with this ID]")),
OPT_STRING( 'h', "duphash", &abrt_hash, "DUPHASH", _("Print BUG_ID which has given DUPHASH")),
- OPT_LIST( 'g', "group", &group , "GROUP" , _("Restrict access to this group only")),
+ OPT_LIST( 'g', "group", &rhbz.b_private_groups , "GROUP" , _("Restrict access to this group only")),
OPT_OPTSTRING('D', "debug", &debug_str , "STR" , _("Debug")),
OPT_END()
};
@@ -910,7 +920,7 @@ int main(int argc, char **argv)
export_abrt_envvars(0);
map_string_t *settings = new_map_string();
- struct bugzilla_struct rhbz = { 0 };
+
{
if (!conf_file)
conf_file = g_list_append(conf_file, (char*) CONF_DIR"/plugins/bugzilla.conf");
@@ -1202,10 +1212,12 @@ int main(int argc, char **argv)
strbuf_append_strf(bzcomment_buf, "\nPotential duplicate: bug %u\n", crossver_id);
char *bzcomment = strbuf_free_nobuf(bzcomment_buf);
char *summary = create_summary_string(problem_data, comment_fmt_spec);
- int new_id = rhbz_new_bug(client, problem_data, rhbz.b_product, rhbz.b_product_version,
+ int new_id = rhbz_new_bug(client,
+ problem_data, rhbz.b_product, rhbz.b_product_version,
summary, bzcomment,
- group
- );
+ (rhbz.b_create_private | (opts & OPT_g)), // either we got Bugzilla_CreatePrivate from settings or -g was specified on cmdline
+ rhbz.b_private_groups
+ );
free(bzcomment);
free(summary);
diff --git a/src/plugins/rhbz.c b/src/plugins/rhbz.c
index 2138c5f..90c390b 100644
--- a/src/plugins/rhbz.c
+++ b/src/plugins/rhbz.c
@@ -527,6 +527,7 @@ int rhbz_new_bug(struct abrt_xmlrpc *ax,
const char *version,
const char *bzsummary,
const char *bzcomment,
+ bool private,
GList *group)
{
func_entry();
@@ -602,16 +603,24 @@ int rhbz_new_bug(struct abrt_xmlrpc *ax,
if(arch)
abrt_xmlrpc_params_add_string(&env, params, "platform", arch);
- if (group)
+ if (private)
{
- xmlrpc_value *xmlrpc_groups = abrt_xmlrpc_array_new(&env);
+ if (group)
+ {
+ xmlrpc_value *xmlrpc_groups = abrt_xmlrpc_array_new(&env);
- for (GList *l = group; l; l = l->next)
- abrt_xmlrpc_array_append_string(&env, xmlrpc_groups, l->data);
+ for (GList *l = group; l; l = l->next)
+ abrt_xmlrpc_array_append_string(&env, xmlrpc_groups, l->data);
- abrt_xmlrpc_params_add_array(&env, params, "groups", xmlrpc_groups);
+ abrt_xmlrpc_params_add_array(&env, params, "groups", xmlrpc_groups);
- xmlrpc_DECREF(xmlrpc_groups);
+ xmlrpc_DECREF(xmlrpc_groups);
+ }
+ else
+ {
+ error_msg(_("A private ticket creation has been requested, but no groups were specified, please see https://github.com/abrt/abrt/wiki/FAQ#creating-private-bugzilla-tickets for more info"));
+ return -1;
+ }
}
xmlrpc_value* result = abrt_xmlrpc_call_params(&env, ax, "Bug.create", params);
diff --git a/src/plugins/rhbz.h b/src/plugins/rhbz.h
index fc99740..0e811ba 100644
--- a/src/plugins/rhbz.h
+++ b/src/plugins/rhbz.h
@@ -90,6 +90,7 @@ int rhbz_new_bug(struct abrt_xmlrpc *ax,
const char *version,
const char *bzsummary,
const char *bzcomment,
+ bool private,
GList *group);
int rhbz_attach_blob(struct abrt_xmlrpc *ax, const char *bug_id,
--
1.8.3.1
10 years, 9 months
[PATCH] abrt-action-save-package-data: properly close rpm database. Closes #674.
by Denys Vlasenko
RPM library uses Berkeley DB, which emits warnings like this
if DB files weren't closed properly:
BDB2053 Freeing read locks for locker 0x1e0: 28718/139661746636736
This change fixes it.
Signed-off-by: Denys Vlasenko <dvlasenk(a)redhat.com>
---
src/daemon/abrt-action-save-package-data.c | 8 ++++++--
src/daemon/rpm.c | 8 +++++++-
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/src/daemon/abrt-action-save-package-data.c b/src/daemon/abrt-action-save-package-data.c
index c209c4b..f1a3385 100644
--- a/src/daemon/abrt-action-save-package-data.c
+++ b/src/daemon/abrt-action-save-package-data.c
@@ -426,6 +426,10 @@ int main(int argc, char **argv)
rpm_load_gpgkey((char*)li->data);
}
- return SavePackageDescriptionToDebugDump(dump_dir_name);
- /* can call rpm_destroy but do we really need to bother? we are exiting! */
+ int r = SavePackageDescriptionToDebugDump(dump_dir_name);
+
+ /* Close RPM database */
+ rpm_destroy();
+
+ return r;
}
diff --git a/src/daemon/rpm.c b/src/daemon/rpm.c
index a1f9532..1b7d660 100644
--- a/src/daemon/rpm.c
+++ b/src/daemon/rpm.c
@@ -61,9 +61,15 @@ void rpm_init()
void rpm_destroy()
{
- rpmFreeRpmrc();
rpmFreeCrypto();
rpmFreeMacros(NULL);
+ rpmFreeRpmrc();
+
+ /* RPM doc says "clean up any open iterators and databases".
+ * Observed to eliminate these Berkeley DB warnings:
+ * "BDB2053 Freeing read locks for locker 0x1e0: 28718/139661746636736"
+ */
+ rpmdbCheckTerminate(1);
list_free_with_free(list_fingerprints);
list_fingerprints = NULL;
--
1.8.1.4
10 years, 9 months
[LIBREPORT PATCH] added missing workflows for Fedora rhbz#866027
by Jiri Moskovcak
Signed-off-by: Jiri Moskovcak <jmoskovc(a)redhat.com>
---
libreport.spec.in | 6 +++++-
po/POTFILES.in | 6 +++++-
src/workflows/Makefile.am | 12 ++++++++++--
src/workflows/report_fedora.conf | 18 +++++++++++++++++-
src/workflows/workflow_Fedora.xml.in | 13 -------------
src/workflows/workflow_FedoraCCpp.xml.in | 13 +++++++++++++
src/workflows/workflow_FedoraKerneloops.xml.in | 11 +++++++++++
src/workflows/workflow_FedoraPython.xml.in | 11 +++++++++++
src/workflows/workflow_FedoraVmcore.xml.in | 12 ++++++++++++
src/workflows/workflow_FedoraXorg.xml.in | 9 +++++++++
10 files changed, 93 insertions(+), 18 deletions(-)
delete mode 100644 src/workflows/workflow_Fedora.xml.in
create mode 100644 src/workflows/workflow_FedoraCCpp.xml.in
create mode 100644 src/workflows/workflow_FedoraKerneloops.xml.in
create mode 100644 src/workflows/workflow_FedoraPython.xml.in
create mode 100644 src/workflows/workflow_FedoraVmcore.xml.in
create mode 100644 src/workflows/workflow_FedoraXorg.xml.in
diff --git a/libreport.spec.in b/libreport.spec.in
index bc09fd7..3d7ab99 100644
--- a/libreport.spec.in
+++ b/libreport.spec.in
@@ -501,7 +501,11 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%if 0%{?fedora}
%files fedora
%defattr(-,root,root,-)
-%{_datadir}/%{name}/workflows/workflow_Fedora.xml
+%{_datadir}/%{name}/workflows/workflow_FedoraCCpp.xml
+%{_datadir}/%{name}/workflows/workflow_FedoraKerneloops.xml
+%{_datadir}/%{name}/workflows/workflow_FedoraPython.xml
+%{_datadir}/%{name}/workflows/workflow_FedoraVmcore.xml
+%{_datadir}/%{name}/workflows/workflow_FedoraXorg.xml
%config(noreplace) %{_sysconfdir}/libreport/workflows.d/report_fedora.conf
%endif
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 3f10efe..914f16b 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -46,7 +46,11 @@ src/plugins/ureport.c
src/report-newt/report-newt.c
src/workflows/workflow_AnacondaFedora.xml.in
src/workflows/workflow_AnacondaUpload.xml.in
-src/workflows/workflow_Fedora.xml.in
+src/workflows/workflow_FedoraCCpp.xml.in
+src/workflows/workflow_FedoraKerneloops.xml.in
+src/workflows/workflow_FedoraPython.xml.in
+src/workflows/workflow_FedoraVmcore.xml.in
+src/workflows/workflow_FedoraXorg.xml.in
src/workflows/workflow_Upload.xml.in
src/workflows/workflow_RHELCCpp.xml.in
src/workflows/workflow_RHELKerneloops.xml.in
diff --git a/src/workflows/Makefile.am b/src/workflows/Makefile.am
index 9e53c8c..0aa8886 100644
--- a/src/workflows/Makefile.am
+++ b/src/workflows/Makefile.am
@@ -1,7 +1,11 @@
workflowsdir = $(WORKFLOWS_DIR)
dist_workflows_DATA = \
- workflow_Fedora.xml \
+ workflow_FedoraCCpp.xml \
+ workflow_FedoraKerneloops.xml \
+ workflow_FedoraPython.xml \
+ workflow_FedoraVmcore.xml \
+ workflow_FedoraXorg.xml \
workflow_Upload.xml \
workflow_RHELCCpp.xml \
workflow_RHELKerneloops.xml \
@@ -29,7 +33,11 @@ endif
@INTLTOOL_XML_RULE@
EXTRA_DIST = \
- workflow_Fedora.xml.in \
+ workflow_FedoraCCpp.xml.in \
+ workflow_FedoraKerneloops.xml.in \
+ workflow_FedoraPython.xml.in \
+ workflow_FedoraVmcore.xml.in \
+ workflow_FedoraXorg.xml.in \
workflow_Upload.xml.in \
workflow_RHELCCpp.xml.in \
workflow_RHELKerneloops.xml.in \
diff --git a/src/workflows/report_fedora.conf b/src/workflows/report_fedora.conf
index 8c58f12..b5a49e2 100644
--- a/src/workflows/report_fedora.conf
+++ b/src/workflows/report_fedora.conf
@@ -1,3 +1,19 @@
-EVENT=workflow_Fedora analyzer=CCpp
+EVENT=workflow_FedoraCCpp analyzer=CCpp
+# this is just a meta event which consists of other events
+# the list is defined in the xml file
+
+EVENT=workflow_FedoraPython analyzer=Python
+# this is just a meta event which consists of other events
+# the list is defined in the xml file
+
+EVENT=workflow_FedoraKerneloops analyzer=Kerneloops
+# this is just a meta event which consists of other events
+# the list is defined in the xml file
+
+EVENT=workflow_FedoraVmcore analyzer=vmcore
+# this is just a meta event which consists of other events
+# the list is defined in the xml file
+
+EVENT=workflow_FedoraXorg analyzer=xorg
# this is just a meta event which consists of other events
# the list is defined in the xml file
diff --git a/src/workflows/workflow_Fedora.xml.in b/src/workflows/workflow_Fedora.xml.in
deleted file mode 100644
index f9df177..0000000
--- a/src/workflows/workflow_Fedora.xml.in
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<workflow>
- <_name>Report to Fedora</_name>
- <_description>Process the report using the Fedora infrastructure</_description>
-
- <events>
- <event>report_uReport</event>
- <event>collect_*</event>
- <event>analyze_CCpp</event>
- <event>report_Bugzilla</event>
- <event>post_report</event>
- </events>
-</workflow>
diff --git a/src/workflows/workflow_FedoraCCpp.xml.in b/src/workflows/workflow_FedoraCCpp.xml.in
new file mode 100644
index 0000000..b48d25a
--- /dev/null
+++ b/src/workflows/workflow_FedoraCCpp.xml.in
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<workflow>
+ <_name>Report to Fedora</_name>
+ <_description>Process the C/C++ crash using the Fedora infrastructure</_description>
+
+ <events>
+ <event>report_uReport</event>
+ <event>collect_*</event>
+ <event>analyze_CCpp</event>
+ <event>report_Bugzilla</event>
+ <event>post_report</event>
+ </events>
+</workflow>
diff --git a/src/workflows/workflow_FedoraKerneloops.xml.in b/src/workflows/workflow_FedoraKerneloops.xml.in
new file mode 100644
index 0000000..a8b4a28
--- /dev/null
+++ b/src/workflows/workflow_FedoraKerneloops.xml.in
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<workflow>
+ <_name>Report to Fedora</_name>
+ <_description>Process the kerneloops using the Fedora infrastructure</_description>
+
+ <events>
+ <event>report_uReport</event>
+ <event>collect_*</event>
+ <event>report_Bugzilla</event>
+ </events>
+</workflow>
\ No newline at end of file
diff --git a/src/workflows/workflow_FedoraPython.xml.in b/src/workflows/workflow_FedoraPython.xml.in
new file mode 100644
index 0000000..81e0fca
--- /dev/null
+++ b/src/workflows/workflow_FedoraPython.xml.in
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<workflow>
+ <_name>Report to Fedora</_name>
+ <_description>Process the python exception using the Fedora infrastructure</_description>
+
+ <events>
+ <event>report_uReport</event>
+ <event>collect_*</event>
+ <event>report_Bugzilla</event>
+ </events>
+</workflow>
diff --git a/src/workflows/workflow_FedoraVmcore.xml.in b/src/workflows/workflow_FedoraVmcore.xml.in
new file mode 100644
index 0000000..a6abb6a
--- /dev/null
+++ b/src/workflows/workflow_FedoraVmcore.xml.in
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<workflow>
+ <_name>Report to Fedora</_name>
+ <_description>Process the kernel crash using the Fedora infrastructure</_description>
+
+ <events>
+ <event>analyze_VMcore</event>
+ <event>report_uReport</event>
+ <event>collect_*</event>
+ <event>report_Bugzilla</event>
+ </events>
+</workflow>
diff --git a/src/workflows/workflow_FedoraXorg.xml.in b/src/workflows/workflow_FedoraXorg.xml.in
new file mode 100644
index 0000000..d796bae
--- /dev/null
+++ b/src/workflows/workflow_FedoraXorg.xml.in
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<workflow>
+ <_name>Report to Fedora</_name>
+ <_description>Process the X Server problem using the Fedora infrastructure</_description>
+
+ <events>
+ <event>report_Bugzilla</event>
+ </events>
+</workflow>
--
1.8.3.1
10 years, 9 months
[ABRT PATCH] stop using the hardcoded event list, use workflows instead rhbz#866027
by Jiri Moskovcak
Signed-off-by: Jiri Moskovcak <jmoskovc(a)redhat.com>
---
src/plugins/ccpp_event.conf | 2 +-
src/plugins/koops_event.conf | 2 +-
src/plugins/python_event.conf | 2 +-
src/plugins/vmcore_event.conf | 2 +-
src/plugins/xorg_event.conf | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/plugins/ccpp_event.conf b/src/plugins/ccpp_event.conf
index aa8cdb3..1dacbeb 100644
--- a/src/plugins/ccpp_event.conf
+++ b/src/plugins/ccpp_event.conf
@@ -90,7 +90,7 @@ EVENT=analyze_CCpp analyzer=CCpp
# Reporting of C/Cpp problems
EVENT=report-gui analyzer=CCpp
- report-gtk -e report_uReport -e analyze_CCpp -e "collect_*" -e report_Bugzilla -e post_report -- "$DUMP_DIR"
+ report-gtk -- "$DUMP_DIR"
EVENT=report-cli analyzer=CCpp
report-cli -e report_uReport -e analyze_CCpp -e report_Bugzilla -e post_report -- "$DUMP_DIR"
diff --git a/src/plugins/koops_event.conf b/src/plugins/koops_event.conf
index 9966775..78f8f4a 100644
--- a/src/plugins/koops_event.conf
+++ b/src/plugins/koops_event.conf
@@ -30,7 +30,7 @@ EVENT=post_report analyzer=Kerneloops
# Automatic/simple GUI-based kernel oopses reporting will do this:
EVENT=report-gui analyzer=Kerneloops
- report-gtk -e report_uReport -e "collect_*" -e report_Bugzilla -e post_report -- "$DUMP_DIR"
+ report-gtk -- "$DUMP_DIR"
EVENT=report-cli analyzer=Kerneloops
report-cli -e report_uReport -e report_Bugzilla -e post_report -- "$DUMP_DIR"
diff --git a/src/plugins/python_event.conf b/src/plugins/python_event.conf
index 3a45373..f211b30 100644
--- a/src/plugins/python_event.conf
+++ b/src/plugins/python_event.conf
@@ -25,7 +25,7 @@ EVENT=post_report analyzer=Python
# Reporting of python exceptions
EVENT=report-gui analyzer=Python component!=anaconda
- report-gtk -e report_uReport -e "collect_*" -e report_Bugzilla -e post_report -- "$DUMP_DIR"
+ report-gtk -- "$DUMP_DIR"
EVENT=report-cli analyzer=Python component!=anaconda
report-cli -e report_uReport -e report_Bugzilla -e post_report -- "$DUMP_DIR"
diff --git a/src/plugins/vmcore_event.conf b/src/plugins/vmcore_event.conf
index 5d2d099..68e1d24 100644
--- a/src/plugins/vmcore_event.conf
+++ b/src/plugins/vmcore_event.conf
@@ -24,7 +24,7 @@ EVENT=report_uReport analyzer=vmcore
/usr/libexec/abrt-action-ureport
EVENT=report-gui analyzer=vmcore
- report-gtk -e analyze_VMcore -e report_uReport -e "collect_*" -e report_Bugzilla -e post_report -- "$DUMP_DIR"
+ report-gtk -- "$DUMP_DIR"
EVENT=report-cli analyzer=vmcore
report-cli -e analyze_VMcore -e report_uReport -e report_Bugzilla -e post_report -- "$DUMP_DIR"
diff --git a/src/plugins/xorg_event.conf b/src/plugins/xorg_event.conf
index 71ca171..1bd7617 100644
--- a/src/plugins/xorg_event.conf
+++ b/src/plugins/xorg_event.conf
@@ -22,7 +22,7 @@ EVENT=report_Bugzilla analyzer=xorg
# Automatic/simple GUI-based xorg problems reporting will do this:
EVENT=report-gui analyzer=xorg
- report-gtk -e report_Bugzilla -- "$DUMP_DIR"
+ report-gtk -- "$DUMP_DIR"
EVENT=report-cli analyzer=xorg
report-cli -e report_Bugzilla -- "$DUMP_DIR"
--
1.8.3.1
10 years, 9 months