summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 */