Blame SOURCES/0123-abrt-auto-reporting-require-rhtsupport.conf-file-onl.patch

a60cd7
From 42c35440205e0174af21315277dedac76fb9c8ae Mon Sep 17 00:00:00 2001
a60cd7
From: Matej Habrnal <mhabrnal@redhat.com>
a60cd7
Date: Fri, 24 Apr 2015 15:37:15 +0200
a60cd7
Subject: [PATCH] abrt-auto-reporting: require rhtsupport.conf file only on
a60cd7
 RHEL
a60cd7
a60cd7
abrt-auto-reporting required the rhtsupport.conf on Fedora and CentOS but the conf
a60cd7
file do not exists in those systems.
a60cd7
a60cd7
Resolves abrt/abrt#957
a60cd7
a60cd7
Signed-off-by: Matej Habrnal <mhabrnal@redhat.com>
a60cd7
---
a60cd7
 configure.ac                                |  11 +++
a60cd7
 doc/Makefile.am                             |  13 +++-
a60cd7
 doc/abrt-auto-reporting-authenticated.txt   | 106 ++++++++++++++++++++++++++++
a60cd7
 doc/abrt-auto-reporting-unauthenticated.txt |  71 +++++++++++++++++++
a60cd7
 doc/abrt-auto-reporting.txt                 | 106 ----------------------------
a60cd7
 src/daemon/abrt-auto-reporting.c            |  71 ++++++++++++++-----
a60cd7
 6 files changed, 254 insertions(+), 124 deletions(-)
a60cd7
 create mode 100644 doc/abrt-auto-reporting-authenticated.txt
a60cd7
 create mode 100644 doc/abrt-auto-reporting-unauthenticated.txt
a60cd7
 delete mode 100644 doc/abrt-auto-reporting.txt
