From c240b5351ee405929d69a064862a5a8c2f67a4e2 Mon Sep 17 00:00:00 2001 From: op Date: Thu, 29 Aug 2024 21:04:16 +0000 Subject: [PATCH] fix handling of Return-Path It doesn't handle angular brackets in Return-Path, which are fine per RFC 5332 (section 3.6.7). Diff from Sven M. Hallberg with a tiny change by me. --- usr.bin/vacation/vacation.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/usr.bin/vacation/vacation.c b/usr.bin/vacation/vacation.c index 7105f567c92..56dd0e79a5d 100644 --- a/usr.bin/vacation/vacation.c +++ b/usr.bin/vacation/vacation.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vacation.c,v 1.38 2019/06/28 13:35:05 deraadt Exp $ */ +/* $OpenBSD: vacation.c,v 1.39 2024/08/29 21:04:16 op Exp $ */ /* $NetBSD: vacation.c,v 1.7 1995/04/29 05:58:27 cgd Exp $ */ /* @@ -246,6 +246,10 @@ readheaders(void) break; for (p = buf + 12; isspace((unsigned char)*p); ++p) ; + if (*p == '<') { + ++p; + p[strcspn(p, ">")] = '\0'; + } if (strlcpy(from, p, sizeof(from)) >= sizeof(from)) { syslog(LOG_NOTICE, "Return-Path %s exceeds limits", p); @@ -303,13 +307,8 @@ readheaders(void) findme: for (cur = names; !tome && cur; cur = cur->next) tome += nsearch(cur->name, buf); } - if (!tome) + if (!tome || !*from) exit(0); - if (!*from) { - syslog(LOG_NOTICE, - "no initial \"From\" or \"Return-Path\"line."); - exit(1); - } } /*