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
struct dnssec_domains
[exim.git]
/
src
/
src
/
route.c
diff --git
a/src/src/route.c
b/src/src/route.c
index 09503044fb74305f7ef81177acd0baa1845a102b..cd7e5d535f67525412294722138da4af85d2d8f4 100644
(file)
--- a/
src/src/route.c
+++ b/
src/src/route.c
@@
-54,6
+54,10
@@
optionlist optionlist_routers[] = {
(void *)offsetof(router_instance, debug_string) },
{ "disable_logging", opt_bool | opt_public,
(void *)offsetof(router_instance, disable_logging) },
(void *)offsetof(router_instance, debug_string) },
{ "disable_logging", opt_bool | opt_public,
(void *)offsetof(router_instance, disable_logging) },
+ { "dnssec_request_domains", opt_stringptr|opt_public,
+ (void *)offsetof(router_instance, dnssec.request) },
+ { "dnssec_require_domains", opt_stringptr|opt_public,
+ (void *)offsetof(router_instance, dnssec.require) },
{ "domains", opt_stringptr|opt_public,
(void *)offsetof(router_instance, domains) },
{ "driver", opt_stringptr|opt_public,
{ "domains", opt_stringptr|opt_public,
(void *)offsetof(router_instance, domains) },
{ "driver", opt_stringptr|opt_public,
@@
-319,11
+323,11
@@
Returns: length of matching prefix or zero
*/
int
*/
int
-route_check_prefix(
uschar *local_part,
uschar *prefixes)
+route_check_prefix(
const uschar *local_part, const
uschar *prefixes)
{
int sep = 0;
uschar *prefix;
{
int sep = 0;
uschar *prefix;
-uschar *listptr = prefixes;
+
const
uschar *listptr = prefixes;
uschar prebuf[64];
while ((prefix = string_nextinlist(&listptr, &sep, prebuf, sizeof(prebuf)))
uschar prebuf[64];
while ((prefix = string_nextinlist(&listptr, &sep, prebuf, sizeof(prebuf)))
@@
-332,7
+336,7
@@
while ((prefix = string_nextinlist(&listptr, &sep, prebuf, sizeof(prebuf)))
int plen = Ustrlen(prefix);
if (prefix[0] == '*')
{
int plen = Ustrlen(prefix);
if (prefix[0] == '*')
{
- uschar *p;
+
const
uschar *p;
prefix++;
for (p = local_part + Ustrlen(local_part) - (--plen);
p >= local_part; p--)
prefix++;
for (p = local_part + Ustrlen(local_part) - (--plen);
p >= local_part; p--)
@@
-363,12
+367,12
@@
Returns: length of matching suffix or zero
*/
int
*/
int
-route_check_suffix(
uschar *local_part,
uschar *suffixes)
+route_check_suffix(
const uschar *local_part, const
uschar *suffixes)
{
int sep = 0;
int alen = Ustrlen(local_part);
uschar *suffix;
{
int sep = 0;
int alen = Ustrlen(local_part);
uschar *suffix;
-uschar *listptr = suffixes;
+
const
uschar *listptr = suffixes;
uschar sufbuf[64];
while ((suffix = string_nextinlist(&listptr, &sep, sufbuf, sizeof(sufbuf)))
uschar sufbuf[64];
while ((suffix = string_nextinlist(&listptr, &sep, sufbuf, sizeof(sufbuf)))
@@
-377,7
+381,7
@@
while ((suffix = string_nextinlist(&listptr, &sep, sufbuf, sizeof(sufbuf)))
int slen = Ustrlen(suffix);
if (suffix[slen-1] == '*')
{
int slen = Ustrlen(suffix);
if (suffix[slen-1] == '*')
{
- uschar *p, *pend;
+
const
uschar *p, *pend;
pend = local_part + alen - (--slen) + 1;
for (p = local_part; p < pend; p++)
if (strncmpic(suffix, p, slen) == 0) return alen - (p - local_part);
pend = local_part + alen - (--slen) + 1;
for (p = local_part; p < pend; p++)
if (strncmpic(suffix, p, slen) == 0) return alen - (p - local_part);
@@
-420,9
+424,9
@@
Returns: OK item is in list
*/
static int
*/
static int
-route_check_dls(uschar *rname, uschar *type,
uschar *list, tree_node
-
**anchorptr, unsigned int *cache_bits, int listtype, uschar *domloc
,
- uschar **ldata, BOOL caseless, uschar **perror)
+route_check_dls(uschar *rname, uschar *type,
const uschar *list,
+
tree_node **anchorptr, unsigned int *cache_bits, int listtype
,
+
const uschar *domloc, const
uschar **ldata, BOOL caseless, uschar **perror)
{
int rc;
{
int rc;
@@
-442,7
+446,7
@@
else
{
uschar *address = (sender_address == NULL)? US"" : sender_address;
rc = match_address_list(address, TRUE, TRUE, &list, cache_bits, -1, 0,
{
uschar *address = (sender_address == NULL)? US"" : sender_address;
rc = match_address_list(address, TRUE, TRUE, &list, cache_bits, -1, 0,
- &sender_data);
+
CUSS
&sender_data);
}
switch(rc)
}
switch(rc)
@@
-570,14
+574,15
@@
Returns: OK if s == NULL or all tests are as required
SKIP otherwise
*/
SKIP otherwise
*/
-int
-check_files(uschar *s, uschar **perror)
+
static
int
+check_files(
const
uschar *s, uschar **perror)
{
int sep = 0; /* List has default separators */
uid_t uid = 0; /* For picky compilers */
gid_t gid = 0; /* For picky compilers */
BOOL ugid_set = FALSE;
{
int sep = 0; /* List has default separators */
uid_t uid = 0; /* For picky compilers */
gid_t gid = 0; /* For picky compilers */
BOOL ugid_set = FALSE;
-uschar *check, *listptr;
+const uschar *listptr;
+uschar *check;
uschar buffer[1024];
if (s == NULL) return OK;
uschar buffer[1024];
if (s == NULL) return OK;
@@
-585,8
+590,7
@@
if (s == NULL) return OK;
DEBUG(D_route) debug_printf("checking require_files\n");
listptr = s;
DEBUG(D_route) debug_printf("checking require_files\n");
listptr = s;
-while ((check = string_nextinlist(&listptr, &sep, buffer, sizeof(buffer)))
- != NULL)
+while ((check = string_nextinlist(&listptr, &sep, buffer, sizeof(buffer))))
{
int rc;
int eacces_code = 0;
{
int rc;
int eacces_code = 0;
@@
-885,8
+889,8
@@
if (verify == v_expn && !r->expn)
/* Skip this router if there's a domain mismatch. */
if ((rc = route_check_dls(r->name, US"domains", r->domains, &domainlist_anchor,
/* Skip this router if there's a domain mismatch. */
if ((rc = route_check_dls(r->name, US"domains", r->domains, &domainlist_anchor,
- addr->domain_cache, TRUE, addr->domain,
&deliver_domain_data, MCL_DOMAIN
,
- perror)) != OK)
+ addr->domain_cache, TRUE, addr->domain,
CUSS &deliver_domain_data
,
+
MCL_DOMAIN,
perror)) != OK)
return rc;
/* Skip this router if there's a local part mismatch. We want to pass over the
return rc;
/* Skip this router if there's a local part mismatch. We want to pass over the
@@
-913,8
+917,8
@@
else
if ((rc = route_check_dls(r->name, US"local_parts", r->local_parts,
&localpartlist_anchor, localpart_cache, MCL_LOCALPART,
if ((rc = route_check_dls(r->name, US"local_parts", r->local_parts,
&localpartlist_anchor, localpart_cache, MCL_LOCALPART,
- check_local_part,
&deliver_localpart_data, !r->caseful_local_part
,
- perror)) != OK)
+ check_local_part,
CUSS &deliver_localpart_data
,
+
!r->caseful_local_part,
perror)) != OK)
return rc;
/* If the check_local_user option is set, check that the local_part is the
return rc;
/* If the check_local_user option is set, check that the local_part is the
@@
-1088,7
+1092,7
@@
static uschar lastgecos[128];
static uschar lastshell[128];
BOOL
static uschar lastshell[128];
BOOL
-route_finduser(uschar *s, struct passwd **pw, uid_t *return_uid)
+route_finduser(
const
uschar *s, struct passwd **pw, uid_t *return_uid)
{
BOOL cache_set = (Ustrcmp(lastname, s) == 0);
{
BOOL cache_set = (Ustrcmp(lastname, s) == 0);
@@
-1342,8
+1346,8
@@
from the original address' parent, if present, otherwise unset. */
*parent = *addr;
parent->child_count = 2;
*parent = *addr;
parent->child_count = 2;
-parent->p.errors_address =
- (addr->parent == NULL)? NULL : addr->parent->p.errors_address;
+parent->p
rop
.errors_address =
+ (addr->parent == NULL)? NULL : addr->parent->p
rop
.errors_address;
/* The routed address gets a new parent. */
/* The routed address gets a new parent. */
@@
-1354,12
+1358,12
@@
was set from the original parent (or to NULL) - see above. We do NOT want to
take the errors address from the unseen router. */
new->parent = parent;
take the errors address from the unseen router. */
new->parent = parent;
-new->p
.errors_address = parent->
p.errors_address;
+new->p
rop.errors_address = parent->pro
p.errors_address;
/* Copy the propagated flags and address_data from the original. */
copyflag(new, addr, af_propagate);
/* Copy the propagated flags and address_data from the original. */
copyflag(new, addr, af_propagate);
-new->p
.address_data = addr->
p.address_data;
+new->p
rop.address_data = addr->pro
p.address_data;
new->dsn_flags = addr->dsn_flags;
new->dsn_orcpt = addr->dsn_orcpt;
new->dsn_flags = addr->dsn_flags;
new->dsn_orcpt = addr->dsn_orcpt;
@@
-1437,7
+1441,7
@@
route_address(address_item *addr, address_item **paddr_local,
int yield = OK;
BOOL unseen;
router_instance *r, *nextr;
int yield = OK;
BOOL unseen;
router_instance *r, *nextr;
-uschar *old_domain = addr->domain;
+
const
uschar *old_domain = addr->domain;
HDEBUG(D_route)
{
HDEBUG(D_route)
{
@@
-1645,7
+1649,7
@@
for (r = (addr->start_router == NULL)? routers : addr->start_router;
goto ROUTE_EXIT;
}
}
goto ROUTE_EXIT;
}
}
- addr->p.address_data = deliver_address_data;
+ addr->p
rop
.address_data = deliver_address_data;
}
/* We are finally cleared for take-off with this router. Clear the the flag
}
/* We are finally cleared for take-off with this router. Clear the the flag
@@
-1891,8
+1895,8
@@
DEBUG(D_route)
debug_printf(" transport: %s\n", (addr->transport == NULL)?
US"<none>" : addr->transport->name);
debug_printf(" transport: %s\n", (addr->transport == NULL)?
US"<none>" : addr->transport->name);
- if (addr->p.errors_address != NULL)
- debug_printf(" errors to %s\n", addr->p.errors_address);
+ if (addr->p
rop
.errors_address != NULL)
+ debug_printf(" errors to %s\n", addr->p
rop
.errors_address);
for (h = addr->host_list; h != NULL; h = h->next)
{
for (h = addr->host_list; h != NULL; h = h->next)
{