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