From 223fe1f8d17386894889e0bd7081064cc5f6c1e9 Mon Sep 17 00:00:00 2001 From: Gilles Chehade Date: Tue, 11 Oct 2011 17:57:11 +0000 Subject: fix parsing of :include: aliases --- usr.sbin/smtpd/aliases.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'usr.sbin/smtpd/aliases.c') 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 @@ -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; -- cgit v1.2.3