Compare commits

...

3 Commits

Author SHA1 Message Date
CentOS Sources 39000aebd8 import libreport-2.9.5-15.el8 2021-09-09 20:50:52 +00:00
CentOS Sources 41c526ab5e import libreport-2.9.5-10.el8 2021-09-09 20:50:49 +00:00
CentOS Sources eb70e875e1 import libreport-2.9.5-9.el8 2021-09-09 20:50:46 +00:00
17 changed files with 1941 additions and 11 deletions

View File

@ -7,14 +7,14 @@ Related to #1592073
Signed-off-by: Matej Habrnal <mhabrnal@redhat.com>
---
src/lib/ureport.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
src/lib/ureport.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lib/ureport.c b/src/lib/ureport.c
index c32c948a..d2045f0f 100644
--- a/src/lib/ureport.c
+++ b/src/lib/ureport.c
@@ -81,9 +81,10 @@ rhsm_config_get_consumer_cert_dir(void)
@@ -81,9 +81,9 @@ rhsm_config_get_consumer_cert_dir(void)
return xstrdup(result);
result = run_in_shell_and_save_output(0,
@ -22,7 +22,6 @@ index c32c948a..d2045f0f 100644
+ "python3 -c \"from rhsm.config import initConfig; print(initConfig().get('rhsm', 'consumerCertDir'))\"",
NULL, NULL);
+
/* run_in_shell_and_save_output always returns non-NULL */
if (result[0] != '/')
goto error;

View File

@ -0,0 +1,53 @@
From 1aa9e3a987439fd4435b40b9c7f56d063097f980 Mon Sep 17 00:00:00 2001
From: Martin Kutlak <mkutlak@redhat.com>
Date: Thu, 3 Jan 2019 16:32:00 +0100
Subject: [PATCH] bugzilla: change the default bugzilla group
Changes the default bugzilla group to redhat and also makes the
reported bugs private by default.
Related to rhbz#1660449
Signed-off-by: Martin Kutlak <mkutlak@redhat.com>
---
configure.ac | 6 +++---
src/plugins/bugzilla.conf | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/configure.ac b/configure.ac
index feafc28e..ce453895 100644
--- a/configure.ac
+++ b/configure.ac
@@ -92,14 +92,14 @@ AC_PATH_PROG([XMLRPC], [xmlrpc-c-config], [no])
AC_ARG_WITH([redhatbugzillacreateprivate],
AS_HELP_STRING([--with-redhatbugzillacreateprivate="yes/no"],
[Whether the Red Hat Bugzilla plugin should open
- bugs private by default ("no")]),
- [], [with_redhatbugzillacreateprivate="no"])
+ bugs private by default ("yes")]),
+ [], [with_redhatbugzillacreateprivate="yes"])
AC_SUBST([RED_HAT_BUGZILLA_CREATE_PRIVATE], [$with_redhatbugzillacreateprivate])
AC_ARG_WITH([redhatbugzillaprivategroups],
AS_HELP_STRING([--with-redhatbugzillaprivategroups="CSV"],
[Name of groups separated by comma]),
- [], [with_redhatbugzillaprivategroups="fedora_contrib_private"])
+ [], [with_redhatbugzillaprivategroups="redhat"])
AC_SUBST([RED_HAT_BUGZILLA_PRIVATE_GROUPS], [$with_redhatbugzillaprivategroups])
diff --git a/src/plugins/bugzilla.conf b/src/plugins/bugzilla.conf
index a7727392..dbbbd05c 100644
--- a/src/plugins/bugzilla.conf
+++ b/src/plugins/bugzilla.conf
@@ -22,5 +22,5 @@ Password =
DontMatchComponents = selinux-policy
# for more info about these settings see: https://github.com/abrt/abrt/wiki/FAQ#creating-private-bugzilla-tickets
-# CreatePrivate = no
-# PrivateGroups = fedora_contrib_private
+# CreatePrivate = yes
+# PrivateGroups = redhat
--
2.21.0

View File

@ -0,0 +1,77 @@
From 69c83b933da2ac7c4a1450c5882027030eb79022 Mon Sep 17 00:00:00 2001
From: Ernestas Kulik <ekulik@redhat.com>
Date: Tue, 12 Mar 2019 13:30:12 +0100
Subject: [PATCH] lib: dump_dir: Clean up on failure in dd_delete()
All callers assume that dd_delete() will succeed and the dump directory
struct will be freed, but in some cases that does not happen and leaks
occur.
Resolves rhbz#1671233
Signed-off-by: Ernestas Kulik <ekulik@redhat.com>
---
src/lib/dump_dir.c | 26 +++++++++++++++++++++-----
1 file changed, 21 insertions(+), 5 deletions(-)
diff --git a/src/lib/dump_dir.c b/src/lib/dump_dir.c
index 632a01fa..4533f4c1 100644
--- a/src/lib/dump_dir.c
+++ b/src/lib/dump_dir.c
@@ -1555,19 +1555,33 @@ static int dd_delete_meta_data(struct dump_dir *dd)
int dd_delete(struct dump_dir *dd)
{
+ int retval;
+
+ retval = 0;
+
if (!dd->locked)
{
error_msg("unlocked problem directory %s cannot be deleted", dd->dd_dirname);
- return -1;
+
+ retval = -1;
+
+ goto close;
}
if (dd_delete_meta_data(dd) != 0)
- return -2;
+ {
+ retval = -2;
+
+ goto close;
+ }
if (delete_file_dir(dd->dd_fd, /*skip_lock_file:*/ true) != 0)
{
perror_msg("Can't remove contents of directory '%s'", dd->dd_dirname);
- return -2;
+
+ retval = -2;
+
+ goto close;
}
unsigned cnt = RMDIR_FAIL_COUNT;
@@ -1586,12 +1600,14 @@ int dd_delete(struct dump_dir *dd)
if (cnt == 0)
{
perror_msg("Can't remove directory '%s'", dd->dd_dirname);
- return -3;
+
+ retval = -3;
}
dd->locked = 0; /* delete_file_dir already removed .lock */
+close:
dd_close(dd);
- return 0;
+ return retval;
}
int dd_chown(struct dump_dir *dd, uid_t new_uid)
--
2.21.0

View File

