diff options
author | Gilles Chehade <gilles@cvs.openbsd.org> | 2012-10-03 18:09:19 +0000 |
---|---|---|
committer | Gilles Chehade <gilles@cvs.openbsd.org> | 2012-10-03 18:09:19 +0000 |
commit | 16373bd82913ff43e95acf3b052f97f43e7e0b54 (patch) | |
tree | fe2a405629af381c1d490e703664501c3e29a5b6 /usr.sbin | |
parent | c103f476f0d7aa20a55b9f8cbd80335447992a15 (diff) |
- add a EXPAND_DEPTH define for ... expansion depth
- bump the expansion depth from 5 to 10
- add the current node depth to log_debug()
ok eric@, ok chl@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/smtpd/lka_session.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/usr.sbin/smtpd/lka_session.c b/usr.sbin/smtpd/lka_session.c index 9ffe9a0f034..3b2e5c409d9 100644 --- a/usr.sbin/smtpd/lka_session.c +++ b/usr.sbin/smtpd/lka_session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lka_session.c,v 1.38 2012/09/30 14:28:16 gilles Exp $ */ +/* $OpenBSD: lka_session.c,v 1.39 2012/10/03 18:09:18 gilles Exp $ */ /* * Copyright (c) 2011 Gilles Chehade <gilles@openbsd.org> @@ -40,6 +40,8 @@ #include "smtpd.h" #include "log.h" +#define EXPAND_DEPTH 10 + #define F_ERROR 0x01 #define F_WAITING 0x02 @@ -194,7 +196,7 @@ lka_expand(struct lka_session *lks, struct rule *rule, struct expandnode *xn) struct envelope ep; struct expandnode node; - if (xn->depth >= 5) { + if (xn->depth >= EXPAND_DEPTH) { log_debug("lka_expand: node too deep."); lks->flags |= F_ERROR; lks->ss.code = 530; @@ -208,8 +210,8 @@ lka_expand(struct lka_session *lks, struct rule *rule, struct expandnode *xn) break; case EXPAND_ADDRESS: - log_debug("lka_expand: expanding address: %s@%s", - xn->u.mailaddr.user, xn->u.mailaddr.domain); + log_debug("lka_expand: expanding address: %s@%s [depth=%d]", + xn->u.mailaddr.user, xn->u.mailaddr.domain, xn->depth); /* Pass the node through the ruleset */ ep = lks->envelope; @@ -247,7 +249,7 @@ lka_expand(struct lka_session *lks, struct rule *rule, struct expandnode *xn) break; case EXPAND_USERNAME: - log_debug("lka_expand: expanding username: %s", xn->u.user); + log_debug("lka_expand: expanding username: %s [depth=%d]", xn->u.user, xn->depth); if (xn->sameuser) { log_debug("lka_expand: same user, submitting"); @@ -274,12 +276,12 @@ lka_expand(struct lka_session *lks, struct rule *rule, struct expandnode *xn) break; case EXPAND_FILENAME: - log_debug("lka_expand: expanding filename: %s", xn->u.buffer); + log_debug("lka_expand: expanding filename: %s [depth=%d]", xn->u.buffer, xn->depth); lka_submit(lks, rule, xn); break; case EXPAND_FILTER: - log_debug("lka_expand: expanding filter: %s", xn->u.buffer); + log_debug("lka_expand: expanding filter: %s [depth=%d]", xn->u.buffer, xn->depth); lka_submit(lks, rule, xn); break; } |