Fix parsing of option type Kint (integer, stored in K). Bug 2348
[exim.git] / src / src / readconf.c
index 9b3eef3673f1d798438f21c7597d7f05883a5824..44452baa6dec2382f76aa2283cc86a8eecfeb0df 100644 (file)
@@ -240,6 +240,10 @@ static optionlist optionlist_config[] = {
 #endif
   { "pid_file_path",            opt_stringptr,   &pid_file_path },
   { "pipelining_advertise_hosts", opt_stringptr, &pipelining_advertise_hosts },
+#ifdef EXPERIMENTAL_PIPE_CONNECT
+  { "pipelining_connect_advertise_hosts", opt_stringptr,
+                                                &pipe_connect_advertise_hosts },
+#endif
 #ifndef DISABLE_PRDR
   { "prdr_enable",              opt_bool,        &prdr_enable },
 #endif
@@ -2126,7 +2130,7 @@ switch (type)
   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:
@@ -2143,7 +2147,7 @@ switch (type)
 
     if (errno != ERANGE && *endptr)
       {
-      uschar * mp = US"GgMmKk\0";      /* YyZzEePpTtGgMmKk */
+      uschar * mp = US"TtGgMmKk\0";    /* YyZzEePpTtGgMmKk */
 
       if ((mp = Ustrchr(mp, *endptr)))
        {
@@ -2178,8 +2182,7 @@ switch (type)
     *(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:
     {
@@ -2193,12 +2196,12 @@ switch (type)
 
     if (errno != ERANGE && *endptr)
       {
-      uschar * mp = US"EePpTtGgMmKk\0";        /* YyZzEePpTtGgMmKk */
+      uschar * mp = US"ZzEePpTtGgMmKk\0";      /* YyZzEePpTtGgMmKk */
 
       if ((mp = Ustrchr(mp, *endptr)))
        {
        endptr++;
-       do
+       while (*(mp += 2))
          {
          if (lvalue > EXIM_ARITH_MAX/1024 || lvalue < EXIM_ARITH_MIN/1024)
            {
@@ -2207,7 +2210,6 @@ switch (type)
            }
          lvalue *= 1024;
          }
-       while (*(mp += 2));
        }
       else
        lvalue = (lvalue + 512)/1024;
@@ -2485,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");
+    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);
@@ -4208,6 +4211,9 @@ static void
 auths_init(void)
 {
 auth_instance *au, *bu;
+#ifdef EXPERIMENTAL_PIPE_CONNECT
+int nauths = 0;
+#endif
 
 readconf_driver_init(US"authenticator",
   (driver_instance **)(&auths),      /* chain anchor */
@@ -4231,7 +4237,13 @@ for (au = auths; au; au = au->next)
           "(%s and %s) have the same public name (%s)",
           au->client ? US"client" : US"server", au->name, bu->name,
           au->public_name);
+#ifdef EXPERIMENTAL_PIPE_CONNECT
+  nauths++;
+#endif
   }
+#ifdef EXPERIMENTAL_PIPE_CONNECT
+f.smtp_in_early_pipe_no_auth = nauths > 16;
+#endif
 }