@ -0,0 +1,62 @@
From 683364e35ef2da8cd646fe1e29e57a17c6e71c36 Mon Sep 17 00:00:00 2001
From: Ernestas Kulik <ekulik@redhat.com>
Date: Tue, 28 May 2019 15:51:05 +0200
Subject: [PATCH] cli: Unpack command-line argument parsing logic
Currently, checking for invalid command line needlessly involves
convoluted bitwise operations, which can be simplified drastically.
First, argc is reduced by optind, which points to the next argument to
be processed. If everything goes well, argc should be 1, since the only
remaining argument to be processed is the problem directory. If that
does not hold, we want to bail. Another point at which we want to bail
is when an option is passed that operates on the positional argument
(anything but -L, which just lists available events). Checking for that
involves ANDing the current option mask with the mask of all such
options. The result is NOTed for comparison, since argc is 0 in such
cases.
Signed-off-by: Ernestas Kulik <ekulik@redhat.com>
---
src/cli/cli.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/src/cli/cli.c b/src/cli/cli.c
index ff5b29f4..67ce7dde 100644
--- a/src/cli/cli.c
+++ b/src/cli/cli.c
@@ -39,6 +39,9 @@ static char *steal_directory_if_needed(char *dump_dir_name)
int main(int argc, char** argv)
{
+ bool runaway_arguments;
+ bool missing_positional_argument;
+
abrt_init(argv);
setlocale(LC_ALL, "");
@@ -108,16 +111,12 @@ int main(int argc, char** argv)
argv += optind;
argc -= optind;
+ runaway_arguments = argc > 1;
+ missing_positional_argument = (opts & OPTMASK_need_arg) && (argc == 0);
+
/* Check for bad usage */
- if (argc > 1 /* more than one arg? */
- ||
- /* dont_need_arg == have_arg? bad in both cases:
- * TRUE == TRUE (dont need arg but have) or
- * FALSE == FALSE (need arg but havent).
- * OPT_list_events is an exception, it can be used in both cases.
- */
- (((!(opts & OPTMASK_need_arg)) == argc) && (op != OPT_list_events))
- ) {
+ if (runaway_arguments || (missing_positional_argument && op != OPT_list_events))
+ {
show_usage_and_die(program_usage_string, program_options);
}
--
2.21.0

View File

@ -0,0 +1,42 @@
From d10e9b9e9b3118405ac701ce9109bc7239ff1752 Mon Sep 17 00:00:00 2001
From: Ernestas Kulik <ekulik@redhat.com>
Date: Wed, 29 May 2019 14:07:52 +0200
Subject: [PATCH] =?UTF-8?q?plugins:=20rhbz:=20Don=E2=80=99t=20call=20strle?=
=?UTF-8?q?n()=20on=20attachment=20data?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
It might not be textual, meaning that, if the blob somehow begins with
NUL, it would be treated as empty.
Signed-off-by: Ernestas Kulik <ekulik@redhat.com>
---
src/plugins/rhbz.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/plugins/rhbz.c b/src/plugins/rhbz.c
index 680527d7..96b6d7da 100644
--- a/src/plugins/rhbz.c
+++ b/src/plugins/rhbz.c
@@ -611,7 +611,7 @@ int rhbz_attach_blob(struct abrt_xmlrpc *ax, const char *bug_id,
{
func_entry();
- if (strlen(data) == 0)
+ if (0 == data_len)
{
log_notice("not attaching an empty file: '%s'", filename);
/* Return SUCCESS */
@@ -681,7 +681,7 @@ int rhbz_attach_fd(struct abrt_xmlrpc *ax, const char *bug_id,
//TODO: need to have a method of attaching huge files (IOW: 1Gb read isn't good).
- char *data = xmalloc(size + 1);
+ char *data = xmalloc(size);
ssize_t r = full_read(fd, data, size);
if (r < 0)
{
--
2.21.0

View File

@ -0,0 +1,34 @@
From 677b495832484943d88f3fa4325b4f5ae38e930b Mon Sep 17 00:00:00 2001
From: Michal Fabik <mfabik@redhat.com>
Date: Tue, 16 Jul 2019 10:27:18 +0200
Subject: [PATCH] tests: Disable strcpm'ing a freed pointer
This was causing an i686 build failure on RHEL8
Related: rhbz#1660449
Impossible to build otherwise
Signed-off-by: Michal Fabik <mfabik@redhat.com>
---
tests/libreport_types.at | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tests/libreport_types.at b/tests/libreport_types.at
index 106ba3b0..c63fdad4 100644
--- a/tests/libreport_types.at
+++ b/tests/libreport_types.at
@@ -233,7 +233,10 @@ int main(int argc, char **argv)
assert(try_get_map_string_item_as_string(map, key, &retval) || !"Cannot find key string('my_string') after freeing original key");
assert(NULL != retval || !"The return value is not assigned to the return variable");
- assert(strcmp(bck, retval) == 0 || !"Garbled string('test') after freeing the original key value");
+
+ /* disabled because this line was failing during an i686 build on RHEL8 */
+ /* need to investigate what it's good for in the first place */
+ //assert(strcmp(bck, retval) == 0 || !"Garbled string('test') after freeing the original key value");
/* TODO: try to store really big string */
--
2.21.0

View File

@ -0,0 +1,37 @@
From fc813bcf566e0ca1ccfff83e7e6f360647066768 Mon Sep 17 00:00:00 2001
From: Jakub Filak <jfilak@redhat.com>
Date: Thu, 9 Jul 2015 15:32:19 +0200
Subject: [PATCH] lib: fix a SEGV in list_possible_events()
The bug has been introduced in
commit fc028b3417349fd60a2ddd1aff1127a417df512b
Related: #1224984
Fixes: rhbz#1733515
Signed-off-by: Jakub Filak <jfilak@redhat.com>
(cherry picked from commit 38a8c2fb2b4a46a35899f6b1066ec65ef155eeac)
---
src/lib/run_event.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/lib/run_event.c b/src/lib/run_event.c
index 64c7a303..077ae189 100644
--- a/src/lib/run_event.c
+++ b/src/lib/run_event.c
@@ -417,7 +417,11 @@ static char* pop_next_command(GList **pp_rule_list,
if (pd == NULL)
free_me = real_val = dd_load_text_ext(dd, var_name, DD_FAIL_QUIETLY_ENOENT);
else
+ {
real_val = problem_data_get_content_or_NULL(pd, var_name);
+ if (real_val == NULL)
+ free_me = real_val = xstrdup("");
+ }
free(var_name);
int vals_differ = regex ? regcmp_lines(real_val, eq_sign + 1) : strcmp(real_val, eq_sign + 1);
free(free_me);
--
2.21.0

View File

@ -0,0 +1,146 @@
From f4a632838a453f168037257d0c48e9b0976d6321 Mon Sep 17 00:00:00 2001
From: Matej Marusak <mmarusak@redhat.com>
Date: Fri, 30 Nov 2018 11:40:09 +0100
Subject: [PATCH] report-client: Find debuginfos in own method
This commit picks a piece of code responsible for looking up debuginfo
packages into own method. For making sure that it works in any code that
used it the old way, it checks if the method for finding packages was
already called and if not, calls it directly.
Purpose of this change is to be able to get size of packages those are
going to be installed before installing them. In that case anyone using
these downloader classes is going to be able for example prepare enough
space for the newly installed packages.
Related to #811978.
Signed-off-by: Matej Marusak <mmarusak@redhat.com>
---
src/client-python/reportclient/debuginfo.py | 69 +++++++++++++--------
1 file changed, 43 insertions(+), 26 deletions(-)
diff --git a/src/client-python/reportclient/debuginfo.py b/src/client-python/reportclient/debuginfo.py
index 4390304e..561de52f 100644
--- a/src/client-python/reportclient/debuginfo.py
+++ b/src/client-python/reportclient/debuginfo.py
@@ -233,6 +233,17 @@ class DebugInfoDownload(object):
self.keeprpms = keep_rpms
self.noninteractive = noninteractive
self.repo_pattern = repo_pattern
+ self.package_files_dict = {}
+ self.not_found = []
+ self.todownload_size = 0
+ self.installed_size = 0
+ self.find_packages_run = False
+
+ def get_download_size(self):
+ return self.todownload_size
+
+ def get_install_size(self):
+ return self.installed_size
def mute_stdout(self):
"""
@@ -286,6 +297,26 @@ class DebugInfoDownload(object):
def download_package(self, pkg):
pass
+ def find_packages(self, files):
+ self.find_packages_run = True;
+ # nothing to download?
+ if not files:
+ return RETURN_FAILURE
+
+ print(_("Initializing package manager"))
+ self.prepare()
+
+ # This takes some time, let user know what we are doing
+ print(_("Setting up repositories"))
+ self.initialize_repositories()
+
+ print(_("Looking for needed packages in repositories"))
+ (self.package_files_dict,
+ self.not_found,
+ self.todownload_size,
+ self.installed_size) = self.triage(files)
+
+
# return value will be used as exitcode. So 0 = ok, !0 - error
def download(self, files, download_exact_files=False):
"""
@@ -309,32 +340,18 @@ class DebugInfoDownload(object):
if retval != RETURN_OK:
return retval
- print(_("Initializing package manager"))
- self.prepare()
- #if verbose == 0:
- # # this suppress yum messages about setting up repositories
- # mute_stdout()
-
- # This takes some time, let user know what we are doing
- print(_("Setting up repositories"))
- self.initialize_repositories()
-
- #if verbose == 0:
- # # re-enable the output to stdout
- # unmute_stdout()
-
- print(_("Looking for needed packages in repositories"))
- package_files_dict, not_found, todownload_size, installed_size = self.triage(files)
+ if not self.find_packages_run:
+ self.find_packages(files)
- if verbose != 0 or len(not_found) != 0:
- print(_("Can't find packages for {0} debuginfo files").format(len(not_found)))
+ if verbose != 0 or len(self.not_found) != 0:
+ print(_("Can't find packages for {0} debuginfo files").format(len(self.not_found)))
- if verbose != 0 or len(package_files_dict) != 0:
- print(_("Packages to download: {0}").format(len(package_files_dict)))
+ if verbose != 0 or len(self.package_files_dict) != 0:
+ print(_("Packages to download: {0}").format(len(self.package_files_dict)))
question = _(
"Downloading {0:.2f}Mb, installed size: {1:.2f}Mb. Continue?") \
- .format(todownload_size / (1024 * 1024),
- installed_size / (1024 * 1024))
+ .format(self.todownload_size / (1024 * 1024),
+ self.installed_size / (1024 * 1024))
if not self.noninteractive and not ask_yes_no(question):
print(_("Download cancelled by user"))
@@ -343,7 +360,7 @@ class DebugInfoDownload(object):
# check if there is enough free space in both tmp and cache
res = os.statvfs(self.tmpdir)
tmp_space = float(res.f_bsize * res.f_bavail) / (1024 * 1024)
- if (todownload_size / (1024 * 1024)) > tmp_space:
+ if (self.todownload_size / (1024 * 1024)) > tmp_space:
question = _("Warning: Not enough free space in tmp dir '{0}'"
" ({1:.2f}Mb left). Continue?").format(
self.tmpdir, tmp_space)
@@ -354,7 +371,7 @@ class DebugInfoDownload(object):
res = os.statvfs(self.cachedir)
cache_space = float(res.f_bsize * res.f_bavail) / (1024 * 1024)
- if (installed_size / (1024 * 1024)) > cache_space:
+ if (self.installed_size / (1024 * 1024)) > cache_space:
question = _("Warning: Not enough free space in cache dir "
"'{0}' ({1:.2f}Mb left). Continue?").format(
self.cachedir, cache_space)
@@ -363,10 +380,10 @@ class DebugInfoDownload(object):
print(_("Download cancelled by user"))
return RETURN_CANCEL_BY_USER
- progress_observer = DownloadProgress(len(package_files_dict))
+ progress_observer = DownloadProgress(len(self.package_files_dict))
self.initialize_progress(progress_observer)
- for pkg, files in package_files_dict.items():
+ for pkg, files in self.package_files_dict.items():
# Download
package_full_path, err = self.download_package(pkg)
--
2.24.1

View File

@ -0,0 +1,77 @@
From 23110cb7198e53c1e211ba8a41c7406b04641574 Mon Sep 17 00:00:00 2001
From: Martin Kutlak <mkutlak@redhat.com>
Date: Mon, 3 Dec 2018 13:54:34 +0100
Subject: [PATCH] reportclient: Find and download required debuginfo packages
The current solution finds packages for given build-ids and then
downloads them. The problem is that some debuginfo packages require
other packages and if they are not available the generated backtrace
becomes unusable.
This commit adds a query for required packages and downloads them together
with the main packages.
Related: rhbz#1515265
Signed-off-by: Martin Kutlak <mkutlak@redhat.com>
---
.../reportclient/dnfdebuginfo.py | 34 +++++++++++++------
1 file changed, 23 insertions(+), 11 deletions(-)
diff --git a/src/client-python/reportclient/dnfdebuginfo.py b/src/client-python/reportclient/dnfdebuginfo.py
index 1867484f..04f98579 100644
--- a/src/client-python/reportclient/dnfdebuginfo.py
+++ b/src/client-python/reportclient/dnfdebuginfo.py
@@ -106,26 +106,38 @@ class DNFDebugInfoDownload(DebugInfoDownload):
print(_("Error setting up repositories: '{0!s}'").format(str(ex)))
def triage(self, files):
- q = self.base.sack.query()
- i = q.available()
+ dnf_query = self.base.sack.query()
+ dnf_available = dnf_query.available()
package_files_dict = {}
not_found = []
todownload_size = 0
installed_size = 0
for debuginfo_path in files:
- packages = i.filter(file=debuginfo_path)
+ di_package_list = []
+ packages = dnf_available.filter(file=debuginfo_path)
+
if not packages:
log2("not found package for %s", debuginfo_path)
not_found.append(debuginfo_path)
else:
- if packages[0] in package_files_dict.keys():
- package_files_dict[packages[0]].append(debuginfo_path)
- else:
- package_files_dict[packages[0]] = [debuginfo_path]
- todownload_size += float(packages[0].downloadsize)
- installed_size += float(packages[0].installsize)
-
- log2("found packages for %s: %s", debuginfo_path, packages[0])
+ di_package_list.append(packages[0])
+ if packages[0].requires:
+ package_reqs = dnf_available.filter(provides=packages[0].requires,
+ arch=packages[0].arch)
+ for pkg in package_reqs:
+ if pkg not in di_package_list:
+ di_package_list.append(pkg)
+ log2("found required package {0} for {1}".format(pkg, packages[0]))
+
+ for pkg in di_package_list:
+ if pkg in package_files_dict.keys():
+ package_files_dict[pkg].append(debuginfo_path)
+ else:
+ package_files_dict[pkg] = [debuginfo_path]
+ todownload_size += float(pkg.downloadsize)
+ installed_size += float(pkg.installsize)
+
+ log2("found packages for %s: %s", debuginfo_path, pkg)
return (package_files_dict, not_found, todownload_size, installed_size)
def download_package(self, pkg):
--
2.24.1

View File

@ -0,0 +1,60 @@
From c0d0e59df7d73feb971ba495c81f4651a8cea8a6 Mon Sep 17 00:00:00 2001
From: Martin Kutlak <mkutlak@redhat.com>
Date: Wed, 5 Dec 2018 16:52:07 +0100
Subject: [PATCH] reportclient: Search for required packages recursively
Adds recursive function to search for required packages of required packages
of re...
Signed-off-by: Martin Kutlak <mkutlak@redhat.com>
---
.../reportclient/dnfdebuginfo.py | 21 +++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
diff --git a/src/client-python/reportclient/dnfdebuginfo.py b/src/client-python/reportclient/dnfdebuginfo.py
index 04f98579..165c12d0 100644
--- a/src/client-python/reportclient/dnfdebuginfo.py
+++ b/src/client-python/reportclient/dnfdebuginfo.py
@@ -112,6 +112,23 @@ class DNFDebugInfoDownload(DebugInfoDownload):
not_found = []
todownload_size = 0
installed_size = 0
+
+ def required_packages(query, package, origin):
+ """
+ Recursive function to find all required packages of required packages of ...
+ origin - should stop infinite recursion (A => B => ... => X => A)
+ """
+ required_pkg_list = []
+ if package.requires:
+ pkg_reqs = query.filter(provides=package.requires, arch=package.arch)
+ for p in pkg_reqs:
+ if p.name != origin.name and p not in required_pkg_list:
+ required_pkg_list.append(p)
+ required_pkg_list += required_packages(query, p, origin)
+
+ return required_pkg_list
+
+
for debuginfo_path in files:
di_package_list = []
packages = dnf_available.filter(file=debuginfo_path)
@@ -122,13 +139,13 @@ class DNFDebugInfoDownload(DebugInfoDownload):
else:
di_package_list.append(packages[0])
if packages[0].requires:
- package_reqs = dnf_available.filter(provides=packages[0].requires,
- arch=packages[0].arch)
+ package_reqs = required_packages(dnf_available, packages[0], packages[0])
for pkg in package_reqs:
if pkg not in di_package_list:
di_package_list.append(pkg)
log2("found required package {0} for {1}".format(pkg, packages[0]))
+
for pkg in di_package_list:
if pkg in package_files_dict.keys():
package_files_dict[pkg].append(debuginfo_path)
--
2.24.1

View File

@ -0,0 +1,41 @@
From 0b37412bc975d6e043c34dbff379029fd94a1758 Mon Sep 17 00:00:00 2001
From: Martin Kutlak <mkutlak@redhat.com>
Date: Wed, 14 Aug 2019 14:46:08 +0000
Subject: [PATCH] dirsize: Skip dirs in which sosreport is being generated
With these changes ABRT will skip directories in which sosreport is running
and won't delete them when MaxCrashReportSize limit is exceeded.
I had a concern about the size of the logs that sosreport collects but
there is a limit set by sosreport for how big the individual logs can
be and the default value is 25MiB.
Fixes: rhbz#1671232
Signed-off-by: Martin Kutlak <mkutlak@redhat.com>
(cherry picked from commit eef59d2358cf63338f38727c5d08be70619e4e55)
---
src/lib/dirsize.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/lib/dirsize.c b/src/lib/dirsize.c
index 6d96e71..7ee9752 100644
--- a/src/lib/dirsize.c
+++ b/src/lib/dirsize.c
@@ -91,6 +91,11 @@ double get_dirsize_find_largest_dir(
if (dot_or_dotdot(ep->d_name))
continue;
char *dname = concat_path_file(pPath, ep->d_name);
+ if (lstat(concat_path_file(dname, "sosreport.log"), &statbuf) == 0)
+ {
+ log_debug("Skipping %s': sosreport is being generated.", dname);
+ goto next;
+ }
if (lstat(dname, &statbuf) != 0)
{
goto next;
--
2.26.0

View File

@ -0,0 +1,101 @@
From 0641129e214fa1cd2a67740c3193944285781819 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miroslav=20Such=C3=BD?= <msuchy@redhat.com>
Date: Wed, 6 May 2020 19:10:48 +0200
Subject: [PATCH] setgid instead of setuid the
abrt-action-install-debuginfo-to-abrt-cache [RHBZ 1796245]
This is called by abrt-action-install-debuginfo-to-abrt-cache which used to be setuid and now is setgid binary.
Therefore we do not need to setuid and we neither need it.
Resolves:
https://bugzilla.redhat.com/show_bug.cgi?id=1796245
---
src/client-python/reportclient/debuginfo.py | 25 +++++++++------------
1 file changed, 11 insertions(+), 14 deletions(-)
diff --git a/src/client-python/reportclient/debuginfo.py b/src/client-python/reportclient/debuginfo.py
index 561de52f..560629cc 100644
--- a/src/client-python/reportclient/debuginfo.py
+++ b/src/client-python/reportclient/debuginfo.py
@@ -35,41 +35,38 @@ from reportclient import (_, log1, log2, RETURN_OK, RETURN_FAILURE,
error_msg)
-def ensure_abrt_uid(fn):
+def ensure_abrt_gid(fn):
"""
- Ensures that the function is called using abrt's uid and gid
+ Ensures that the function is called using abrt's gid
Returns:
Either an unchanged function object or a wrapper function object for
the function.
"""
- current_uid = os.getuid()
current_gid = os.getgid()
abrt = pwd.getpwnam("abrt")
# if we're are already running as abrt, don't do anything
- if abrt.pw_uid == current_uid and abrt.pw_gid == current_gid:
+ if abrt.pw_gid == current_gid:
return fn
def wrapped(*args, **kwargs):
"""
Wrapper function around the called function.
- Sets up uid and gid to match abrt's and after the function finishes
- rolls its uid and gid back.
+ Sets up gid to match abrt's and after the function finishes
+ rolls its gid back.
Returns:
Return value of the wrapped function.
"""
- # switch to abrt
+ # switch to abrt group
os.setegid(abrt.pw_gid)
- os.seteuid(abrt.pw_uid)
# extract the files as abrt:abrt
retval = fn(*args, **kwargs)
# switch back to whatever we were
- os.seteuid(current_uid)
os.setegid(current_gid)
return retval
@@ -79,7 +76,7 @@ def ensure_abrt_uid(fn):
# TODO: unpack just required debuginfo and not entire rpm?
# ..that can lead to: foo.c No such file and directory
# files is not used...
-@ensure_abrt_uid
+@ensure_abrt_gid
def unpack_rpm(package_full_path, files, tmp_dir, destdir, exact_files=False):
"""
Unpacks a single rpm located in tmp_dir into destdir.
@@ -265,7 +262,7 @@ class DebugInfoDownload(object):
else:
print("ERR: unmute called without mute?")
- @ensure_abrt_uid
+ @ensure_abrt_gid
def setup_tmp_dirs(self):
if not os.path.exists(self.tmpdir):
try:
@@ -406,9 +403,9 @@ class DebugInfoDownload(object):
s = os.stat(self.cachedir)
abrt = pwd.getpwnam("abrt")
- if (s.st_uid != abrt.pw_uid) or (s.st_gid != abrt.pw_gid):
- print(_("'{0}' must be owned by abrt. "
- "Please run '# chown -R abrt.abrt {0}' "
+ if s.st_gid != abrt.pw_gid:
+ print(_("'{0}' must be owned by group abrt. "
+ "Please run '# chown -R :abrt {0}' "
"to fix the issue.").format(self.cachedir))
clean_up(self.tmpdir)
--
2.21.3

View File

@ -0,0 +1,952 @@
From 646101d558765b59bae94aa27bfbefed3a085ab5 Mon Sep 17 00:00:00 2001
From: Ernestas Kulik <ekulik@redhat.com>
Date: Tue, 2 Jun 2020 10:57:36 +0200
Subject: [PATCH] ureport: Drop Strata integration
Strata is being sunset with no replacement for our used API endpoints in
sight. This commit drops the integration code, because no one pretty
much wants it, either.
---
configure.ac | 11 --
doc/reporter-rhtsupport.txt | 17 --
doc/reporter-ureport.txt | 8 -
src/include/ureport.h | 4 +-
src/lib/ureport.c | 138 +--------------
src/plugins/Makefile.am | 6 -
src/plugins/cert-api.access.redhat.com.pem | 74 --------
src/plugins/report_RHTSupport.xml.in | 5 -
src/plugins/reporter-rhtsupport.c | 186 +--------------------
src/plugins/ureport.conf | 4 -
tests/ureport.at | 174 -------------------
tests/ureport/rhsm/__init__.py | 0
tests/ureport/rhsm/config.py | 8 -
13 files changed, 7 insertions(+), 628 deletions(-)
delete mode 100644 src/plugins/cert-api.access.redhat.com.pem
delete mode 100644 tests/ureport/rhsm/__init__.py
delete mode 100644 tests/ureport/rhsm/config.py
diff --git a/configure.ac b/configure.ac
index ce45389..ef35f84 100644
--- a/configure.ac
+++ b/configure.ac
@@ -172,17 +172,6 @@ do
done
fi dnl end NO_MANTISBT
-dnl enable import of certificate for rhtsupport plugin
-AC_ARG_ENABLE([import-rhtsupport-cert],
-AS_HELP_STRING([--enable-import-rhtsupport-cert],
- [import certificate needed for rhtsupport plugin (default is NO)]),
-[], [enable_import_rhtsupport_cert="no"])
-
-AS_IF([test "x$enable_import_rhtsupport_cert" != "xno"],
-AM_CONDITIONAL(ENABLE_IMPORT_RHTSUPPORT_CERT, true),
-AM_CONDITIONAL(ENABLE_IMPORT_RHTSUPPORT_CERT, false))
-
-
AC_ARG_WITH(python2,
AS_HELP_STRING([--with-python2],[use python2 (default is YES)]),
LIBREPORT_PARSE_WITH([python2]))
diff --git a/doc/reporter-rhtsupport.txt b/doc/reporter-rhtsupport.txt
index e52a152..132c0ea 100644
--- a/doc/reporter-rhtsupport.txt
+++ b/doc/reporter-rhtsupport.txt
@@ -18,9 +18,6 @@ DESCRIPTION
The tool reads problem directory DIR. Then it logs in to RHTSupport
and creates a new case.
-The tool can be configured to submit an uReport to RHTSupport together with
-creating a new case.
-
The URL to new case is printed to stdout and recorded in 'reported_to'
element in DIR.
@@ -36,10 +33,6 @@ to enter case ID to which you want to upload the FILEs.
Option -tCASE uploads FILEs to the case CASE on RHTSupport site.
-d DIR is ignored.
-Option -u uploads uReport along with creating a new case. uReport configuration
-is loaded from UR_CONFFILE which defaults to
-/etc/libreport/plugins/ureport.conf.
-
Configuration file
~~~~~~~~~~~~~~~~~~
Configuration file lines should have 'PARAM = VALUE' format. The parameters are:
@@ -56,10 +49,6 @@ Configuration file lines should have 'PARAM = VALUE' format. The parameters are:
'SSLVerify'::
Use yes/true/on/1 to verify server's SSL certificate. (default: yes)
-'SubmitUReport'::
- Use yes/true/on/1 to enable submitting uReport together wit creating a new
- case. (default: no)
-
Parameters can be overridden via $RHTSupport_PARAM environment variables.
Integration with ABRT events
@@ -84,12 +73,6 @@ OPTIONS
-t[ID]::
Upload FILEs to the already created case on RHTSupport site.
--u::
- Submit uReport together with creating a new case.
-
--C UR_CONFFILE::
- Configuration file for submitting uReports.
-
-F CONF_FORMAT_FILE::
Formatting file for a new case.
diff --git a/doc/reporter-ureport.txt b/doc/reporter-ureport.txt
index 7deb911..fc06541 100644
--- a/doc/reporter-ureport.txt
+++ b/doc/reporter-ureport.txt
@@ -34,10 +34,6 @@ Configuration file lines should have 'PARAM = VALUE' format. The parameters are:
Possible values are:
- 'rhsm';;
- Uses the system V3 entitlement certificate that is used for Red Hat
- subscription management.
-
'puppet';;
Uses the certificate that is used by the Puppet configuration management tool.
@@ -51,10 +47,6 @@ Configuration file lines should have 'PARAM = VALUE' format. The parameters are:
Possible values are::
- 'rhts-credentials';;
- Uses Login= and Password= values from /etc/libreport/plugins/rhtsupport.conf and
- user's local ~/.config/libreport/rhtsupport.conf.
-
'<user_name>:<password>';;
Manually supply credentials.
diff --git a/src/include/ureport.h b/src/include/ureport.h
index 63d9bf2..2e6de49 100644
--- a/src/include/ureport.h
+++ b/src/include/ureport.h
@@ -115,8 +115,7 @@ ureport_server_config_set_url(struct ureport_server_config *config,
* Configure client certificate paths
*
* @param config Where the paths are stored
- * @param client_path Path in form of cert_full_path:key_full_path or one of
- * the following string: 'rhsm', 'puppet'.
+ * @param client_path Path in form of cert_full_path:key_full_path or 'puppet'.
*/
#define ureport_server_config_set_client_auth libreport_ureport_server_config_set_client_auth
void
@@ -139,7 +138,6 @@ ureport_server_config_set_basic_auth(struct ureport_server_config *config,
* Configure user name and password for HTTP Basic authentication according to
* user preferences.
*
- * "rhts-credentials" - Uses Login= and Password= from rhtsupport.conf
* "<user_name>:<password>" - Manually supply user name and password.
* "<user_name>" - Manually supply user name and be asked for password.
*
diff --git a/src/lib/ureport.c b/src/lib/ureport.c
index ced4810..5d0a820 100644
--- a/src/lib/ureport.c
+++ b/src/lib/ureport.c
@@ -30,19 +30,6 @@
#define BTHASH_URL_SFX "reports/bthash/"
-#define RHSM_WEB_SERVICE_URL "https://cert-api.access.redhat.com/rs/telemetry/abrt"
-
-#define RHSMCON_PEM_DIR_PATH "/etc/pki/consumer"
-#define RHSMCON_CERT_NAME "cert.pem"
-#define RHSMCON_KEY_NAME "key.pem"
-
-/* Using the same template as for RHSM certificate, macro for cert dir path and
- * macro for cert name. Cert path can be easily modified for example by reading
- * an environment variable LIBREPORT_DEBUG_AUTHORITY_CERT_DIR_PATH
- */
-#define CERT_AUTHORITY_CERT_PATH "/etc/libreport"
-#define CERT_AUTHORITY_CERT_NAME "cert-api.access.redhat.com.pem"
-
static char *
puppet_config_print(const char *key)
{
@@ -73,55 +60,6 @@ ureport_server_config_set_url(struct ureport_server_config *config,
config->ur_url = server_url;
}
-static char *
-rhsm_config_get_consumer_cert_dir(void)
-{
- char *result = getenv("LIBREPORT_DEBUG_RHSMCON_PEM_DIR_PATH");
- if (result != NULL)
- return xstrdup(result);
-
- result = run_in_shell_and_save_output(0,
- "python3 -c \"from rhsm.config import initConfig; print(initConfig().get('rhsm', 'consumerCertDir'))\"",
- NULL, NULL);
-
- /* run_in_shell_and_save_output always returns non-NULL */
- if (result[0] != '/')
- goto error;
-
- char *newline = strchrnul(result, '\n');
- if (!newline)
- goto error;
-
- *newline = '\0';
- return result;
-error:
- free(result);
- error_msg("Failed to get 'rhsm':'consumerCertDir' from rhsm.config python module. Using "RHSMCON_PEM_DIR_PATH);
- return xstrdup(RHSMCON_PEM_DIR_PATH);
-}
-
-static bool
-certificate_exist(char *cert_name)
-{
- if (access(cert_name, F_OK) != 0)
- {
- log_notice("RHSM consumer certificate '%s' does not exist.", cert_name);
- return false;
- }
- return true;
-}
-
-static bool
-cert_authority_cert_exist(char *cert_name)
-{
- if (access(cert_name, F_OK) != 0)
- {
- log_notice("Certs validating the server '%s' does not exist.", cert_name);
- return false;
- }
- return true;
-}
-
void
ureport_server_config_set_client_auth(struct ureport_server_config *config,
const char *client_auth)
@@ -139,52 +77,6 @@ ureport_server_config_set_client_auth(struct ureport_server_config *config,
log_notice("Not using client authentication");
}
- else if (strcmp(client_auth, "rhsm") == 0)
- {
- if (config->ur_url == NULL)
- ureport_server_config_set_url(config, xstrdup(RHSM_WEB_SERVICE_URL));
-
- /* always returns non-NULL */
- char *rhsm_dir = rhsm_config_get_consumer_cert_dir();
-
- char *cert_full_name = concat_path_file(rhsm_dir, RHSMCON_CERT_NAME);
- char *key_full_name = concat_path_file(rhsm_dir, RHSMCON_KEY_NAME);
-
- /* get authority certificate dir path from environment variable, if it
- * is not set, use CERT_AUTHORITY_CERT_PATH
- */
- const char *authority_cert_dir_path = getenv("LIBREPORT_DEBUG_AUTHORITY_CERT_DIR_PATH");
- if (authority_cert_dir_path == NULL)
- authority_cert_dir_path = CERT_AUTHORITY_CERT_PATH;
-
- char *cert_authority_cert_full_name = concat_path_file(authority_cert_dir_path,
- CERT_AUTHORITY_CERT_NAME);
-
- if (certificate_exist(cert_full_name) && certificate_exist(key_full_name))
- {
- config->ur_client_cert = cert_full_name;
- config->ur_client_key = key_full_name;
- log_debug("Using cert files: '%s' : '%s'", config->ur_client_cert, config->ur_client_key);
- }
- else
- {
- free(cert_full_name);
- free(key_full_name);
- log_notice("Using the default configuration for uReports.");
- }
-
- if (cert_authority_cert_exist(cert_authority_cert_full_name))
- {
- config->ur_cert_authority_cert = cert_authority_cert_full_name;
- log_debug("Using validating server cert: '%s'", config->ur_cert_authority_cert);
- }
- else
- {
- free(cert_authority_cert_full_name);
- }
-
- free(rhsm_dir);
- }
else if (strcmp(client_auth, "puppet") == 0)
{
config->ur_client_cert = puppet_config_print("hostcert");
@@ -241,32 +133,12 @@ ureport_server_config_load_basic_auth(struct ureport_server_config *config,
const char *username = NULL;
const char *password = NULL;
- if (strcmp(http_auth_pref, "rhts-credentials") == 0)
- {
- settings = new_map_string();
-
- char *local_conf = xasprintf("%s"USER_HOME_CONFIG_PATH"/rhtsupport.conf", getenv("HOME"));
-
- if (!load_plugin_conf_file("rhtsupport.conf", settings, /*skip key w/o values:*/ false) &&
- !load_conf_file(local_conf, settings, /*skip key w/o values:*/ false))
- error_msg_and_die("Could not get RHTSupport credentials");
- free(local_conf);
-
- username = get_map_string_item_or_NULL(settings, "Login");
- password = get_map_string_item_or_NULL(settings, "Password");
-
- if (config->ur_url == NULL)
- ureport_server_config_set_url(config, xstrdup(RHSM_WEB_SERVICE_URL));
- }
- else
- {
- username = tmp_username = xstrdup(http_auth_pref);
- password = strchr(tmp_username, ':');
+ username = tmp_username = xstrdup(http_auth_pref);
+ password = strchr(tmp_username, ':');
- if (password != NULL)
- /* It is "char *", see strchr() few lines above. */
- *((char *)(password++)) = '\0';
- }
+ if (password != NULL)
+ /* It is "char *", see strchr() few lines above. */
+ *((char *)(password++)) = '\0';
if (password == NULL)
{
diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am
index b228602..f73e7dc 100644
--- a/src/plugins/Makefile.am
+++ b/src/plugins/Makefile.am
@@ -28,12 +28,6 @@ pluginsconfdir = $(PLUGINS_CONF_DIR)
reportpluginsconfdir = $(REPORT_PLUGINS_CONF_DIR)
-if ENABLE_IMPORT_RHTSUPPORT_CERT
-libreportconfdir = $(CONF_DIR)
-dist_libreportconf_DATA = \
- cert-api.access.redhat.com.pem
-endif
-
reporters_plugin_conf =
reporters_plugin_format_conf =
if BUILD_BUGZILLA
diff --git a/src/plugins/cert-api.access.redhat.com.pem b/src/plugins/cert-api.access.redhat.com.pem
deleted file mode 100644
index 20ef8c0..0000000
--- a/src/plugins/cert-api.access.redhat.com.pem
+++ /dev/null
@@ -1,74 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIHZDCCBUygAwIBAgIJAOb+QiglyeZeMA0GCSqGSIb3DQEBBQUAMIGwMQswCQYD
-VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExEDAOBgNVBAcMB1JhbGVp
-Z2gxFjAUBgNVBAoMDVJlZCBIYXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0
-d29yazEeMBwGA1UEAwwVRW50aXRsZW1lbnQgTWFzdGVyIENBMSQwIgYJKoZIhvcN
-AQkBFhVjYS1zdXBwb3J0QHJlZGhhdC5jb20wHhcNMTAwMzE3MTkwMDQ0WhcNMzAw
-MzEyMTkwMDQ0WjCBsDELMAkGA1UEBhMCVVMxFzAVBgNVBAgMDk5vcnRoIENhcm9s
-aW5hMRAwDgYDVQQHDAdSYWxlaWdoMRYwFAYDVQQKDA1SZWQgSGF0LCBJbmMuMRgw
-FgYDVQQLDA9SZWQgSGF0IE5ldHdvcmsxHjAcBgNVBAMMFUVudGl0bGVtZW50IE1h
-c3RlciBDQTEkMCIGCSqGSIb3DQEJARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMIIC
-IjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA2Z+mW7OYcBcGxWS+RSKG2GJ2
-csMXiGGfEp36vKVsIvypmNS60SkicKENMYREalbdSjrgfXxPJygZWsVWJ5lHPfBV
-o3WkFrFHTIXd/R6LxnaHD1m8Cx3GwEeuSlE/ASjc1ePtMnsHH7xqZ9wdl85b1C8O
-scgO7fwuM192kvv/veI/BogIqUQugtG6szXpV8dp4ml029LXFoNIy2lfFoa2wKYw
-MiUHwtYgAz7TDY63e8qGhd5PoqTv9XKQogo2ze9sF9y/npZjliNy5qf6bFE+24oW
-E8pGsp3zqz8h5mvw4v+tfIx5uj7dwjDteFrrWD1tcT7UmNrBDWXjKMG81zchq3h4
-etgF0iwMHEuYuixiJWNzKrLNVQbDmcLGNOvyJfq60tM8AUAd72OUQzivBegnWMit
-CLcT5viCT1AIkYXt7l5zc/duQWLeAAR2FmpZFylSukknzzeiZpPclRziYTboDYHq
-revM97eER1xsfoSYp4mJkBHfdlqMnf3CWPcNgru8NbEPeUGMI6+C0YvknPlqDDtU
-ojfl4qNdf6nWL+YNXpR1YGKgWGWgTU6uaG8Sc6qGfAoLHh6oGwbuz102j84OgjAJ
-DGv/S86svmZWSqZ5UoJOIEqFYrONcOSgztZ5tU+gP4fwRIkTRbTEWSgudVREOXhs
-bfN1YGP7HYvS0OiBKZUCAwEAAaOCAX0wggF5MB0GA1UdDgQWBBSIS6ZFxEbsj9bP
-pvYazyY8kMx/FzCB5QYDVR0jBIHdMIHagBSIS6ZFxEbsj9bPpvYazyY8kMx/F6GB
-tqSBszCBsDELMAkGA1UEBhMCVVMxFzAVBgNVBAgMDk5vcnRoIENhcm9saW5hMRAw
-DgYDVQQHDAdSYWxlaWdoMRYwFAYDVQQKDA1SZWQgSGF0LCBJbmMuMRgwFgYDVQQL
-DA9SZWQgSGF0IE5ldHdvcmsxHjAcBgNVBAMMFUVudGl0bGVtZW50IE1hc3RlciBD
-QTEkMCIGCSqGSIb3DQEJARYVY2Etc3VwcG9ydEByZWRoYXQuY29tggkA5v5CKCXJ
-5l4wDAYDVR0TBAUwAwEB/zALBgNVHQ8EBAMCAQYwEQYJYIZIAYb4QgEBBAQDAgEG
-MCAGA1UdEQQZMBeBFWNhLXN1cHBvcnRAcmVkaGF0LmNvbTAgBgNVHRIEGTAXgRVj
-YS1zdXBwb3J0QHJlZGhhdC5jb20wDQYJKoZIhvcNAQEFBQADggIBAJ1hEdNBDTRr
-6kI6W6stoogSUwjuiWPDY8DptwGhdpyIfbCoxvBR7F52DlwyXOpCunogfKMRklnE
-gH1Wt66RYkgNuJcenKHAhR5xgSLoPCOVF9rDjMunyyBuxjIbctM21R7BswVpsEIE
-OpV5nlJ6wkHsrn0/E+Zk5UJdCzM+Fp4hqHtEn/c97nvRspQcpWeDg6oUvaJSZTGM
-8yFpzR90X8ZO4rOgpoERukvYutUfJUzZuDyS3LLc6ysamemH93rZXr52zc4B+C9G
-Em8zemDgIPaH42ce3C3TdVysiq/yk+ir7pxW8toeavFv75l1UojFSjND+Q2AlNQn
-pYkmRznbD5TZ3yDuPFQG2xYKnMPACepGgKZPyErtOIljQKCdgcvb9EqNdZaJFz1+
-/iWKYBL077Y0CKwb+HGIDeYdzrYxbEd95YuVU0aStnf2Yii2tLcpQtK9cC2+DXjL
-Yf3kQs4xzH4ZejhG9wzv8PGXOS8wHYnfVNA3+fclDEQ1mEBKWHHmenGI6QKZUP8f
-g0SQ3PNRnSZu8R+rhABOEuVFIBRlaYijg2Pxe0NgL9FlHsNyRfo6EUrB2QFRKACW
-3Mo6pZyDjQt7O8J7l9B9IIURoJ1niwygf7VSJTMl2w3fFleNJlZTGgdXw0V+5g+9
-Kg6Ay0rrsi4nw1JHue2GvdjdfVOaWSWC
------END CERTIFICATE-----
------BEGIN CERTIFICATE-----
-MIIFfTCCA2WgAwIBAgIJAJGKz8qFAAADMA0GCSqGSIb3DQEBBQUAMIGwMQswCQYD
-VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExEDAOBgNVBAcMB1JhbGVp
-Z2gxFjAUBgNVBAoMDVJlZCBIYXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0
-d29yazEeMBwGA1UEAwwVRW50aXRsZW1lbnQgTWFzdGVyIENBMSQwIgYJKoZIhvcN
-AQkBFhVjYS1zdXBwb3J0QHJlZGhhdC5jb20wHhcNMTUwNTA1MTMwMzQ4WhcNMjUw
-NTAyMTMwMzQ4WjCBiTELMAkGA1UEBhMCVVMxFzAVBgNVBAgTDk5PUlRIIENBUk9M
-SU5BMRAwDgYDVQQHEwdSYWxlaWdoMRAwDgYDVQQKEwdSZWQgSGF0MRgwFgYDVQQL
-Ew9SZWQgSGF0IE5ldHdvcmsxIzAhBgNVBAMTGmNlcnQtYXBpLmFjY2Vzcy5yZWRo
-YXQuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA9hTNMtZMa7Kg
-Jlux6pnuUinP0Rv0aiiPFr7qNHFore4loGrPlpzUvQbUByy3xm7lhf4R4qbINCls
-veWg6HDidvQr174RXb5YLMXuBrYAiPWQTrRRLNuvXFHKzREghRWTv48IXTIDEo0G
-fZJUO+myY2RfwqugZKic5dR6ZakHSSpQO70O6H5R0eHlKa13k4eEpG2fVY/xqFto
-WkfZyEmSacZpqxp7gIjZqreLc4MFwpiVjGFrK3Jk+Px1Z6J94LTLx2SxrYzWIeUs
-5j+lceQOvpV4/pkClnRCW1pkCKTccjFKQkpNPGwdIusRXUGl9IYc20Fa/7g9iUQc
-5fXu9EAzfwIDAQABo4G+MIG7MAkGA1UdEwQCMAAwEQYJYIZIAYb4QgEBBAQDAgZA
-MAsGA1UdDwQEAwIF4DATBgNVHSUEDDAKBggrBgEFBQcDATA5BglghkgBhvhCAQ0E
-LBYqTWFuYWdlZCBieSBSZWQgSGF0IChjYS1zdXBwb3J0QHJlZGhhdC5jb20pMB0G
-A1UdDgQWBBRfgCjd8aXf0U4VX8DKTVIn+paGBzAfBgNVHSMEGDAWgBSIS6ZFxEbs
-j9bPpvYazyY8kMx/FzANBgkqhkiG9w0BAQUFAAOCAgEAlC+r6UEEp5BUkI0Rj2T+
-1PH7oUCaGQeQoyVbGddz/WUcBk/lMMtyCEoxU+3tTwNWmCWWjYXtjoL9MlSAC/q+
-NZfBi1iq0uuSus9JI/Uu8aRhoxTK56qGRed/JNixOHEmFn891cahIPpF0exWwtYD
-ThwXo7Z6PI7t8EMKdSrGTOowp58yho8xYFL/Z7JmjL55Pf85GIrdiniNZd4i178J
-07R9zsiLvdXq9mT33iJwkm+uhO+FA9d8OE3ji21pBbGUAQSWOdkemvUCsy8zANW9
-fT+dBrMr5Buk7eaBBJ2PxECNiWLCRQJWmyff1O5zMT0daS2lBdEGUNhBZ0hnX13Q
-kabUp0bxRrNRq+WkomP7onZhfZS6SjKm0UmwoV6o3V1ED6y7muQNRmgDpA5PcbvO
-gl7OexNL4zcpyfMdAmTYf5yTRSvB42Yg5hVfuzPEnOIqupwES3mWkEHRlqbMUkHw
-qIQAxIwQqZd5PdPpElQ/6j/ZT9DwW/I6zgndX2rsS0oGYcwFTkSj0/rKKkC13hk7
-LchXMZu5ckdustM79U6OZIBairrJaL2OpR08un2nwIjgEGqhVFYc44UK1VpkE8mr
-qvqJS6OHVlTlKcEDnhVkPS3i5qjuS/PtSq0CwH8bzYKFJayLDY/z36Zv6PdttzmU
-Yb1NSDcJejHJ80pMINutyYQ=
------END CERTIFICATE-----
diff --git a/src/plugins/report_RHTSupport.xml.in b/src/plugins/report_RHTSupport.xml.in
index 357a94d..c64cb55 100644
--- a/src/plugins/report_RHTSupport.xml.in
+++ b/src/plugins/report_RHTSupport.xml.in
@@ -26,11 +26,6 @@
<allow-empty>no</allow-empty>
</option>
<advanced-options>
- <option type="bool" name="RHTSupport_SubmitUReport">
- <_label>Submit uReport</_label>
- <_note-html>Submit &lt;a href="https://access.redhat.com/articles/642323"&gt;micro-report&lt;/a&gt; when creating a new case. </_note-html>
- <default-value>yes</default-value>
- </option>
<option type="text" name="RHTSupport_URL">
<_label>RH Portal URL</_label>
<allow-empty>no</allow-empty>
diff --git a/src/plugins/reporter-rhtsupport.c b/src/plugins/reporter-rhtsupport.c
index d11b4bd..411bffc 100644
--- a/src/plugins/reporter-rhtsupport.c
+++ b/src/plugins/reporter-rhtsupport.c
@@ -222,96 +222,6 @@ ret_clean:
return retval;
}
-static
-struct ureport_server_response *ureport_do_post_credentials(const char *json, struct ureport_server_config *config, const char *action)
-{
- struct post_state *post_state = NULL;
- while (1)
- {
- post_state = ureport_do_post(json, config, action);
-
- if (post_state == NULL)
- {
- error_msg(_("Failed on submitting the problem"));
- return NULL;
- }
-
- if (post_state->http_resp_code != 401)
- break;
-
- free_post_state(post_state);
-
- char *login = NULL;
- char *password = NULL;
- ask_rh_credentials(&login, &password);
- ureport_server_config_set_basic_auth(config, login, password);
- free(password);
- free(login);
- }
-
- struct ureport_server_response *resp = ureport_server_response_from_reply(post_state, config);
- free(post_state);
- return resp;
-}
-
-static
-char *submit_ureport(const char *dump_dir_name, struct ureport_server_config *conf)
-{
- struct dump_dir *dd = dd_opendir(dump_dir_name, DD_OPEN_READONLY);
- if (dd == NULL)
- return NULL;
-
- report_result_t *rr_bthash = find_in_reported_to(dd, "uReport");
- dd_close(dd);
-
- if (rr_bthash != NULL)
- {
- log_notice("uReport has already been submitted.");
- char *ret = xstrdup(rr_bthash->bthash);
- free_report_result(rr_bthash);
- return ret;
- }
-
- char *json = ureport_from_dump_dir(dump_dir_name);
- if (json == NULL)
- {
- log_notice(_("Failed to generate microreport from the problem data"));
- return NULL;
- }
-
- struct ureport_server_response *resp = ureport_do_post_credentials(json, conf, UREPORT_SUBMIT_ACTION);
- free(json);
- if (resp == NULL)
- return NULL;
-
- char *bthash = NULL;
- if (!resp->urr_is_error)
- {
- if (resp->urr_bthash != NULL)
- bthash = xstrdup(resp->urr_bthash);
-
- ureport_server_response_save_in_dump_dir(resp, dump_dir_name, conf);
-
- if (resp->urr_message)
- log_warning("%s", resp->urr_message);
- }
- else if (g_verbose > 2)
- error_msg(_("Server responded with an error: '%s'"), resp->urr_value);
-
- ureport_server_response_free(resp);
- return bthash;
-}
-
-static
-void attach_to_ureport(struct ureport_server_config *conf,
- const char *bthash, const char *attach_id, const char *data)
-{
- char *json = ureport_json_attachment_new(bthash, attach_id, data);
- struct ureport_server_response *resp = ureport_do_post_credentials(json, conf, UREPORT_ATTACH_ACTION);
- ureport_server_response_free(resp);
- free(json);
-}
-
static
bool check_for_hints(const char *url, char **login, char **password, bool ssl_verify, const char *tempfile)
{
@@ -420,42 +330,6 @@ char *get_param_string(const char *name, map_string_t *settings, const char *dfl
return xstrdup(envvar ? envvar : (get_map_string_item_or_NULL(settings, name) ? : dflt));
}
-static
-void prepare_ureport_configuration(const char *urcfile,
- map_string_t *settings, struct ureport_server_config *urconf,
- const char *portal_url, const char *login, const char *password, bool ssl_verify)
-{
- load_conf_file(urcfile, settings, false);
- ureport_server_config_init(urconf);
-
- /* The following lines cause that we always use URL from ureport's
- * configuration becuase the GUI reporter always exports uReport_URL env
- * var.
- *
- * char *url = NULL;
- * UREPORT_OPTION_VALUE_FROM_CONF(settings, "URL", url, xstrdup);
- * if (url != NULL)
- * ureport_server_config_set_url(urconf, url);
- */
-
- ureport_server_config_set_url(urconf, concat_path_file(portal_url, "/telemetry/abrt"));
- urconf->ur_ssl_verify = ssl_verify;
-
- ureport_server_config_set_basic_auth(urconf, login, password);
-
- bool include_auth = true;
- UREPORT_OPTION_VALUE_FROM_CONF(settings, "IncludeAuthData", include_auth, string_to_bool);
-
- if (include_auth)
- {
- const char *auth_items = NULL;
- UREPORT_OPTION_VALUE_FROM_CONF(settings, "AuthDataItems", auth_items, (const char *));
- urconf->ur_prefs.urp_auth_items = parse_list(auth_items);
- }
-
- urconf->ur_prefs.urp_flags |= UREPORT_PREF_FLAG_RETURN_ON_FAILURE;
-}
-
static char *create_case_url(char *url, const char *case_no)
{
char *url1 = concat_path_file(url, RHTSUPPORT_CASE_URL_PATH);
@@ -496,7 +370,6 @@ int main(int argc, char **argv)
const char *dump_dir_name = ".";
const char *case_no = NULL;
GList *conf_file = NULL;
- const char *urconf_file = UREPORT_CONF_FILE_PATH;
const char *fmt_file = NULL;
/* Can't keep these strings/structs static: _() doesn't support that */
@@ -524,10 +397,6 @@ int main(int argc, char **argv)
"\n"
"Option -tCASE uploads FILEs to the case CASE on RHTSupport site.\n"
"-d DIR is ignored.\n"
- "\n"
- "Option -u sends ABRT crash statistics data (uReport) before creating a new case.\n"
- "uReport configuration is loaded from UR_CONFFILE which defaults to\n"
- UREPORT_CONF_FILE_PATH".\n"
);
enum {
OPT_v = 1 << 0,
@@ -547,8 +416,6 @@ int main(int argc, char **argv)
OPT_LIST( 'c', NULL, &conf_file , "FILE", _("Configuration file (may be given many times)")),
OPT_OPTSTRING('t', NULL, &case_no , "ID" , _("Upload FILEs [to case with this ID]")),
OPT_BOOL( 'f', NULL, NULL , _("Force reporting even if this problem is already reported")),
- OPT_BOOL( 'u', NULL, NULL , _("Submit uReport before creating a new case")),
- OPT_STRING( 'C', NULL, &urconf_file , "FILE", _("Configuration file for uReport")),
OPT_STRING( 'F', NULL, &fmt_file , "FILE", _("Formatting file for a new case")),
OPT_BOOL( 'D', NULL, NULL , _("Debug")),
OPT_END()
@@ -607,22 +474,10 @@ int main(int argc, char **argv)
/* RH has a 250m limit for web attachments (as of 2013) */
envvar ? envvar : (get_map_string_item_or_NULL(settings, "BigSizeMB") ? : "200")
);
- envvar = getenv("RHTSupport_SubmitUReport");
- bool submit_ur = string_to_bool(
- envvar ? envvar :
- (get_map_string_item_or_NULL(settings, "SubmitUReport") ? :
- ((opts & OPT_u) ? "1" : "0"))
- );
+
free_map_string(settings);
char *base_api_url = xstrdup(url);
- char *bthash = NULL;
-
- map_string_t *ursettings = new_map_string();
- struct ureport_server_config urconf;
-
- prepare_ureport_configuration(urconf_file, ursettings, &urconf,
- url, login, password, ssl_verify);
if (opts & OPT_t)
{
@@ -697,17 +552,6 @@ int main(int argc, char **argv)
return 0;
}
free_report_result(reported_to);
-
- if (submit_ur)
- {
- log_warning(_("Sending ABRT crash statistics data"));
-
- bthash = submit_ureport(dump_dir_name, &urconf);
-
- /* Ensure that we will use the updated credentials */
- STRCPY_IF_NOT_EQUAL(login, urconf.ur_username);
- STRCPY_IF_NOT_EQUAL(password, urconf.ur_password);
- }
}
problem_data_t *problem_data = create_problem_data_for_reporting(dump_dir_name);
@@ -930,30 +774,6 @@ int main(int argc, char **argv)
}
/* else: error msg was already emitted by dd_opendir */
- if (bthash)
- {
- log_warning(_("Linking ABRT crash statistics record with the case"));
-
- /* Make sure we use the current credentials */
- ureport_server_config_set_basic_auth(&urconf, login, password);
-
- /* Attach Customer Case ID*/
- attach_to_ureport(&urconf, bthash, "RHCID", result->url);
-
- /* Attach Contact e-mail if configured */
- const char *email = NULL;
- UREPORT_OPTION_VALUE_FROM_CONF(ursettings, "ContactEmail", email, (const char *));
- if (email != NULL)
- {
- log_warning(_("Linking ABRT crash statistics record with contact email: '%s'"), email);
- attach_to_ureport(&urconf, bthash, "email", email);
- }
-
- /* Update the credentials */
- STRCPY_IF_NOT_EQUAL(login, urconf.ur_username);
- STRCPY_IF_NOT_EQUAL(password, urconf.ur_password);
- }
-
url = result->url;
result->url = NULL;
free_rhts_result(result);
@@ -1021,10 +841,6 @@ int main(int argc, char **argv)
free_rhts_result(result_atch);
free_rhts_result(result);
- ureport_server_config_destroy(&urconf);
- free_map_string(ursettings);
- free(bthash);
-
free(base_api_url);
free(url);
free(login);
diff --git a/src/plugins/ureport.conf b/src/plugins/ureport.conf
index 04dc100..11f4531 100644
--- a/src/plugins/ureport.conf
+++ b/src/plugins/ureport.conf
@@ -22,8 +22,6 @@
# 'IncludeAuthData' to 'yes'.
# None (default):
# SSLClientAuth =
-# Using RH subscription management consumer certificate:
-# SSLClientAuth = rhsm
# Using Puppet certificate:
# SSLClientAuth = puppet
# Using custom certificate:
@@ -32,8 +30,6 @@
# HTTP Basic authentication credentials.
# Assingning any value to 'HTTPAuth' changes the default value of
# 'IncludeAuthData' to 'yes'.
-# Use Login= and Password= from /etc/libreport/plugins/rhtsupport.conf:
-# HTTPAuth = rhts-credentials
# Use username and password:
# HTTPAuth = username:password
diff --git a/tests/ureport.at b/tests/ureport.at
index ecaa3dd..51ca0c2 100644
--- a/tests/ureport.at
+++ b/tests/ureport.at
@@ -250,73 +250,6 @@ int main(void)
ureport_server_config_destroy(&config);
free_map_string(settings);
- /* value from env */
- /* HTTPAuth set to 'username:password' */
- /* SSLClientAuth set to 'rhsm' */
- ureport_server_config_init(&config);
-
- settings = new_map_string();
-
- setenv("uReport_SSLClientAuth", "rhsm", 1);
- setenv("uReport_HTTPAuth", "username:password", 1);
- setenv("uReport_AuthDataItems", "hostname, time", 1);
-
- setenv("LIBREPORT_DEBUG_RHSMCON_PEM_DIR_PATH", TESTING_CERTS_CORRECT_DIR_PATH, 1);
-
- ureport_server_config_load(&config, settings);
-
- assert(strcmp(config.ur_username, "username") == 0);
- assert(strcmp(config.ur_password, "password") == 0);
-
- assert(config.ur_client_cert == NULL);
- assert(config.ur_client_key == NULL);
- assert(size_map_string(config.ur_http_headers) == 0);
-
- l = config.ur_prefs.urp_auth_items;
- assert(strcmp(l->data, "hostname") == 0);
- assert(strcmp(l->next->data, "time") == 0);
-
- unsetenv("LIBREPORT_DEBUG_RHSMCON_PEM_DIR_PATH");
-
- unsetenv("uReport_SSLClientAuth");
- unsetenv("uReport_HTTPAuth");
- unsetenv("uReport_AuthDataItems");
-
- free_map_string(settings);
-
- ureport_server_config_destroy(&config);
-
- /* value from settings */
- /* HTTPAuth set to 'username:password' */
- /* SSLClientAuth set to 'rhsm' */
- ureport_server_config_init(&config);
-
- settings = new_map_string();
- insert_map_string(settings, xstrdup("SSLClientAuth"), xstrdup("rhsm"));
- insert_map_string(settings, xstrdup("HTTPAuth"), xstrdup("rhn-username:rhn-password"));
- insert_map_string(settings, xstrdup("AuthDataItems"), xstrdup("hostname, type"));
-
- setenv("LIBREPORT_DEBUG_RHSMCON_PEM_DIR_PATH", TESTING_CERTS_CORRECT_DIR_PATH, 1);
-
- ureport_server_config_load(&config, settings);
-
- assert(strcmp(config.ur_username, "rhn-username") == 0);
- assert(strcmp(config.ur_password, "rhn-password") == 0);
-
- assert(config.ur_client_cert == NULL);
- assert(config.ur_client_key == NULL);
- assert(size_map_string(config.ur_http_headers) == 0);
-
- l = config.ur_prefs.urp_auth_items;
- assert(strcmp(l->data, "hostname") == 0);
- assert(strcmp(l->next->data, "type") == 0);
-
- unsetenv("LIBREPORT_DEBUG_RHSMCON_PEM_DIR_PATH");
-
- free_map_string(settings);
-
- ureport_server_config_destroy(&config);
-
return 0;
}
]])
@@ -366,7 +299,6 @@ AT_TESTFUN([ureport_server_config_set_client_auth],
#include <assert.h>
#define DESTROYED_POINTER (void *)0xdeadbeef
-#define RHSM_WEB_SERVICE_URL "https://cert-api.access.redhat.com/rs/telemetry/abrt"
#define TESTING_CERTS_CORRECT_DIR_PATH "../../ureport/certs/correct"
#define TESTING_CERTS_INCORRECT_ONLY_CERT_DIR_PATH "../../ureport/certs/only_cert"
@@ -374,10 +306,6 @@ AT_TESTFUN([ureport_server_config_set_client_auth],
#define TESTING_PYTHONPATH "../../ureport/"
#define WRONG_TESTING_PYTHONPATH "../../ureportxxxxxx/"
-#define RHSMCON_PEM_DIR_PATH "/etc/pki/consumer"
-#define RHSMCON_CERT_NAME "cert.pem"
-#define RHSMCON_KEY_NAME "key.pem"
-
char *my_strdup(const char *str)
{
if (str == NULL)
@@ -500,52 +428,6 @@ int main(void)
ureport_server_config_destroy(&config);
- /* client_auth == rhsm */
- /* ur_url == NULL */
- /* no certs */
- char *empty_cert_dir = mkdtemp(strdup("/tmp/cert_XXXXXX"));
- assert(empty_cert_dir);
- setenv("LIBREPORT_DEBUG_RHSMCON_PEM_DIR_PATH", empty_cert_dir, 1);
-
- int status = test_ureport_server_config_set_client_auth_exit_code_ext(&config, "rhsm", NULL, NULL);
- assert(status == 0);
-
- assert(rmdir(empty_cert_dir) == 0);
-
- /* client_auth == rhsm */
- /* ur_url == NULL */
- /* certs exists (only RHSMCON_CERT_NAME exists) */
-
- setenv("LIBREPORT_DEBUG_RHSMCON_PEM_DIR_PATH", TESTING_CERTS_INCORRECT_ONLY_CERT_DIR_PATH, 1);
-
- status = test_ureport_server_config_set_client_auth_exit_code_ext(&config, "rhsm", NULL, NULL);
- assert(status == 0);
-
- /* client_auth == rhsm */
- /* ur_url == NULL */
- /* certs exists (only RHSMCON_KEY_NAME exists) */
-
- setenv("LIBREPORT_DEBUG_RHSMCON_PEM_DIR_PATH", TESTING_CERTS_INCORRECT_ONLY_KEY_DIR_PATH, 1);
-
- status = test_ureport_server_config_set_client_auth_exit_code_ext(&config, "rhsm", NULL, NULL);
- assert(status == 0);
-
- /* client_auth == rhsm */
- /* ur_url == NULL */
- /* certs exists (correct) */
- ureport_server_config_init(&config);
-
- setenv("LIBREPORT_DEBUG_RHSMCON_PEM_DIR_PATH", TESTING_CERTS_CORRECT_DIR_PATH, 1);
-
- ureport_server_config_set_client_auth(&config, "rhsm");
-
- assert_ureport_server_config(&config, RHSM_WEB_SERVICE_URL, true,
- TESTING_CERTS_CORRECT_DIR_PATH"/cert.pem",
- TESTING_CERTS_CORRECT_DIR_PATH"/key.pem",
- NULL, NULL);
-
- ureport_server_config_destroy(&config);
-
/* client_auth == cert:key */
/* ur_url == NULL */
ureport_server_config_init(&config);
@@ -572,44 +454,6 @@ int main(void)
ret_val = test_ureport_server_config_set_client_auth_exit_code(&config, "cert");
assert(ret_val != 0 && ret_val != -1);
-/* rhsm_config_get_consumer_cert_dir */
-/* certs exists (correct content) */
- unsetenv("LIBREPORT_DEBUG_RHSMCON_PEM_DIR_PATH");
- setenv("PYTHONPATH", TESTING_PYTHONPATH, 1);
-
- ureport_server_config_init(&config);
- ureport_server_config_set_client_auth(&config, "rhsm");
-
- char *abs_path_cert = realpath(TESTING_CERTS_CORRECT_DIR_PATH"/cert.pem", NULL);
- char *abs_path_key = realpath(TESTING_CERTS_CORRECT_DIR_PATH"/key.pem", NULL);
-
- assert_ureport_server_config(&config, RHSM_WEB_SERVICE_URL, true,
- abs_path_cert,
- abs_path_key,
- NULL, NULL);
- free(abs_path_cert);
- free(abs_path_key);
-
- ureport_server_config_destroy(&config);
-
- /* python script fails, '/etc/pki/consumer' is returned */
-
- /* set cert dir path to '/etc/pki/consumer' */
- /* store return value of ureport_server_config_set_client_auth */
- setenv("LIBREPORT_DEBUG_RHSMCON_PEM_DIR_PATH", RHSMCON_PEM_DIR_PATH, 1);
-
- int exp_ret_val = test_ureport_server_config_set_client_auth_exit_code(&config, "rhsm");
-
- /* Do the same with unset LIBREPORT_DEBUG_RHSMCON_PEM_DIR_PATH and wrong PYTHONPATH */
- /* function rhsm_config_get_consumer_cert_dir has to return RHSMCON_PEM_DIR_PATH */
- unsetenv("LIBREPORT_DEBUG_RHSMCON_PEM_DIR_PATH");
- setenv("PYTHONPATH", WRONG_TESTING_PYTHONPATH, 1);
-
- int rec_ret_val = test_ureport_server_config_set_client_auth_exit_code(&config, "rhsm");
-
- /* we expect the same return value */
-// assert(exp_ret_val == rec_ret_val);
-
return 0;
}
]])
@@ -1208,8 +1052,6 @@ AT_TESTFUN([ureport_server_config_load_basic_auth],
#include "libreport_curl.h"
#include "problem_data.h"
-#define RHSM_WEB_SERVICE_URL "https://cert-api.access.redhat.com/rs/telemetry/abrt"
-
int main(void)
{
g_verbose=3;
@@ -1226,22 +1068,6 @@ int main(void)
ureport_server_config_destroy(&config);
}
- {
- struct ureport_server_config config;
- ureport_server_config_init(&config);
-
- setenv("LIBREPORT_DEBUG_PLUGINS_CONF_DIR", "../../ureport-rhts-credentials/", 1);
-
- ureport_server_config_load_basic_auth(&config, "rhts-credentials");
-
- assert(strcmp(config.ur_username, "rhn-user-name") == 0);
- assert(strcmp(config.ur_password, "rhn-password") == 0);
- assert(strcmp(config.ur_url, RHSM_WEB_SERVICE_URL) == 0);
-
- unsetenv("LIBREPORT_DEBUG_PLUGINS_CONF_DIR");
- ureport_server_config_destroy(&config);
- }
-
{
pid_t pid = fork();
if (pid < 0)
diff --git a/tests/ureport/rhsm/__init__.py b/tests/ureport/rhsm/__init__.py
deleted file mode 100644
index e69de29..0000000
diff --git a/tests/ureport/rhsm/config.py b/tests/ureport/rhsm/config.py
deleted file mode 100644
index 44483d8..0000000
--- a/tests/ureport/rhsm/config.py
+++ /dev/null
@@ -1,8 +0,0 @@
-import os
-
-def initConfig():
- return myConfig()
-
-class myConfig():
- def get(self, key, value):
- return os.path.abspath("../../ureport/certs/correct")

View File

@ -0,0 +1,34 @@
From aea02b3719a161a05dac815955cfa1bb630e8da4 Mon Sep 17 00:00:00 2001
From: Ernestas Kulik <ekulik@redhat.com>
Date: Fri, 24 Jul 2020 10:45:37 +0200
Subject: [PATCH] plugins: reporter-rhtsupport: Fix command-line parsing
cb81dc0870949fbacaa6e2384e91fc4de4df43a5 drops -u and -C options, but
does not remove them from the enumeration, which maps the options to the
option struct, leading to -F and -D not being parsed.
https://bugzilla.redhat.com/show_bug.cgi?id=1860285
---
src/plugins/reporter-rhtsupport.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/plugins/reporter-rhtsupport.c b/src/plugins/reporter-rhtsupport.c
index 411bffc..7f5aafa 100644
--- a/src/plugins/reporter-rhtsupport.c
+++ b/src/plugins/reporter-rhtsupport.c
@@ -404,10 +404,8 @@ int main(int argc, char **argv)
OPT_c = 1 << 2,
OPT_t = 1 << 3,
OPT_f = 1 << 4,
- OPT_u = 1 << 5,
- OPT_C = 1 << 6,
- OPT_F = 1 << 7,
- OPT_D = 1 << 8,
+ OPT_F = 1 << 5,
+ OPT_D = 1 << 6,
};
/* Keep enum above and order of options below in sync! */
struct options program_options[] = {
--
2.26.2

View File

@ -0,0 +1,44 @@
From 143c76e6db52881a8da188f54ec0ec1aacb209de Mon Sep 17 00:00:00 2001
From: Ernestas Kulik <ekulik@redhat.com>
Date: Wed, 19 Aug 2020 09:30:28 +0300
Subject: [PATCH] Drop remaining references to removed command-line options
cb81dc0870949fbacaa6e2384e91fc4de4df43a5 drops -u and -C options, but
the report_RHTSupport event handler still passes one of them, resulting
in failures.
https://bugzilla.redhat.com/show_bug.cgi?id=1867064
---
doc/reporter-rhtsupport.txt | 2 +-
src/plugins/rhtsupport_event.conf | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/doc/reporter-rhtsupport.txt b/doc/reporter-rhtsupport.txt
index 132c0eaa..7d79e33b 100644
--- a/doc/reporter-rhtsupport.txt
+++ b/doc/reporter-rhtsupport.txt
@@ -7,7 +7,7 @@ reporter-rhtsupport - Reports problem to RHTSupport.
SYNOPSIS
--------
-'reporter-rhtsupport' [-v] [-c CONFFILE] [-F FMTFILE] [-u -C UR_CONFFILE] -d DIR
+'reporter-rhtsupport' [-v] [-c CONFFILE] [-F FMTFILE] -d DIR
Or:
diff --git a/src/plugins/rhtsupport_event.conf b/src/plugins/rhtsupport_event.conf
index cc2f05d1..6b0b3e67 100644
--- a/src/plugins/rhtsupport_event.conf
+++ b/src/plugins/rhtsupport_event.conf
@@ -1,6 +1,6 @@
EVENT=report_RHTSupport
- # Submit an uReport and create a case in Red Hat Customer Portal
- reporter-rhtsupport -u
+ # Create a case in Red Hat Customer Portal
+ reporter-rhtsupport
EVENT=report_RHTSupport_AddData
# Attach data to a case in Red Hat Customer Portal
--
2.28.0

View File

@ -0,0 +1,116 @@
From 9636b85c5570911c753bc8074ce5bd73f490d4da Mon Sep 17 00:00:00 2001
From: Michal Fabik <mfabik@redhat.com>
Date: Wed, 19 Jun 2019 13:42:07 +0200
Subject: [PATCH] Add autogen.sh
---
autogen.sh | 97 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 97 insertions(+)
create mode 100755 autogen.sh
diff --git a/autogen.sh b/autogen.sh
new file mode 100755
index 00000000..fd48b5f0
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,97 @@
+#!/bin/sh
+
+print_help()
+{
+cat << EOH
+Prepares the source tree for configuration
+
+Usage:
+ autogen.sh [sysdeps [--install]]
+
+Options:
+
+ sysdeps prints out all dependencies
+ --install install all dependencies ('sudo yum install \$DEPS')
+
+EOH
+}
+
+parse_build_requires_from_spec_file()
+{
+ PACKAGE=$1
+ TEMPFILE=$(mktemp -u --suffix=.spec)
+ sed 's/@@LIBREPORT_VERSION@@/1/' < $PACKAGE.spec.in | sed 's/@.*@//' > $TEMPFILE
+ rpmspec -P $TEMPFILE | grep "^\(Build\)\?Requires:" | \
+ tr -s " " | tr "," "\n" | cut -f2- -d " " | \
+ grep -v "\(^\|python[23]-\)"$PACKAGE | sort -u | sed -E 's/^(.*) (.*)$/"\1 \2"/' | tr \" \'
+ rm $TEMPFILE
+}
+
+list_build_dependencies()
+{
+ local BUILD_SYSTEM_DEPS_LIST="gettext-devel"
+ echo $BUILD_SYSTEM_DEPS_LIST $(parse_build_requires_from_spec_file libreport)
+}
+
+case "$1" in
+ "--help"|"-h")
+ print_help
+ exit 0
+ ;;
+ "sysdeps")
+ DEPS_LIST=$(list_build_dependencies)
+
+ if [ "$2" == "--install" ]; then
+ set -x verbose
+ eval sudo dnf install --setopt=strict=0 $DEPS_LIST
+ set +x verbose
+ else
+ echo $DEPS_LIST
+ fi
+ exit 0
+ ;;
+ *)
+ echo "Running gen-version"
+ ./gen-version
+
+ mkdir -p m4
+ echo "Creating m4/aclocal.m4 ..."
+ test -r m4/aclocal.m4 || touch m4/aclocal.m4
+
+ echo "Running autopoint"
+ autopoint --force || exit 1
+
+ echo "Running intltoolize..."
+ intltoolize --force --copy --automake || exit 1
+
+ echo "Running aclocal..."
+ aclocal || exit 1
+
+ echo "Running libtoolize..."
+ libtoolize || exit 1
+
+ echo "Running autoheader..."
+ autoheader || return 1
+
+ echo "Running autoconf..."
+ autoconf --force || exit 1
+
+ echo "Running automake..."
+ automake --add-missing --force --copy || exit 1
+
+ echo "Running configure ..."
+ if [ 0 -eq $# ]; then
+ ./configure \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --sharedstatedir=/var/lib \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ --enable-debug
+ echo "Configured for local debugging ..."
+ else
+ ./configure "$@"
+ fi
+ ;;
+esac
--
2.21.0

View File

@ -29,7 +29,7 @@
Summary: Generic library for reporting various problems
Name: libreport
Version: 2.9.5
Release: 6%{?dist}
Release: 15%{?dist}
License: GPLv2+
URL: https://abrt.readthedocs.org/
Source: https://github.com/abrt/%{name}/archive/%{version}/%{name}-%{version}.tar.gz
@ -51,6 +51,31 @@ Patch0014: 0014-coverity-Remove-check-for-null-pointer-with-no-effec.patch
Patch0015: 0015-coverity-Check-return-value-of-fstat-call-def31.patch
Patch0016: 0016-coverity-Remove-reverse-inull-def30.patch
Patch0017: 0017-coverity-Remove-deadcode-def47.patch
#Patch0018: 0018-Make-this-build-without-usr-bin-python.patch
Patch0019: 0019-bugzilla-change-the-default-bugzilla-group.patch
Patch0020: 0020-lib-dump_dir-Clean-up-on-failure-in-dd_delete.patch
Patch0021: 0021-cli-Unpack-command-line-argument-parsing-logic.patch
Patch0022: 0022-plugins-rhbz-Don-t-call-strlen-on-attachment-data.patch
Patch0023: 0023-tests-Disable-strcpm-ing-a-freed-pointer.patch
#git format-patch -N --start-number=24
Patch0024: 0024-lib-fix-a-SEGV-in-list_possible_events.patch
#git format-patch -N --start-number=25
Patch0025: 0025-report-client-Find-debuginfos-in-own-method.patch
Patch0026: 0026-reportclient-Find-and-download-required-debuginfo-pa.patch
Patch0027: 0027-reportclient-Search-for-required-packages-recursivel.patch
# git format-patch --no-numbered --start-number=28 --topo-order 2.9.5-10.el8
Patch0028: 0028-dirsize-Skip-dirs-in-which-sosreport-is-being-genera.patch
# git format-patch --no-numbered --start-number=29 --topo-order 2.9.5-11.el8
Patch0029: 0029-setgid-instead-of-setuid-the-abrt-action-install-deb.patch
# git format-patch --no-numbered --start-number=30 --topo-order 2.9.5-12.el8
Patch0030: 0030-ureport-Drop-Strata-integration.patch
# git format-patch --no-numbered --start-number=31 --topo-order 2.9.5-13.el8
Patch0031: 0031-plugins-reporter-rhtsupport-Fix-command-line-parsing.patch
# git format-patch --no-numbered --start-number=32 --topo-order 2.9.5-14.el8
Patch0032: 0032-Drop-remaining-references-to-removed-command-line-op.patch
# autogen.sh is need to regenerate all the Makefile files
Patch9000: 9000-Add-autogen.sh.patch
BuildRequires: %{dbus_devel}
BuildRequires: gtk3-devel
@ -379,6 +404,7 @@ data over ftp/scp...
%autosetup -S git
%build
./autogen.sh
autoconf
CFLAGS="%{optflags} -Werror" %configure \
@ -390,9 +416,6 @@ CFLAGS="%{optflags} -Werror" %configure \
%endif # with python3
%if %{without bugzilla}
--without-bugzilla \
%endif
%if 0%{?rhel}
--enable-import-rhtsupport-cert \
%endif
--enable-doxygen-docs \
--disable-silent-rules
@ -726,9 +749,6 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%{_datadir}/%{name}/events/report_RHTSupport.xml
%{_datadir}/%{name}/events/report_RHTSupport_AddData.xml
%{_datadir}/dbus-1/interfaces/com.redhat.problems.configuration.rhtsupport.xml
%if 0%{?rhel}
%attr(600,root,root)%{_sysconfdir}/%{name}/cert-api.access.redhat.com.pem
%endif
%config(noreplace) %{_sysconfdir}/libreport/events.d/rhtsupport_event.conf
%{_mandir}/man1/reporter-rhtsupport.1.gz
%{_mandir}/man5/rhtsupport.conf.5.*
@ -833,6 +853,41 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%endif
%changelog
* Tue Aug 18 2020 - Ernestas Kulik <ekulik@redhat.com> - 2.9.5-15
- Add patch for rhbz#1867064
* Fri Jul 24 2020 - Ernestas Kulik <ekulik@redhat.com> - 2.9.5-14
- Add patch for #1860285
* Mon Jun 29 2020 - Ernestas Kulik <ekulik@redhat.com> - 2.9.5-13
- Add patch for #1848903
* Wed Jun 24 2020 Michal Židek <mzidek@redhat.com> - 2.9.5-12
- Resolves: rhbz#1835388 - abrt-addon-ccpp causes failures during openscap scans on CCE-27119-7
- This is just libreport side (abrt also needs to be patched)
* Thu Apr 16 2020 Ernestas Kulik <ekulik@redhat.com> - 2.9.5-11
- Add patch for #1822092
* Tue Jan 21 2020 Martin Kutlak <mkutlak@redhat.com> - 2.9.5-10
- reportclient: Search for required packages recursively
- reportclient: Find and download required debuginfo packages
- report-client: Find debuginfos in own method
- Resolves: rhbz#1783897
* Mon Jul 29 2019 Martin Kutlak <mkutlak@redhat.com> - 2.9.5-9
- lib: fix a SEGV in list_possible_events()
- Resolves: rhbz#1733515
* Wed Jul 24 2019 Ernestas Kulik <ekulik@redhat.com> - 2.9.5-8
- Uncomment some patches for Coverity issues
* Tue Jul 16 2019 Michal Fabik <mfabik@redhat.com> 2.9.5-7
- bugzilla: change the default bugzilla group
- tests: Disable strcpm'ing a freed pointer
- Add autogen.sh
- Resolves #1660449
* Wed Aug 29 2018 Matej Habrnal <mhabrnal@redhat.com> 2.9.5-6
- replace all Fedora URLs by corresponding values for RHEL
- fix coverity issues