rpms/rsyslog/devel rsyslog-3.21.10-convVar.patch, NONE, 1.1 rsyslog.spec, 1.56, 1.57

Tomas Heinrich theinric at fedoraproject.org
Wed Mar 18 12:14:11 UTC 2009


Author: theinric

Update of /cvs/extras/rpms/rsyslog/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv32246

Modified Files:
	rsyslog.spec 
Added Files:
	rsyslog-3.21.10-convVar.patch 
Log Message:
fix variables' type conversion in expression-based filters (#485937)


rsyslog-3.21.10-convVar.patch:

--- NEW FILE rsyslog-3.21.10-convVar.patch ---
diff -up rsyslog-3.21.10/runtime/stringbuf.c.convVar rsyslog-3.21.10/runtime/stringbuf.c
--- rsyslog-3.21.10/runtime/stringbuf.c.convVar	2009-03-13 21:32:55.000000000 +0100
+++ rsyslog-3.21.10/runtime/stringbuf.c	2009-03-13 21:39:09.000000000 +0100
@@ -820,7 +820,7 @@ rsCStrConvertToNumber(cstr_t *pStr, numb
 	/* TODO: octal? hex? */
 	n = 0;
 	while(i < pStr->iStrLen && isdigit(pStr->pBuf[i])) {
-		n = n * 10 + pStr->pBuf[i] * 10;
+		n = n * 10 + pStr->pBuf[i] - '0';
 		++i;
 	}
 	
diff -up rsyslog-3.21.10/runtime/var.c.convVar rsyslog-3.21.10/runtime/var.c
--- rsyslog-3.21.10/runtime/var.c.convVar	2009-03-13 00:31:48.000000000 +0100
+++ rsyslog-3.21.10/runtime/var.c	2009-03-13 00:44:51.000000000 +0100
@@ -366,7 +366,7 @@ ConvForOperation(var_t *pThis, var_t *pO
 				case VARTYPE_NUMBER:
 					/* check if we can convert pThis to a number, if so use number format. */
 					iRet = ConvToNumber(pThis);
-					if(iRet != RS_RET_NOT_A_NUMBER) {
+					if(iRet == RS_RET_NOT_A_NUMBER) {
 						CHKiRet(ConvToString(pOther));
 					} else {
 						FINALIZE; /* OK or error */
@@ -384,7 +384,7 @@ ConvForOperation(var_t *pThis, var_t *pO
 					break;
 				case VARTYPE_STR:
 					iRet = ConvToNumber(pOther);
-					if(iRet != RS_RET_NOT_A_NUMBER) {
+					if(iRet == RS_RET_NOT_A_NUMBER) {
 						CHKiRet(ConvToString(pThis));
 					} else {
 						FINALIZE; /* OK or error */


Index: rsyslog.spec
===================================================================
RCS file: /cvs/extras/rpms/rsyslog/devel/rsyslog.spec,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -r1.56 -r1.57
--- rsyslog.spec	25 Feb 2009 21:08:14 -0000	1.56
+++ rsyslog.spec	18 Mar 2009 12:13:41 -0000	1.57
@@ -3,7 +3,7 @@
 Summary: Enhanced system logging and kernel message trapping daemons
 Name: rsyslog
 Version: 3.21.10
-Release: 2%{?dist}
+Release: 3%{?dist}
 License: GPLv3+
 Group: System Environment/Daemons
 URL: http://www.rsyslog.com/
@@ -12,6 +12,7 @@
 Source2: rsyslog.conf
 Source3: rsyslog.sysconfig
 Source4: rsyslog.log
+Patch0: rsyslog-3.21.10-convVar.patch
 BuildRequires: zlib-devel
 BuildRequires: autoconf automake
 Requires: logrotate >= 3.5.2
@@ -87,6 +88,7 @@
 
 %prep
 %setup -q
+%patch0 -p1 -b .convVar
 
 %build
 export CFLAGS="$RPM_OPT_FLAGS -DSYSLOGD_PIDNAME=\\\"syslogd.pid\\\""
@@ -192,6 +194,9 @@
 %{_libdir}/rsyslog/lmnsd_gtls.so
 
 %changelog
+* Wed Mar 18 2009 Tomas Heinrich <theinric at redhat.com> 3.21.10-3
+- fix variables' type conversion in expression-based filters (#485937)
+
 * Wed Feb 25 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 3.21.10-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
 




More information about the fedora-extras-commits mailing list