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

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