a60cd7
a60cd7
diff --git a/configure.ac b/configure.ac
a60cd7
index d95fc4a..d65bf54 100644
a60cd7
--- a/configure.ac
a60cd7
+++ b/configure.ac
a60cd7
@@ -207,6 +207,17 @@ AC_ARG_ENABLE(suggest-autoreporting,
a60cd7
 
a60cd7
 AM_CONDITIONAL(SUGGEST_AUTOREPORTING, test "$enable_suggest_autoreporting" = "yes")
a60cd7
 
a60cd7
+# Authenticated autoreporting
a60cd7
+
a60cd7
+AC_ARG_ENABLE(authenticated-autoreporting,
a60cd7
+    AS_HELP_STRING([--enable-authenticated-autoreporting],
a60cd7
+    [enable authenticated autoreporting]),
a60cd7
+    [enable_authenticated_autoreporting=$enableval],
a60cd7
+    [enable_authenticated_autoreporting=no]
a60cd7
+)
a60cd7
+
a60cd7
+AM_CONDITIONAL(AUTHENTICATED_AUTOREPORTING, test "$enable_authenticated_autoreporting" = "yes")
a60cd7
+
a60cd7
 # Make satyr use GDB or elfutils/libunwind for unwinding?
a60cd7
 
a60cd7
 AC_ARG_ENABLE([native-unwinder],
a60cd7
diff --git a/doc/Makefile.am b/doc/Makefile.am
a60cd7
index 0480114..309a330 100644
a60cd7
--- a/doc/Makefile.am
a60cd7
+++ b/doc/Makefile.am
a60cd7
@@ -71,6 +71,17 @@ man1_MANS = ${MAN1_TXT:%.txt=%.1}
a60cd7
 man5_MANS = ${MAN5_TXT:%.txt=%.5} ${MAN5_PREFORMATTED}
a60cd7
 man8_MANS = ${MAN8_TXT:%.txt=%.8}
a60cd7
 
a60cd7
+MAN_SOURCE =
a60cd7
+MAN_SOURCE = abrt-auto-reporting-authenticated.txt
a60cd7
+MAN_SOURCE = abrt-auto-reporting-unauthenticated.txt
a60cd7
+
a60cd7
+if AUTHENTICATED_AUTOREPORTING
a60cd7
+abrt-auto-reporting.txt: abrt-auto-reporting-authenticated.txt
a60cd7
+else
a60cd7
+abrt-auto-reporting.txt: abrt-auto-reporting-unauthenticated.txt
a60cd7
+endif
a60cd7
+	cp $< $@
a60cd7
+
a60cd7
 %.1 %.5 %.8: %.xml
a60cd7
 	$(XMLTO_SILENT) xmlto man $< 2>&1 | sed '/Note/d'
a60cd7
 
a60cd7
@@ -79,6 +90,6 @@ man8_MANS = ${MAN8_TXT:%.txt=%.8}
a60cd7
                            --conf-file ../asciidoc.conf \
a60cd7
                            -aabrt_version=$(PACKAGE_VERSION) -o $@ $<
a60cd7
 
a60cd7
-EXTRA_DIST = $(MAN1_TXT) $(MAN5_TXT) $(MAN8_TXT) $(MAN5_PREFORMATTED)
a60cd7
+EXTRA_DIST = $(MAN1_TXT) $(MAN5_TXT) $(MAN8_TXT) $(MAN5_PREFORMATTED) $(MAN_SOURCE)
a60cd7
 
a60cd7
 CLEANFILES = ${MAN1_TXT:%.txt=%.1} ${MAN5_TXT:%.txt=%.5} ${MAN8_TXT:%.txt=%.8}
a60cd7
diff --git a/doc/abrt-auto-reporting-authenticated.txt b/doc/abrt-auto-reporting-authenticated.txt
a60cd7
new file mode 100644
a60cd7
index 0000000..2a27945
a60cd7
--- /dev/null
a60cd7
+++ b/doc/abrt-auto-reporting-authenticated.txt
a60cd7
@@ -0,0 +1,106 @@
a60cd7
+abrt-auto-reporting(1)
a60cd7
+======================
a60cd7
+
a60cd7
+NAME
a60cd7
+----
a60cd7
+abrt-auto-reporting - Get or modify the auto reporting option values
a60cd7
+
a60cd7
+SYNOPSIS
a60cd7
+--------
a60cd7
+'abrt-auto-reporting' [-v] [ enabled | yes | 1 | on | disabled | no | 0 | off ]
a60cd7
+                      [ [--anonymous] |
a60cd7
+                        [--username USERNAME [--password PASSWORD] ] |
a60cd7
+                        [--certificate SOURCE] ]
a60cd7
+
a60cd7
+DESCRIPTION
a60cd7
+-----------
a60cd7
+Reads the configuration from abrt.conf and saves the changes to the same file.
a60cd7
+
a60cd7
+The changes will take effect immediately without necessity to restart any ABRT
a60cd7
+process and will be persistent.
a60cd7
+
a60cd7
+'disabled'::
a60cd7
+   User have to report the detect problems manually
a60cd7
+
a60cd7
+'enabled'::
a60cd7
+   ABRT uploads an uReport which was generated for a detected problem
a60cd7
+   immediately after the detection phase.
a60cd7
+
a60cd7
+Reads and saves the authentication configuration options in
a60cd7
+/etc/libreport/plugins/ureport.conf and /etc/libreport/plugins/rhtsupport.conf
a60cd7
+
a60cd7
+uReport description
a60cd7
+~~~~~~~~~~~~~~~~~~~
a60cd7
+ABRT supports uReports for four types of crashes: crashes of C/C++ programs
a60cd7
+that result in a core dump, uncaught Python exceptions, uncaught Java
a60cd7
+exceptions and kernel oopses.
a60cd7
+
a60cd7
+Each uReport generally contains a stack trace, or multiple stack traces in the
a60cd7
+case of multi-threaded C/C++ and Java programs. The stack trace only describes
a60cd7
+the call stack of the program at the time of the crash and does not contain
a60cd7
+contents of any variables.
a60cd7
+
a60cd7
+Every uReport also contains identification of the operating system, versions of
a60cd7
+the RPM packages involved in the crash, and whether the program ran under a
a60cd7
+root user.
a60cd7
+
a60cd7
+There are also items specific to each crash type:
a60cd7
+
a60cd7
+C/C++ crashes::
a60cd7
+    these are path to the executable and signal delivered to the program,
a60cd7
+
a60cd7
+Python exceptions::
a60cd7
+    there is the type of the exception (without the error message, which may
a60cd7
+    contain sensitive data),
a60cd7
+
a60cd7
+for kernel oopses::
a60cd7
+    these are list of loaded kernel modules, list of taint flags, and full text
a60cd7
+    of the kernel oops.
a60cd7
+
a60cd7
+The authenticated uReports also contains *hostname* and *machineid* to enable a
a60cd7
+server side filtering at https://access.redhat.com/.
a60cd7
+
a60cd7
+The authenticated uReports have the benefit of rich server replies which may
a60cd7
+include a solution for the submitted crash. The authentication is done using
a60cd7
+either Red Hat Subscription Certificates or Red Hat Customer Portal
a60cd7
+credentials.
a60cd7
+
a60cd7
+'Warning':
a60cd7
+The full text of a kernel oops might contain information like the
a60cd7
+identification of the host hardware type. You should disable the autoreporting
a60cd7
+feature if you do not want to share this information with Red Hat.
a60cd7
+
a60cd7
+
a60cd7
+OPTIONS
a60cd7
+-------
a60cd7
+-v, --verbose::
a60cd7
+   Be more verbose. Can be given multiple times.
a60cd7
+
a60cd7
+-a, --anonymous::
a60cd7
+   Turns the authentication off by clearing both 'SSLClientAuth' and 'HTTPAuth'
a60cd7
+   configuration options in /etc/libreport/plugins/ureport.conf
a60cd7
+
a60cd7
+-u, --username USERNAME::
a60cd7
+   Turns HTTP Authentication on by setting 'HTTPAuth' configuration option to
a60cd7
+   *rhts-credentials* in /etc/libreport/plugins/ureport.conf and storing
a60cd7
+   USERNAME and PASSWORD in /etc/libreport/plugins/rhtsupport.conf
a60cd7
+   Also turns the SSL Client Authentication off, because these methods cannot
a60cd7
+   be used together.
a60cd7
+
a60cd7
+-p, --password PASSWORD::
a60cd7
+   Password for HTTP Authentication. If not provided, a prompt asking for it
a60cd7
+   will be issued.
a60cd7
+
a60cd7
+-c, --certificate SOURCE::
a60cd7
+   Turns SSL Client Authentication on by setting 'SSLClientAuth' configuration
a60cd7
+   option to SOURCE in /etc/libreport/plugins/ureport.conf.
a60cd7
+   Also turns the HTTP Authentication off, because these methods cannot
a60cd7
+   be used together.
a60cd7
+
a60cd7
+SEE ALSO
a60cd7
+--------
a60cd7
+abrt.conf(5), ureport.conf(5), rhtsupport.conf(5)
a60cd7
+
a60cd7
+AUTHORS
a60cd7
+-------
a60cd7
+* ABRT team
a60cd7
diff --git a/doc/abrt-auto-reporting-unauthenticated.txt b/doc/abrt-auto-reporting-unauthenticated.txt
a60cd7
new file mode 100644
a60cd7
index 0000000..320c803
a60cd7
--- /dev/null
a60cd7
+++ b/doc/abrt-auto-reporting-unauthenticated.txt
a60cd7
@@ -0,0 +1,71 @@
a60cd7
+abrt-auto-reporting(1)
a60cd7
+======================
a60cd7
+
a60cd7
+NAME
a60cd7
+----
a60cd7
+abrt-auto-reporting - Get or modify the auto reporting option values
a60cd7
+
a60cd7
+SYNOPSIS
a60cd7
+--------
a60cd7
+'abrt-auto-reporting' [-v] [ enabled | yes | 1 | on | disabled | no | 0 | off ]
a60cd7
+
a60cd7
+DESCRIPTION
a60cd7
+-----------
a60cd7
+Reads the configuration from abrt.conf and saves the changes to the same file.
a60cd7
+
a60cd7
+The changes will take effect immediately without necessity to restart any ABRT
a60cd7
+process and will be persistent.
a60cd7
+
a60cd7
+'disabled'::
a60cd7
+   User have to report the detect problems manually
a60cd7
+
a60cd7
+'enabled'::
a60cd7
+   ABRT uploads an uReport which was generated for a detected problem
a60cd7
+   immediately after the detection phase.
a60cd7
+
a60cd7
+uReport description
a60cd7
+~~~~~~~~~~~~~~~~~~~
a60cd7
+ABRT supports uReports for four types of crashes: crashes of C/C++ programs
a60cd7
+that result in a core dump, uncaught Python exceptions, uncaught Java
a60cd7
+exceptions and kernel oopses.
a60cd7
+
a60cd7
+Each uReport generally contains a stack trace, or multiple stack traces in the
a60cd7
+case of multi-threaded C/C++ and Java programs. The stack trace only describes
a60cd7
+the call stack of the program at the time of the crash and does not contain
a60cd7
+contents of any variables.
a60cd7
+
a60cd7
+Every uReport also contains identification of the operating system, versions of
a60cd7
+the RPM packages involved in the crash, and whether the program ran under a
a60cd7
+root user.
a60cd7
+
a60cd7
+There are also items specific to each crash type:
a60cd7
+
a60cd7
+C/C++ crashes::
a60cd7
+    these are path to the executable and signal delivered to the program,
a60cd7
+
a60cd7
+Python exceptions::
a60cd7
+    there is the type of the exception (without the error message, which may
a60cd7
+    contain sensitive data),
a60cd7
+
a60cd7
+for kernel oopses::
a60cd7
+    these are list of loaded kernel modules, list of taint flags, and full text
a60cd7
+    of the kernel oops.
a60cd7
+
a60cd7
+'Warning':
a60cd7
+The full text of a kernel oops might contain information like the
a60cd7
+identification of the host hardware type. You should disable the autoreporting
a60cd7
+feature if you do not want to share this information with Red Hat.
a60cd7
+
a60cd7
+
a60cd7
+OPTIONS
a60cd7
+-------
a60cd7
+-v, --verbose::
a60cd7
+   Be more verbose. Can be given multiple times.
a60cd7
+
a60cd7
+SEE ALSO
a60cd7
+--------
a60cd7
+abrt.conf(5)
a60cd7
+
a60cd7
+AUTHORS
a60cd7
+-------
a60cd7
+* ABRT team
a60cd7
diff --git a/doc/abrt-auto-reporting.txt b/doc/abrt-auto-reporting.txt
a60cd7
deleted file mode 100644
a60cd7
index 2a27945..0000000
a60cd7
--- a/doc/abrt-auto-reporting.txt
a60cd7
+++ /dev/null
a60cd7
@@ -1,106 +0,0 @@
a60cd7
-abrt-auto-reporting(1)
a60cd7
-======================
a60cd7
-
a60cd7
-NAME
a60cd7
-----
a60cd7
-abrt-auto-reporting - Get or modify the auto reporting option values
a60cd7
-
a60cd7
-SYNOPSIS
a60cd7
---------
a60cd7
-'abrt-auto-reporting' [-v] [ enabled | yes | 1 | on | disabled | no | 0 | off ]
a60cd7
-                      [ [--anonymous] |
a60cd7
-                        [--username USERNAME [--password PASSWORD] ] |
a60cd7
-                        [--certificate SOURCE] ]
a60cd7
-
a60cd7
-DESCRIPTION
a60cd7
------------
a60cd7
-Reads the configuration from abrt.conf and saves the changes to the same file.
a60cd7
-
a60cd7
-The changes will take effect immediately without necessity to restart any ABRT
a60cd7
-process and will be persistent.
a60cd7
-
a60cd7
-'disabled'::
a60cd7
-   User have to report the detect problems manually
a60cd7
-
a60cd7
-'enabled'::
a60cd7
-   ABRT uploads an uReport which was generated for a detected problem
a60cd7
-   immediately after the detection phase.
a60cd7
-
a60cd7
-Reads and saves the authentication configuration options in
a60cd7
-/etc/libreport/plugins/ureport.conf and /etc/libreport/plugins/rhtsupport.conf
a60cd7
-
a60cd7
-uReport description
a60cd7
-~~~~~~~~~~~~~~~~~~~
a60cd7
-ABRT supports uReports for four types of crashes: crashes of C/C++ programs
a60cd7
-that result in a core dump, uncaught Python exceptions, uncaught Java
a60cd7
-exceptions and kernel oopses.
a60cd7
-
a60cd7
-Each uReport generally contains a stack trace, or multiple stack traces in the
a60cd7
-case of multi-threaded C/C++ and Java programs. The stack trace only describes
a60cd7
-the call stack of the program at the time of the crash and does not contain
a60cd7
-contents of any variables.
a60cd7
-
a60cd7
-Every uReport also contains identification of the operating system, versions of
a60cd7
-the RPM packages involved in the crash, and whether the program ran under a
a60cd7
-root user.
a60cd7
-
a60cd7
-There are also items specific to each crash type:
a60cd7
-
a60cd7
-C/C++ crashes::
a60cd7
-    these are path to the executable and signal delivered to the program,
a60cd7
-
a60cd7
-Python exceptions::
a60cd7
-    there is the type of the exception (without the error message, which may
a60cd7
-    contain sensitive data),
a60cd7
-
a60cd7
-for kernel oopses::
a60cd7
-    these are list of loaded kernel modules, list of taint flags, and full text
a60cd7
-    of the kernel oops.
a60cd7
-
a60cd7
-The authenticated uReports also contains *hostname* and *machineid* to enable a
a60cd7
-server side filtering at https://access.redhat.com/.
a60cd7
-
a60cd7
-The authenticated uReports have the benefit of rich server replies which may
a60cd7
-include a solution for the submitted crash. The authentication is done using
a60cd7
-either Red Hat Subscription Certificates or Red Hat Customer Portal
a60cd7
-credentials.
a60cd7
-
a60cd7
-'Warning':
a60cd7
-The full text of a kernel oops might contain information like the
a60cd7
-identification of the host hardware type. You should disable the autoreporting
a60cd7
-feature if you do not want to share this information with Red Hat.
a60cd7
-
a60cd7
-
a60cd7
-OPTIONS
a60cd7
--------
a60cd7
--v, --verbose::
a60cd7
-   Be more verbose. Can be given multiple times.
a60cd7
-
a60cd7
--a, --anonymous::
a60cd7
-   Turns the authentication off by clearing both 'SSLClientAuth' and 'HTTPAuth'
a60cd7
-   configuration options in /etc/libreport/plugins/ureport.conf
a60cd7
-
a60cd7
--u, --username USERNAME::
a60cd7
-   Turns HTTP Authentication on by setting 'HTTPAuth' configuration option to
a60cd7
-   *rhts-credentials* in /etc/libreport/plugins/ureport.conf and storing
a60cd7
-   USERNAME and PASSWORD in /etc/libreport/plugins/rhtsupport.conf
a60cd7
-   Also turns the SSL Client Authentication off, because these methods cannot
a60cd7
-   be used together.
a60cd7
-
a60cd7
--p, --password PASSWORD::
a60cd7
-   Password for HTTP Authentication. If not provided, a prompt asking for it
a60cd7
-   will be issued.
a60cd7
-
a60cd7
--c, --certificate SOURCE::
a60cd7
-   Turns SSL Client Authentication on by setting 'SSLClientAuth' configuration
a60cd7
-   option to SOURCE in /etc/libreport/plugins/ureport.conf.
a60cd7
-   Also turns the HTTP Authentication off, because these methods cannot
a60cd7
-   be used together.
a60cd7
-
a60cd7
-SEE ALSO
a60cd7
---------
a60cd7
-abrt.conf(5), ureport.conf(5), rhtsupport.conf(5)
a60cd7
-
a60cd7
-AUTHORS
a60cd7
--------
a60cd7
-* ABRT team
a60cd7
diff --git a/src/daemon/abrt-auto-reporting.c b/src/daemon/abrt-auto-reporting.c
a60cd7
index 573c1ae..46f8923 100644
a60cd7
--- a/src/daemon/abrt-auto-reporting.c
a60cd7
+++ b/src/daemon/abrt-auto-reporting.c
a60cd7
@@ -66,6 +66,7 @@ set_abrt_reporting(map_string_t *conf, const char *opt_value)
a60cd7
     return 1;
a60cd7
 }
a60cd7
 
a60cd7
+#if AUTHENTICATED_AUTOREPORTING != 0
a60cd7
 static int
a60cd7
 set_ureport_http_auth(map_string_t *conf, const char *opt_value)
a60cd7
 {
a60cd7
@@ -136,6 +137,7 @@ set_rhts_credentials(map_string_t *conf, const char *username, const char *passw
a60cd7
     /* No changes needed -> success */
a60cd7
     return 1;
a60cd7
 }
a60cd7
+#endif
a60cd7
 
a60cd7
 static const char *
a60cd7
 get_abrt_reporting(map_string_t *conf)
a60cd7
@@ -145,6 +147,7 @@ get_abrt_reporting(map_string_t *conf)
a60cd7
     return REPORTING_STATES[index][0];
a60cd7
 }
a60cd7
 
a60cd7
+#if AUTHENTICATED_AUTOREPORTING != 0
a60cd7
 static const char *
a60cd7
 get_ureport_http_auth(map_string_t *conf)
a60cd7
 {
a60cd7
@@ -156,6 +159,7 @@ get_ureport_client_auth(map_string_t *conf)
a60cd7
 {
a60cd7
     return get_map_string_item_or_NULL(conf, UREPORT_CLIENT_AUTH_OPTION);
a60cd7
 }
a60cd7
+#endif
a60cd7
 
a60cd7
 int main(int argc, char *argv[])
a60cd7
 {
a60cd7
@@ -173,57 +177,78 @@ int main(int argc, char *argv[])
a60cd7
     textdomain(PACKAGE);
a60cd7
 #endif
a60cd7
 
a60cd7
+#define PROGRAM_USAGE_MIDDLE_PART \
a60cd7
+            "\n" \
a60cd7
+            "Get or modify a value of the auto-reporting option. The changes will take\n" \
a60cd7
+            "effect immediately and will be persistent.\n" \
a60cd7
+            "\n" \
a60cd7
+            ""STATE_MANUAL":\n" \
a60cd7
+            "User have to report the detect problems manually\n" \
a60cd7
+            "\n" \
a60cd7
+            ""STATE_AUTO":\n" \
a60cd7
+            "ABRT uploads an uReport which was generated for a detected problem\n" \
a60cd7
+            "immediately after the detection phase. uReport generally contains a stack\n" \
a60cd7
+            "trace which only describes the call stack of the program at the time of the\n" \
a60cd7
+            "crash and does not contain contents of any variables.  Every uReport also\n" \
a60cd7
+            "contains identification of the operating system, versions of the RPM packages\n" \
a60cd7
+            "involved in the crash, and whether the program ran under a root user.\n" \
a60cd7
+            "\n"
a60cd7
+
a60cd7
     abrt_init(argv);
a60cd7
+#if AUTHENTICATED_AUTOREPORTING != 0
a60cd7
     const char *program_usage_string = _(
a60cd7
             "& [ "STATE_MANUAL" | "STATE_AUTO" | yes | no | 1 | 0 ] \\\n"
a60cd7
             "  [[--anonymous] | [--username USERNAME [--password PASSWORD]] | [--certificate SOURCE]]\n"
a60cd7
-            "\n"
a60cd7
-            "Get or modify a value of the auto-reporting option. The changes will take\n"
a60cd7
-            "effect immediately and will be persistent.\n"
a60cd7
-            "\n"
a60cd7
-            ""STATE_MANUAL":\n"
a60cd7
-            "User have to report the detect problems manually\n"
a60cd7
-            "\n"
a60cd7
-            ""STATE_AUTO":\n"
a60cd7
-            "ABRT uploads an uReport which was generated for a detected problem\n"
a60cd7
-            "immediately after the detection phase. uReport generally contains a stack\n"
a60cd7
-            "trace which only describes the call stack of the program at the time of the\n"
a60cd7
-            "crash and does not contain contents of any variables.  Every uReport also\n"
a60cd7
-            "contains identification of the operating system, versions of the RPM packages\n"
a60cd7
-            "involved in the crash, and whether the program ran under a root user.\n"
a60cd7
-            "\n"
a60cd7
+            PROGRAM_USAGE_MIDDLE_PART
a60cd7
             "See abrt-auto-reporting(1), reporter-ureport(1) and reporter-rhtsupport(1)\n"
a60cd7
             "for more details.\n"
a60cd7
     );
a60cd7
+#else
a60cd7
+    const char *program_usage_string = _(
a60cd7
+            "& [ "STATE_MANUAL" | "STATE_AUTO" | yes | no | 1 | 0 ]\n"
a60cd7
+            PROGRAM_USAGE_MIDDLE_PART
a60cd7
+            "See abrt-auto-reporting(1) and reporter-ureport(1) for more details.\n"
a60cd7
+    );
a60cd7
+#endif
a60cd7
 
a60cd7
     enum {
a60cd7
         OPT_v = 1 << 0,
a60cd7
+#if AUTHENTICATED_AUTOREPORTING != 0
a60cd7
         OPT_a = 1 << 1,
a60cd7
         OPT_u = 1 << 2,
a60cd7
         OPT_p = 1 << 3,
a60cd7
         OPT_c = 1 << 4,
a60cd7
+#endif
a60cd7
     };
a60cd7
 
a60cd7
+#if AUTHENTICATED_AUTOREPORTING != 0
a60cd7
     int anonymous = 0;
a60cd7
     const char *username = NULL;
a60cd7
     const char *password = NULL;
a60cd7
     const char *certificate = NULL;
a60cd7
+#endif
a60cd7
 
a60cd7
     /* Keep enum above and order of options below in sync! */
a60cd7
     struct options program_options[] = {
a60cd7
         OPT__VERBOSE(&g_verbose),
a60cd7
+#if AUTHENTICATED_AUTOREPORTING != 0
a60cd7
         OPT_BOOL  (  'a', "anonymous",   &anonymous,               _("Turns the authentication off")),
a60cd7
         OPT_STRING(  'u', "username",    &username,    "USERNAME", _("Red Hat Support user name")),
a60cd7
         OPT_STRING(  'p', "password",    &password,    "PASSWORD", _("Red Hat Support password, if not given, a prompt for it will be issued")),
a60cd7
         OPT_STRING(  'c', "certificate", &certificate, "SOURCE",   _("uReport SSL certificate paths or certificate type")),
a60cd7
+#endif
a60cd7
         OPT_END()
a60cd7
     };
a60cd7
 
a60cd7
-    const unsigned opts = parse_opts(argc, argv, program_options, program_usage_string);
a60cd7
+#if AUTHENTICATED_AUTOREPORTING != 0
a60cd7
+    const unsigned opts =
a60cd7
+#endif
a60cd7
+    parse_opts(argc, argv, program_options, program_usage_string);
a60cd7
 
a60cd7
     argv += optind;
a60cd7
     argc -= optind;
a60cd7
 
a60cd7
+#if AUTHENTICATED_AUTOREPORTING != 0
a60cd7
     if ((opts & OPT_p) && !(opts & OPT_u))
a60cd7
     {
a60cd7
         error_msg(_("You also need to specify --username for --password"));
a60cd7
@@ -248,6 +273,7 @@ int main(int argc, char *argv[])
a60cd7
         show_usage_and_die(program_usage_string, program_options);
a60cd7
     }
a60cd7
 
a60cd7
+#endif
a60cd7
     if (argc > 1)
a60cd7
     {
a60cd7
         error_msg(_("Invalid number of arguments"));
a60cd7
@@ -277,20 +303,25 @@ int main(int argc, char *argv[])
a60cd7
     int exit_code = EXIT_FAILURE;
a60cd7
 
a60cd7
     map_string_t *conf = new_map_string();
a60cd7
+#if AUTHENTICATED_AUTOREPORTING != 0
a60cd7
     map_string_t *rhts_conf = new_map_string();
a60cd7
     map_string_t *rhts_conf_bck = NULL;
a60cd7
+#endif
a60cd7
     map_string_t *ureport_conf = new_map_string();
a60cd7
     map_string_t *ureport_conf_bck = NULL;
a60cd7
 
a60cd7
     if (!load_abrt_conf_file(CONF_NAME, conf))
a60cd7
         goto finito;
a60cd7
 
a60cd7
+#if AUTHENTICATED_AUTOREPORTING != 0
a60cd7
     if (!load_plugin_conf_file(RHTS_NAME, rhts_conf, false))
a60cd7
         goto finito;
a60cd7
+#endif
a60cd7
 
a60cd7
     if (!load_plugin_conf_file(UREPORT_NAME, ureport_conf, false))
a60cd7
         goto finito;
a60cd7
 
a60cd7
+#if AUTHENTICATED_AUTOREPORTING != 0
a60cd7
     if ((opts & OPT_a))
a60cd7
     {
a60cd7
         ureport_conf_bck = clone_map_string(ureport_conf);
a60cd7
@@ -336,11 +367,13 @@ int main(int argc, char *argv[])
a60cd7
             goto finito;
a60cd7
     }
a60cd7
 
a60cd7
+#endif
a60cd7
     if (argc == 0)
a60cd7
     {
a60cd7
         printf("%s", get_abrt_reporting(conf));
a60cd7
         exit_code = EXIT_SUCCESS;
a60cd7
 
a60cd7
+#if AUTHENTICATED_AUTOREPORTING != 0
a60cd7
         if (g_verbose >= 1)
a60cd7
         {
a60cd7
             const char *tmp = get_ureport_http_auth(ureport_conf);
a60cd7
@@ -352,7 +385,7 @@ int main(int argc, char *argv[])
a60cd7
             else
a60cd7
                 printf(" %s", _("anonymous auto reporting"));
a60cd7
         }
a60cd7
-
a60cd7
+#endif
a60cd7
         putchar('\n');
a60cd7
 
a60cd7
         goto finito;
a60cd7
@@ -371,16 +404,20 @@ int main(int argc, char *argv[])
a60cd7
         if (ureport_conf_bck != NULL)
a60cd7
             save_plugin_conf_file(UREPORT_NAME, ureport_conf_bck);
a60cd7
 
a60cd7
+#if AUTHENTICATED_AUTOREPORTING != 0
a60cd7
         if (rhts_conf_bck != NULL)
a60cd7
             save_plugin_conf_file(RHTS_NAME, rhts_conf_bck);
a60cd7
+#endif
a60cd7
     }
a60cd7
 
a60cd7
 
a60cd7
 finito:
a60cd7
     free_map_string(ureport_conf);
a60cd7
     free_map_string(ureport_conf_bck);
a60cd7
+#if AUTHENTICATED_AUTOREPORTING != 0
a60cd7
     free_map_string(rhts_conf);
a60cd7
     free_map_string(rhts_conf_bck);
a60cd7
+#endif
a60cd7
     free_map_string(conf);
a60cd7
     return exit_code;
a60cd7
 }
a60cd7
-- 
a60cd7
2.4.3
a60cd7