FS#28064 - [ulogd] 1.24-7 fails to write mac while logging directly to mysql

Attached to Project: Community Packages
Opened by Bartlomiej Rekke (BartekR) - Monday, 23 January 2012, 10:22 GMT
Last edited by Sergej Pupykin (sergej) - Thursday, 26 January 2012, 14:38 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sergej Pupykin (sergej)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

ulogd-1.24-7 x64_86 and probably i686


Steps to reproduce:
Install mysql and ulogd from pacman repositories. Make configuration to log directly to mysql (modules BASE and MYSQL).
Everything works fine except logging of raw_mac field ( confirmed by viewing database using phpmyadmin and ulog_query.php). Instead of real mac ulog fills column with '00' .

Steps to solve problem.
I have found similar bugreport in redhat bugzilla.

Applying patch written by Jean-Baptiste Vignaud solves issue.

Source links.
https://bugzilla.redhat.com/show_bug.cgi?id=247345
https://bugzilla.redhat.com/attachment.cgi?id=160741&action=edit

patch:

--- ulogd_BASE.c-save 2007-08-06 11:23:53.000000000 +0200
+++ ulogd_BASE.c 2007-08-06 11:28:47.000000000 +0200
@@ -63,7 +63,7 @@ static ulog_iret_t *_interp_raw(ulog_int
{
unsigned char *p;
int i;
- char *buf, *oldbuf = NULL;
+ char *buf = NULL;
ulog_iret_t *ret = ip->result;

if (pkt->mac_len) {
@@ -75,9 +75,8 @@ static ulog_iret_t *_interp_raw(ulog_int
*buf = '\0';

p = pkt->mac;
- oldbuf = buf;
for (i = 0; i < pkt->mac_len; i++, p++)
- sprintf(buf, "%s%02x%c", oldbuf, *p, i==pkt->mac_len-1 ? ' ':':');
+ sprintf(buf + (i*3), "%02x%c", *p, i==pkt->mac_len-1 ? ' ':':');
ret[0].value.ptr = buf;
ret[0].flags |= ULOGD_RETF_VALID;
}



Maybe it can be included in standard PKGBUILD ?
This task depends upon

Closed by  Sergej Pupykin (sergej)
Thursday, 26 January 2012, 14:38 GMT
Reason for closing:  Fixed

Loading...