diff options
| author | Nikola Pajkovsky <npajkovs@redhat.com> | 2010-02-15 18:09:55 +0100 |
|---|---|---|
| committer | Nikola Pajkovsky <npajkovs@redhat.com> | 2010-02-15 18:09:55 +0100 |
| commit | d93fc21129f08a149d7a1bb042179942485fcedb (patch) | |
| tree | 72ec4eb636b15d8e2385f068881f86a6aa88db2b /lib/Plugins | |
| parent | deef343e0372b0a167f1d35f9ef9d18694aa9a0e (diff) | |
| parent | 3a0729e697b24d4d30e3a1a008f83ca605aaad5d (diff) | |
| download | abrt-d93fc21129f08a149d7a1bb042179942485fcedb.tar.gz abrt-d93fc21129f08a149d7a1bb042179942485fcedb.tar.xz abrt-d93fc21129f08a149d7a1bb042179942485fcedb.zip | |
Merge branch 'master' into bugzilla
Diffstat (limited to 'lib/Plugins')
| -rw-r--r-- | lib/Plugins/Bugzilla.conf | 2 | ||||
| -rw-r--r-- | lib/Plugins/Makefile.am | 30 | ||||
| -rw-r--r-- | lib/Plugins/Python.cpp | 23 | ||||
| -rw-r--r-- | lib/Plugins/Python_hash.cpp | 17 |
4 files changed, 55 insertions, 17 deletions
diff --git a/lib/Plugins/Bugzilla.conf b/lib/Plugins/Bugzilla.conf index 14fc92c..ff2f828 100644 --- a/lib/Plugins/Bugzilla.conf +++ b/lib/Plugins/Bugzilla.conf @@ -1,4 +1,4 @@ -Enabled = 1 +Enabled = yes # Bugzilla URL BugzillaURL = https://bugzilla.redhat.com/ # yes means that ssl certificates will not be checked diff --git a/lib/Plugins/Makefile.am b/lib/Plugins/Makefile.am index 4fc0efe..fe3969f 100644 --- a/lib/Plugins/Makefile.am +++ b/lib/Plugins/Makefile.am @@ -7,6 +7,7 @@ pluginslib_LTLIBRARIES = \ libLogger.la \ libKerneloopsScanner.la\ libKerneloops.la \ + libKerneloopsReporter.la \ libRunApp.la \ libSOSreport.la \ libBugzilla.la \ @@ -18,8 +19,11 @@ pluginslib_LTLIBRARIES = \ dist_pluginslib_DATA = \ Logger.GTKBuilder \ - Mailx.GTKBuilder Bugzilla.GTKBuilder \ - TicketUploader.GTKBuilder Catcut.GTKBuilder + Mailx.GTKBuilder \ + Bugzilla.GTKBuilder \ + TicketUploader.GTKBuilder \ + Catcut.GTKBuilder \ + KerneloopsReporter.GTKBuilder pluginsconfdir = $(PLUGINS_CONF_DIR) dist_pluginsconf_DATA = \ @@ -35,9 +39,17 @@ dist_pluginsconf_DATA = \ Python.conf \ SOSreport.conf -man_MANS = abrt-FileTransfer.7 abrt-Bugzilla.7 \ - abrt-KerneloopsScanner.7 abrt-Logger.7 abrt-Mailx.7 abrt-plugins.7 \ - abrt-SQLite3.7 abrt-RunApp.7 abrt-TicketUploader.7 +man_MANS = \ + abrt-FileTransfer.7 \ + abrt-Bugzilla.7 \ + abrt-KerneloopsScanner.7 \ + abrt-KerneloopsReporter.7 \ + abrt-Logger.7 abrt-Mailx.7 \ + abrt-plugins.7 \ + abrt-SQLite3.7 \ + abrt-RunApp.7 \ + abrt-TicketUploader.7 + # + abrt-Catcut.7 EXTRA_DIST = $(man_MANS) @@ -78,10 +90,10 @@ libKerneloops_la_LDFLAGS = -avoid-version libKerneloops_la_CPPFLAGS = -I$(srcdir)/../../inc -I$(srcdir)/../Utils # KerneloopsReporter -#libKerneloopsReporter_la_SOURCES = KerneloopsReporter.cpp KerneloopsReporter.h -#libKerneloopsReporter_la_LDFLAGS = -avoid-version -#libKerneloopsReporter_la_LIBADD = $(CURL_LIBS) -#libKerneloopsReporter_la_CPPFLAGS = -I$(srcdir)/../../inc -I$(srcdir)/../Utils $(CURL_CFLAGS) -DPLUGINS_LIB_DIR=\"$(PLUGINS_LIB_DIR)\" +libKerneloopsReporter_la_SOURCES = KerneloopsReporter.cpp KerneloopsReporter.h +libKerneloopsReporter_la_LDFLAGS = -avoid-version +libKerneloopsReporter_la_LIBADD = $(CURL_LIBS) +libKerneloopsReporter_la_CPPFLAGS = -I$(srcdir)/../../inc -I$(srcdir)/../Utils $(CURL_CFLAGS) -DPLUGINS_LIB_DIR=\"$(PLUGINS_LIB_DIR)\" # KerneloopsScanner libKerneloopsScanner_la_SOURCES = KerneloopsScanner.cpp KerneloopsScanner.h KerneloopsSysLog.cpp KerneloopsSysLog.h diff --git a/lib/Plugins/Python.cpp b/lib/Plugins/Python.cpp index d6a3084..12cc47e 100644 --- a/lib/Plugins/Python.cpp +++ b/lib/Plugins/Python.cpp @@ -38,7 +38,27 @@ string CAnalyzerPython::GetLocalUUID(const char *pDebugDumpDir) unsigned char hash2[MD5_RESULT_LEN]; md5_ctx_t md5ctx; md5_begin(&md5ctx); - md5_hash(bt_str, bt_end - bt_str, &md5ctx); + // Better: + // "example.py:1:<module>:ZeroDivisionError: integer division or modulo by zero" + //md5_hash(bt_str, bt_end - bt_str, &md5ctx); + // For now using compat version: + { + char *copy = xstrndup(bt_str, bt_end - bt_str); + char *s = copy; + char *d = copy; + unsigned colon_cnt = 0; + while (*s && colon_cnt < 3) { + if (*s != ':') + *d++ = *s; + else + colon_cnt++; + s++; + } + // "example.py1<module>" + md5_hash(copy, d - copy, &md5ctx); +//*d = '\0'; log("str:'%s'", copy); + free(copy); + } md5_end(hash2, &md5ctx); // Hash is MD5_RESULT_LEN bytes long, but we use only first 4 @@ -56,7 +76,6 @@ string CAnalyzerPython::GetLocalUUID(const char *pDebugDumpDir) //log("hash2:%s str:'%.*s'", hash_str, (int)(bt_end - bt_str), bt_str); return hash_str; - } string CAnalyzerPython::GetGlobalUUID(const char *pDebugDumpDir) { diff --git a/lib/Plugins/Python_hash.cpp b/lib/Plugins/Python_hash.cpp index ae246b3..36ddacd 100644 --- a/lib/Plugins/Python_hash.cpp +++ b/lib/Plugins/Python_hash.cpp @@ -14,6 +14,7 @@ */ #include "abrtlib.h" #include "Python_hash.h" +#include <byteswap.h> #if defined(__BIG_ENDIAN__) && __BIG_ENDIAN__ # define MD5_BIG_ENDIAN 1 @@ -28,6 +29,16 @@ # error "Can't determine endianness" #endif +/* SWAP_LEnn means "convert CPU<->little_endian if needed (by swapping bytes)" */ +#if MD5_BIG_ENDIAN +# define SWAP_BE32(x) (x) +# define SWAP_LE32(x) bswap_32(x) +#else +# define SWAP_BE32(x) bswap_32(x) +# define SWAP_LE32(x) (x) +#endif + + /* 0: fastest, 3: smallest */ #define MD5_SIZE_VS_SPEED 3 @@ -123,11 +134,7 @@ static void md5_hash_block(const void *buffer, md5_ctx_t *ctx) uint32_t temp; for (i = 0; i < 16; i++) { -#if MD5_BIG_ENDIAN - cwp[i] = bswap_32(words[i]); -#else - cwp[i] = words[i]; -#endif + cwp[i] = SWAP_LE32(words[i]); } words += 16; |
