diff options
| author | Jiri Moskovcak <jmoskovc@redhat.com> | 2010-01-19 16:02:40 +0100 |
|---|---|---|
| committer | Jiri Moskovcak <jmoskovc@redhat.com> | 2010-01-19 16:02:40 +0100 |
| commit | f750288769b23497ad5b57b1c50f683402c509f6 (patch) | |
| tree | b71f2a2c6ed6b5a1f5353c58780b09ef55f2c383 /lib | |
| parent | b8ef905c6455ef98cd7fa488de7d602a70bd57dc (diff) | |
| parent | b7e20eb84250ce9feeefde8dad2eab448125dc5d (diff) | |
| download | abrt-f750288769b23497ad5b57b1c50f683402c509f6.tar.gz abrt-f750288769b23497ad5b57b1c50f683402c509f6.tar.xz abrt-f750288769b23497ad5b57b1c50f683402c509f6.zip | |
Merge branch 'master' into rhel6
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/Plugins/Bugzilla.GTKBuilder | 29 | ||||
| -rw-r--r-- | lib/Plugins/Bugzilla.cpp | 2 | ||||
| -rw-r--r-- | lib/Plugins/CCpp.cpp | 9 | ||||
| -rw-r--r-- | lib/Plugins/Catcut.cpp | 6 | ||||
| -rw-r--r-- | lib/Plugins/Logger.conf | 4 | ||||
| -rw-r--r-- | lib/Plugins/Logger.cpp | 2 | ||||
| -rw-r--r-- | lib/Plugins/Mailx.cpp | 12 | ||||
| -rw-r--r-- | lib/Plugins/SQLite3.cpp | 4 | ||||
| -rw-r--r-- | lib/Plugins/TicketUploader.cpp | 5 | ||||
| -rw-r--r-- | lib/Utils/make_descr.cpp | 68 | ||||
| -rw-r--r-- | lib/Utils/spawn.cpp | 36 |
11 files changed, 94 insertions, 83 deletions
diff --git a/lib/Plugins/Bugzilla.GTKBuilder b/lib/Plugins/Bugzilla.GTKBuilder index 95abb71..27af868 100644 --- a/lib/Plugins/Bugzilla.GTKBuilder +++ b/lib/Plugins/Bugzilla.GTKBuilder @@ -163,11 +163,32 @@ </packing> </child> <child> - <object class="GtkLabel" id="label1"> + <object class="GtkHBox" id="hbox1"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Don't have an account yet? You can register at https://bugzilla.redhat.com/createaccount.cgi</property> - <property name="use_markup">True</property> + <child> + <object class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="xalign">0</property> + <property name="yalign">0</property> + <property name="label" translatable="yes">Don't have an account yet? You can register at</property> + <property name="use_markup">True</property> + </object> + <packing> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label4"> + <property name="visible">True</property> + <property name="xpad">5</property> + <property name="label" translatable="yes">https://bugzilla.redhat.com/createaccount.cgi</property> + <property name="selectable">True</property> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> </object> <packing> <property name="position">2</property> diff --git a/lib/Plugins/Bugzilla.cpp b/lib/Plugins/Bugzilla.cpp index 6f0f8d7..f963eb9 100644 --- a/lib/Plugins/Bugzilla.cpp +++ b/lib/Plugins/Bugzilla.cpp @@ -360,7 +360,7 @@ void ctx::add_attachments(const char* bug_id_str, const map_crash_report_t& pCra const std::string &type = it->second[CD_TYPE]; const std::string &content = it->second[CD_CONTENT]; - if (type == CD_ATT) + if (type == CD_TXT && content.length() > CD_TEXT_ATT_SIZE) { char *encoded64 = encode_base64(content.c_str(), content.length()); // fails only when you write query. when it's done it never fails. diff --git a/lib/Plugins/CCpp.cpp b/lib/Plugins/CCpp.cpp index e0db9cf..ab29fbb 100644 --- a/lib/Plugins/CCpp.cpp +++ b/lib/Plugins/CCpp.cpp @@ -270,7 +270,7 @@ static void GetBacktrace(const char *pDebugDumpDir, unsetenv("TERM"); putenv((char*)"TERM=dumb"); - char *args[13]; + char *args[15]; args[0] = (char*)"gdb"; args[1] = (char*)"-batch"; @@ -311,7 +311,10 @@ static void GetBacktrace(const char *pDebugDumpDir, args[9] = (char*)"thread apply all backtrace 3000 full"; args[10] = (char*)"-ex"; args[11] = (char*)"info sharedlib"; - args[12] = NULL; + /* glibc's abort() stores its message in this variable */ + args[12] = (char*)"-ex"; + args[13] = (char*)"print (char*)__abort_msg"; + args[14] = NULL; ExecVP(args, xatoi_u(UID.c_str()), /*redirect_stderr:*/ 1, pBacktrace); } @@ -687,7 +690,6 @@ static bool DebuginfoCheckPolkit(uid_t uid) void CAnalyzerCCpp::CreateReport(const char *pDebugDumpDir, int force) { string package; - string backtrace; string UID; CDebugDump dd; @@ -725,6 +727,7 @@ void CAnalyzerCCpp::CreateReport(const char *pDebugDumpDir, int force) VERB1 log(_("Skipping debuginfo installation")); } + string backtrace; GetBacktrace(pDebugDumpDir, m_sDebugInfoDirs.c_str(), backtrace); dd.Open(pDebugDumpDir); diff --git a/lib/Plugins/Catcut.cpp b/lib/Plugins/Catcut.cpp index 27b868d..b69038f 100644 --- a/lib/Plugins/Catcut.cpp +++ b/lib/Plugins/Catcut.cpp @@ -390,9 +390,9 @@ ctx::add_attachments(const char* xmlrpc_URL, map_crash_report_t::const_iterator it = pCrashReport.begin(); for (; it != pCrashReport.end(); it++) { - if (it->second[CD_TYPE] == CD_ATT) + if (it->second[CD_TYPE] == CD_TXT && it->second[CD_TYPE].size() > CD_TEXT_ATT_SIZE) { - update_client(_("Attaching (CD_ATT): %s"), it->first.c_str()); + update_client(_("Attaching (text): %s"), it->first.c_str()); string description = "File: " + it->first; string URL = request_upload(auth_cookie, @@ -410,7 +410,7 @@ ctx::add_attachments(const char* xmlrpc_URL, } else if (it->second[CD_TYPE] == CD_BIN) { - update_client(_("Attaching (CD_ATT): %s"), it->first.c_str()); + update_client(_("Attaching binary: %s"), it->first.c_str()); string description = "File: " + it->first; string URL = request_upload(auth_cookie, diff --git a/lib/Plugins/Logger.conf b/lib/Plugins/Logger.conf index 39ba47e..8809963 100644 --- a/lib/Plugins/Logger.conf +++ b/lib/Plugins/Logger.conf @@ -1,6 +1,6 @@ # Configuration for Logger plugin -LogPath = /var/log/abrt-logger +LogPath = /var/log/abrt.log AppendLogs = yes -Enabled = yes
\ No newline at end of file +Enabled = yes diff --git a/lib/Plugins/Logger.cpp b/lib/Plugins/Logger.cpp index a0dea42..d6cc124 100644 --- a/lib/Plugins/Logger.cpp +++ b/lib/Plugins/Logger.cpp @@ -28,7 +28,7 @@ #include "ABRTException.h" CLogger::CLogger() : - m_sLogPath("/var/log/abrt-logger"), + m_sLogPath("/var/log/abrt.log"), m_bAppendLogs(true) {} diff --git a/lib/Plugins/Mailx.cpp b/lib/Plugins/Mailx.cpp index df33e84..2f8448f 100644 --- a/lib/Plugins/Mailx.cpp +++ b/lib/Plugins/Mailx.cpp @@ -74,7 +74,7 @@ std::string CMailx::Report(const map_crash_report_t& pCrashReport, args = append_str_to_vector(args, arg_size, MAILX_COMMAND); //TODO: move email body generation to make_descr.cpp - std::string binaryFiles, commonFiles, bigTextFiles, additionalFiles, UUIDFile; + std::string binaryFiles, commonFiles, additionalFiles, UUIDFile; map_crash_report_t::const_iterator it; for (it = pCrashReport.begin(); it != pCrashReport.end(); it++) { @@ -105,13 +105,6 @@ std::string CMailx::Report(const map_crash_report_t& pCrashReport, commonFiles += "\n\n"; } } - if (it->second[CD_TYPE] == CD_ATT) - { - bigTextFiles += it->first; - bigTextFiles += "\n-----\n"; - bigTextFiles += it->second[CD_CONTENT]; - bigTextFiles += "\n\n"; - } if (it->second[CD_TYPE] == CD_BIN) { binaryFiles += " -a "; @@ -133,9 +126,6 @@ std::string CMailx::Report(const map_crash_report_t& pCrashReport, emailBody += "\nAdditional information\n"; emailBody += "=====\n\n"; emailBody += additionalFiles; - emailBody += "\nOther information\n"; - emailBody += "=====\n\n"; - emailBody += bigTextFiles; emailBody += '\n'; args = append_str_to_vector(args, arg_size, "-s"); diff --git a/lib/Plugins/SQLite3.cpp b/lib/Plugins/SQLite3.cpp index ffcf05f..7f90c46 100644 --- a/lib/Plugins/SQLite3.cpp +++ b/lib/Plugins/SQLite3.cpp @@ -21,11 +21,9 @@ #include <sqlite3.h> #include <string> -#include <stdlib.h> +#include "abrtlib.h" #include "SQLite3.h" #include "ABRTException.h" -#include <limits.h> -#include <abrtlib.h> using namespace std; diff --git a/lib/Plugins/TicketUploader.cpp b/lib/Plugins/TicketUploader.cpp index 608ee40..7483768 100644 --- a/lib/Plugins/TicketUploader.cpp +++ b/lib/Plugins/TicketUploader.cpp @@ -203,9 +203,8 @@ string CTicketUploader::Report(const map_crash_report_t& pCrashReport, map_crash_report_t::const_iterator it; for (it = pCrashReport.begin(); it != pCrashReport.end(); it++) { - if (it->second[CD_TYPE] == CD_TXT - || it->second[CD_TYPE] == CD_ATT - ) { + if (it->second[CD_TYPE] == CD_TXT) + { string ofile_name = concat_path_file(tmptar_name.c_str(), it->first.c_str()); ofstream ofile(ofile_name.c_str(), fstream::trunc|fstream::binary); if (!ofile) diff --git a/lib/Utils/make_descr.cpp b/lib/Utils/make_descr.cpp index 90bd76a..2a0d4a9 100644 --- a/lib/Utils/make_descr.cpp +++ b/lib/Utils/make_descr.cpp @@ -50,9 +50,6 @@ static void add_content(bool &was_multiline, string& description, const char *he } } -/* Text attachments smaller than this will be also included in descrition */ -#define INLINE_TEXT_ATT_SIZE (2*1024) - string make_description_bz(const map_crash_report_t& pCrashReport) { string description; @@ -79,22 +76,21 @@ string make_description_bz(const map_crash_report_t& pCrashReport) const string &filename = it->first; const string &type = it->second[CD_TYPE]; const string &content = it->second[CD_CONTENT]; - if (type == CD_TXT - || (type == CD_ATT && content.size() < INLINE_TEXT_ATT_SIZE) - ) { - if (filename != CD_UUID - && filename != FILENAME_ARCHITECTURE - && filename != FILENAME_RELEASE - && filename != CD_REPRODUCE - && filename != CD_COMMENT - ) { - add_content(was_multiline, description, filename.c_str(), content.c_str()); - } - continue; - } - if (type == CD_ATT) + if (type == CD_TXT) { - add_content(was_multiline, description, "Attached file", filename.c_str()); + if (content.size() <= CD_TEXT_ATT_SIZE) + { + if (filename != CD_UUID + && filename != FILENAME_ARCHITECTURE + && filename != FILENAME_RELEASE + && filename != CD_REPRODUCE + && filename != CD_COMMENT + ) { + add_content(was_multiline, description, filename.c_str(), content.c_str()); + } + } else { + add_content(was_multiline, description, "Attached file", filename.c_str()); + } } } @@ -113,7 +109,6 @@ string make_description_logger(const map_crash_report_t& pCrashReport) const string &type = it->second[CD_TYPE]; const string &content = it->second[CD_CONTENT]; if (type == CD_TXT - || type == CD_ATT || type == CD_BIN ) { if (content == "1.\n2.\n3.\n") @@ -181,26 +176,27 @@ string make_description_catcut(const map_crash_report_t& pCrashReport) const string &content = it->second[CD_CONTENT]; if (type == CD_TXT) { - if (filename != CD_UUID - && filename != FILENAME_ARCHITECTURE - && filename != FILENAME_RELEASE - && filename != CD_REPRODUCE - && filename != CD_COMMENT - ) { - pDescription += '\n'; + if (content.length() <= CD_TEXT_ATT_SIZE) + { + if (filename != CD_UUID + && filename != FILENAME_ARCHITECTURE + && filename != FILENAME_RELEASE + && filename != CD_REPRODUCE + && filename != CD_COMMENT + ) { + pDescription += '\n'; + pDescription += filename; + pDescription += "\n-----\n"; + pDescription += content; + pDescription += "\n\n"; + } + } else { + pDescription += "\n\nAttached files\n" + "----\n"; pDescription += filename; - pDescription += "\n-----\n"; - pDescription += content; - pDescription += "\n\n"; + pDescription += '\n'; } } - else if (type == CD_ATT) - { - pDescription += "\n\nAttached files\n" - "----\n"; - pDescription += filename; - pDescription += '\n'; - } else if (type == CD_BIN) { error_msg(_("Binary file %s will not be reported"), filename.c_str()); diff --git a/lib/Utils/spawn.cpp b/lib/Utils/spawn.cpp index d3e6ac6..43c4b4a 100644 --- a/lib/Utils/spawn.cpp +++ b/lib/Utils/spawn.cpp @@ -48,6 +48,22 @@ pid_t fork_execv_on_steroids(int flags, if (child == 0) { /* Child */ + if (dir) + xchdir(dir); + + if (flags & EXECFLG_SETGUID) { + struct passwd* pw = getpwuid(uid); + gid_t gid = pw ? pw->pw_gid : uid; + setgroups(1, &gid); + xsetregid(gid, gid); + xsetreuid(uid, uid); + } + + if (unsetenv_vec) { + while (*unsetenv_vec) + unsetenv(*unsetenv_vec++); + } + /* Play with stdio descriptors */ if (flags & EXECFLG_INPUT) { xmove_fd(pipe_to_child[0], STDIN_FILENO); @@ -59,6 +75,10 @@ pid_t fork_execv_on_steroids(int flags, } else if (flags & EXECFLG_OUTPUT_NUL) { xmove_fd(xopen("/dev/null", O_RDWR), STDOUT_FILENO); } + + /* This should be done BEFORE stderr redirect */ + VERB1 log("Executing: %s", concat_str_vector(argv).c_str()); + if (flags & EXECFLG_ERR2OUT) { /* Want parent to see errors in the same stream */ xdup2(STDOUT_FILENO, STDERR_FILENO); @@ -66,25 +86,9 @@ pid_t fork_execv_on_steroids(int flags, xmove_fd(xopen("/dev/null", O_RDWR), STDERR_FILENO); } - if (flags & EXECFLG_SETGUID) { - struct passwd* pw = getpwuid(uid); - gid_t gid = pw ? pw->pw_gid : uid; - setgroups(1, &gid); - xsetregid(gid, gid); - xsetreuid(uid, uid); - } if (flags & EXECFLG_SETSID) setsid(); - if (unsetenv_vec) { - while (*unsetenv_vec) - unsetenv(*unsetenv_vec++); - } - - if (dir) - xchdir(dir); - - VERB1 log("Executing: %s", concat_str_vector(argv).c_str()); execvp(argv[0], argv); if (!(flags & EXECFLG_QUIET)) perror_msg("Can't execute '%s'", argv[0]); |
