diff options
| author | Karel Klic <kklic@redhat.com> | 2011-04-07 16:51:33 +0200 |
|---|---|---|
| committer | Karel Klic <kklic@redhat.com> | 2011-04-07 16:51:33 +0200 |
| commit | 581757d9245c9c8abfcb3bd5e0d12c95af523619 (patch) | |
| tree | 59642c89daefcaf4e8cd0491adc3e664efcbd93f /src/plugins | |
| parent | f540d45ddbbe61c07b82446cd24ce870dbb4ff01 (diff) | |
| parent | 8a9cb205c89d61a7a8198768bac2606df8f508e7 (diff) | |
| download | abrt-581757d9245c9c8abfcb3bd5e0d12c95af523619.tar.gz abrt-581757d9245c9c8abfcb3bd5e0d12c95af523619.tar.xz abrt-581757d9245c9c8abfcb3bd5e0d12c95af523619.zip | |
Merge branch 'master' of ssh://git.fedorahosted.org/git/abrt
Diffstat (limited to 'src/plugins')
| -rw-r--r-- | src/plugins/Makefile.am | 3 | ||||
| -rw-r--r-- | src/plugins/abrt-action-rhtsupport.c | 14 |
2 files changed, 12 insertions, 5 deletions
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); |
