arrfab / rpms / abrt

Forked from rpms/abrt 5 years ago
Clone

Blame SOURCES/0263-cli-don-t-start-reporting-of-not-reportable-problems.patch

a013b7
From 726eaedf70802680a3634b572603b39422016c80 Mon Sep 17 00:00:00 2001
a013b7
From: Jakub Filak <jfilak@redhat.com>
a013b7
Date: Thu, 20 Aug 2015 11:15:59 +0200
a013b7
Subject: [PATCH] cli: don't start reporting of not-reportable problems
a013b7
a013b7
If the reported problem data contains 'not-reportable' element, the
a013b7
reporting process fails unexpectedly and after the reporter already spent some
a013b7
time on it.
a013b7
a013b7
This commit ensures that the reporting process won't start, so
a013b7
abrt-cli's behaviour will be consistent with ABRT GUI.
a013b7
a013b7
However, this is not an ideal solution because we might want to allow
a013b7
the reporter to report the problem directly to developers via e-mail.
a013b7
a013b7
Closes #986
a013b7
Related to #1257159
a013b7
a013b7
Signed-off-by: Jakub Filak <jfilak@redhat.com>
a013b7
---
a013b7
 src/cli/report.c | 9 +++++++++
a013b7
 1 file changed, 9 insertions(+)
a013b7
a013b7
diff --git a/src/cli/report.c b/src/cli/report.c
a013b7
index 19b4c51..cc4035e 100644
a013b7
--- a/src/cli/report.c
a013b7
+++ b/src/cli/report.c
a013b7
@@ -36,6 +36,15 @@ int _cmd_report(const char **dirs_strv, int remove)
a013b7
             continue;
a013b7
         }
a013b7
 
a013b7
+        const int not_reportable = test_exist_over_dbus(real_problem_id, FILENAME_NOT_REPORTABLE);
a013b7
+        if (not_reportable != 0)
a013b7
+        {
a013b7
+            error_msg(_("Problem '%s' cannot be reported"), real_problem_id);
a013b7
+            free(real_problem_id);
a013b7
+            ++ret;
a013b7
+            continue;
a013b7
+        }
a013b7
+
a013b7
         const int res = chown_dir_over_dbus(real_problem_id);
a013b7
         if (res != 0)
a013b7
         {
a013b7
-- 
a013b7
1.8.3.1
a013b7