diff options
author | Gilles Chehade <gilles@cvs.openbsd.org> | 2011-10-11 17:57:11 +0000 |
---|---|---|
committer | Gilles Chehade <gilles@cvs.openbsd.org> | 2011-10-11 17:57:11 +0000 |
commit | 223fe1f8d17386894889e0bd7081064cc5f6c1e9 (patch) | |
tree | e44e9af49f8362884f49dbdaedc164d0273e3cf5 /usr.sbin/smtpd/aliases.c | |
parent | 011c514a02df1a21ef406cb30bf13c6fd1b61f20 (diff) |
fix parsing of :include: aliases
Diffstat (limited to 'usr.sbin/smtpd/aliases.c')
-rw-r--r-- | usr.sbin/smtpd/aliases.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/usr.sbin/smtpd/aliases.c b/usr.sbin/smtpd/aliases.c index 9695e5aea42..8d1cc300168 100644 --- a/usr.sbin/smtpd/aliases.c +++ b/usr.sbin/smtpd/aliases.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aliases.c,v 1.43 2011/05/16 21:05:51 gilles Exp $ */ +/* $OpenBSD: aliases.c,v 1.44 2011/10/11 17:57:10 gilles Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -365,10 +365,16 @@ alias_is_filename(struct expandnode *alias, char *line, size_t len) int alias_is_include(struct expandnode *alias, char *line, size_t len) { - if (strncasecmp(":include:", line, 9) != 0) + size_t skip; + + if (strncasecmp(":include:", line, 9) == 0) + skip = 9; + else if (strncasecmp("include:", line, 8) == 0) + skip = 8; + else return 0; - if (! alias_is_filename(alias, line + 9, len - 9)) + if (! alias_is_filename(alias, line + skip, len - skip)) return 0; alias->type = EXPAND_INCLUDE; |