diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Applet/Applet.cpp | 2 | ||||
-rw-r--r-- | src/Applet/CCApplet.cpp | 3 | ||||
-rw-r--r-- | src/Daemon/Daemon.cpp | 4 | ||||
-rw-r--r-- | src/Daemon/PluginManager.cpp | 6 | ||||
-rw-r--r-- | src/Daemon/Settings.cpp | 61 | ||||
-rw-r--r-- | src/Daemon/abrt.conf | 4 | ||||
-rw-r--r-- | src/Gui/CCMainWindow.py | 4 | ||||
-rw-r--r-- | src/Hooks/CCpp.cpp | 2 |
8 files changed, 56 insertions, 30 deletions
diff --git a/src/Applet/Applet.cpp b/src/Applet/Applet.cpp index ab8640a2..46278c62 100644 --- a/src/Applet/Applet.cpp +++ b/src/Applet/Applet.cpp @@ -201,7 +201,7 @@ int main(int argc, char** argv) default: error_msg_and_die( "Usage: abrt-applet [-v]\n" - "\nOptions:" + "\nOptions:" "\n\t-v\tVerbose" ); } diff --git a/src/Applet/CCApplet.cpp b/src/Applet/CCApplet.cpp index 704eccef..e6a3cf07 100644 --- a/src/Applet/CCApplet.cpp +++ b/src/Applet/CCApplet.cpp @@ -229,7 +229,7 @@ void CApplet::OnMenuPopup_cb(GtkStatusIcon *status_icon, CApplet *applet = (CApplet *)user_data; /* stop the animation */ applet->stop_animate_icon(); - + if (applet->m_pMenu != NULL) { gtk_menu_popup(GTK_MENU(((CApplet *)user_data)->m_pMenu), @@ -237,7 +237,6 @@ void CApplet::OnMenuPopup_cb(GtkStatusIcon *status_icon, gtk_status_icon_position_menu, status_icon, button, activate_time); } - } void CApplet::ShowIcon() diff --git a/src/Daemon/Daemon.cpp b/src/Daemon/Daemon.cpp index 99f4af80..087d5373 100644 --- a/src/Daemon/Daemon.cpp +++ b/src/Daemon/Daemon.cpp @@ -685,9 +685,9 @@ static void sanitize_dump_dir_rights() /* 00777 bits are usual "rwxrwxrwx" access rights */ ensure_writable_dir(DEBUG_DUMPS_DIR, 0775, "abrt"); /* debuginfo cache */ - ensure_writable_dir(DEBUG_DUMPS_DIR"-di", 0755, "root"); + ensure_writable_dir(DEBUG_DUMPS_DIR"-di", 0755, "root"); /* temp dir */ - ensure_writable_dir(VAR_RUN"/abrt", 0755, "root"); + ensure_writable_dir(VAR_RUN"/abrt", 0755, "root"); } int main(int argc, char** argv) diff --git a/src/Daemon/PluginManager.cpp b/src/Daemon/PluginManager.cpp index 5865e42c..3867ec9b 100644 --- a/src/Daemon/PluginManager.cpp +++ b/src/Daemon/PluginManager.cpp @@ -150,10 +150,10 @@ void CPluginManager::LoadPlugins() void CPluginManager::UnLoadPlugins() { - map_abrt_plugins_t::iterator it_p = m_mapABRTPlugins.begin(); - while (it_p != m_mapABRTPlugins.end()) + map_abrt_plugins_t::iterator it; + while ((it = m_mapABRTPlugins.begin()) != m_mapABRTPlugins.end()) { - UnLoadPlugin(it_p->first.c_str()); + UnLoadPlugin(it->first.c_str()); } } diff --git a/src/Daemon/Settings.cpp b/src/Daemon/Settings.cpp index 7f419ec5..327851f5 100644 --- a/src/Daemon/Settings.cpp +++ b/src/Daemon/Settings.cpp @@ -78,8 +78,11 @@ static set_string_t ParseList(const char* pList) return set; } +/* (What format do we parse here?) */ static vector_pair_string_string_t ParseListWithArgs(const char *pValue) { + VERB3 log(" ParseListWithArgs(%s)", pValue); + vector_pair_string_string_t pluginsWithArgs; unsigned int ii; std::string item; @@ -88,39 +91,55 @@ static vector_pair_string_string_t ParseListWithArgs(const char *pValue) bool is_arg = false; for (ii = 0; pValue[ii]; ii++) { - if (pValue[ii] == '\"') + if (is_quote && pValue[ii] == '\\' && pValue[ii+1]) + { + item += pValue[ii]; + ii++; + item += pValue[ii]; + continue; + } + if (pValue[ii] == '"') { is_quote = !is_quote; item += pValue[ii]; + continue; + } + if (is_quote) + { + item += pValue[ii]; + continue; } - else if (pValue[ii] == '(' && !is_quote) + if (pValue[ii] == '(') { action = item; item = ""; is_arg = true; + continue; } - else if (pValue[ii] == ')' && is_arg && !is_quote) + if (pValue[ii] == ')' && is_arg) { + VERB3 log(" adding (%s,%s)", action.c_str(), item.c_str()); pluginsWithArgs.push_back(make_pair(action, item)); item = ""; is_arg = false; action = ""; + continue; } - else if (pValue[ii] == ',' && !is_quote && !is_arg) + if (pValue[ii] == ',' && !is_arg) { if (item != "") { + VERB3 log(" adding (%s,%s)", item.c_str(), ""); pluginsWithArgs.push_back(make_pair(item, "")); item = ""; } + continue; } - else - { - item += pValue[ii]; - } + item += pValue[ii]; } if (item != "") { + VERB3 log(" adding (%s,%s)", item.c_str(), ""); pluginsWithArgs.push_back(make_pair(item, "")); } return pluginsWithArgs; @@ -255,42 +274,50 @@ void LoadSettings() std::string value; for (ii = 0; ii < line.length(); ii++) { + if (is_quote && line[ii] == '\\' && ii+1 < line.length()) + { + value += line[ii]; + ii++; + value += line[ii]; + continue; + } if (isspace(line[ii]) && !is_quote) { continue; } - else if (line[ii] == '#' && !is_quote && key == "") + if (line[ii] == '#' && !is_quote && key == "") { break; } - else if (line[ii] == '[' && !is_quote) + if (line[ii] == '[' && !is_quote) { is_section = true; section = ""; + continue; } - else if (line[ii] == '\"') + if (line[ii] == '"') { is_quote = !is_quote; value += line[ii]; + continue; } - else if (is_section) + if (is_section) { if (line[ii] == ']') { break; } section += line[ii]; + continue; } - else if (line[ii] == '=' && !is_quote) + if (line[ii] == '=' && !is_quote) { is_key = false; key = value; value = ""; + continue; } - else - { - value += line[ii]; - } + value += line[ii]; } if (!is_key && !is_quote) { diff --git a/src/Daemon/abrt.conf b/src/Daemon/abrt.conf index f24ec4a8..028f582d 100644 --- a/src/Daemon/abrt.conf +++ b/src/Daemon/abrt.conf @@ -17,14 +17,14 @@ Database = SQLite3 MaxCrashReportsSize = 1000 # Vector of actions and reporters which are activated immediately after a crash occurs #ActionsAndReporters = Mailx("[abrt] new crash was detected") -# TODO: teach parser to escape \". Should be: x"`cat component`" = x"xorg-x11-server-Xorg" -ActionsAndReporters = RunApp("test x`cat component` = xxorg-x11-server-Xorg && cp /var/log/Xorg*.log .") +ActionsAndReporters = RunApp("test x\"`cat component`\" = x\"xorg-x11-server-Xorg\" && cp /var/log/Xorg.0.log .") # Reporters association with analyzers [ AnalyzerActionsAndReporters ] Kerneloops = KerneloopsReporter CCpp = Bugzilla, Logger Python = Bugzilla, Logger +#CCpp:xorg-x11-apps = RunApp("date", "date.txt") # Repeated calling of Action plugins [ Cron ] diff --git a/src/Gui/CCMainWindow.py b/src/Gui/CCMainWindow.py index 31ebb410..3ada6f25 100644 --- a/src/Gui/CCMainWindow.py +++ b/src/Gui/CCMainWindow.py @@ -325,7 +325,7 @@ class MainWindow(): try: self.ccdaemon.getReport(report["_MWUUID"][2], force=1) except Exception, e: - # FIXME #3 dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Did not receive a reply + # FIXME #3 dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Did not receive a reply # do this async and wait for yum to end with debuginfoinstal if self.timer: gobject.source_remove(self.timer) @@ -352,7 +352,7 @@ class MainWindow(): try: self.ccdaemon.getReport(dump.getUUID()) except Exception, e: - # FIXME #3 dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Did not receive a reply + # FIXME #3 dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Did not receive a reply # do this async and wait for yum to end with debuginfoinstal if self.timer: gobject.source_remove(self.timer) diff --git a/src/Hooks/CCpp.cpp b/src/Hooks/CCpp.cpp index 81cd77a3..2b753819 100644 --- a/src/Hooks/CCpp.cpp +++ b/src/Hooks/CCpp.cpp @@ -65,7 +65,7 @@ static char* get_cmdline(pid_t pid) if (len > 0) { /* In Linux, there is always one trailing NUL byte, - * prevent it from being replaced by space below. + * prevent it from being replaced by space below. */ if (cmdline[len - 1] == '\0') len--; |