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