diff options
author | Karel Klic <kklic@redhat.com> | 2009-10-22 14:38:55 +0200 |
---|---|---|
committer | Karel Klic <kklic@redhat.com> | 2009-10-22 14:38:55 +0200 |
commit | eec58f224eda6415f58907f37efb2f3e51453362 (patch) | |
tree | 5dc0b525a4b2c187dae423e9d9603f742207f525 | |
parent | 71571cc968cf8b002eee6761be96b8af7969483f (diff) | |
parent | 326f6403b29aa2e2932826dc6facb567ebac8ab7 (diff) | |
download | abrt-eec58f224eda6415f58907f37efb2f3e51453362.tar.gz abrt-eec58f224eda6415f58907f37efb2f3e51453362.tar.xz abrt-eec58f224eda6415f58907f37efb2f3e51453362.zip |
Merge branch 'master' of ssh://git.fedorahosted.org/git/abrt
-rw-r--r-- | lib/Plugins/SQLite3.cpp | 11 | ||||
-rw-r--r-- | po/es.po | 39 | ||||
-rw-r--r-- | po/pt_BR.po | 85 | ||||
-rw-r--r-- | src/CLI/CLI.cpp | 3 | ||||
-rw-r--r-- | src/CLI/abrt-cli.1 | 10 | ||||
-rw-r--r-- | src/CLI/abrt-cli.bash | 2 | ||||
-rw-r--r-- | src/CLI/dbus.cpp | 2 | ||||
-rw-r--r-- | src/CLI/report.cpp | 78 | ||||
-rw-r--r-- | src/CLI/run-command.cpp | 22 | ||||
-rw-r--r-- | src/Daemon/CommLayerServerDBus.cpp | 25 | ||||
-rw-r--r-- | src/Daemon/MiddleWare.cpp | 47 | ||||
-rw-r--r-- | src/Daemon/PluginManager.cpp | 119 |
12 files changed, 237 insertions, 206 deletions
diff --git a/lib/Plugins/SQLite3.cpp b/lib/Plugins/SQLite3.cpp index 797ed2db..a2dc426f 100644 --- a/lib/Plugins/SQLite3.cpp +++ b/lib/Plugins/SQLite3.cpp @@ -321,7 +321,16 @@ void CSQLite3::Delete(const std::string& pUUID, const std::string& pUID) void CSQLite3::SetReported(const std::string& pUUID, const std::string& pUID, const std::string& pMessage) { - if (Exist(pUUID, pUID)) + if(pUID == "0") + { + Exec("UPDATE "ABRT_TABLE" " + "SET "DATABASE_COLUMN_REPORTED" = 1 " + "WHERE "DATABASE_COLUMN_UUID" = '"+pUUID+"';"); + Exec("UPDATE "ABRT_TABLE" " + "SET "DATABASE_COLUMN_MESSAGE" = '" + pMessage + "' " + "WHERE "DATABASE_COLUMN_UUID" = '"+pUUID+"';"); + } + else if (Exist(pUUID, pUID)) { Exec("UPDATE "ABRT_TABLE" " "SET "DATABASE_COLUMN_REPORTED" = 1 " @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: abrt.master.es\n" "Report-Msgid-Bugs-To: jmoskovc@redhat.com\n" -"POT-Creation-Date: 2009-10-09 16:26+0000\n" -"PO-Revision-Date: 2009-10-09 17:30-0300\n" +"POT-Creation-Date: 2009-10-22 09:44+0000\n" +"PO-Revision-Date: 2009-10-22 09:16-0300\n" "Last-Translator: Domingo Becker <domingobecker@gmail.com>\n" "Language-Team: Spanish <fedora-trans-es@redhat.com>\n" "MIME-Version: 1.0\n" @@ -196,7 +196,7 @@ msgstr "" "Incapaz de conseguir el informe!\n" "¿Falta la información de la depuración?" -#: ../src/Gui/CCMainWindow.py:308 +#: ../src/Gui/CCMainWindow.py:310 #, python-format msgid "" "Reporting failed!\n" @@ -205,12 +205,17 @@ msgstr "" "¡El informe falló!\n" "%s" -#: ../src/Gui/CCMainWindow.py:340 +#: ../src/Gui/CCMainWindow.py:329 +#: ../src/Gui/CCMainWindow.py:356 #, python-format msgid "Error getting the report: %s" msgstr "Error al obtener el informe: %s" -#: ../src/Gui/CCReporterDialog.py:98 +#: ../src/Gui/CCReporterDialog.py:167 +msgid "Brief description how to reproduce this or what you did..." +msgstr "Breve descripción de cómo reproducir esto o lo que hizo..." + +#: ../src/Gui/CCReporterDialog.py:211 #, python-format msgid "" "<b>WARNING</b>, you're about to send data which might contain sensitive information.\n" @@ -219,10 +224,6 @@ msgstr "" "<b>ADVERTENCIA</b>, ¡está por enviar datos que pueden contener información sensible!\n" "¿Realmente quiere enviar <b>%s</b>?\n" -#: ../src/Gui/CCReporterDialog.py:111 -msgid "Brief description how to reproduce this or what you did..." -msgstr "Breve descripción de cómo reproducir esto o lo que hizo..." - #: ../src/Gui/dialogs.glade.h:1 msgid "Report done" msgstr "Informe hecho" @@ -264,6 +265,10 @@ msgstr "Enviar" msgid "gtk-cancel" msgstr "gtk-cancel" +#: ../src/Gui/report.glade.h:5 +msgid "gtk-refresh" +msgstr "gtk-refresh" + #: ../src/Gui/SettingsDialog.py:34 #: ../src/Gui/SettingsDialog.py:51 msgid "<b>Select plugin</b>" @@ -449,31 +454,33 @@ msgstr "Saliendo..." msgid "Getting local universal unique identification" msgstr "Obteniendo la identificación única universal local" -#: ../lib/Plugins/CCpp.cpp:153 +#: ../lib/Plugins/CCpp.cpp:161 msgid "Getting backtrace..." msgstr "Obteniendo el backtrace..." -#: ../lib/Plugins/CCpp.cpp:425 +#: ../lib/Plugins/CCpp.cpp:447 +#: ../lib/Plugins/CCpp.cpp:572 msgid "Searching for debug-info packages..." msgstr "Buscando paquetes de información del depurador..." -#: ../lib/Plugins/CCpp.cpp:487 +#: ../lib/Plugins/CCpp.cpp:509 +#: ../lib/Plugins/CCpp.cpp:607 msgid "Downloading and installing debug-info packages..." msgstr "Descargando e instalando paquetes de información del depurador..." -#: ../lib/Plugins/CCpp.cpp:549 +#: ../lib/Plugins/CCpp.cpp:650 msgid "Getting local universal unique identification..." msgstr "Obteniendo la identificación única universal local..." -#: ../lib/Plugins/CCpp.cpp:568 +#: ../lib/Plugins/CCpp.cpp:669 msgid "Getting global universal unique identification..." msgstr "Obteniendo la identificación única universal global..." -#: ../lib/Plugins/CCpp.cpp:619 +#: ../lib/Plugins/CCpp.cpp:714 msgid "Starting report creation..." msgstr "Iniciando la creación del informe..." -#: ../lib/Plugins/CCpp.cpp:649 +#: ../lib/Plugins/CCpp.cpp:745 msgid "Skipping debuginfo installation" msgstr "Omita la instalación de la información de depuración" diff --git a/po/pt_BR.po b/po/pt_BR.po index dee84787..ceb8b0a2 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: ABRT\n" "Report-Msgid-Bugs-To: jmoskovc@redhat.com\n" -"POT-Creation-Date: 2009-10-07 09:58+0000\n" -"PO-Revision-Date: 2009-10-07 12:18-0300\n" +"POT-Creation-Date: 2009-10-17 16:06+0000\n" +"PO-Revision-Date: 2009-10-17 15:59-0300\n" "Last-Translator: Igor Pires Soares <igor@projetofedora.org>\n" "Language-Team: Brazilian Portuguese <fedora-trans-pt_br@redhat.com>\n" "MIME-Version: 1.0\n" @@ -46,15 +46,17 @@ msgstr "Plugins de banco de dados" msgid "Plugin name is not set, can't load it's settings" msgstr "O nome do plugin não está definido, não é possível carregar as configurações dele" -#: ../src/Gui/CCDBusBackend.py:138 -msgid "Can't connect to dbus" -msgstr "Não foi possível conectar ao dbus" +#: ../src/Gui/CCDBusBackend.py:74 +#: ../src/Gui/CCDBusBackend.py:97 +msgid "Can't connect to system dbus" +msgstr "Não foi possível conectar ao dbus do sistema" -#: ../src/Gui/CCDBusBackend.py:148 -msgid "Please check if abrt daemon is running." -msgstr "Por favor, verifique se o daemon do abrt está em execução." +#: ../src/Gui/CCDBusBackend.py:100 +#: ../src/Gui/CCDBusBackend.py:103 +msgid "Please check if abrt daemon is running" +msgstr "Por favor, verifique se o daemon do abrt está em execução" -#: ../src/Gui/CCDBusBackend.py:158 +#: ../src/Gui/CCDBusBackend.py:155 msgid "" "Daemon did't return valid report info\n" "Debuginfo is missing?" @@ -194,7 +196,7 @@ msgstr "" "Não foi possível obter o relatório!\n" "O debuginfo está faltando?" -#: ../src/Gui/CCMainWindow.py:308 +#: ../src/Gui/CCMainWindow.py:310 #, python-format msgid "" "Reporting failed!\n" @@ -203,12 +205,17 @@ msgstr "" "Falha no relato!\n" "%s" -#: ../src/Gui/CCMainWindow.py:340 +#: ../src/Gui/CCMainWindow.py:329 +#: ../src/Gui/CCMainWindow.py:356 #, python-format msgid "Error getting the report: %s" msgstr "Erro ao obter o relatório: %s" -#: ../src/Gui/CCReporterDialog.py:98 +#: ../src/Gui/CCReporterDialog.py:167 +msgid "Brief description how to reproduce this or what you did..." +msgstr "Breve descrição sobre como reproduzir isto ou o que você fazia..." + +#: ../src/Gui/CCReporterDialog.py:211 #, python-format msgid "" "<b>WARNING</b>, you're about to send data which might contain sensitive information.\n" @@ -217,10 +224,6 @@ msgstr "" "<b>AVISO</b>, você está prestes a enviar dados que podem conter informações delicadas.\n" "Você realmente deseja enviar o <b>%s</b>?\n" -#: ../src/Gui/CCReporterDialog.py:111 -msgid "Brief description how to reproduce this or what you did..." -msgstr "Breve descrição sobre como reproduzir isto ou o que você fazia..." - #: ../src/Gui/dialogs.glade.h:1 msgid "Report done" msgstr "Relato concluído" @@ -240,12 +243,12 @@ msgstr "Não foi possível localizar o widget PluginDialog na descrição da int msgid "No UI for plugin %s" msgstr "Nenhuma interface de usuário para o plugin %s" -#: ../src/Gui/PluginSettingsUI.py:41 -#: ../src/Gui/PluginSettingsUI.py:67 +#: ../src/Gui/PluginSettingsUI.py:55 +#: ../src/Gui/PluginSettingsUI.py:81 msgid "combo box is not implemented" msgstr "caixa de combinação não implementada" -#: ../src/Gui/PluginSettingsUI.py:50 +#: ../src/Gui/PluginSettingsUI.py:64 msgid "Nothing to hydrate!" msgstr "Nada a ser hidratado!" @@ -262,6 +265,10 @@ msgstr "Enviar" msgid "gtk-cancel" msgstr "gtk-cancel" +#: ../src/Gui/report.glade.h:5 +msgid "gtk-refresh" +msgstr "gtk-refresh" + #: ../src/Gui/SettingsDialog.py:34 #: ../src/Gui/SettingsDialog.py:51 msgid "<b>Select plugin</b>" @@ -401,7 +408,7 @@ msgstr "O serviço do ABRT não está em execução" msgid "Warning" msgstr "Aviso" -#: ../src/Daemon/Daemon.cpp:546 +#: ../src/Daemon/Daemon.cpp:542 msgid "Report size exceeded the quota. Please check system's MaxCrashReportsSize value in abrt.conf." msgstr "O tamanho do relatório excedeu a cota. Por favor, verifique o valor MaxCrashReportsSize do sistema no abrt.conf." @@ -409,37 +416,37 @@ msgstr "O tamanho do relatório excedeu a cota. Por favor, verifique o valor Max msgid "Empty login and password. Please check Bugzilla.conf" msgstr "Nome de usuário e senha vazios. Por favor, verifique o Bugzilla.conf" -#: ../lib/Plugins/Bugzilla.cpp:227 +#: ../lib/Plugins/Bugzilla.cpp:205 msgid "Bug is already reported: " msgstr "O erro já foi relatado: " -#: ../lib/Plugins/Bugzilla.cpp:282 +#: ../lib/Plugins/Bugzilla.cpp:260 #, c-format msgid "Binary file %s will not be reported." msgstr "O arquivo binário %s não será relatado." -#: ../lib/Plugins/Bugzilla.cpp:352 +#: ../lib/Plugins/Bugzilla.cpp:330 msgid "New bug id: " msgstr "Novo id do erro: " -#: ../lib/Plugins/Bugzilla.cpp:421 +#: ../lib/Plugins/Bugzilla.cpp:399 msgid "Checking for duplicates..." msgstr "Verificando duplicatas..." -#: ../lib/Plugins/Bugzilla.cpp:424 -#: ../lib/Plugins/Bugzilla.cpp:436 +#: ../lib/Plugins/Bugzilla.cpp:402 +#: ../lib/Plugins/Bugzilla.cpp:413 msgid "Logging into bugzilla..." msgstr "Autenticando no bugzilla..." -#: ../lib/Plugins/Bugzilla.cpp:427 -msgid "Check CC and add coment +1..." -msgstr "Verifique o CC e adicione o comentário +1..." +#: ../lib/Plugins/Bugzilla.cpp:405 +msgid "Checking CC..." +msgstr "Verificando CC..." -#: ../lib/Plugins/Bugzilla.cpp:448 +#: ../lib/Plugins/Bugzilla.cpp:425 msgid "Creating new bug..." msgstr "Criando novo erro..." -#: ../lib/Plugins/Bugzilla.cpp:453 +#: ../lib/Plugins/Bugzilla.cpp:430 msgid "Logging out..." msgstr "Encerrando sessão..." @@ -447,31 +454,31 @@ msgstr "Encerrando sessão..." msgid "Getting local universal unique identification" msgstr "Obtendo identificação universal local única" -#: ../lib/Plugins/CCpp.cpp:146 +#: ../lib/Plugins/CCpp.cpp:161 msgid "Getting backtrace..." msgstr "Obtendo backtrace..." -#: ../lib/Plugins/CCpp.cpp:415 +#: ../lib/Plugins/CCpp.cpp:442 msgid "Searching for debug-info packages..." msgstr "Pesquisando por pacotes debug-info..." -#: ../lib/Plugins/CCpp.cpp:451 +#: ../lib/Plugins/CCpp.cpp:504 msgid "Downloading and installing debug-info packages..." msgstr "Baixando e instalando pacotes debug-info..." -#: ../lib/Plugins/CCpp.cpp:513 +#: ../lib/Plugins/CCpp.cpp:566 msgid "Getting local universal unique identification..." msgstr "Obtendo identificação universal local única..." -#: ../lib/Plugins/CCpp.cpp:532 +#: ../lib/Plugins/CCpp.cpp:585 msgid "Getting global universal unique identification..." msgstr "Obtendo identificação universal global única..." -#: ../lib/Plugins/CCpp.cpp:583 +#: ../lib/Plugins/CCpp.cpp:630 msgid "Starting report creation..." msgstr "Iniciando a criação do relatório..." -#: ../lib/Plugins/CCpp.cpp:612 +#: ../lib/Plugins/CCpp.cpp:661 msgid "Skipping debuginfo installation" msgstr "Pulando instalação do debuginfo" @@ -527,6 +534,8 @@ msgstr "executando o sosreport: " msgid "done running sosreport" msgstr "Execução do sosreport realizada" +#~ msgid "Check CC and add coment +1..." +#~ msgstr "Verifique o CC e adicione o comentário +1..." #~ msgid "Pending events: %i" #~ msgstr "Eventos pendentes: %i" #~ msgid "Can't create menu from the description, popup won't be available!\n" diff --git a/src/CLI/CLI.cpp b/src/CLI/CLI.cpp index a782a59a..18e99dcf 100644 --- a/src/CLI/CLI.cpp +++ b/src/CLI/CLI.cpp @@ -65,7 +65,7 @@ static void print_crash_infos(vector_crash_infos_t& pCrashInfos, int pMode) int success = strftime(timeloc, 128, "%c", localtime(&time)); if (!success) error_msg_and_die("Error while converting time to string."); - + printf(_("%u.\n" "\tUID : %s\n" "\tUUID : %s\n" @@ -132,7 +132,6 @@ int main(int argc, char** argv) { char* uuid = NULL; int op = -1; - char *name; setlocale(LC_ALL,""); #if ENABLE_NLS diff --git a/src/CLI/abrt-cli.1 b/src/CLI/abrt-cli.1 index 9ccc6159..4fe4bb42 100644 --- a/src/CLI/abrt-cli.1 +++ b/src/CLI/abrt-cli.1 @@ -24,16 +24,16 @@ Prints list of crashes which are not reported yet. .IP "\-\-get-list-full" Prints list of all crashes. .IP "\-\-report \fIUUID\fR" -Creates a crash report and then the text editor is invoked on that -report. When you are done with editing the report just exit the editor -and then you will be asked if you want to send the report. +Creates a crash report and then the text editor is invoked on that +report. When you are done with editing the report just exit the editor +and then you will be asked if you want to send the report. .IP "\-\-report-always \fIUUID\fR" Creates and sends the crash report without asking. .IP "\-\-delete \fIUUID\fR" Removes data about particular crash. .SH ENVIRONMENT VARIABLES -The editor used to edit the crash report is chosen from the ABRT_EDITOR -environment variable, the VISUAL environment variable, or the EDITOR +The editor used to edit the crash report is chosen from the ABRT_EDITOR +environment variable, the VISUAL environment variable, or the EDITOR environment variable, in that order. .SH "SEE ALSO" .IR abrtd (8), diff --git a/src/CLI/abrt-cli.bash b/src/CLI/abrt-cli.bash index 089d5a3f..10b086ae 100644 --- a/src/CLI/abrt-cli.bash +++ b/src/CLI/abrt-cli.bash @@ -1,7 +1,7 @@ # bash-completion add-on for abrt-cli(1) # http://bash-completion.alioth.debian.org/ -_abrt_cli() +_abrt_cli() { local cur prev opts COMPREPLY=() diff --git a/src/CLI/dbus.cpp b/src/CLI/dbus.cpp index 64dac094..420fe703 100644 --- a/src/CLI/dbus.cpp +++ b/src/CLI/dbus.cpp @@ -38,7 +38,7 @@ static DBusMessage* send_get_reply_and_unref(DBusMessage* msg) DBusError err; dbus_error_init(&err); DBusMessage *reply; - reply = dbus_connection_send_with_reply_and_block(s_dbus_conn, + reply = dbus_connection_send_with_reply_and_block(s_dbus_conn, msg, /*timeout*/ -1, &err); if (reply == NULL) { diff --git a/src/CLI/report.cpp b/src/CLI/report.cpp index 8dedf036..b9a13914 100644 --- a/src/CLI/report.cpp +++ b/src/CLI/report.cpp @@ -33,15 +33,15 @@ /* Field separator for the crash report file that is edited by user. */ #define FIELD_SEP "%----" -/* - * Trims whitespace characters both from left and right side of a string. +/* + * Trims whitespace characters both from left and right side of a string. * Modifies the string in-place. Returns the trimmed string. */ char *trim(char *str) { if (!str) return NULL; - + // Remove leading spaces. char *ibuf; for (ibuf = str; *ibuf && isspace(*ibuf); ++ibuf) @@ -60,9 +60,9 @@ char *trim(char *str) return str; } -/* - * Escapes the field content string to avoid confusion with file comments. - * Returned field must be free()d by caller. +/* + * Escapes the field content string to avoid confusion with file comments. + * Returned field must be free()d by caller. */ static char *escape(const char *str) { @@ -87,12 +87,12 @@ static char *escape(const char *str) ++ptr; } - // Copy the input string to the resultant string, and escape all + // Copy the input string to the resultant string, and escape all // occurences of \# and #. char *result = (char*)malloc(strlen(str) + 1 + count); if (!result) error_msg_and_die("Memory error while escaping a field."); - + const char *src = str; char *dest = result; newline = true; @@ -109,15 +109,15 @@ static char *escape(const char *str) newline = (*src == '\n'); *dest++ = *src++; } - *dest = '\0'; + *dest = '\0'; return result; } /* - * Removes all comment lines, and unescapes the string previously escaped - * by escape(). Works in-place. + * Removes all comment lines, and unescapes the string previously escaped + * by escape(). Works in-place. */ -static char *remove_comments_and_unescape(char *str) +static void remove_comments_and_unescape(char *str) { char *src = str, *dest = str; bool newline = true; @@ -125,7 +125,7 @@ static char *remove_comments_and_unescape(char *str) { if (newline) { - if (*src == '#') + if (*src == '#') { // Skip the comment line! while (*src && *src != '\n') ++src; @@ -136,25 +136,25 @@ static char *remove_comments_and_unescape(char *str) ++src; continue; } - else if (*src == '\\' && - (*(src + 1) == '#' || + else if (*src == '\\' && + (*(src + 1) == '#' || (*(src + 1) == '\\' && *(src + 2) == '#'))) { ++src; // Unescape escaped char. } } - + newline = (*src == '\n'); *dest++ = *src++; } *dest = '\0'; } -/* +/* * Writes a field of crash report to a file. * Field must be writable. */ -static void write_crash_report_field(FILE *fp, const map_crash_report_t &report, +static void write_crash_report_field(FILE *fp, const map_crash_report_t &report, const char *field, const char *description) { const map_crash_report_t::const_iterator it = report.find(field); @@ -168,9 +168,9 @@ static void write_crash_report_field(FILE *fp, const map_crash_report_t &report, if (it->second[CD_TYPE] == CD_SYS) { error_msg("Cannot write field %s because it is a system value\n", field); - return; + return; } - + fprintf(fp, "%s%s\n", FIELD_SEP, it->first.c_str()); fprintf(fp, "%s\n", description); @@ -182,8 +182,8 @@ static void write_crash_report_field(FILE *fp, const map_crash_report_t &report, free(escaped_content); } -/* - * Saves the crash report to a file. +/* + * Saves the crash report to a file. * Parameter 'fp' must be opened before write_crash_report is called. * Returned value: * If the report is successfully stored to the file, a zero value is returned. @@ -194,7 +194,7 @@ static int write_crash_report(const map_crash_report_t &report, FILE *fp) fprintf(fp, "# Please check this report. Lines starting with '#' will be ignored.\n" "# Lines starting with '%%----' separate fields, please do not delete them.\n\n"); - write_crash_report_field(fp, report, CD_COMMENT, + write_crash_report_field(fp, report, CD_COMMENT, _("# Describe the circumstances of this crash below.")); write_crash_report_field(fp, report, CD_REPRODUCE, _("# How to reproduce the crash?")); @@ -210,19 +210,19 @@ static int write_crash_report(const map_crash_report_t &report, FILE *fp) write_crash_report_field(fp, report, FILENAME_PACKAGE, _("# Package")); write_crash_report_field(fp, report, FILENAME_REASON, _("# Reason of crash")); write_crash_report_field(fp, report, FILENAME_RELEASE, _("# Release string of the operating system")); - + return 0; } -/* +/* * Updates appropriate field in the report from the text. The text can - * contain multiple fields. + * contain multiple fields. * Returns: * 0 if no change to the field was detected. * 1 if the field was changed. * Changes to read-only fields are ignored. */ -static int read_crash_report_field(const char *text, map_crash_report_t &report, +static int read_crash_report_field(const char *text, map_crash_report_t &report, const char *field) { char separator[strlen("\n" FIELD_SEP) + strlen(field) + 2]; // 2 = '\n\0' @@ -236,9 +236,9 @@ static int read_crash_report_field(const char *text, map_crash_report_t &report, const char *end = strstr(textfield, "\n" FIELD_SEP); if (!end) length = strlen(textfield); - else + else length = end - textfield; - + const map_crash_report_t::iterator it = report.find(field); if (it == report.end()) { @@ -249,7 +249,7 @@ static int read_crash_report_field(const char *text, map_crash_report_t &report, if (it->second[CD_TYPE] == CD_SYS) { error_msg("Cannot update field %s because it is a system value.\n", field); - return 0; + return 0; } // Do not change noneditable fields. @@ -275,12 +275,12 @@ static int read_crash_report_field(const char *text, map_crash_report_t &report, return 1; } -/* - * Updates the crash report 'report' from the text. The text must not contain - * any comments. +/* + * Updates the crash report 'report' from the text. The text must not contain + * any comments. * Returns: * 0 if no field was changed. - * 1 if any field was changed. + * 1 if any field was changed. * Changes to read-only fields are ignored. */ static int read_crash_report(map_crash_report_t &report, const char *text) @@ -306,20 +306,20 @@ static int read_crash_report(map_crash_report_t &report, const char *text) int launch_editor(const char *path) { const char *editor, *terminal; - + editor = getenv("ABRT_EDITOR"); if (!editor) editor = getenv("VISUAL"); if (!editor) editor = getenv("EDITOR"); - + terminal = getenv("TERM"); if (!editor && (!terminal || !strcmp(terminal, "dumb"))) { error_msg(_("Terminal is dumb but no VISUAL nor EDITOR defined.")); return 1; } - + if (!editor) editor = "vi"; @@ -367,7 +367,7 @@ int report(const char *uuid, bool always) error_msg("could not close '%s'", filename); return 2; } - + // Start a text editor on the temporary file. launch_editor(filename); @@ -394,7 +394,7 @@ int report(const char *uuid, bool always) remove_comments_and_unescape(text); // Updates the crash report from the file text. - int report_changed = read_crash_report(cr, text); + int report_changed = read_crash_report(cr, text); if (report_changed) puts(_("\nThe report has been updated.")); else diff --git a/src/CLI/run-command.cpp b/src/CLI/run-command.cpp index df29b0e1..80184cfa 100644 --- a/src/CLI/run-command.cpp +++ b/src/CLI/run-command.cpp @@ -23,7 +23,7 @@ http://git.kernel.org/?p=git/git.git;a=blob;f=run-command.c;hb=HEAD */ -struct child_process +struct child_process { const char **argv; pid_t pid; @@ -51,28 +51,28 @@ static int finish_command(struct child_process *cmd) int status, code = -1; while ((waiting = waitpid(cmd->pid, &status, 0)) < 0 && errno == EINTR) ; /* nothing */ - - if (waiting < 0) + + if (waiting < 0) error_msg_and_die("waitpid for %s failed: %s", cmd->argv[0], strerror(errno)); - else if (waiting != cmd->pid) + else if (waiting != cmd->pid) error_msg_and_die("waitpid is confused (%s)", cmd->argv[0]); - else if (WIFSIGNALED(status)) + else if (WIFSIGNALED(status)) { code = WTERMSIG(status); error_msg("%s died of signal %d", cmd->argv[0], code); - } - else if (WIFEXITED(status)) + } + else if (WIFEXITED(status)) { code = WEXITSTATUS(status); - if (code == 127) + if (code == 127) { code = -1; error_msg_and_die("cannot run %s: %s", cmd->argv[0], strerror(ENOENT)); } - } - else + } + else error_msg_and_die("waitpid is confused (%s)", cmd->argv[0]); - + return code; } diff --git a/src/Daemon/CommLayerServerDBus.cpp b/src/Daemon/CommLayerServerDBus.cpp index fc28a122..cc98fc2c 100644 --- a/src/Daemon/CommLayerServerDBus.cpp +++ b/src/Daemon/CommLayerServerDBus.cpp @@ -215,20 +215,19 @@ static int handle_Report(DBusMessage* call, DBusMessage* reply) comment = (it_comment != argin1.end()) ? it_comment->second[CD_CONTENT].c_str() : ""; reproduce = (it_reproduce != argin1.end()) ? it_reproduce->second[CD_CONTENT].c_str() : ""; + const char* errmsg = NULL; if (strlen(comment) > LIMIT_MESSAGE) { - dbus_message_unref(reply); - reply = dbus_message_new_error(call, DBUS_ERROR_FAILED, _("Comment message is too long")); - if (!reply) - die_out_of_memory(); - send_flush_and_unref(reply); - return 0; + errmsg = _("Comment is too long"); } - - if (strlen(reproduce) > LIMIT_MESSAGE) + else if (strlen(reproduce) > LIMIT_MESSAGE) + { + errmsg = _("'How to reproduce' is too long"); + } + if (errmsg) { dbus_message_unref(reply); - reply = dbus_message_new_error(call, DBUS_ERROR_FAILED, _("How to reproduce message is too long")); + reply = dbus_message_new_error(call, DBUS_ERROR_FAILED, errmsg); if (!reply) die_out_of_memory(); send_flush_and_unref(reply); @@ -247,21 +246,19 @@ static int handle_Report(DBusMessage* call, DBusMessage* reply) } } - const char * sender = dbus_message_get_sender(call); if (!user_conf_data.empty()) { std::string PluginName; map_plugin_settings_t plugin_settings; - map_map_string_t::const_iterator it_user_conf_data; - for (it_user_conf_data = user_conf_data.begin(); it_user_conf_data != user_conf_data.end(); it_user_conf_data++) + map_map_string_t::const_iterator it_user_conf_data = user_conf_data.begin(); + for (; it_user_conf_data != user_conf_data.end(); it_user_conf_data++) { - map_string_t::const_iterator it_plugin_config; - map_string_t plugin_config = it_user_conf_data->second; PluginName = it_user_conf_data->first; plugin_settings = it_user_conf_data->second; #if DEBUG std::cout << "plugin name: " << it_user_conf_data->first; + map_string_t::const_iterator it_plugin_config; for (it_plugin_config = it_user_conf_data->second.begin(); it_plugin_config != it_user_conf_data->second.end(); it_plugin_config++) diff --git a/src/Daemon/MiddleWare.cpp b/src/Daemon/MiddleWare.cpp index 9060d79a..2ccd5890 100644 --- a/src/Daemon/MiddleWare.cpp +++ b/src/Daemon/MiddleWare.cpp @@ -311,11 +311,12 @@ static bool CheckReport(const map_crash_report_t& pCrashReport) map_crash_report_t::const_iterator it_release = pCrashReport.find(FILENAME_RELEASE); map_crash_report_t::const_iterator it_executable = pCrashReport.find(FILENAME_EXECUTABLE); - if (it_analyzer == pCrashReport.end() || it_mwuid == pCrashReport.end() || - it_mwuuid == pCrashReport.end() || it_package == pCrashReport.end() || - it_architecture == pCrashReport.end() || it_kernel == pCrashReport.end() || - it_component == pCrashReport.end() || it_release == pCrashReport.end() || - it_executable == pCrashReport.end()) + map_crash_report_t::const_iterator end = pCrashReport.end(); + if (it_analyzer == end || it_mwuid == end || + it_mwuuid == end || it_package == end || + it_architecture == end || it_kernel == end || + it_component == end || it_release == end || + it_executable == end) { return false; } @@ -336,9 +337,6 @@ report_status_t Report(const map_crash_report_t& pCrashReport, const std::string& pUID) { report_status_t ret; - std::string key; - std::string message; - CDebugDump dd; if (!CheckReport(pCrashReport)) { @@ -349,25 +347,28 @@ report_status_t Report(const map_crash_report_t& pCrashReport, std::string UID = pCrashReport.find(CD_MWUID)->second[CD_CONTENT]; std::string UUID = pCrashReport.find(CD_MWUUID)->second[CD_CONTENT]; std::string packageNVR = pCrashReport.find(FILENAME_PACKAGE)->second[CD_CONTENT]; - std::string packageName = packageNVR.substr(0, packageNVR.rfind("-", packageNVR.rfind("-") - 1 )); + std::string packageName = packageNVR.substr(0, packageNVR.rfind("-", packageNVR.rfind("-") - 1)); // Save comments and how to reproduciton map_crash_report_t::const_iterator it_comment = pCrashReport.find(CD_COMMENT); map_crash_report_t::const_iterator it_reproduce = pCrashReport.find(CD_REPRODUCE); std::string pDumpDir = getDebugDumpDir(UUID,UID); - dd.Open(pDumpDir); - if ( it_comment != pCrashReport.end() ) - { - dd.SaveText(FILENAME_COMMENT, it_comment->second[CD_CONTENT]); - } - if ( it_reproduce != pCrashReport.end() ) { - dd.SaveText(FILENAME_REPRODUCE, it_reproduce->second[CD_CONTENT]); + CDebugDump dd; + dd.Open(pDumpDir); + if (it_comment != pCrashReport.end()) + { + dd.SaveText(FILENAME_COMMENT, it_comment->second[CD_CONTENT]); + } + if (it_reproduce != pCrashReport.end()) + { + dd.SaveText(FILENAME_REPRODUCE, it_reproduce->second[CD_CONTENT]); + } } - dd.Close(); + // analyzer with package name (CCpp:xrog-x11-app) has higher priority - key = analyzer + ":" + packageName; + std::string key = analyzer + ":" + packageName; map_analyzer_actions_and_reporters_t::iterator keyPtr = s_mapAnalyzerActionsAndReporters.find(key); if (keyPtr == s_mapAnalyzerActionsAndReporters.end()) { @@ -375,6 +376,7 @@ report_status_t Report(const map_crash_report_t& pCrashReport, keyPtr = s_mapAnalyzerActionsAndReporters.find(analyzer); } + std::string message; if (keyPtr != s_mapAnalyzerActionsAndReporters.end()) { vector_pair_string_string_t::iterator it_r = keyPtr->second.begin(); @@ -386,10 +388,10 @@ report_status_t Report(const map_crash_report_t& pCrashReport, if (g_pPluginManager->GetPluginType(pluginName) == REPORTER) { CReporter* reporter = g_pPluginManager->GetReporter(pluginName); +#if 0 /* Using ~user/.abrt/ is bad wrt security */ std::string home = ""; map_plugin_settings_t oldSettings; map_plugin_settings_t newSettings; - std::string res; if (pUID != "") { @@ -404,14 +406,15 @@ report_status_t Report(const map_crash_report_t& pCrashReport, } } } +#endif + std::string res = reporter->Report(pCrashReport, it_r->second); - res = reporter->Report(pCrashReport, it_r->second); - +#if 0 /* Using ~user/.abrt/ is bad wrt security */ if (home != "") { reporter->SetSettings(oldSettings); } - +#endif ret[pluginName].push_back("1"); ret[pluginName].push_back(res); message += res + "\n"; diff --git a/src/Daemon/PluginManager.cpp b/src/Daemon/PluginManager.cpp index bd5727e0..2363308a 100644 --- a/src/Daemon/PluginManager.cpp +++ b/src/Daemon/PluginManager.cpp @@ -376,66 +376,73 @@ void CPluginManager::SetPluginSettings(const std::string& pName, const map_plugin_settings_t& pSettings) { map_abrt_plugins_t::iterator abrt_plugin = m_mapABRTPlugins.find(pName); - if (abrt_plugin != m_mapABRTPlugins.end()) + if (abrt_plugin == m_mapABRTPlugins.end()) { - map_plugins_t::iterator plugin = m_mapPlugins.find(pName); - if (plugin != m_mapPlugins.end()) - { - plugin->second->SetSettings(pSettings); + return; + } + map_plugins_t::iterator plugin = m_mapPlugins.find(pName); + if (plugin == m_mapPlugins.end()) + { + return; + } + plugin->second->SetSettings(pSettings); - if (abrt_plugin->second->GetType() == REPORTER) - { - std::string home = get_home_dir(atoi(pUID.c_str())); - if (home != "") - { - std::string confDir = home + "/.abrt"; - std::string confPath = confDir + "/" + pName + "."PLUGINS_CONF_EXTENSION; - uid_t uid = atoi(pUID.c_str()); - struct passwd* pw = getpwuid(uid); - gid_t gid = pw ? pw->pw_gid : uid; - - struct stat buf; - if (stat(confDir.c_str(), &buf) != 0) - { - if (mkdir(confDir.c_str(), 0700) == -1) - { - perror_msg("Can't create dir '%s'", confDir.c_str()); - return; - } - if (chmod(confDir.c_str(), 0700) == -1) - { - perror_msg("Can't change mod of dir '%s'", confDir.c_str()); - return; - } - if (chown(confDir.c_str(), uid, gid) == -1) - { - perror_msg("Can't change '%s' ownership to %u:%u", confPath.c_str(), (int)uid, (int)gid); - return; - } - - } - else if (!S_ISDIR(buf.st_mode)) - { - perror_msg("'%s' is not a directory", confDir.c_str()); - return; - } - - /** we don't want to save it from daemon if it's running under root - but wi might get back to this once we make the daemon to not run - with root privileges - */ - /* - SavePluginSettings(confPath, pSettings); - if (chown(confPath.c_str(), uid, gid) == -1) - { - perror_msg("Can't change '%s' ownership to %u:%u", confPath.c_str(), (int)uid, (int)gid); - return; - } - */ - } - } +#if 0 /* Writing to ~user/.abrt/ is bad wrt security */ + if (abrt_plugin->second->GetType() != REPORTER) + { + return; + } + + std::string home = get_home_dir(atoi(pUID.c_str())); + if (home == "") + { + return; + } + + std::string confDir = home + "/.abrt"; + std::string confPath = confDir + "/" + pName + "."PLUGINS_CONF_EXTENSION; + uid_t uid = atoi(pUID.c_str()); + struct passwd* pw = getpwuid(uid); + gid_t gid = pw ? pw->pw_gid : uid; + + struct stat buf; + if (stat(confDir.c_str(), &buf) != 0) + { + if (mkdir(confDir.c_str(), 0700) == -1) + { + perror_msg("Can't create dir '%s'", confDir.c_str()); + return; + } + if (chmod(confDir.c_str(), 0700) == -1) + { + perror_msg("Can't change mod of dir '%s'", confDir.c_str()); + return; + } + if (chown(confDir.c_str(), uid, gid) == -1) + { + perror_msg("Can't change '%s' ownership to %u:%u", confPath.c_str(), (int)uid, (int)gid); + return; } } + else if (!S_ISDIR(buf.st_mode)) + { + perror_msg("'%s' is not a directory", confDir.c_str()); + return; + } + + /** we don't want to save it from daemon if it's running under root + but wi might get back to this once we make the daemon to not run + with root privileges + */ + /* + SavePluginSettings(confPath, pSettings); + if (chown(confPath.c_str(), uid, gid) == -1) + { + perror_msg("Can't change '%s' ownership to %u:%u", confPath.c_str(), (int)uid, (int)gid); + return; + } + */ +#endif } map_plugin_settings_t CPluginManager::GetPluginSettings(const std::string& pName, |