summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Woodhouse <David.Woodhouse@intel.com>2010-12-11 13:44:55 +0000
committerDavid Woodhouse <David.Woodhouse@intel.com>2010-12-11 21:12:40 +0000
commitc1d94452b1b7f3620ee3cc9aa197ad98821de79f (patch)
tree5152e5ff0bb43108d3c7030913ecc8c51852a085 /src
parent7f36d675a458b3cf823c977e2cc4b47a6e6c8d4a (diff)
Don't allow a configure file which is writeable by the Exim user or group
(Bug 1044, CVE-2010-4345)
Diffstat (limited to 'src')
-rw-r--r--src/src/EDITME7
-rw-r--r--src/src/config.h.defaults1
-rw-r--r--src/src/globals.c1
-rw-r--r--src/src/globals.h1
-rw-r--r--src/src/readconf.c5
5 files changed, 8 insertions, 7 deletions
diff --git a/src/src/EDITME b/src/src/EDITME
index 050d9ad10..285e5b656 100644
--- a/src/src/EDITME
+++ b/src/src/EDITME
@@ -430,14 +430,13 @@ FIXED_NEVER_USERS=root
#------------------------------------------------------------------------------
-# By default, Exim insists that its configuration file be owned either by root
-# or by the Exim user. You can specify one additional permitted owner here.
+# By default, Exim insists that its configuration file be owned by root. You
+# can specify one additional permitted owner here.
# CONFIGURE_OWNER=
# If the configuration file is group-writeable, Exim insists by default that it
-# is owned by root or the Exim user. You can specify one additional permitted
-# group owner here.
+# is owned by root. You can specify one additional permitted group owner here.
# CONFIGURE_GROUP=
diff --git a/src/src/config.h.defaults b/src/src/config.h.defaults
index c6895b621..9f0eba0fe 100644
--- a/src/src/config.h.defaults
+++ b/src/src/config.h.defaults
@@ -161,5 +161,6 @@ just in case. */
#define DNS_MAXNAME 1024
#define EXPAND_MAXN 20
#define ROOT_UID 0
+#define ROOT_GID 0
/* End of config.h.defaults */
diff --git a/src/src/globals.c b/src/src/globals.c
index 645cdb130..9b77d876b 100644
--- a/src/src/globals.c
+++ b/src/src/globals.c
@@ -946,6 +946,7 @@ int rewrite_existflags = 0;
uschar *rfc1413_hosts = US"*";
int rfc1413_query_timeout = 5;
/* BOOL rfc821_domains = FALSE; <<< on the way out */
+uid_t root_gid = ROOT_GID;
uid_t root_uid = ROOT_UID;
router_instance *routers = NULL;
diff --git a/src/src/globals.h b/src/src/globals.h
index b036def7c..d66880e67 100644
--- a/src/src/globals.h
+++ b/src/src/globals.h
@@ -610,6 +610,7 @@ extern int rewrite_existflags; /* Indicate which headers have rewrites *
extern uschar *rfc1413_hosts; /* RFC hosts */
extern int rfc1413_query_timeout; /* Timeout on RFC 1413 calls */
/* extern BOOL rfc821_domains; */ /* If set, syntax is 821, not 822 => being abolished */
+extern uid_t root_gid; /* The gid for root */
extern uid_t root_uid; /* The uid for root */
extern router_info routers_available[];/* Vector of available routers */
extern router_instance *routers; /* Chain of instantiated routers */
diff --git a/src/src/readconf.c b/src/src/readconf.c
index 954d546a4..080305834 100644
--- a/src/src/readconf.c
+++ b/src/src/readconf.c
@@ -2883,13 +2883,12 @@ if (!config_changed)
log_write(0, LOG_MAIN|LOG_PANIC_DIE, "failed to stat configuration file %s",
big_buffer);
- if ((statbuf.st_uid != root_uid && /* owner not root */
- statbuf.st_uid != exim_uid /* owner not exim */
+ if ((statbuf.st_uid != root_uid /* owner not root */
#ifdef CONFIGURE_OWNER
&& statbuf.st_uid != config_uid /* owner not the special one */
#endif
) || /* or */
- (statbuf.st_gid != exim_gid /* group not exim & */
+ (statbuf.st_gid != root_gid /* group not root & */
#ifdef CONFIGURE_GROUP
&& statbuf.st_gid != config_gid /* group not the special one */
#endif