git://git.exim.org
/
exim.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b275850
)
Fix parsing of option type Kint (integer, stored in K). Bug 2348
author
Jeremy Harris
<jgh146exb@wizmail.org>
Fri, 14 Dec 2018 14:03:18 +0000
(14:03 +0000)
committer
Jeremy Harris
<jgh146exb@wizmail.org>
Fri, 14 Dec 2018 14:07:29 +0000
(14:07 +0000)
Broken-by: a45431fa71
src/src/readconf.c
patch
|
blob
|
history
test/paniclog/0415
patch
|
blob
|
history
test/scripts/0000-Basic/0415
patch
|
blob
|
history
test/stderr/0415
patch
|
blob
|
history
test/stdout/0415
patch
|
blob
|
history
diff --git
a/src/src/readconf.c
b/src/src/readconf.c
index f21ce4d04b9ad307b007e0b2f98f03b52ddbe34c..44452baa6dec2382f76aa2283cc86a8eecfeb0df 100644
(file)
--- a/
src/src/readconf.c
+++ b/
src/src/readconf.c
@@
-2130,7
+2130,7
@@
switch (type)
inttype = US"octal ";
/* Integer: a simple(ish) case; allow octal and hex formats, and
inttype = US"octal ";
/* Integer: a simple(ish) case; allow octal and hex formats, and
- suffixes K, M
and G.
The different types affect output, not input. */
+ suffixes K, M
, G, and T.
The different types affect output, not input. */
case opt_mkint:
case opt_int:
case opt_mkint:
case opt_int:
@@
-2147,7
+2147,7
@@
switch (type)
if (errno != ERANGE && *endptr)
{
if (errno != ERANGE && *endptr)
{
- uschar * mp = US"
GgMmKk\0";
/* YyZzEePpTtGgMmKk */
+ uschar * mp = US"
TtGgMmKk\0";
/* YyZzEePpTtGgMmKk */
if ((mp = Ustrchr(mp, *endptr)))
{
if ((mp = Ustrchr(mp, *endptr)))
{
@@
-2182,8
+2182,7
@@
switch (type)
*(int *)ol->value = value;
break;
*(int *)ol->value = value;
break;
- /* Integer held in K: again, allow octal and hex formats, and suffixes K, M,
- G and T. */
+ /* Integer held in K: again, allow formats and suffixes as above. */
case opt_Kint:
{
case opt_Kint:
{
@@
-2197,12
+2196,12
@@
switch (type)
if (errno != ERANGE && *endptr)
{
if (errno != ERANGE && *endptr)
{
- uschar * mp = US"
EePpTtGgMmKk\0";
/* YyZzEePpTtGgMmKk */
+ uschar * mp = US"
ZzEePpTtGgMmKk\0";
/* YyZzEePpTtGgMmKk */
if ((mp = Ustrchr(mp, *endptr)))
{
endptr++;
if ((mp = Ustrchr(mp, *endptr)))
{
endptr++;
- do
+ while (*(mp += 2))
{
if (lvalue > EXIM_ARITH_MAX/1024 || lvalue < EXIM_ARITH_MIN/1024)
{
{
if (lvalue > EXIM_ARITH_MAX/1024 || lvalue < EXIM_ARITH_MIN/1024)
{
@@
-2211,7
+2210,6
@@
switch (type)
}
lvalue *= 1024;
}
}
lvalue *= 1024;
}
- while (*(mp += 2));
}
else
lvalue = (lvalue + 512)/1024;
}
else
lvalue = (lvalue + 512)/1024;
@@
-2489,6
+2487,7
@@
switch(ol->type & opt_mask)
int_eximarith_t x = *((int_eximarith_t *)value);
if (!no_labels) printf("%s = ", name);
if (x == 0) printf("0\n");
int_eximarith_t x = *((int_eximarith_t *)value);
if (!no_labels) printf("%s = ", name);
if (x == 0) printf("0\n");
+ else if ((x & ((1<<30)-1)) == 0) printf(PR_EXIM_ARITH "T\n", x >> 30);
else if ((x & ((1<<20)-1)) == 0) printf(PR_EXIM_ARITH "G\n", x >> 20);
else if ((x & ((1<<10)-1)) == 0) printf(PR_EXIM_ARITH "M\n", x >> 10);
else printf(PR_EXIM_ARITH "K\n", x);
else if ((x & ((1<<20)-1)) == 0) printf(PR_EXIM_ARITH "G\n", x >> 20);
else if ((x & ((1<<10)-1)) == 0) printf(PR_EXIM_ARITH "M\n", x >> 10);
else printf(PR_EXIM_ARITH "K\n", x);
diff --git
a/test/paniclog/0415
b/test/paniclog/0415
index 68a0f4491437d8cf70fa8743dffc8c4c242d7d3d..8ab0c2cb90ca20aeb7c80ea8053009e397bab4e0 100644
(file)
--- a/
test/paniclog/0415
+++ b/
test/paniclog/0415
@@
-1,5
+1,5
@@
1999-03-02 09:44:33 Exim configuration error in line 15 of TESTSUITE/test-config:
1999-03-02 09:44:33 Exim configuration error in line 15 of TESTSUITE/test-config:
- absolute value of integer "4000
E
" is too large (overflow)
+ absolute value of integer "4000
Z
" is too large (overflow)
1999-03-02 09:44:33 Exim configuration error in line 15 of TESTSUITE/test-config:
extra characters follow integer value for check_spool_space
1999-03-02 09:44:33 Exim configuration error in line 16 of TESTSUITE/test-config:
1999-03-02 09:44:33 Exim configuration error in line 15 of TESTSUITE/test-config:
extra characters follow integer value for check_spool_space
1999-03-02 09:44:33 Exim configuration error in line 16 of TESTSUITE/test-config:
diff --git
a/test/scripts/0000-Basic/0415
b/test/scripts/0000-Basic/0415
index 09f582b6233c495148df673110c434897e43e21d..411efac16197c32794a9cc5dad764d3c32e67396 100644
(file)
--- a/
test/scripts/0000-Basic/0415
+++ b/
test/scripts/0000-Basic/0415
@@
-1,6
+1,6
@@
# overflow in integer options
1
# overflow in integer options
1
-exim -DARG1=4000
E
-bP check_spool_space
+exim -DARG1=4000
Z
-bP check_spool_space
****
exim -DARG1=4000G -bP check_spool_space
****
****
exim -DARG1=4000G -bP check_spool_space
****
diff --git
a/test/stderr/0415
b/test/stderr/0415
index 4292620946b0d5045caad3be7fcc99371296ff04..211d7323be1cf36afb385cc56c8471f75d543878 100644
(file)
--- a/
test/stderr/0415
+++ b/
test/stderr/0415
@@
-1,6
+1,6
@@
LOG: PANIC DIE
Exim configuration error in line 15 of TESTSUITE/test-config:
LOG: PANIC DIE
Exim configuration error in line 15 of TESTSUITE/test-config:
- absolute value of integer "4000
E
" is too large (overflow)
+ absolute value of integer "4000
Z
" is too large (overflow)
LOG: PANIC DIE
Exim configuration error in line 15 of TESTSUITE/test-config:
extra characters follow integer value for check_spool_space
LOG: PANIC DIE
Exim configuration error in line 15 of TESTSUITE/test-config:
extra characters follow integer value for check_spool_space
diff --git
a/test/stdout/0415
b/test/stdout/0415
index 7215cca80631f5340c0ef51b4a6cfe2cf7daac06..619f9f3732c73fef5dd83a0cde1bc822e9f31ff3 100644
(file)
--- a/
test/stdout/0415
+++ b/
test/stdout/0415
@@
-1,4
+1,4
@@
-check_spool_space = 40
960
00G
+check_spool_space = 4000G
queue_only_load = 2000000.123
finduser_retries = 0
finduser_retries = 999999999
queue_only_load = 2000000.123
finduser_retries = 0
finduser_retries = 999999999