diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-02-07 23:08:53 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-02-07 23:08:53 +0100 |
commit | eafe336a8e5580bbd76546970351956810f01d8f (patch) | |
tree | 131b770ca194f2d840208ae9e52ee650b12e75e0 | |
parent | 5ddcae3c61341e655e98470ceb26dda91b013704 (diff) | |
download | abrt-eafe336a8e5580bbd76546970351956810f01d8f.tar.gz abrt-eafe336a8e5580bbd76546970351956810f01d8f.tar.xz abrt-eafe336a8e5580bbd76546970351956810f01d8f.zip |
*: remove all usages of C++ streams (-10k in code size)
Also add copyright banners to all files which were missing them
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
76 files changed, 635 insertions, 180 deletions
diff --git a/doc/HOW_TO_TEST b/doc/HOW_TO_TEST index d5103dd7..d11c6d89 100644 --- a/doc/HOW_TO_TEST +++ b/doc/HOW_TO_TEST @@ -13,7 +13,7 @@ II. Crash detection b) edit some packaged python script to raise an exception and watch is abrt detects it c) use our saved kerneloopses and test detection of oopses - + == 2. Advanced crash detection == a) crash some app that comes from unsigned package - abrt should ignore it b) disable the gpg chcek and try repeat step a) - abrt shouldn't ignore it @@ -21,7 +21,7 @@ II. Crash detection III. Reporting ============= == 1. Reporting to bugzilla == - a) try to report some crash to bz using gui + a) try to report some crash to bz using gui - gui should ask for login+pass - crash should be reported after filling the right credentials b) try to report using gui without gnome-keyring diff --git a/inc/ABRTException.h b/inc/ABRTException.h index dc18132e..b826bfa8 100644 --- a/inc/ABRTException.h +++ b/inc/ABRTException.h @@ -1,3 +1,21 @@ +/* + Copyright (C) 2010 ABRT team + Copyright (C) 2010 RedHat Inc + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ #ifndef ABRTEXCEPTION_H_ #define ABRTEXCEPTION_H_ diff --git a/inc/CrashTypesSocket.h b/inc/CrashTypesSocket.h index db3ee44e..85f14567 100644 --- a/inc/CrashTypesSocket.h +++ b/inc/CrashTypesSocket.h @@ -17,8 +17,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - +*/ #ifndef SOCKETCRASHTYPES_H_ #define SOCKETCRASHTYPES_H_ diff --git a/inc/abrt_types.h b/inc/abrt_types.h index d096ddd5..ae22b03d 100644 --- a/inc/abrt_types.h +++ b/inc/abrt_types.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - +*/ #ifndef ABRT_TYPES_H_ #define ABRT_TYPES_H_ diff --git a/inc/abrtlib.h b/inc/abrtlib.h index 6b1db552..5e0dc462 100644 --- a/inc/abrtlib.h +++ b/inc/abrtlib.h @@ -39,8 +39,6 @@ #include <grp.h> /* C++ bits */ #include <string> -#include <sstream> -#include <iostream> #include "abrt_types.h" @@ -261,13 +259,14 @@ double get_dirsize_find_largest_dir( std::string *worst_dir = NULL, const char *excluded = NULL); +std::string unsigned_to_string(unsigned long long x); +std::string signed_to_string(long long x); template <class T> -std::string -to_string(T x) +std::string to_string(T x) { - std::ostringstream o; - o << x; - return o.str(); + if (T(~T(0)) < T(0)) /* T is a signed type */ + return unsigned_to_string(x); + return signed_to_string(x); } void parse_args(const char *psArgs, vector_string_t& pArgs, int quote = -1); diff --git a/lib/Plugins/Bugzilla.cpp b/lib/Plugins/Bugzilla.cpp index fa6b35e4..b809e34c 100644 --- a/lib/Plugins/Bugzilla.cpp +++ b/lib/Plugins/Bugzilla.cpp @@ -1,3 +1,21 @@ +/* + Copyright (C) 2010 ABRT team + Copyright (C) 2010 RedHat Inc + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ #include <xmlrpc-c/base.h> #include <xmlrpc-c/client.h> #include "abrtlib.h" @@ -185,7 +203,7 @@ void ctx::add_plus_one_cc(uint32_t bug_id, const char* login) xmlrpc_env env; xmlrpc_env_init(&env); - xmlrpc_value* param = xmlrpc_build_value(&env, "({s:i,s:{s:(s)}})", "ids", bug_id, "updates", "add_cc", login); + xmlrpc_value* param = xmlrpc_build_value(&env, "({s:i,s:{s:(s)}})", "ids", bug_id, "updates", "add_cc", login); throw_if_xml_fault_occurred(&env); // failed to allocate memory xmlrpc_value* result = NULL; diff --git a/lib/Plugins/Bugzilla.h b/lib/Plugins/Bugzilla.h index 571d0c60..7ee7b01d 100644 --- a/lib/Plugins/Bugzilla.h +++ b/lib/Plugins/Bugzilla.h @@ -1,3 +1,21 @@ +/* + Copyright (C) 2010 ABRT team + Copyright (C) 2010 RedHat Inc + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ #ifndef BUGZILLA_H_ #define BUGZILLA_H_ diff --git a/lib/Plugins/CCpp.cpp b/lib/Plugins/CCpp.cpp index 50423b7c..7b3eab1c 100644 --- a/lib/Plugins/CCpp.cpp +++ b/lib/Plugins/CCpp.cpp @@ -17,10 +17,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include <fstream> -#include <sstream> +*/ #include <set> #include <iomanip> //#include <nss.h> @@ -702,21 +699,21 @@ string CAnalyzerCCpp::GetGlobalUUID(const char *pDebugDumpDir) { perror_msg("abrt-backtrace not executed properly, " "status: %x signal: %d", status, WIFSIGNALED(status)); - } + } else { int exit_status = WEXITSTATUS(status); if (exit_status == 79) /* EX_PARSINGFAILED */ { - /* abrt-backtrace returns alternative backtrace - representation in this case, so everything will work + /* abrt-backtrace returns alternative backtrace + representation in this case, so everything will work as expected except worse duplication detection */ log_msg("abrt-backtrace failed to parse the backtrace"); } else if (exit_status == 80) /* EX_THREADDETECTIONFAILED */ { - /* abrt-backtrace returns backtrace with all threads - in this case, so everything will work as expected + /* abrt-backtrace returns backtrace with all threads + in this case, so everything will work as expected except worse duplication detection */ log_msg("abrt-backtrace failed to determine crash frame"); } @@ -890,12 +887,13 @@ static int set_limits() void CAnalyzerCCpp::Init() { - ifstream fInCorePattern; - fInCorePattern.open(CORE_PATTERN_IFACE); - if (fInCorePattern.is_open()) + FILE *fp = fopen(CORE_PATTERN_IFACE, "r"); + if (fp) { - getline(fInCorePattern, m_sOldCorePattern); - fInCorePattern.close(); + char line[PATH_MAX]; + if (fgets(line, sizeof(line), fp)) + m_sOldCorePattern = line; + fclose(fp); } if (m_sOldCorePattern[0] == '|') { @@ -915,28 +913,26 @@ void CAnalyzerCCpp::Init() } } #ifdef HOSTILE_KERNEL - if(set_limits() != 0) + if (set_limits() != 0) log("warning: failed to set core_size limit, ABRT won't detect crashes in" "compiled apps"); #endif - ofstream fOutCorePattern; - fOutCorePattern.open(CORE_PATTERN_IFACE); - if (fOutCorePattern.is_open()) + fp = fopen(CORE_PATTERN_IFACE, "w"); + if (fp) { - fOutCorePattern << CORE_PATTERN << endl; - fOutCorePattern.close(); + fputs(CORE_PATTERN, fp); + fclose(fp); } } void CAnalyzerCCpp::DeInit() { - ofstream fOutCorePattern; - fOutCorePattern.open(CORE_PATTERN_IFACE); - if (fOutCorePattern.is_open()) + FILE *fp = fopen(CORE_PATTERN_IFACE, "w"); + if (fp) { - fOutCorePattern << m_sOldCorePattern << endl; - fOutCorePattern.close(); + fputs(m_sOldCorePattern.c_str(), fp); + fclose(fp); } } diff --git a/lib/Plugins/CCpp.h b/lib/Plugins/CCpp.h index 03ba5ee4..afdc2c6e 100644 --- a/lib/Plugins/CCpp.h +++ b/lib/Plugins/CCpp.h @@ -1,6 +1,6 @@ /* CCpp.h - header file for C/C++ analyzer plugin - - it can ger UUID and memory maps from core files + - it can get UUID and memory maps from core files Copyright (C) 2009 Zdenek Prikryl (zprikryl@redhat.com) Copyright (C) 2009 RedHat inc. @@ -18,8 +18,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - +*/ #ifndef CCPP_H_ #define CCPP_H_ diff --git a/lib/Plugins/Catcut.cpp b/lib/Plugins/Catcut.cpp index badca4b4..48546367 100644 --- a/lib/Plugins/Catcut.cpp +++ b/lib/Plugins/Catcut.cpp @@ -1,3 +1,21 @@ +/* + Copyright (C) 2010 ABRT team + Copyright (C) 2010 RedHat Inc + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ #include "abrtlib.h" #include "abrt_xmlrpc.h" #include "Catcut.h" diff --git a/lib/Plugins/Catcut.h b/lib/Plugins/Catcut.h index 65c70444..427dd375 100644 --- a/lib/Plugins/Catcut.h +++ b/lib/Plugins/Catcut.h @@ -1,3 +1,21 @@ +/* + Copyright (C) 2010 ABRT team + Copyright (C) 2010 RedHat Inc + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ #ifndef CATCUT_H_ #define CATCUT_H_ diff --git a/lib/Plugins/FileTransfer.cpp b/lib/Plugins/FileTransfer.cpp index 5479f9fb..8f5bc6db 100644 --- a/lib/Plugins/FileTransfer.cpp +++ b/lib/Plugins/FileTransfer.cpp @@ -17,8 +17,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - +*/ #ifndef _GNU_SOURCE # define _GNU_SOURCE #endif diff --git a/lib/Plugins/FileTransfer.h b/lib/Plugins/FileTransfer.h index 2548c506..8f77223d 100644 --- a/lib/Plugins/FileTransfer.h +++ b/lib/Plugins/FileTransfer.h @@ -18,8 +18,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - +*/ #ifndef FILETRANSFER_H_ #define FILETRANSFER_H_ diff --git a/lib/Plugins/Firefox.cpp b/lib/Plugins/Firefox.cpp index 7bee46dc..3cb9c938 100644 --- a/lib/Plugins/Firefox.cpp +++ b/lib/Plugins/Firefox.cpp @@ -17,10 +17,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include <fstream> -#include <sstream> +*/ #include <set> #include <iomanip> #include <nss.h> diff --git a/lib/Plugins/Firefox.h b/lib/Plugins/Firefox.h index dd7758d9..d3f67ba4 100644 --- a/lib/Plugins/Firefox.h +++ b/lib/Plugins/Firefox.h @@ -18,8 +18,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - +*/ #ifndef CCPP_H_ #define CCPP_H_ diff --git a/lib/Plugins/Logger.cpp b/lib/Plugins/Logger.cpp index 3424d73d..a0c23645 100644 --- a/lib/Plugins/Logger.cpp +++ b/lib/Plugins/Logger.cpp @@ -17,10 +17,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include <fstream> -#include <sstream> +*/ #include "abrtlib.h" #include "Logger.h" #include "DebugDump.h" diff --git a/lib/Plugins/Logger.h b/lib/Plugins/Logger.h index 02429b2c..8801dd4f 100644 --- a/lib/Plugins/Logger.h +++ b/lib/Plugins/Logger.h @@ -18,8 +18,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - +*/ #ifndef LOGGER_H_ #define LOGGER_H_ diff --git a/lib/Plugins/Mailx.cpp b/lib/Plugins/Mailx.cpp index 2ee96455..50bc3920 100644 --- a/lib/Plugins/Mailx.cpp +++ b/lib/Plugins/Mailx.cpp @@ -17,10 +17,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - - -#include <stdio.h> +*/ #include "abrtlib.h" #include "Mailx.h" #include "DebugDump.h" diff --git a/lib/Plugins/Mailx.h b/lib/Plugins/Mailx.h index 619e349c..c71d83d8 100644 --- a/lib/Plugins/Mailx.h +++ b/lib/Plugins/Mailx.h @@ -18,8 +18,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - +*/ #ifndef MAILX_H_ #define MAILX_H_ diff --git a/lib/Plugins/Python.cpp b/lib/Plugins/Python.cpp index ad954681..cf4d81e2 100644 --- a/lib/Plugins/Python.cpp +++ b/lib/Plugins/Python.cpp @@ -1,3 +1,21 @@ +/* + Copyright (C) 2010 ABRT team + Copyright (C) 2010 RedHat Inc + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ #include "abrtlib.h" #include "Python.h" #include "DebugDump.h" diff --git a/lib/Plugins/Python.h b/lib/Plugins/Python.h index 82f52c05..6de2cbbe 100644 --- a/lib/Plugins/Python.h +++ b/lib/Plugins/Python.h @@ -1,3 +1,21 @@ +/* + Copyright (C) 2010 ABRT team + Copyright (C) 2010 RedHat Inc + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ #ifndef PYTHON_H_ #define PYTHON_H_ diff --git a/lib/Plugins/RunApp.cpp b/lib/Plugins/RunApp.cpp index ecbecf20..c7d5183b 100644 --- a/lib/Plugins/RunApp.cpp +++ b/lib/Plugins/RunApp.cpp @@ -17,8 +17,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - +*/ #include "abrtlib.h" #include "RunApp.h" #include "DebugDump.h" diff --git a/lib/Plugins/RunApp.h b/lib/Plugins/RunApp.h index da465f89..390b60a2 100644 --- a/lib/Plugins/RunApp.h +++ b/lib/Plugins/RunApp.h @@ -17,8 +17,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - +*/ #ifndef RUNAPP_H_ #define RUNAPP_H_ diff --git a/lib/Plugins/SOSreport.cpp b/lib/Plugins/SOSreport.cpp index bc71e236..188d16d6 100644 --- a/lib/Plugins/SOSreport.cpp +++ b/lib/Plugins/SOSreport.cpp @@ -17,8 +17,6 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -//#include <fstream> -//#include <sstream> #include "abrtlib.h" #include "abrt_types.h" #include "ABRTException.h" diff --git a/lib/Plugins/SOSreport.h b/lib/Plugins/SOSreport.h index bd08eee1..d5c44235 100644 --- a/lib/Plugins/SOSreport.h +++ b/lib/Plugins/SOSreport.h @@ -16,8 +16,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - +*/ #ifndef SOSREPORT_H_ #define SOSREPORT_H_ diff --git a/lib/Plugins/SQLite3.cpp b/lib/Plugins/SQLite3.cpp index 80cbd82b..97f99b68 100644 --- a/lib/Plugins/SQLite3.cpp +++ b/lib/Plugins/SQLite3.cpp @@ -17,10 +17,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - +*/ #include <sqlite3.h> -#include <string> #include "abrtlib.h" #include "SQLite3.h" #include "ABRTException.h" diff --git a/lib/Plugins/SQLite3.h b/lib/Plugins/SQLite3.h index dfebf5d7..d4b321a2 100644 --- a/lib/Plugins/SQLite3.h +++ b/lib/Plugins/SQLite3.h @@ -17,8 +17,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - +*/ #ifndef SQLITE3_H_ #define SQLITE3_H_ diff --git a/lib/Plugins/TicketUploader.cpp b/lib/Plugins/TicketUploader.cpp index d924b916..a7151b5e 100644 --- a/lib/Plugins/TicketUploader.cpp +++ b/lib/Plugins/TicketUploader.cpp @@ -16,8 +16,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -#include <string> +*/ #include "abrtlib.h" #include "abrt_xmlrpc.h" /* for xcurl_easy_init */ #include "TicketUploader.h" diff --git a/lib/Plugins/TicketUploader.h b/lib/Plugins/TicketUploader.h index a719d0bd..402e2ccf 100644 --- a/lib/Plugins/TicketUploader.h +++ b/lib/Plugins/TicketUploader.h @@ -20,8 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - +*/ #ifndef TICKETUPLOADER_H_ #define TICKETUPLOADER_H_ diff --git a/lib/Utils/ABRTException.cpp b/lib/Utils/ABRTException.cpp index aa6c99d9..a451cbdf 100644 --- a/lib/Utils/ABRTException.cpp +++ b/lib/Utils/ABRTException.cpp @@ -1,3 +1,21 @@ +/* + Copyright (C) 2010 ABRT team + Copyright (C) 2010 RedHat Inc + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ #include "ABRTException.h" CABRTException::CABRTException(abrt_exception_t type, const char* fmt, ...) diff --git a/lib/Utils/Action.h b/lib/Utils/Action.h index d9a68b79..fc56277b 100644 --- a/lib/Utils/Action.h +++ b/lib/Utils/Action.h @@ -17,8 +17,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - +*/ #ifndef ACTION_H_ #define ACTION_H_ diff --git a/lib/Utils/Analyzer.h b/lib/Utils/Analyzer.h index 9108a914..a45bd0e8 100644 --- a/lib/Utils/Analyzer.h +++ b/lib/Utils/Analyzer.h @@ -17,8 +17,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - +*/ #ifndef ANALYZER_H_ #define ANALYZER_H_ diff --git a/lib/Utils/CommLayerInner.cpp b/lib/Utils/CommLayerInner.cpp index 4a3b80a8..bde3a71c 100644 --- a/lib/Utils/CommLayerInner.cpp +++ b/lib/Utils/CommLayerInner.cpp @@ -1,3 +1,21 @@ +/* + Copyright (C) 2010 ABRT team + Copyright (C) 2010 RedHat Inc + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ #include <pthread.h> #include <map> #include "abrtlib.h" diff --git a/lib/Utils/CommLayerInner.h b/lib/Utils/CommLayerInner.h index 9c22968a..353cfc76 100644 --- a/lib/Utils/CommLayerInner.h +++ b/lib/Utils/CommLayerInner.h @@ -1,3 +1,21 @@ +/* + Copyright (C) 2010 ABRT team + Copyright (C) 2010 RedHat Inc + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ #ifndef COMMLAYERINNER_H_ #define COMMLAYERINNER_H_ diff --git a/lib/Utils/CrashTypesSocket.cpp b/lib/Utils/CrashTypesSocket.cpp index d555571b..710e31e9 100644 --- a/lib/Utils/CrashTypesSocket.cpp +++ b/lib/Utils/CrashTypesSocket.cpp @@ -17,8 +17,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - +*/ #include "abrtlib.h" #include "CrashTypesSocket.h" diff --git a/lib/Utils/DBusCommon.h b/lib/Utils/DBusCommon.h index 2e3ed8a5..58b4c8dc 100644 --- a/lib/Utils/DBusCommon.h +++ b/lib/Utils/DBusCommon.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - +*/ #ifndef DBUSCOMMON_H_ #define DBUSCOMMON_H_ diff --git a/lib/Utils/Database.h b/lib/Utils/Database.h index 1691f1ce..ed4ef0ca 100644 --- a/lib/Utils/Database.h +++ b/lib/Utils/Database.h @@ -17,9 +17,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - - +*/ #ifndef DATABASE_H_ #define DATABASE_H_ diff --git a/lib/Utils/DebugDump.cpp b/lib/Utils/DebugDump.cpp index a0a52ab9..b8f8827c 100644 --- a/lib/Utils/DebugDump.cpp +++ b/lib/Utils/DebugDump.cpp @@ -17,11 +17,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include <fstream> -#include <iostream> -#include <sstream> +*/ #include <sys/utsname.h> #include "abrtlib.h" #include "DebugDump.h" @@ -251,7 +247,7 @@ void CDebugDump::UnLock() * * Security: we should not allow users to write new files or write * into existing ones, but they should be able to read them. - * + * * @param uid * Crashed application's User Id * @@ -282,7 +278,7 @@ void CDebugDump::Create(const char *pDir, uid_t uid) Lock(); m_bOpened = true; - /* Was creating it with mode 0700 and user as the owner, but this allows + /* Was creating it with mode 0700 and user as the owner, but this allows * the user to replace any file in the directory, changing security-sensitive data * (e.g. "uid", "analyzer", "executable") */ @@ -302,7 +298,7 @@ void CDebugDump::Create(const char *pDir, uid_t uid) } /* Get ABRT's user id */ - m_uid = 0; + m_uid = 0; struct passwd *pw = getpwnam("abrt"); if (pw) m_uid = pw->pw_uid; @@ -319,7 +315,7 @@ void CDebugDump::Create(const char *pDir, uid_t uid) if (chown(m_sDebugDumpDir.c_str(), m_uid, m_gid) == -1) { - perror_msg("can't change '%s' ownership to %lu:%lu", m_sDebugDumpDir.c_str(), + perror_msg("can't change '%s' ownership to %lu:%lu", m_sDebugDumpDir.c_str(), (long)m_uid, (long)m_gid); } diff --git a/lib/Utils/DebugDump.h b/lib/Utils/DebugDump.h index 60d3bd3b..a5de743f 100644 --- a/lib/Utils/DebugDump.h +++ b/lib/Utils/DebugDump.h @@ -18,8 +18,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - +*/ #ifndef DEBUGDUMP_H_ #define DEBUGDUMP_H_ diff --git a/lib/Utils/Makefile.am b/lib/Utils/Makefile.am index 59607104..6bf11daa 100644 --- a/lib/Utils/Makefile.am +++ b/lib/Utils/Makefile.am @@ -15,7 +15,7 @@ libABRTUtils_la_SOURCES = \ copyfd.cpp \ daemon.cpp \ skip_whitespace.cpp \ - xatonum.cpp \ + xatonum.cpp numtoa.cpp \ spawn.cpp \ stringops.cpp \ dirsize.cpp \ diff --git a/lib/Utils/Observer.h b/lib/Utils/Observer.h index db748659..adf6844a 100644 --- a/lib/Utils/Observer.h +++ b/lib/Utils/Observer.h @@ -1,3 +1,21 @@ +/* + Copyright (C) 2010 ABRT team + Copyright (C) 2010 RedHat Inc + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ #ifndef OBSERVER_H_ #define OBSERVER_H_ diff --git a/lib/Utils/Plugin.cpp b/lib/Utils/Plugin.cpp index 4d561b46..2865027f 100644 --- a/lib/Utils/Plugin.cpp +++ b/lib/Utils/Plugin.cpp @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - +*/ #include "Plugin.h" CPlugin::CPlugin() {} diff --git a/lib/Utils/Plugin.h b/lib/Utils/Plugin.h index e8464032..c699eb36 100644 --- a/lib/Utils/Plugin.h +++ b/lib/Utils/Plugin.h @@ -18,8 +18,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - +*/ #ifndef PLUGIN_H_ #define PLUGIN_H_ diff --git a/lib/Utils/Reporter.h b/lib/Utils/Reporter.h index e9445f93..4144ec33 100644 --- a/lib/Utils/Reporter.h +++ b/lib/Utils/Reporter.h @@ -17,8 +17,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - +*/ #ifndef REPORTER_H_ #define REPORTER_H_ diff --git a/lib/Utils/abrt_dbus.cpp b/lib/Utils/abrt_dbus.cpp index 8423e66c..66608410 100644 --- a/lib/Utils/abrt_dbus.cpp +++ b/lib/Utils/abrt_dbus.cpp @@ -1,3 +1,21 @@ +/* + Copyright (C) 2010 ABRT team + Copyright (C) 2010 RedHat Inc + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ #include <dbus/dbus.h> #include <glib.h> #include "abrtlib.h" diff --git a/lib/Utils/abrt_dbus.h b/lib/Utils/abrt_dbus.h index 25e099ea..ffa4421b 100644 --- a/lib/Utils/abrt_dbus.h +++ b/lib/Utils/abrt_dbus.h @@ -1,3 +1,21 @@ +/* + Copyright (C) 2010 ABRT team + Copyright (C) 2010 RedHat Inc + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ #ifndef ABRT_UTIL_DBUS_H #define ABRT_UTIL_DBUS_H diff --git a/lib/Utils/abrt_xmlrpc.cpp b/lib/Utils/abrt_xmlrpc.cpp index c2d716e1..3737ee14 100644 --- a/lib/Utils/abrt_xmlrpc.cpp +++ b/lib/Utils/abrt_xmlrpc.cpp @@ -1,3 +1,21 @@ +/* + Copyright (C) 2010 ABRT team + Copyright (C) 2010 RedHat Inc + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ #if HAVE_CONFIG_H # include "config.h" #endif diff --git a/lib/Utils/abrt_xmlrpc.h b/lib/Utils/abrt_xmlrpc.h index a0e9ca34..4d20d4e8 100644 --- a/lib/Utils/abrt_xmlrpc.h +++ b/lib/Utils/abrt_xmlrpc.h @@ -1,3 +1,21 @@ +/* + Copyright (C) 2010 ABRT team + Copyright (C) 2010 RedHat Inc + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ #ifndef ABRT_XMLRPC_H_ #define ABRT_XMLRPC_H_ 1 diff --git a/lib/Utils/make_descr.cpp b/lib/Utils/make_descr.cpp index b67dfe65..c2821a5f 100644 --- a/lib/Utils/make_descr.cpp +++ b/lib/Utils/make_descr.cpp @@ -1,3 +1,21 @@ +/* + Copyright (C) 2010 ABRT team + Copyright (C) 2010 RedHat Inc + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ #include "abrtlib.h" #include "CrashTypes.h" #include "DebugDump.h" /* FILENAME_ARCHITECTURE etc */ diff --git a/lib/Utils/parse_release.cpp b/lib/Utils/parse_release.cpp index 8a106b69..4f7d76e1 100644 --- a/lib/Utils/parse_release.cpp +++ b/lib/Utils/parse_release.cpp @@ -1,3 +1,21 @@ +/* + Copyright (C) 2010 ABRT team + Copyright (C) 2010 RedHat Inc + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ #include "abrtlib.h" #ifdef HAVE_CONFIG_H # include "config.h" diff --git a/lib/Utils/stringops.cpp b/lib/Utils/stringops.cpp index dc71b5bd..7bc5413f 100644 --- a/lib/Utils/stringops.cpp +++ b/lib/Utils/stringops.cpp @@ -1,3 +1,21 @@ +/* + Copyright (C) 2010 ABRT team + Copyright (C) 2010 RedHat Inc + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ #include "abrtlib.h" void parse_args(const char *psArgs, vector_string_t& pArgs, int quote) diff --git a/lib/Utils/test.cpp b/lib/Utils/test.cpp index 3711ef18..24a62760 100644 --- a/lib/Utils/test.cpp +++ b/lib/Utils/test.cpp @@ -17,8 +17,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - +*/ #include "MiddleWare.h" #include "DebugDump.h" #include "CrashTypes.h" diff --git a/lib/Utils/xconnect.cpp b/lib/Utils/xconnect.cpp index 746edd63..0d02b1a4 100644 --- a/lib/Utils/xconnect.cpp +++ b/lib/Utils/xconnect.cpp @@ -6,7 +6,6 @@ * * Licensed under GPLv2, see file LICENSE in this tarball for details. */ - #include "abrtlib.h" #include <sys/socket.h> /* netinet/in.h needs it */ #include <netinet/in.h> diff --git a/src/Applet/Applet.cpp b/src/Applet/Applet.cpp index c29a164d..9398e4b6 100644 --- a/src/Applet/Applet.cpp +++ b/src/Applet/Applet.cpp @@ -15,22 +15,21 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - +*/ #include <dbus/dbus-shared.h> #include <dbus/dbus-glib.h> #include <dbus/dbus-glib-lowlevel.h> #if HAVE_CONFIG_H - #include <config.h> +# include <config.h> #endif #if HAVE_LOCALE_H - #include <locale.h> +# include <locale.h> #endif #if ENABLE_NLS - #include <libintl.h> - #define _(S) gettext(S) +# include <libintl.h> +# define _(S) gettext(S) #else - #define _(S) (S) +# define _(S) (S) #endif #include "abrtlib.h" #include "abrt_dbus.h" diff --git a/src/Applet/CCApplet.cpp b/src/Applet/CCApplet.cpp index 9817f415..13a6eb6f 100644 --- a/src/Applet/CCApplet.cpp +++ b/src/Applet/CCApplet.cpp @@ -15,16 +15,15 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - +*/ #if HAVE_CONFIG_H - #include <config.h> +# include <config.h> #endif #if ENABLE_NLS - #include <libintl.h> - #define _(S) gettext(S) +# include <libintl.h> +# define _(S) gettext(S) #else - #define _(S) (S) +# define _(S) (S) #endif #include "abrtlib.h" #include "CCApplet.h" diff --git a/src/Applet/CCApplet.h b/src/Applet/CCApplet.h index 48dbabcc..a14498e8 100644 --- a/src/Applet/CCApplet.h +++ b/src/Applet/CCApplet.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - +*/ #ifndef CC_APPLET_H_ #define CC_APPLET_H_ diff --git a/src/CLI/ABRTSocket.cpp b/src/CLI/ABRTSocket.cpp index 82c304ee..61618c08 100644 --- a/src/CLI/ABRTSocket.cpp +++ b/src/CLI/ABRTSocket.cpp @@ -1,3 +1,21 @@ +/* + Copyright (C) 2010 ABRT team + Copyright (C) 2010 RedHat Inc + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ #include "ABRTSocket.h" #include "ABRTException.h" #include "CrashTypesSocket.h" diff --git a/src/CLI/ABRTSocket.h b/src/CLI/ABRTSocket.h index d4905be1..f8fb42b8 100644 --- a/src/CLI/ABRTSocket.h +++ b/src/CLI/ABRTSocket.h @@ -1,3 +1,21 @@ +/* + Copyright (C) 2010 ABRT team + Copyright (C) 2010 RedHat Inc + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ #ifndef ABRTSOCKET_H_ #define ABRTSOCKET_H_ diff --git a/src/Daemon/CommLayerServer.cpp b/src/Daemon/CommLayerServer.cpp index d61da399..5e250121 100644 --- a/src/Daemon/CommLayerServer.cpp +++ b/src/Daemon/CommLayerServer.cpp @@ -1,3 +1,21 @@ +/* + Copyright (C) 2010 ABRT team + Copyright (C) 2010 RedHat Inc + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ #include "CommLayerServer.h" #include "CrashWatcher.h" diff --git a/src/Daemon/CommLayerServer.h b/src/Daemon/CommLayerServer.h index 367c0956..bb33a1e9 100644 --- a/src/Daemon/CommLayerServer.h +++ b/src/Daemon/CommLayerServer.h @@ -1,7 +1,24 @@ +/* + Copyright (C) 2010 ABRT team + Copyright (C) 2010 RedHat Inc + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ #ifndef COMMLAYERSERVER_H_ #define COMMLAYERSERVER_H_ -#include <string> #include "abrtlib.h" #include "CrashTypes.h" diff --git a/src/Daemon/CommLayerServerDBus.cpp b/src/Daemon/CommLayerServerDBus.cpp index f2471586..6dfc48b7 100644 --- a/src/Daemon/CommLayerServerDBus.cpp +++ b/src/Daemon/CommLayerServerDBus.cpp @@ -1,3 +1,21 @@ +/* + Copyright (C) 2010 ABRT team + Copyright (C) 2010 RedHat Inc + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ #include <dbus/dbus.h> #include "abrtlib.h" #include "abrt_dbus.h" diff --git a/src/Daemon/CommLayerServerDBus.h b/src/Daemon/CommLayerServerDBus.h index 9bd77666..4fecf1be 100644 --- a/src/Daemon/CommLayerServerDBus.h +++ b/src/Daemon/CommLayerServerDBus.h @@ -1,3 +1,21 @@ +/* + Copyright (C) 2010 ABRT team + Copyright (C) 2010 RedHat Inc + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ #ifndef COMMLAYERSERVERDBUS_H_ #define COMMLAYERSERVERDBUS_H_ diff --git a/src/Daemon/CommLayerServerSocket.cpp b/src/Daemon/CommLayerServerSocket.cpp index ab880fb2..1e8bf6ee 100644 --- a/src/Daemon/CommLayerServerSocket.cpp +++ b/src/Daemon/CommLayerServerSocket.cpp @@ -1,3 +1,21 @@ +/* + Copyright (C) 2010 ABRT team + Copyright (C) 2010 RedHat Inc + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ #include <sys/socket.h> #include <sys/un.h> #include "abrtlib.h" diff --git a/src/Daemon/CommLayerServerSocket.h b/src/Daemon/CommLayerServerSocket.h index c511954c..40f6f892 100644 --- a/src/Daemon/CommLayerServerSocket.h +++ b/src/Daemon/CommLayerServerSocket.h @@ -1,3 +1,21 @@ +/* + Copyright (C) 2010 ABRT team + Copyright (C) 2010 RedHat Inc + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ #include "CommLayerServer.h" #include "DBusCommon.h" #include <glib.h> diff --git a/src/Daemon/CrashWatcher.cpp b/src/Daemon/CrashWatcher.cpp index 93365f3b..4d68a811 100644 --- a/src/Daemon/CrashWatcher.cpp +++ b/src/Daemon/CrashWatcher.cpp @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - +*/ #include "abrtlib.h" #include "Daemon.h" #include "ABRTException.h" diff --git a/src/Daemon/CrashWatcher.h b/src/Daemon/CrashWatcher.h index 31b72e08..eaf24997 100644 --- a/src/Daemon/CrashWatcher.h +++ b/src/Daemon/CrashWatcher.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - +*/ #ifndef CRASHWATCHER_H_ #define CRASHWATCHER_H_ diff --git a/src/Daemon/Daemon.cpp b/src/Daemon/Daemon.cpp index 99214230..704d2c35 100644 --- a/src/Daemon/Daemon.cpp +++ b/src/Daemon/Daemon.cpp @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - +*/ #include <syslog.h> #include <pthread.h> #include <resolv.h> /* res_init */ diff --git a/src/Daemon/Daemon.h b/src/Daemon/Daemon.h index ac998b93..67a97ca7 100644 --- a/src/Daemon/Daemon.h +++ b/src/Daemon/Daemon.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - +*/ #ifndef DAEMON_H_ #define DAEMON_H_ diff --git a/src/Daemon/MiddleWare.cpp b/src/Daemon/MiddleWare.cpp index ebd5c0fc..e0687fd5 100644 --- a/src/Daemon/MiddleWare.cpp +++ b/src/Daemon/MiddleWare.cpp @@ -17,8 +17,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - +*/ #include "abrtlib.h" #include "abrt_types.h" #include "Daemon.h" diff --git a/src/Daemon/MiddleWare.h b/src/Daemon/MiddleWare.h index aa37e3ed..94f9fb99 100644 --- a/src/Daemon/MiddleWare.h +++ b/src/Daemon/MiddleWare.h @@ -18,8 +18,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - +*/ #ifndef MIDDLEWARE_H_ #define MIDDLEWARE_H_ diff --git a/src/Daemon/PluginManager.cpp b/src/Daemon/PluginManager.cpp index 5166c6a4..e63cb3ac 100644 --- a/src/Daemon/PluginManager.cpp +++ b/src/Daemon/PluginManager.cpp @@ -17,10 +17,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include <fstream> -#include <iostream> +*/ #include <dlfcn.h> #include "abrtlib.h" #include "ABRTException.h" @@ -85,23 +82,21 @@ static const char *const plugin_type_str[] = { bool LoadPluginSettings(const char *pPath, map_plugin_settings_t& pSettings) { - ifstream fIn; - fIn.open(pPath); - if (!fIn.is_open()) + FILE *fp = fopen(pPath, "r"); + if (!fp) return false; - string line; - while (!fIn.eof()) + char line[512]; + while (fgets(line, sizeof(line), fp)) { - getline(fIn, line); - - int ii; + strchrnul(line, '\n')[0] = '\0'; + unsigned ii; bool is_value = false; bool valid = false; bool in_quote = false; string key; string value; - for (ii = 0; ii < line.length(); ii++) + for (ii = 0; line[ii] != '\0'; ii++) { if (line[ii] == '"') { @@ -135,7 +130,7 @@ bool LoadPluginSettings(const char *pPath, map_plugin_settings_t& pSettings) pSettings[key] = value; } } - fIn.close(); + fclose(fp); return true; } diff --git a/src/Daemon/PluginManager.h b/src/Daemon/PluginManager.h index 8eebe7da..b5dcebc5 100644 --- a/src/Daemon/PluginManager.h +++ b/src/Daemon/PluginManager.h @@ -18,8 +18,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - +*/ #ifndef PLUGINMANAGER_H_ #define PLUGINMANAGER_H_ diff --git a/src/Daemon/RPM.cpp b/src/Daemon/RPM.cpp index 6cc0ba68..c40f9a07 100644 --- a/src/Daemon/RPM.cpp +++ b/src/Daemon/RPM.cpp @@ -1,3 +1,21 @@ +/* + Copyright (C) 2010 ABRT team + Copyright (C) 2010 RedHat Inc + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ #include "abrtlib.h" #include "RPM.h" #include "CommLayerInner.h" diff --git a/src/Daemon/RPM.h b/src/Daemon/RPM.h index fed5e43d..4df868da 100644 --- a/src/Daemon/RPM.h +++ b/src/Daemon/RPM.h @@ -18,8 +18,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - +*/ #ifndef RPM_H_ #define RPM_H_ diff --git a/src/Daemon/Settings.cpp b/src/Daemon/Settings.cpp index 725c0d2a..9b0376b3 100644 --- a/src/Daemon/Settings.cpp +++ b/src/Daemon/Settings.cpp @@ -1,4 +1,21 @@ -#include <fstream> +/* + Copyright (C) 2010 ABRT team + Copyright (C) 2010 RedHat Inc + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ #include "Settings.h" #include "abrtlib.h" #include "abrt_types.h" @@ -243,46 +260,45 @@ static void ParseAnalyzerActionsAndReporters() static void LoadGPGKeys() { - std::ifstream fIn; - fIn.open(CONF_DIR"/gpg_keys"); - if (fIn.is_open()) + FILE *fp = fopen(CONF_DIR"/gpg_keys", "r"); + if (fp) { - std::string line; /* every line is one key - FIXME: make it more robust, it doesn't handle comments - */ - while (fIn.good()) + * FIXME: make it more robust, it doesn't handle comments + */ + char line[512]; + while (fgets(line, sizeof(line), fp)) { - getline(fIn, line); if (line[0] == '/') // probably the begining of path, so let's handle it as a key + { + strchrnul(line, '\n')[0] = '\0'; g_settings_setOpenGPGPublicKeys.insert(line); + } } - fIn.close(); + fclose(fp); } } /* abrt daemon loads .conf file */ void LoadSettings() { - std::ifstream fIn; - fIn.open(CONF_DIR"/abrt.conf"); - if (fIn.is_open()) + FILE *fp = fopen(CONF_DIR"/abrt.conf", "r"); + if (fp) { - std::string line; + char line[512]; std::string section; - while (fIn.good()) + while (fgets(line, sizeof(line), fp)) { - getline(fIn, line); - - unsigned int ii; + strchrnul(line, '\n')[0] = '\0'; + unsigned ii; bool is_key = true; bool is_section = false; bool is_quote = false; std::string key; std::string value; - for (ii = 0; ii < line.length(); ii++) + for (ii = 0; line[ii] != '\0'; ii++) { - if (is_quote && line[ii] == '\\' && ii+1 < line.length()) + if (is_quote && line[ii] == '\\' && line[ii+1] != '\0') { value += line[ii]; ii++; @@ -355,7 +371,7 @@ void LoadSettings() } } } - fIn.close(); + fclose(fp); } ParseCommon(); ParseAnalyzerActionsAndReporters(); diff --git a/src/Daemon/Settings.h b/src/Daemon/Settings.h index 3fdb8b9d..cd3179d2 100644 --- a/src/Daemon/Settings.h +++ b/src/Daemon/Settings.h @@ -1,3 +1,21 @@ +/* + Copyright (C) 2010 ABRT team + Copyright (C) 2010 RedHat Inc + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ #ifndef SETTINGS_H_ #define SETTINGS_H_ |