the ClamAV and openssl_options patches in this release.
Logic in buildconfig.c for adjusting some print format strings assumed that
long ints were four bytes; adjust to test this against reality, to remove
spurious warnings on my dev box (FreeBSD/amd64).
Note: this commit adds a buildconfig.h dependency upon inttypes.h, which was in
SUSv2, so should be safe.
-/* $Cambridge: exim/src/src/buildconfig.c,v 1.16 2010/06/06 02:46:13 pdp Exp $ */
+/* $Cambridge: exim/src/src/buildconfig.c,v 1.17 2010/06/07 00:12:42 pdp Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
#include <ctype.h>
+#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
{
off_t test_off_t = 0;
time_t test_time_t = 0;
+size_t test_size_t = 0;
+unsigned long test_ulong_t = 0L;
+long test_long_t = 0;
FILE *base;
FILE *new;
int last_initial = 'A';
This assumption is known to be OK for the common operating systems. */
fprintf(new, "#ifndef OFF_T_FMT\n");
-if (sizeof(test_off_t) > 4)
+if (sizeof(test_off_t) > sizeof(test_long_t))
{
fprintf(new, "#define OFF_T_FMT \"%%lld\"\n");
fprintf(new, "#define LONGLONG_T long long int\n");
off_t. */
fprintf(new, "#ifndef TIME_T_FMT\n");
-if (sizeof(test_time_t) > 4)
+if (sizeof(test_time_t) > sizeof(test_long_t))
{
fprintf(new, "#define TIME_T_FMT \"%%lld\"\n");
fprintf(new, "#undef LONGLONG_T\n");
}
fprintf(new, "#endif\n\n");
+/* And for sizeof() results, size_t, which should with C99 be just %zu, deal
+with C99 not being ubiquitous yet. Unfortunately. */
+
+#if __STDC_VERSION__ >= 199901L
+fprintf(new, "#define SIZE_T_FMT \"%%zu\"\n");
+#else
+/*# ifdef PRIdMAX */
+#if 0
+fprintf(new, "#define SIZE_T_FMT \"%%" PRIdMAX "\"\n");
+# else
+if (sizeof(test_size_t) > sizeof (test_ulong_t))
+ fprintf(new, "#define SIZE_T_FMT \"%%llu\"\n");
+else
+ fprintf(new, "#define SIZE_T_FMT \"%%lu\"\n");
+# endif
+#endif
+
/* Now search the makefile for certain settings */
base = fopen("Makefile", "rb");
-/* $Cambridge: exim/src/src/exim.c,v 1.70 2010/06/06 22:46:34 pdp Exp $ */
+/* $Cambridge: exim/src/src/exim.c,v 1.71 2010/06/07 00:12:42 pdp Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
fprintf(f, "%d\n", (unsigned int)fixed_never_users[i]);
}
-fprintf(f, "Size of off_t: %d\n", sizeof(off_t));
+fprintf(f, "Size of off_t: " SIZE_T_FMT "\n", sizeof(off_t));
/* This runtime check is to help diagnose library linkage mismatches which
result in segfaults and the like; as such, it's left until the end,
else if (Ustrcmp(argrest, "version") == 0)
{
switchchar = 'b';
- argrest = "V";
+ argrest = US"V";
}
}
-/* $Cambridge: exim/src/src/malware.c,v 1.20 2010/06/06 22:46:34 pdp Exp $ */
+/* $Cambridge: exim/src/src/malware.c,v 1.21 2010/06/07 00:12:42 pdp Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
uschar message_id_buf[64];
int ret;
- scan_options[0] = "*";
+ scan_options[0] = US"*";
scan_options[1] = NULL;
/* spool_mbox() assumes various parameters exist, when creating
the relevant directory and the email within */
(void) string_format(message_id_buf, sizeof(message_id_buf),
- US"dummy-%d", pseudo_random_number(INT_MAX));
+ "dummy-%d", pseudo_random_number(INT_MAX));
message_id = message_id_buf;
- sender_address = "malware-sender@example.net";
- return_path = "";
+ sender_address = US"malware-sender@example.net";
+ return_path = US"";
recipients_list = NULL;
- receive_add_recipient("malware-victim@example.net", -1);
+ receive_add_recipient(US"malware-victim@example.net", -1);
enable_dollar_recipients = TRUE;
ret = malware_internal(scan_options, eml_filename, TRUE);
- strncpy(spooled_message_id, message_id, sizeof(spooled_message_id));
+ Ustrncpy(spooled_message_id, message_id, sizeof(spooled_message_id));
spool_mbox_ok = 1;
/* don't set no_mbox_unspool; at present, there's no way for it to become
set, but if that changes, then it should apply to these tests too */
log_write(0, LOG_MAIN|LOG_PANIC,
"malware filename does not fit in buffer [malware_internal() kavdaemon]");
}
- p = strrchr(scanrequest, '/');
+ p = Ustrrchr(scanrequest, '/');
if (p)
*p = '\0';
"malware filename does not fit in buffer [malware_internal() cmdline]");
return DEFER;
}
- p = strrchr(eml_filename, '/');
+ p = Ustrrchr(eml_filename, '/');
if (p)
*p = '\0';
fits = string_format(commandline, sizeof(commandline), CS cmdline_scanner, file_name);
struct sockaddr_un server;
int sock, len;
uschar *p;
- BOOL fits;
uschar file_name[1024];
uschar av_buffer[1024];
return DEFER;
}
memcpy(file_name, eml_filename, len);
- p = strrchr(file_name, '/');
+ p = Ustrrchr(file_name, '/');
if (p)
*p = '\0';
uschar clamd_options2_buffer[1024];
uschar clamd_options2_default[] = "";
uschar *clamav_fbuf;
- uschar scanrequest[1024];
- int sockData, clam_fd, result;
+ int clam_fd, result;
unsigned int fsize;
BOOL use_scan_command, fits;
#ifdef WITH_OLD_CLAMAV_STREAM
uschar av_buffer2[1024];
+ int sockData;
#else
uint32_t send_size, send_final_zeroblock;
#endif
-/* $Cambridge: exim/src/src/readconf.c,v 1.40 2010/06/05 09:10:10 pdp Exp $ */
+/* $Cambridge: exim/src/src/readconf.c,v 1.41 2010/06/07 00:12:42 pdp Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
readconf_main(void)
{
int sep = 0;
-long dummy_l;
struct stat statbuf;
uschar *s, *filename;
uschar *list = config_main_filelist;
-/* $Cambridge: exim/src/src/rfc2047.c,v 1.5 2009/11/16 19:50:37 nm4 Exp $ */
+/* $Cambridge: exim/src/src/rfc2047.c,v 1.6 2010/06/07 00:12:42 pdp Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
else
{
DEBUG(D_any) debug_printf("iconv error translating \"%.*s\" to %s: "
- "%s\n", endword + 2 - mimeword, mimeword, target, strerror(errno));
+ "%s\n", (int)(endword + 2 - mimeword), mimeword, target, strerror(errno));
}
}
-/* $Cambridge: exim/src/src/tls-openssl.c,v 1.26 2010/06/05 10:34:29 pdp Exp $ */
+/* $Cambridge: exim/src/src/tls-openssl.c,v 1.27 2010/06/07 00:12:42 pdp Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
okay = tls_openssl_options_parse(openssl_options, &init_options);
if (!okay)
- return tls_error("openssl_options parsing failed", host, NULL);
+ return tls_error(US"openssl_options parsing failed", host, NULL);
if (init_options)
{
static struct exim_openssl_option exim_openssl_options[] = {
/* KEEP SORTED ALPHABETICALLY! */
#ifdef SSL_OP_ALL
- { "all", SSL_OP_ALL },
+ { US"all", SSL_OP_ALL },
#endif
#ifdef SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION
- { "allow_unsafe_legacy_renegotiation", SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION },
+ { US"allow_unsafe_legacy_renegotiation", SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION },
#endif
#ifdef SSL_OP_CIPHER_SERVER_PREFERENCE
- { "cipher_server_preference", SSL_OP_CIPHER_SERVER_PREFERENCE },
+ { US"cipher_server_preference", SSL_OP_CIPHER_SERVER_PREFERENCE },
#endif
#ifdef SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS
- { "dont_insert_empty_fragments", SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS },
+ { US"dont_insert_empty_fragments", SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS },
#endif
#ifdef SSL_OP_EPHEMERAL_RSA
- { "ephemeral_rsa", SSL_OP_EPHEMERAL_RSA },
+ { US"ephemeral_rsa", SSL_OP_EPHEMERAL_RSA },
#endif
#ifdef SSL_OP_LEGACY_SERVER_CONNECT
- { "legacy_server_connect", SSL_OP_LEGACY_SERVER_CONNECT },
+ { US"legacy_server_connect", SSL_OP_LEGACY_SERVER_CONNECT },
#endif
#ifdef SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER
- { "microsoft_big_sslv3_buffer", SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER },
+ { US"microsoft_big_sslv3_buffer", SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER },
#endif
#ifdef SSL_OP_MICROSOFT_SESS_ID_BUG
- { "microsoft_sess_id_bug", SSL_OP_MICROSOFT_SESS_ID_BUG },
+ { US"microsoft_sess_id_bug", SSL_OP_MICROSOFT_SESS_ID_BUG },
#endif
#ifdef SSL_OP_MSIE_SSLV2_RSA_PADDING
- { "msie_sslv2_rsa_padding", SSL_OP_MSIE_SSLV2_RSA_PADDING },
+ { US"msie_sslv2_rsa_padding", SSL_OP_MSIE_SSLV2_RSA_PADDING },
#endif
#ifdef SSL_OP_NETSCAPE_CHALLENGE_BUG
- { "netscape_challenge_bug", SSL_OP_NETSCAPE_CHALLENGE_BUG },
+ { US"netscape_challenge_bug", SSL_OP_NETSCAPE_CHALLENGE_BUG },
#endif
#ifdef SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG
- { "netscape_reuse_cipher_change_bug", SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG },
+ { US"netscape_reuse_cipher_change_bug", SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG },
#endif
#ifdef SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION
- { "no_session_resumption_on_renegotiation", SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION },
+ { US"no_session_resumption_on_renegotiation", SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION },
#endif
#ifdef SSL_OP_SINGLE_DH_USE
- { "single_dh_use", SSL_OP_SINGLE_DH_USE },
+ { US"single_dh_use", SSL_OP_SINGLE_DH_USE },
#endif
#ifdef SSL_OP_SINGLE_ECDH_USE
- { "single_ecdh_use", SSL_OP_SINGLE_ECDH_USE },
+ { US"single_ecdh_use", SSL_OP_SINGLE_ECDH_USE },
#endif
#ifdef SSL_OP_SSLEAY_080_CLIENT_DH_BUG
- { "ssleay_080_client_dh_bug", SSL_OP_SSLEAY_080_CLIENT_DH_BUG },
+ { US"ssleay_080_client_dh_bug", SSL_OP_SSLEAY_080_CLIENT_DH_BUG },
#endif
#ifdef SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG
- { "sslref2_reuse_cert_type_bug", SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG },
+ { US"sslref2_reuse_cert_type_bug", SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG },
#endif
#ifdef SSL_OP_TLS_BLOCK_PADDING_BUG
- { "tls_block_padding_bug", SSL_OP_TLS_BLOCK_PADDING_BUG },
+ { US"tls_block_padding_bug", SSL_OP_TLS_BLOCK_PADDING_BUG },
#endif
#ifdef SSL_OP_TLS_D5_BUG
- { "tls_d5_bug", SSL_OP_TLS_D5_BUG },
+ { US"tls_d5_bug", SSL_OP_TLS_D5_BUG },
#endif
#ifdef SSL_OP_TLS_ROLLBACK_BUG
- { "tls_rollback_bug", SSL_OP_TLS_ROLLBACK_BUG },
+ { US"tls_rollback_bug", SSL_OP_TLS_ROLLBACK_BUG },
#endif
};
static int exim_openssl_options_size =
-/* $Cambridge: exim/src/src/transports/appendfile.c,v 1.26 2010/05/29 12:11:48 pdp Exp $ */
+/* $Cambridge: exim/src/src/transports/appendfile.c,v 1.27 2010/06/07 00:12:42 pdp Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
goto RETURN;
}
- if (lstat(mbx_lockname, &lstatbuf) < 0)
+ if (Ulstat(mbx_lockname, &lstatbuf) < 0)
{
addr->basic_errno = ERRNO_LOCKFAILED;
addr->message = string_sprintf("attempting to lstat open MBX "