diff options
-rw-r--r-- | lib/Plugins/RunApp.cpp | 2 | ||||
-rw-r--r-- | lib/Utils/DebugDump.cpp | 10 | ||||
-rw-r--r-- | lib/Utils/DebugDump.h | 8 | ||||
-rw-r--r-- | po/pt_BR.po | 164 | ||||
-rw-r--r-- | src/Daemon/CommLayerServerDBus.cpp | 6 | ||||
-rw-r--r-- | src/Daemon/PluginManager.cpp | 30 | ||||
-rw-r--r-- | src/Daemon/PluginManager.h | 16 | ||||
-rw-r--r-- | src/Daemon/org.fedoraproject.abrt.policy | 20 |
8 files changed, 170 insertions, 86 deletions
diff --git a/lib/Plugins/RunApp.cpp b/lib/Plugins/RunApp.cpp index 4bc53181..fdbc3a75 100644 --- a/lib/Plugins/RunApp.cpp +++ b/lib/Plugins/RunApp.cpp @@ -83,7 +83,7 @@ void CActionRunApp::Run(const std::string& pActionDir, { CDebugDump dd; dd.Open(pActionDir); - dd.SaveText(args[FILENAME], output); + dd.SaveText(args[FILENAME].c_str(), output); dd.Close(); } } diff --git a/lib/Utils/DebugDump.cpp b/lib/Utils/DebugDump.cpp index 345dbf02..e607d940 100644 --- a/lib/Utils/DebugDump.cpp +++ b/lib/Utils/DebugDump.cpp @@ -410,7 +410,7 @@ static void SaveBinaryFile(const std::string& pPath, const char* pData, const un } } -void CDebugDump::LoadText(const std::string& pName, std::string& pData) +void CDebugDump::LoadText(const char* pName, std::string& pData) { if (!m_bOpened) { @@ -419,7 +419,7 @@ void CDebugDump::LoadText(const std::string& pName, std::string& pData) std::string fullPath = m_sDebugDumpDir + "/" + pName; LoadTextFile(fullPath, pData); } -void CDebugDump::LoadBinary(const std::string& pName, char** pData, unsigned int* pSize) +void CDebugDump::LoadBinary(const char* pName, char** pData, unsigned int* pSize) { if (!m_bOpened) { @@ -429,7 +429,7 @@ void CDebugDump::LoadBinary(const std::string& pName, char** pData, unsigned int LoadBinaryFile(fullPath, pData, pSize); } -void CDebugDump::SaveText(const std::string& pName, const std::string& pData) +void CDebugDump::SaveText(const char* pName, const std::string& pData) { if (!m_bOpened) { @@ -438,7 +438,7 @@ void CDebugDump::SaveText(const std::string& pName, const std::string& pData) std::string fullPath = m_sDebugDumpDir + "/" + pName; SaveTextFile(fullPath, pData); } -void CDebugDump::SaveBinary(const std::string& pName, const char* pData, const unsigned int pSize) +void CDebugDump::SaveBinary(const char* pName, const char* pData, const unsigned int pSize) { if (!m_bOpened) { @@ -489,7 +489,7 @@ bool CDebugDump::GetNextFile(std::string& pFileName, std::string& pContent, bool pFileName = dent->d_name; if (IsTextFile(fullname)) { - LoadText(pFileName, pContent); + LoadText(dent->d_name, pContent); pIsTextFile = true; } else diff --git a/lib/Utils/DebugDump.h b/lib/Utils/DebugDump.h index 573c6073..c5ee060d 100644 --- a/lib/Utils/DebugDump.h +++ b/lib/Utils/DebugDump.h @@ -64,11 +64,11 @@ class CDebugDump bool Exist(const char* pFileName); - void LoadText(const std::string& pName, std::string& pData); - void LoadBinary(const std::string& pName, char** pData, unsigned int* pSize); + void LoadText(const char* pName, std::string& pData); + void LoadBinary(const char* pName, char** pData, unsigned int* pSize); - void SaveText(const std::string& pName, const std::string& pData); - void SaveBinary(const std::string& pName, const char* pData, const unsigned int pSize); + void SaveText(const char* pName, const std::string& pData); + void SaveBinary(const char* pName, const char* pData, const unsigned int pSize); void InitGetNextFile(); bool GetNextFile(std::string& pFileName, std::string& pContent, bool& pIsTextFile); diff --git a/po/pt_BR.po b/po/pt_BR.po index 3eced7b9..2bf9532d 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-09-05 08:42+0000\n" -"PO-Revision-Date: 2009-09-05 11:22-0300\n" +"POT-Creation-Date: 2009-09-09 10:05+0000\n" +"PO-Revision-Date: 2009-09-09 10:58-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" @@ -47,11 +47,11 @@ msgid "Can't connect to dbus" msgstr "Não foi possível conectar ao dbus" #: ../src/Gui/CCDBusBackend.py:144 -#: ../src/Gui/CCDBusBackend.py:163 +#: ../src/Gui/CCDBusBackend.py:164 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:181 +#: ../src/Gui/CCDBusBackend.py:182 msgid "" "Daemon did't return valid report info\n" "Debuginfo is missing?" @@ -68,7 +68,7 @@ msgid "(C) 2009 Red Hat, Inc." msgstr "(C) 2009 Red Hat, Inc." #: ../src/Gui/ccgui.glade.h:3 -#: ../src/Gui/CCMainWindow.py:215 +#: ../src/Gui/CCMainWindow.py:223 msgid "<b>Not reported!</b>" msgstr "<b>Não relatado!</b>" @@ -89,15 +89,19 @@ msgid "Delete" msgstr "Excluir" #: ../src/Gui/ccgui.glade.h:8 +msgid "Global settings" +msgstr "Configurações globais" + +#: ../src/Gui/ccgui.glade.h:9 msgid "Please wait.." msgstr "Por favor aguarde..." -#: ../src/Gui/ccgui.glade.h:9 +#: ../src/Gui/ccgui.glade.h:10 #: ../src/Gui/report.glade.h:2 msgid "Report" msgstr "Relatar" -#: ../src/Gui/ccgui.glade.h:10 +#: ../src/Gui/ccgui.glade.h:11 msgid "" "This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\n" "\n" @@ -111,43 +115,43 @@ msgstr "" "\n" "Você deve ter recebido uma cópia da GNU General Public License (GPL) junto com este programa. Se não, acesse <http://www.gnu.org/licenses/>." -#: ../src/Gui/ccgui.glade.h:15 +#: ../src/Gui/ccgui.glade.h:16 msgid "Working..." msgstr "Processando..." -#: ../src/Gui/ccgui.glade.h:16 +#: ../src/Gui/ccgui.glade.h:17 msgid "_Edit" msgstr "_Editar" -#: ../src/Gui/ccgui.glade.h:17 +#: ../src/Gui/ccgui.glade.h:18 msgid "_File" msgstr "_Arquivo" -#: ../src/Gui/ccgui.glade.h:18 +#: ../src/Gui/ccgui.glade.h:19 msgid "_Help" msgstr "Aj_uda" -#: ../src/Gui/CCMainWindow.py:86 +#: ../src/Gui/CCMainWindow.py:87 msgid "Package" msgstr "Pacote" -#: ../src/Gui/CCMainWindow.py:87 +#: ../src/Gui/CCMainWindow.py:88 msgid "Application" msgstr "Aplicativo" -#: ../src/Gui/CCMainWindow.py:88 +#: ../src/Gui/CCMainWindow.py:89 msgid "Date" msgstr "Data" -#: ../src/Gui/CCMainWindow.py:89 +#: ../src/Gui/CCMainWindow.py:90 msgid "Crash Rate" msgstr "Taxa de travamento" -#: ../src/Gui/CCMainWindow.py:91 +#: ../src/Gui/CCMainWindow.py:92 msgid "User" msgstr "Usuário" -#: ../src/Gui/CCMainWindow.py:157 +#: ../src/Gui/CCMainWindow.py:165 #, python-format msgid "" "Unable to finish current task!\n" @@ -156,7 +160,7 @@ msgstr "" "Não foi possível finalizar a tarefa atual!\n" "%s" -#: ../src/Gui/CCMainWindow.py:174 +#: ../src/Gui/CCMainWindow.py:182 #, python-format msgid "" "Error while loading the dumplist, please check if abrt daemon is running\n" @@ -165,11 +169,11 @@ msgstr "" "Erro ao carregar a lista de despejo, por favor, verifique se o daemon do abrt está em execução\n" " %s" -#: ../src/Gui/CCMainWindow.py:207 +#: ../src/Gui/CCMainWindow.py:215 msgid "<b>This crash has been reported, you can find the report(s) at:</b>\n" msgstr "<b>Este travamento foi relatado, você pode localizar o(s) relatório(s) em:</b>\n" -#: ../src/Gui/CCMainWindow.py:267 +#: ../src/Gui/CCMainWindow.py:275 msgid "" "Unable to get report!\n" "Debuginfo is missing?" @@ -177,7 +181,7 @@ msgstr "" "Não foi possível obter o relatório!\n" "O debuginfo está faltando?" -#: ../src/Gui/CCMainWindow.py:279 +#: ../src/Gui/CCMainWindow.py:287 #, python-format msgid "" "Reporting failed!\n" @@ -186,7 +190,7 @@ msgstr "" "Falha no relato!\n" "%s" -#: ../src/Gui/CCMainWindow.py:311 +#: ../src/Gui/CCMainWindow.py:319 #, python-format msgid "Error getting the report: %s" msgstr "Erro ao obter o relatório: %s" @@ -235,45 +239,9 @@ msgstr "Enviar" msgid "gtk-cancel" msgstr "gtk-cancel" -#: ../src/Gui/SettingsDialog.py:22 -msgid "Can't load gui description for SettingsDialog!" -msgstr "Não foi possível carregar a descrição da interface gráfica de usuário para o SettingsDialog!" - -#: ../src/Gui/SettingsDialog.py:34 -msgid "Name" -msgstr "Nome" - -#: ../src/Gui/SettingsDialog.py:52 -msgid "Enabled" -msgstr "Habilitado" - -#: ../src/Gui/SettingsDialog.py:117 -msgid "Can't get plugin description" -msgstr "Não foi possível obter a descrição do plugin" - -#: ../src/Gui/SettingsDialog.py:125 -#, python-format -msgid "" -"Error while opening plugin settings UI: \n" -"\n" -"%s" -msgstr "" -"Erro ao abrir a interface de usuário das configurações do plugin: \n" -"\n" -"%s" - -#: ../src/Gui/SettingsDialog.py:135 -#, python-format -msgid "" -"Can't save plugin settings:\n" -" %s" -msgstr "" -"Não foi possível salvar as configurações do plugin:\n" -" %s" - -#: ../src/Gui/SettingsDialog.py:141 -msgid "unknown response from settings dialog" -msgstr "resposta desconhecida do diálogo de configurações" +#: ../src/Gui/SettingsDialog.py:44 +msgid "Select a plugin" +msgstr "Selecione um plugin" #: ../src/Applet/Applet.cpp:45 #, c-format @@ -318,32 +286,41 @@ msgstr "Memória insuficiente" msgid "Warning" msgstr "Aviso" -#: ../lib/Plugins/Bugzilla.cpp:219 +#: ../lib/Plugins/Bugzilla.cpp:84 +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:228 msgid "Bug is already reported: " msgstr "O erro já foi relatado: " -#: ../lib/Plugins/Bugzilla.cpp:279 +#: ../lib/Plugins/Bugzilla.cpp:283 #, c-format msgid "Binary file %s will not be reported." msgstr "O arquivo binário %s não será relatado." -#: ../lib/Plugins/Bugzilla.cpp:349 +#: ../lib/Plugins/Bugzilla.cpp:353 msgid "New bug id: " msgstr "Novo id do erro: " -#: ../lib/Plugins/Bugzilla.cpp:413 +#: ../lib/Plugins/Bugzilla.cpp:421 msgid "Checking for duplicates..." msgstr "Verificando duplicatas..." -#: ../lib/Plugins/Bugzilla.cpp:429 +#: ../lib/Plugins/Bugzilla.cpp:424 +#: ../lib/Plugins/Bugzilla.cpp:436 msgid "Logging into bugzilla..." msgstr "Autenticando no bugzilla..." -#: ../lib/Plugins/Bugzilla.cpp:443 +#: ../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:448 msgid "Creating new bug..." msgstr "Criando novo erro..." -#: ../lib/Plugins/Bugzilla.cpp:448 +#: ../lib/Plugins/Bugzilla.cpp:453 msgid "Logging out..." msgstr "Encerrando sessão..." @@ -367,14 +344,19 @@ msgstr "Obtendo backtrace..." msgid "Getting local universal unique identification..." msgstr "Obtendo identificação universal local única..." -#: ../lib/Plugins/CCpp.cpp:453 +#: ../lib/Plugins/CCpp.cpp:455 msgid "Getting global universal unique identification..." msgstr "Obtendo identificação universal global única..." -#: ../lib/Plugins/CCpp.cpp:471 +#: ../lib/Plugins/CCpp.cpp:473 msgid "Starting report creation..." msgstr "Iniciando a criação do relatório..." +#: ../lib/Plugins/CCpp.cpp:495 +#, c-format +msgid "Skip debuginfo installation for package %s" +msgstr "Pular instalação do debuginfo para o pacote %s" + #: ../lib/Plugins/KerneloopsReporter.cpp:101 msgid "Creating and submitting a report..." msgstr "Criando e enviando um relatório..." @@ -419,10 +401,44 @@ msgstr "Criando relatórios de oops do kernel no travamento..." msgid "Sending an email..." msgstr "Enviando email..." -#: ../lib/Plugins/SOSreport.cpp:90 -msgid "Executing SOSreportAction plugin..." -msgstr "Executando o plugin SOSreportAction..." - +#: ../lib/Plugins/SOSreport.cpp:116 +msgid "Executing SOSreport plugin..." +msgstr "Executando o plugin SOSreport..." + +#: ../lib/Plugins/SOSreport.cpp:138 +msgid "running sosreport: " +msgstr "executando o sosreport: " + +#: ../lib/Plugins/SOSreport.cpp:153 +msgid "done running sosreport" +msgstr "Execução do sosreport realizada" + +#~ msgid "Can't load gui description for SettingsDialog!" +#~ msgstr "" +#~ "Não foi possível carregar a descrição da interface gráfica de usuário " +#~ "para o SettingsDialog!" +#~ msgid "Name" +#~ msgstr "Nome" +#~ msgid "Enabled" +#~ msgstr "Habilitado" +#~ msgid "Can't get plugin description" +#~ msgstr "Não foi possível obter a descrição do plugin" +#~ msgid "" +#~ "Error while opening plugin settings UI: \n" +#~ "\n" +#~ "%s" +#~ msgstr "" +#~ "Erro ao abrir a interface de usuário das configurações do plugin: \n" +#~ "\n" +#~ "%s" +#~ msgid "" +#~ "Can't save plugin settings:\n" +#~ " %s" +#~ msgstr "" +#~ "Não foi possível salvar as configurações do plugin:\n" +#~ " %s" +#~ msgid "unknown response from settings dialog" +#~ msgstr "resposta desconhecida do diálogo de configurações" #~ msgid "Daemon is not running." #~ msgstr "O daemon não está em execução." diff --git a/src/Daemon/CommLayerServerDBus.cpp b/src/Daemon/CommLayerServerDBus.cpp index 726c37af..d84a3345 100644 --- a/src/Daemon/CommLayerServerDBus.cpp +++ b/src/Daemon/CommLayerServerDBus.cpp @@ -672,7 +672,8 @@ static int handle_RegisterPlugin(DBusMessage* call, DBusMessage* reply) return -1; } - g_pPluginManager->RegisterPlugin(PluginName); + const char * sender = dbus_message_get_sender(call); + g_pPluginManager->RegisterPluginDBUS(PluginName, sender); send_flush_and_unref(reply); return 0; @@ -695,7 +696,8 @@ static int handle_UnRegisterPlugin(DBusMessage* call, DBusMessage* reply) return -1; } - g_pPluginManager->UnRegisterPlugin(PluginName); + const char * sender = dbus_message_get_sender(call); + g_pPluginManager->UnRegisterPluginDBUS(PluginName, sender); send_flush_and_unref(reply); return 0; diff --git a/src/Daemon/PluginManager.cpp b/src/Daemon/PluginManager.cpp index 5580cdf2..412a1868 100644 --- a/src/Daemon/PluginManager.cpp +++ b/src/Daemon/PluginManager.cpp @@ -24,6 +24,7 @@ #include "abrtlib.h" #include "ABRTException.h" #include "CommLayerInner.h" +#include "Polkit.h" #include "PluginManager.h" /** @@ -228,6 +229,20 @@ void CPluginManager::RegisterPlugin(const std::string& pName) } } +void CPluginManager::RegisterPluginDBUS(const std::string& pName, + const char * pDBUSSender) +{ + int polkit_result = polkit_check_authorization(pDBUSSender, + "org.fedoraproject.abrt.register-plugin"); + if (polkit_result == PolkitYes) + { + RegisterPlugin(pName); + } else + { + log("user %s not authorized, returned %d", pDBUSSender, polkit_result); + } +} + void CPluginManager::UnRegisterPlugin(const std::string& pName) { map_abrt_plugins_t::iterator abrt_plugin = m_mapABRTPlugins.find(pName); @@ -244,6 +259,21 @@ void CPluginManager::UnRegisterPlugin(const std::string& pName) } } +void CPluginManager::UnRegisterPluginDBUS(const std::string& pName, + const char * pDBUSSender) +{ + int polkit_result = polkit_check_authorization(pDBUSSender, + "org.fedoraproject.abrt.unregister-plugin"); + if (polkit_result == PolkitYes) + { + UnRegisterPlugin(pName); + } else + { + log("user %s not authorized, returned %d", pDBUSSender, polkit_result); + } +} + + CAnalyzer* CPluginManager::GetAnalyzer(const std::string& pName) { map_plugins_t::iterator plugin = m_mapPlugins.find(pName); diff --git a/src/Daemon/PluginManager.h b/src/Daemon/PluginManager.h index 06d5f035..d4914db6 100644 --- a/src/Daemon/PluginManager.h +++ b/src/Daemon/PluginManager.h @@ -91,6 +91,22 @@ class CPluginManager */ void UnRegisterPlugin(const std::string& pName); /** + * A method, which registers particular plugin, + * called via DBUS + * @param pName A plugin name. + * @param pDBUSSender DBUS user identification + */ + void RegisterPluginDBUS(const std::string& pName, + const char * pDBUSSender); + /** + * A method, which unregister particular plugin, + * called via DBUS + * @param pName A plugin name. + * @param pDBUSSender DBUS user identification + */ + void UnRegisterPluginDBUS(const std::string& pName, + const char * pDBUSSender); + /** * A method, which returns instance of particular analyzer plugin. * @param pName A plugin name. * @return An analyzer plugin. diff --git a/src/Daemon/org.fedoraproject.abrt.policy b/src/Daemon/org.fedoraproject.abrt.policy index 9cf16a62..39b0ef21 100644 --- a/src/Daemon/org.fedoraproject.abrt.policy +++ b/src/Daemon/org.fedoraproject.abrt.policy @@ -23,4 +23,24 @@ Copyright (c) 2009 Red Hat inc. </defaults> </action> + <action id="org.fedoraproject.abrt.register-plugin"> + <description>Register plugin</description> + <message>Registering a plugin requires authentication</message> + <defaults> + <allow_any>auth_admin</allow_any> + <allow_active>auth_admin</allow_active> + <allow_inactive>auth_admin</allow_inactive> + </defaults> + </action> + + <action id="org.fedoraproject.abrt.unregister-plugin"> + <description>Unregister plugin</description> + <message>Unregistering a plugin requires authentication</message> + <defaults> + <allow_any>auth_admin</allow_any> + <allow_active>auth_admin</allow_active> + <allow_inactive>auth_admin</allow_inactive> + </defaults> + </action> + </policyconfig> |