diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Applet/CCApplet.cpp | 28 | ||||
-rw-r--r-- | src/CLI/CLI.cpp | 4 | ||||
-rw-r--r-- | src/CLI/dbus.cpp | 6 | ||||
-rw-r--r-- | src/CLI/report.cpp | 14 | ||||
-rw-r--r-- | src/CLI/run-command.cpp | 2 | ||||
-rw-r--r-- | src/Daemon/Daemon.cpp | 27 | ||||
-rw-r--r-- | src/Daemon/MiddleWare.cpp | 18 | ||||
-rw-r--r-- | src/Daemon/abrt-handle-upload | 2 | ||||
-rw-r--r-- | src/Daemon/abrt.conf | 27 | ||||
-rw-r--r-- | src/Gui/ccgui.glade | 1 | ||||
-rw-r--r-- | src/Hooks/dumpoops.cpp | 2 |
11 files changed, 82 insertions, 49 deletions
diff --git a/src/Applet/CCApplet.cpp b/src/Applet/CCApplet.cpp index b0da75c7..c5046416 100644 --- a/src/Applet/CCApplet.cpp +++ b/src/Applet/CCApplet.cpp @@ -198,7 +198,7 @@ void CApplet::action_report(NotifyNotification *notification, gchar *action, gpo /* Did not find abrt-gui in installation directory. Oh well */ /* Trying to find it in PATH */ execlp("abrt-gui", "abrt-gui", buf, (char*) NULL); - perror_msg_and_die("Can't exec abrt-gui"); + perror_msg_and_die("Can't execute abrt-gui"); } GError *err = NULL; notify_notification_close(notification, &err); @@ -227,7 +227,7 @@ void CApplet::action_open_gui(NotifyNotification *notification, gchar *action, g /* Did not find abrt-gui in installation directory. Oh well */ /* Trying to find it in PATH */ execlp("abrt-gui", "abrt-gui", (char*) NULL); - perror_msg_and_die("Can't exec abrt-gui"); + perror_msg_and_die("Can't execute abrt-gui"); } GError *err = NULL; notify_notification_close(notification, &err); @@ -310,7 +310,7 @@ void CApplet::OnAppletActivate_CB(GtkStatusIcon *status_icon, gpointer user_data /* Did not find abrt-gui in installation directory. Oh well */ /* Trying to find it in PATH */ execlp("abrt-gui", "abrt-gui", (char*) NULL); - perror_msg_and_die("Can't exec abrt-gui"); + perror_msg_and_die("Can't execute abrt-gui"); } gtk_status_icon_set_visible(applet->m_pStatusIcon, false); applet->stop_animate_icon(); @@ -383,16 +383,17 @@ void CApplet::Enable(const char *reason) gboolean CApplet::update_icon(void *user_data) { CApplet* applet = (CApplet*)user_data; - if (applet->m_pStatusIcon && applet->m_iAnimationStage < ICON_STAGE_LAST) { + if (applet->m_pStatusIcon && applet->m_iAnimationStage < ICON_STAGE_LAST) + { gtk_status_icon_set_from_pixbuf(applet->m_pStatusIcon, applet->icon_stages_buff[applet->m_iAnimationStage++]); } - else - error_msg("icon is null"); - if (applet->m_iAnimationStage == ICON_STAGE_LAST) { + if (applet->m_iAnimationStage == ICON_STAGE_LAST) + { applet->m_iAnimationStage = 0; } - if (--applet->m_iAnimCountdown == 0) { + if (--applet->m_iAnimCountdown == 0) + { applet->stop_animate_icon(); } return true; @@ -410,7 +411,8 @@ void CApplet::animate_icon() void CApplet::stop_animate_icon() { /* animator should be 0 if icons are not loaded, so this should be safe */ - if (m_iAnimator != 0) { + if (m_iAnimator != 0) + { g_source_remove(m_iAnimator); gtk_status_icon_set_from_pixbuf(m_pStatusIcon, icon_stages_buff[ICON_DEFAULT]); m_iAnimator = 0; @@ -426,10 +428,12 @@ bool CApplet::load_icons() { char name[sizeof(ICON_DIR"/abrt%02d.png")]; GError *error = NULL; - if (snprintf(name, sizeof(ICON_DIR"/abrt%02d.png"), ICON_DIR"/abrt%02d.png", stage) > 0) { + if (snprintf(name, sizeof(ICON_DIR"/abrt%02d.png"), ICON_DIR"/abrt%02d.png", stage) > 0) + { icon_stages_buff[stage] = gdk_pixbuf_new_from_file(name, &error); - if (error != NULL) { - error_msg("Can't load pixbuf from %s, animation is disabled!", name); + if (error != NULL) + { + error_msg("Can't load pixbuf from %s, animation is disabled", name); return false; } } diff --git a/src/CLI/CLI.cpp b/src/CLI/CLI.cpp index d882161a..c751bd37 100644 --- a/src/CLI/CLI.cpp +++ b/src/CLI/CLI.cpp @@ -44,7 +44,7 @@ static void print_crash(const map_crash_data_t &crash) char timeloc[256]; int success = strftime(timeloc, 128, "%c", localtime(&time)); if (!success) - error_msg_and_die("Error while converting time to string."); + error_msg_and_die("Error while converting time to string"); printf(_("\tUID : %s\n" "\tUUID : %s\n" @@ -212,7 +212,7 @@ int main(int argc, char** argv) #define SET_OP(newop) \ if (op != -1 && op != newop) \ { \ - error_msg(_("You must specify exactly one operation.")); \ + error_msg(_("You must specify exactly one operation")); \ return 1; \ } \ op = newop; diff --git a/src/CLI/dbus.cpp b/src/CLI/dbus.cpp index 2eddb5d9..55ebf9db 100644 --- a/src/CLI/dbus.cpp +++ b/src/CLI/dbus.cpp @@ -46,7 +46,7 @@ static DBusMessage* send_get_reply_and_unref(DBusMessage* msg) if (!received) { if (FALSE == dbus_connection_read_write(s_dbus_conn, -1)) - error_msg_and_die("DBus connection closed"); + error_msg_and_die("dbus connection closed"); continue; } @@ -100,7 +100,7 @@ static DBusMessage* send_get_reply_and_unref(DBusMessage* msg) DBUS_TYPE_STRING, &warning_msg, DBUS_TYPE_INVALID)) { - error_msg_and_die("dbus Update message: arguments mismatch"); + error_msg_and_die("dbus Warning message: arguments mismatch"); } log(">! %s\n", warning_msg); } @@ -114,7 +114,7 @@ static DBusMessage* send_get_reply_and_unref(DBusMessage* msg) if (tp == DBUS_MESSAGE_TYPE_ERROR && dbus_message_get_reply_serial(received) == serial ) { - error_msg_and_die("Dbus call returned error: '%s'", error_str); + error_msg_and_die("dbus call returned error: '%s'", error_str); } dbus_message_unref(received); diff --git a/src/CLI/report.cpp b/src/CLI/report.cpp index ebaeafa1..8316418c 100644 --- a/src/CLI/report.cpp +++ b/src/CLI/report.cpp @@ -162,13 +162,13 @@ static void write_crash_report_field(FILE *fp, const map_crash_data_t &report, if (it == report.end()) { // exit silently, all fields are optional for now - //error_msg("Field %s not found.\n", field); + //error_msg("Field %s not found", field); return; } if (it->second[CD_TYPE] == CD_SYS) { - error_msg("Cannot write field %s because it is a system value\n", field); + error_msg("Cannot update field %s because it is a system value", field); return; } @@ -241,13 +241,13 @@ static int read_crash_report_field(const char *text, map_crash_data_t &report, const map_crash_data_t::iterator it = report.find(field); if (it == report.end()) { - error_msg("Field %s not found.\n", field); + error_msg("Field %s not found", field); return 0; } if (it->second[CD_TYPE] == CD_SYS) { - error_msg("Cannot update field %s because it is a system value.\n", field); + error_msg("Cannot update field %s because it is a system value", field); return 0; } @@ -331,9 +331,9 @@ static int launch_editor(const char *path) editor = getenv("EDITOR"); terminal = getenv("TERM"); - if (!editor && (!terminal || !strcmp(terminal, "dumb"))) + if (!editor && (!terminal || strcmp(terminal, "dumb") == 0)) { - error_msg(_("Terminal is dumb but no VISUAL nor EDITOR defined.")); + error_msg(_("Can't run vi: $TERM, $VISUAL and $EDITOR are not set")); return 1; } @@ -567,7 +567,7 @@ static bool set_echo(bool enabled) t.c_lflag &= ~ECHO; if (tcsetattr(STDIN_FILENO, TCSANOW, &t) < 0) - perror_msg_and_die("tcsetattr failed"); + perror_msg_and_die("tcsetattr"); return true; } diff --git a/src/CLI/run-command.cpp b/src/CLI/run-command.cpp index 8f9d63ec..1f6836d6 100644 --- a/src/CLI/run-command.cpp +++ b/src/CLI/run-command.cpp @@ -28,7 +28,7 @@ static pid_t start_command(char **argv) pid_t pid = vfork(); if (pid < 0) { - perror_msg_and_die("Can't fork"); + perror_msg_and_die("vfork"); } if (pid == 0) { // new process diff --git a/src/Daemon/Daemon.cpp b/src/Daemon/Daemon.cpp index 6c61d4df..3ba8d4d2 100644 --- a/src/Daemon/Daemon.cpp +++ b/src/Daemon/Daemon.cpp @@ -506,16 +506,19 @@ static gboolean handle_inotify_cb(GIOChannel *gio, GIOCondition condition, gpoin } log("Directory '%s' creation detected", name); - std::string worst_dir; - while (g_settings_nMaxCrashReportsSize > 0 - && get_dirsize_find_largest_dir(DEBUG_DUMPS_DIR, &worst_dir, name) / (1024*1024) >= g_settings_nMaxCrashReportsSize - && worst_dir != "" - ) { - log("Size of '%s' >= %u MB, deleting '%s'", DEBUG_DUMPS_DIR, g_settings_nMaxCrashReportsSize, worst_dir.c_str()); - g_pCommLayer->QuotaExceed(_("Report size exceeded the quota. Please check system's MaxCrashReportsSize value in abrt.conf.")); - /* deletes both directory and DB record */ - DeleteDebugDump_by_dir(concat_path_file(DEBUG_DUMPS_DIR, worst_dir.c_str()).c_str()); - worst_dir = ""; + if (g_settings_nMaxCrashReportsSize > 0) + { + std::string worst_dir; + while (g_settings_nMaxCrashReportsSize > 0 + && get_dirsize_find_largest_dir(DEBUG_DUMPS_DIR, &worst_dir, name) / (1024*1024) >= g_settings_nMaxCrashReportsSize + && worst_dir != "" + ) { + log("Size of '%s' >= %u MB, deleting '%s'", DEBUG_DUMPS_DIR, g_settings_nMaxCrashReportsSize, worst_dir.c_str()); + g_pCommLayer->QuotaExceed(_("Report size exceeded the quota. Please check system's MaxCrashReportsSize value in abrt.conf.")); + /* deletes both directory and DB record */ + DeleteDebugDump_by_dir(concat_path_file(DEBUG_DUMPS_DIR, worst_dir.c_str()).c_str()); + worst_dir = ""; + } } try @@ -770,7 +773,7 @@ int main(int argc, char** argv) /* fall through to error */ default: error_msg_and_die( - "Usage: abrtd [-dv]\n" + "Usage: abrtd [-dsv] [-t SEC]\n" "\nOptions:" "\n\t-d\tDo not daemonize" "\n\t-s\tLog to syslog even with -d" @@ -797,7 +800,7 @@ int main(int argc, char** argv) pid_t pid = fork(); if (pid < 0) { - perror_msg_and_die("Can't fork"); + perror_msg_and_die("fork"); } if (pid > 0) { diff --git a/src/Daemon/MiddleWare.cpp b/src/Daemon/MiddleWare.cpp index fb4953d2..8b3e7e39 100644 --- a/src/Daemon/MiddleWare.cpp +++ b/src/Daemon/MiddleWare.cpp @@ -795,14 +795,17 @@ static mw_result_t SavePackageDescriptionToDebugDump( std::string description = GetDescription(packageName.c_str()); - // HOST_NAME_MAX is defined in limits.h char host[HOST_NAME_MAX + 1]; - int ret = gethostname(host, HOST_NAME_MAX); - host[HOST_NAME_MAX] = '\0'; - if (ret < 0) + if (!remote) { - perror_msg("gethostname"); - host[0] = '\0'; + // HOST_NAME_MAX is defined in limits.h + int ret = gethostname(host, HOST_NAME_MAX); + host[HOST_NAME_MAX] = '\0'; + if (ret < 0) + { + perror_msg("gethostname"); + host[0] = '\0'; + } } try @@ -812,7 +815,8 @@ static mw_result_t SavePackageDescriptionToDebugDump( dd.SaveText(FILENAME_PACKAGE, package.c_str()); dd.SaveText(FILENAME_DESCRIPTION, description.c_str()); dd.SaveText(FILENAME_COMPONENT, component.c_str()); - dd.SaveText(FILENAME_HOSTNAME, host); + if (!remote) + dd.SaveText(FILENAME_HOSTNAME, host); } catch (CABRTException& e) { diff --git a/src/Daemon/abrt-handle-upload b/src/Daemon/abrt-handle-upload index 82f52692..71851535 100644 --- a/src/Daemon/abrt-handle-upload +++ b/src/Daemon/abrt-handle-upload @@ -62,7 +62,7 @@ if test -f "$tempdir/analyzer" && test -f "$tempdir/time" && test -f "$tempdir/u else for d in "$tempdir"/*; do test -d "$d" || continue - printf "1" >"$tempdir/$d/remote" + printf "1" >"$d/remote" mv -- "$d" "$abrt_dir" done fi diff --git a/src/Daemon/abrt.conf b/src/Daemon/abrt.conf index 6a70b820..534aef8f 100644 --- a/src/Daemon/abrt.conf +++ b/src/Daemon/abrt.conf @@ -3,38 +3,59 @@ # only crashes in signed packages will be analyzed. # the list of public keys used to check the signature is # in the file gpg_keys +# OpenGPGCheck = yes + # Blacklisted packages +# BlackList = nspluginwrapper, valgrind, strace + # Process crashes in executables which do not belong to any package? +# ProcessUnpackaged = no + # Blacklisted executable paths (shell patterns) +# BlackListedPaths = /usr/share/doc/*, */example* + # Which database plugin to use +# Database = SQLite3 + # Enable this if you want abrtd to auto-unpack crashdump tarballs which appear # in this directory (for example, uploaded via ftp, scp etc). # Note: you must ensure that whatever directory you specify here exists # and is writable for abrtd. abrtd will not create it automatically. +# #WatchCrashdumpArchiveDir = /var/spool/abrt-upload -# Max size for crash storage [MiB] + +# Max size for crash storage [MiB] or 0 for unlimited +# MaxCrashReportsSize = 1000 + # Vector of actions and reporters which are activated immediately # after a crash occurs, comma separated. +# #ActionsAndReporters = Mailx("[abrt] new crash was detected") #ActionsAndReporters = FileTransfer("store") ActionsAndReporters = RunApp("test x\"`cat component`\" = x\"xorg-x11-server-Xorg\" && cp /var/log/Xorg.0.log .") + # What actions or reporters to run on each crash type +# [ AnalyzerActionsAndReporters ] Kerneloops = KerneloopsReporter CCpp = Bugzilla, Logger Python = Bugzilla, Logger #CCpp:xorg-x11-apps = RunApp("date", "date.txt") + # Which Action plugins to run repeatedly +# [ Cron ] -# h:m - at h:m -# s - every s seconds +# h:m - at h:m +# s - every s seconds + 120 = KerneloopsScanner + #02:00 = FileTransfer diff --git a/src/Gui/ccgui.glade b/src/Gui/ccgui.glade index f6072b87..7d46c298 100644 --- a/src/Gui/ccgui.glade +++ b/src/Gui/ccgui.glade @@ -247,6 +247,7 @@ Máirín Duffy <duffy@redhat.com></property> <property name="visible">True</property> <property name="xalign">0</property> <property name="yalign">0</property> + <property name="wrap">True</property> </widget> <packing> <property name="position">1</property> diff --git a/src/Hooks/dumpoops.cpp b/src/Hooks/dumpoops.cpp index 99ecf009..ab4b6ba3 100644 --- a/src/Hooks/dumpoops.cpp +++ b/src/Hooks/dumpoops.cpp @@ -57,7 +57,7 @@ int main(int argc, char **argv) default: usage: error_msg_and_die( - "Usage: %s [-ds] FILE\n\n" + "Usage: %s [-dsv] FILE\n\n" "Options:\n" "\t-d\tCreate ABRT dump for every oops found\n" "\t-s\tPrint found oopses on standard output\n" |