summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRB <aoz.syn@gmail.com>2008-09-01 16:40:24 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2008-09-01 16:40:24 +0200
commit8cba42c16a0d1d9ff9357379645e7c96ff9cef13 (patch)
tree9c909b3013f8f022ed4f0350d8c4dfc4bf6a0ae6
parent6cbc5652ddee825899d1126ddef51f6f8bfa6467 (diff)
downloadrsyslog-8cba42c16a0d1d9ff9357379645e7c96ff9cef13.tar.gz
rsyslog-8cba42c16a0d1d9ff9357379645e7c96ff9cef13.tar.xz
rsyslog-8cba42c16a0d1d9ff9357379645e7c96ff9cef13.zip
bugfix: order-of magnitude issue with base-10 size definitions in config file parser.
Could lead to invalid sizes, constraints etc for e.g. queue files and any other object whose size was specified in base-10 entities. Did not apply to binary entities. Signed-off-by: Rainer Gerhards <rgerhards@adiscon.com>
-rw-r--r--ChangeLog5
-rw-r--r--cfsysline.c10
2 files changed, 10 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 1989d550..b03e9dc9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+- bugfix: order-of magnitude issue with base-10 size definitions
+ in config file parser. Could lead to invalid sizes, constraints
+ etc for e.g. queue files and any other object whose size was specified
+ in base-10 entities. Did not apply to binary entities. Thanks to
+ RB for finding this bug and providing a patch.
- bugfix: action was not called when system time was set backwards
(until the previous time was reached again). There are still some
side-effects when time is rolled back (A time rollback is really a bad
diff --git a/cfsysline.c b/cfsysline.c
index d3203ccc..cf8e087a 100644
--- a/cfsysline.c
+++ b/cfsysline.c
@@ -213,11 +213,11 @@ static rsRetVal doGetSize(uchar **pp, rsRetVal (*pSetHdlr)(void*, uid_t), void *
case 'e': i *= (int64) 1024 * 1024 * 1024 * 1024 * 1024 * 1024; ++(*pp); break; /* exa */
/* and now the "new" 1000-based definitions */
case 'K': i *= 1000; ++(*pp); break;
- case 'M': i *= 10000; ++(*pp); break;
- case 'G': i *= 100000; ++(*pp); break;
- case 'T': i *= 1000000; ++(*pp); break; /* tera */
- case 'P': i *= 10000000; ++(*pp); break; /* peta */
- case 'E': i *= 100000000; ++(*pp); break; /* exa */
+ case 'M': i *= 1000000; ++(*pp); break;
+ case 'G': i *= 1000000000; ++(*pp); break;
+ case 'T': i *= 1000000000000; ++(*pp); break; /* tera */
+ case 'P': i *= 1000000000000000; ++(*pp); break; /* peta */
+ case 'E': i *= 1000000000000000000; ++(*pp); break; /* exa */
}
/* done */