diff options
author | Denys Vlasenko <dvlasenk@redhat.com> | 2010-11-10 00:10:22 +0100 |
---|---|---|
committer | Denys Vlasenko <dvlasenk@redhat.com> | 2010-11-10 00:10:22 +0100 |
commit | 9d2cb4518c3a8a72ccc714ddbc131aaa84506092 (patch) | |
tree | e21efa47e3ed2e2f911c87fad8d0d992f236124a /lib | |
parent | d1c6a4329284a1daba12a7e0fbd743a90cb0d884 (diff) | |
download | abrt-9d2cb4518c3a8a72ccc714ddbc131aaa84506092.tar.gz abrt-9d2cb4518c3a8a72ccc714ddbc131aaa84506092.tar.xz abrt-9d2cb4518c3a8a72ccc714ddbc131aaa84506092.zip |
Decouple settings handling from old-style plugins
The breakage was discovered when i removed Logger class.
it turned out the fix is somewhat involved.
This change implements it as discussed with the rest of the team.
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/plugins/Bugzilla.conf | 2 | ||||
-rw-r--r-- | lib/plugins/CCpp.h | 2 | ||||
-rw-r--r-- | lib/plugins/FileTransfer.h | 2 | ||||
-rw-r--r-- | lib/plugins/Logger.conf | 8 | ||||
-rw-r--r-- | lib/plugins/Mailx.conf | 2 | ||||
-rw-r--r-- | lib/plugins/Makefile.am | 4 | ||||
-rw-r--r-- | lib/plugins/RHTSupport.conf | 2 | ||||
-rw-r--r-- | lib/plugins/ReportUploader.conf | 2 | ||||
-rw-r--r-- | lib/utils/Makefile.am | 1 | ||||
-rw-r--r-- | lib/utils/Plugin.cpp | 15 | ||||
-rw-r--r-- | lib/utils/overlapping_strcpy.c | 22 |
11 files changed, 42 insertions, 20 deletions
diff --git a/lib/plugins/Bugzilla.conf b/lib/plugins/Bugzilla.conf index 4eebd994..76e0d1d8 100644 --- a/lib/plugins/Bugzilla.conf +++ b/lib/plugins/Bugzilla.conf @@ -1,3 +1,5 @@ +# Description: Reports bugs to bugzilla + Enabled = yes # Bugzilla URL diff --git a/lib/plugins/CCpp.h b/lib/plugins/CCpp.h index db372b01..e95b4d09 100644 --- a/lib/plugins/CCpp.h +++ b/lib/plugins/CCpp.h @@ -44,8 +44,6 @@ class CAnalyzerCCpp : public CAnalyzer virtual void Init(); virtual void DeInit(); virtual void SetSettings(const map_plugin_settings_t& pSettings); -//ok to delete? -// virtual const map_plugin_settings_t& GetSettings(); }; #endif /* CCPP */ diff --git a/lib/plugins/FileTransfer.h b/lib/plugins/FileTransfer.h index 5e9f4938..17bebf3d 100644 --- a/lib/plugins/FileTransfer.h +++ b/lib/plugins/FileTransfer.h @@ -40,8 +40,6 @@ class CFileTransfer : public CAction public: CFileTransfer(); virtual void SetSettings(const map_plugin_settings_t& pSettings); -//ok to delete? -// virtual const map_plugin_settings_t& GetSettings(); virtual void Run(const char *pActionDir, const char *pArgs, int force); }; diff --git a/lib/plugins/Logger.conf b/lib/plugins/Logger.conf new file mode 100644 index 00000000..aadd3515 --- /dev/null +++ b/lib/plugins/Logger.conf @@ -0,0 +1,8 @@ +# Description: Writes report to a file + +# Configuration for Logger plugin +Enabled = yes + +LogPath = /var/log/abrt.log + +AppendLogs = yes diff --git a/lib/plugins/Mailx.conf b/lib/plugins/Mailx.conf index ccd14292..1d946427 100644 --- a/lib/plugins/Mailx.conf +++ b/lib/plugins/Mailx.conf @@ -1,3 +1,5 @@ +# Description: Sends an email with a report (using mailx command) + # Configuration to Email reporter plugin Enabled = yes diff --git a/lib/plugins/Makefile.am b/lib/plugins/Makefile.am index 2f1e7966..caf5ea27 100644 --- a/lib/plugins/Makefile.am +++ b/lib/plugins/Makefile.am @@ -27,6 +27,7 @@ dist_pluginsconf_DATA = \ CCpp.conf \ Mailx.conf \ SQLite3.conf \ + Logger.conf \ Kerneloops.conf \ Bugzilla.conf \ RHTSupport.conf \ @@ -53,7 +54,8 @@ $(DESTDIR)/$(DEBUG_INFO_DIR): install-data-hook: $(DESTDIR)/$(DEBUG_INFO_DIR) sed 's: = /var/: = $(localstatedir)/:g' -i \ - $(DESTDIR)$(sysconfdir)/abrt/plugins/SQLite3.conf + $(DESTDIR)$(sysconfdir)/abrt/plugins/SQLite3.conf \ + $(DESTDIR)$(sysconfdir)/abrt/plugins/Logger.conf INC_PATH=$(srcdir)/../../inc UTILS_PATH=$(srcdir)/../utils diff --git a/lib/plugins/RHTSupport.conf b/lib/plugins/RHTSupport.conf index ed2c3a85..ecd5992a 100644 --- a/lib/plugins/RHTSupport.conf +++ b/lib/plugins/RHTSupport.conf @@ -1,3 +1,5 @@ +# Description: Reports crashes to Red Hat support + Enabled = yes URL = https://api.access.redhat.com/rs diff --git a/lib/plugins/ReportUploader.conf b/lib/plugins/ReportUploader.conf index 57692531..7a7b9133 100644 --- a/lib/plugins/ReportUploader.conf +++ b/lib/plugins/ReportUploader.conf @@ -1,3 +1,5 @@ +# Description: Packs crash data into .tar.gz file, optionally uploads it via FTP/SCP/etc + Enabled = yes # Customer = "Example Inc." diff --git a/lib/utils/Makefile.am b/lib/utils/Makefile.am index 129feeb5..37508ee7 100644 --- a/lib/utils/Makefile.am +++ b/lib/utils/Makefile.am @@ -16,6 +16,7 @@ libABRTUtils_la_SOURCES = \ xfuncs.c \ concat_path_file.c \ append_to_malloced_string.c \ + overlapping_strcpy.c \ encbase64.c \ stdio_helpers.c \ hash_md5.c hash_md5.h \ diff --git a/lib/utils/Plugin.cpp b/lib/utils/Plugin.cpp index 8c00e609..bf237959 100644 --- a/lib/utils/Plugin.cpp +++ b/lib/utils/Plugin.cpp @@ -40,21 +40,6 @@ void CPlugin::SetSettings(const map_plugin_settings_t& pSettings) } } -const map_plugin_settings_t& CPlugin::GetSettings() -{ - VERB3 - { - log("GetSettings:"); - map_plugin_settings_t::const_iterator it = m_pSettings.begin(); - while (it != m_pSettings.end()) - { - log(" settings[%s]:'%s'", it->first.c_str(), it->second.c_str()); - it++; - } - } - return m_pSettings; -} - bool LoadPluginSettings(const char *pPath, map_plugin_settings_t& pSettings, bool skipKeysWithoutValue /*= true*/) { diff --git a/lib/utils/overlapping_strcpy.c b/lib/utils/overlapping_strcpy.c new file mode 100644 index 00000000..41c1c1a1 --- /dev/null +++ b/lib/utils/overlapping_strcpy.c @@ -0,0 +1,22 @@ +/* + * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> + * + * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + */ +#include "abrtlib.h" + +/* Like strcpy but can copy overlapping strings. */ +void overlapping_strcpy(char *dst, const char *src) +{ + /* Cheap optimization for dst == src case - + * better to have it here than in many callers. + */ + if (dst != src) + { + while ((*dst = *src) != '\0') + { + dst++; + src++; + } + } +} |