summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--abrt.spec5
-rw-r--r--src/plugins/Makefile.am3
-rw-r--r--src/plugins/abrt-action-rhtsupport.c14
3 files changed, 15 insertions, 7 deletions
diff --git a/abrt.spec b/abrt.spec
index c23c98e5..e4147444 100644
--- a/abrt.spec
+++ b/abrt.spec
@@ -506,7 +506,7 @@ fi
%defattr(-,root,root,-)
%config(noreplace) %{_sysconfdir}/%{name}/plugins/Kerneloops.conf
%{_sysconfdir}/%{name}/events/report_Kerneloops.xml
-%{_sysconfdir}/%{name}/events.d/koops_events.conf
+%config(noreplace) %{_sysconfdir}/%{name}/events.d/koops_events.conf
%{_mandir}/man7/abrt-KerneloopsReporter.7.gz
%{_bindir}/abrt-dump-oops
%{_bindir}/abrt-action-analyze-oops
@@ -521,7 +521,7 @@ fi
%files plugin-mailx
%defattr(-,root,root,-)
%{_sysconfdir}/%{name}/events/report_Mailx.xml
-%{_sysconfdir}/%{name}/events.d/mailx_events.conf
+%config(noreplace) %{_sysconfdir}/%{name}/events.d/mailx_events.conf
%{_mandir}/man7/abrt-Mailx.7.gz
%{_bindir}/abrt-action-mailx
@@ -537,6 +537,7 @@ fi
%files plugin-rhtsupport
%defattr(-,root,root,-)
%{_sysconfdir}/%{name}/events/report_RHTSupport.xml
+%config(noreplace) %{_sysconfdir}/%{name}/events.d/rhtsupport_events.conf
# {_mandir}/man7/abrt-RHTSupport.7.gz
%{_bindir}/abrt-action-rhtsupport
diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am
index 418b5a19..1e3c15d0 100644
--- a/src/plugins/Makefile.am
+++ b/src/plugins/Makefile.am
@@ -49,7 +49,8 @@ eventsconfdir = $(EVENTS_CONF_DIR)
dist_eventsconf_DATA = \
ccpp_events.conf \
mailx_events.conf \
- koops_events.conf
+ koops_events.conf \
+ rhtsupport_events.conf
man_MANS = \
abrt-Bugzilla.7 \
diff --git a/src/plugins/abrt-action-rhtsupport.c b/src/plugins/abrt-action-rhtsupport.c
index 6bbf76a0..233b607f 100644
--- a/src/plugins/abrt-action-rhtsupport.c
+++ b/src/plugins/abrt-action-rhtsupport.c
@@ -91,11 +91,16 @@ static void report_to_rhtsupport(
dsc = xasprintf("abrt version: "VERSION"\n%s", bz_dsc);
free(bz_dsc);
}
-
file = new_reportfile();
-
- /* SELinux guys are not happy with /tmp, using /var/run/abrt */
- tempfile = xasprintf(LOCALSTATEDIR"/run/abrt/tmp-%s-%lu.tar.gz", iso_date_string(NULL), (long)getpid());
+ const char *dt_string = iso_date_string(NULL);
+ char tmpdir_name[sizeof("/tmp/rhtsupport-YYYY-MM-DD-hh:mm:ss-XXXXXX")];
+ sprintf(tmpdir_name, "/tmp/rhtsupport-%s-XXXXXX", dt_string);
+ /* mkdtemp does mkdir(xxx, 0700), should be safe (is it?) */
+ if (mkdtemp(tmpdir_name) == NULL)
+ {
+ error_msg_and_die(_("Can't create a temporary directory in /tmp"));
+ }
+ tempfile = xasprintf("%s/tmp-%s-%lu.tar.gz",tmpdir_name, iso_date_string(NULL), (long)getpid());
int pipe_from_parent_to_child[2];
xpipe(pipe_from_parent_to_child);
@@ -236,6 +241,7 @@ static void report_to_rhtsupport(
unlink(tempfile);
free(tempfile);
reportfile_free(file);
+ rmdir(tmpdir_name);
free(summary);
free(dsc);