git://git.exim.org
/
exim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add perl_taintmode option
[exim.git]
/
src
/
src
/
readconf.c
diff --git
a/src/src/readconf.c
b/src/src/readconf.c
index d0b8e0bcf87b7737e4a148eb0886550ca45cc542..ba4cb668b51d1db832bb8da05238e8b5a7c7eb83 100644
(file)
--- a/
src/src/readconf.c
+++ b/
src/src/readconf.c
@@
-2,7
+2,7
@@
* Exim - an Internet mail transport agent *
*************************************************/
* Exim - an Internet mail transport agent *
*************************************************/
-/* Copyright (c) University of Cambridge 1995 - 201
5
*/
+/* Copyright (c) University of Cambridge 1995 - 201
6
*/
/* See the file NOTICE for conditions of use and distribution. */
/* Functions for reading the configuration file, and for displaying
/* See the file NOTICE for conditions of use and distribution. */
/* Functions for reading the configuration file, and for displaying
@@
-16,7
+16,7
@@
extern char **environ;
static void fn_smtp_receive_timeout(const uschar * name, const uschar * str);
static void save_config_line(const uschar* line);
static void save_config_position(const uschar *file, int line);
static void fn_smtp_receive_timeout(const uschar * name, const uschar * str);
static void save_config_line(const uschar* line);
static void save_config_position(const uschar *file, int line);
-static void print_config(BOOL admin);
+static void print_config(BOOL admin
, BOOL terse
);
#define CSTATE_STACK_SIZE 10
#define CSTATE_STACK_SIZE 10
@@
-349,6
+349,7
@@
static optionlist optionlist_config[] = {
#ifdef EXIM_PERL
{ "perl_at_start", opt_bool, &opt_perl_at_start },
{ "perl_startup", opt_stringptr, &opt_perl_startup },
#ifdef EXIM_PERL
{ "perl_at_start", opt_bool, &opt_perl_at_start },
{ "perl_startup", opt_stringptr, &opt_perl_startup },
+ { "perl_taintmode", opt_bool, &opt_perl_taintmode },
#endif
#ifdef LOOKUP_PGSQL
{ "pgsql_servers", opt_stringptr, &pgsql_servers },
#endif
#ifdef LOOKUP_PGSQL
{ "pgsql_servers", opt_stringptr, &pgsql_servers },
@@
-2649,7
+2650,7
@@
if (type == NULL)
if (Ustrcmp(name, "config") == 0)
{
if (Ustrcmp(name, "config") == 0)
{
- print_config(admin_user);
+ print_config(admin_user
, no_labels
);
return;
}
return;
}
@@
-2947,7
+2948,7
@@
Returns: bool for "okay"; false will cause caller to immediately exit.
#ifdef SUPPORT_TLS
static BOOL
#ifdef SUPPORT_TLS
static BOOL
-tls_dropprivs_validate_require_cipher(
void
)
+tls_dropprivs_validate_require_cipher(
BOOL nowarn
)
{
const uschar *errmsg;
pid_t pid;
{
const uschar *errmsg;
pid_t pid;
@@
-2961,7
+2962,7
@@
if ( !tls_advertise_hosts
|| Ustrcmp(tls_advertise_hosts, ":") == 0
)
return TRUE;
|| Ustrcmp(tls_advertise_hosts, ":") == 0
)
return TRUE;
-else if (!tls_certificate)
+else if (!
nowarn && !
tls_certificate)
log_write(0, LOG_MAIN|LOG_PANIC,
"Warning: No server certificate defined; TLS connections will fail.\n"
" Suggested action: either install a certificate or change tls_advertise_hosts option");
log_write(0, LOG_MAIN|LOG_PANIC,
"Warning: No server certificate defined; TLS connections will fail.\n"
" Suggested action: either install a certificate or change tls_advertise_hosts option");
@@
-3035,7
+3036,7
@@
systems. Therefore they are available only when requested by compile-time
options. */
void
options. */
void
-readconf_main(
void
)
+readconf_main(
BOOL nowarn
)
{
int sep = 0;
struct stat statbuf;
{
int sep = 0;
struct stat statbuf;
@@
-3473,7
+3474,7
@@
if ((tls_verify_hosts != NULL || tls_try_verify_hosts != NULL) &&
/* This also checks that the library linkage is working and we can call
routines in it, so call even if tls_require_ciphers is unset */
/* This also checks that the library linkage is working and we can call
routines in it, so call even if tls_require_ciphers is unset */
-if (!tls_dropprivs_validate_require_cipher())
+if (!tls_dropprivs_validate_require_cipher(
nowarn
))
exit(1);
/* Magic number: at time of writing, 1024 has been the long-standing value
exit(1);
/* Magic number: at time of writing, 1024 has been the long-standing value
@@
-3497,16
+3498,16
@@
if (openssl_options != NULL)
# endif
}
# endif
}
-if (
gnutls_require_kx || gnutls_require_mac || gnutls_require_proto
)
+if (
!nowarn && (gnutls_require_kx || gnutls_require_mac || gnutls_require_proto)
)
log_write(0, LOG_MAIN, "WARNING: main options"
" gnutls_require_kx, gnutls_require_mac and gnutls_require_protocols"
" are obsolete\n");
#endif /*SUPPORT_TLS*/
log_write(0, LOG_MAIN, "WARNING: main options"
" gnutls_require_kx, gnutls_require_mac and gnutls_require_protocols"
" are obsolete\n");
#endif /*SUPPORT_TLS*/
-if (
(!add_environment || *add_environment == '\0') && !keep_environment
)
+if (
!nowarn && !keep_environment && environ && *environ
)
log_write(0, LOG_MAIN,
log_write(0, LOG_MAIN,
- "W
ARNING
: purging the environment.\n"
- " Suggested action: use keep_environment
and add_environment
.");
+ "W
arning
: purging the environment.\n"
+ " Suggested action: use keep_environment.");
}
}
@@
-4303,10
+4304,10
@@
current = next;
/* List the parsed config lines, care about nice formatting and
hide the <hide> values unless we're the admin user */
void
/* List the parsed config lines, care about nice formatting and
hide the <hide> values unless we're the admin user */
void
-print_config(BOOL admin)
+print_config(BOOL admin
, BOOL terse
)
{
config_line_item *i;
{
config_line_item *i;
-const int TS = 2;
+const int TS =
terse ? 0 :
2;
int indent = 0;
for (i = config_lines; i; i = i->next)
int indent = 0;
for (i = config_lines; i; i = i->next)
@@
-4346,7
+4347,7
@@
for (i = config_lines; i; i = i->next)
/* begin lines are left aligned */
else if (Ustrncmp(current, "begin", 5) == 0 && isspace(current[5]))
{
/* begin lines are left aligned */
else if (Ustrncmp(current, "begin", 5) == 0 && isspace(current[5]))
{
- puts("");
+
if (!terse)
puts("");
puts(CCS current);
indent = TS;
}
puts(CCS current);
indent = TS;
}
@@
-4354,7
+4355,8
@@
for (i = config_lines; i; i = i->next)
/* router/acl/transport block names */
else if (current[Ustrlen(current)-1] == ':' && !Ustrchr(current, '='))
{
/* router/acl/transport block names */
else if (current[Ustrlen(current)-1] == ':' && !Ustrchr(current, '='))
{
- printf("\n%*s%s\n", TS, "", current);
+ if (!terse) puts("");
+ printf("%*s%s\n", TS, "", current);
indent = 2 * TS;
}
indent = 2 * TS;
}