summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2015-01-22 16:25:08 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2015-01-22 16:25:08 +0000
commitcafa5bb29acce74dab3a0eeac84ff06ff6db2734 (patch)
tree701a572d22ab9b8611cbb762feceffa3fd138f6a /usr.bin
parentc69e04438ae019cff89355c6c707a52ea7667845 (diff)
Only allow the -r flag when sending a message; from Martin Brandenburg
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/mail/main.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/mail/main.c b/usr.bin/mail/main.c
index eb02c18b57c..a9d22de475b 100644
--- a/usr.bin/mail/main.c
+++ b/usr.bin/mail/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.28 2015/01/20 16:59:07 millert Exp $ */
+/* $OpenBSD: main.c,v 1.29 2015/01/22 16:25:07 millert Exp $ */
/* $NetBSD: main.c,v 1.7 1997/05/13 06:15:57 mikel Exp $ */
/*
@@ -185,8 +185,10 @@ main(int argc, char **argv)
/*
* Check for inconsistent arguments.
*/
- if (to == NULL && (subject != NULL || cc != NULL || bcc != NULL))
- errx(1, "You must specify direct recipients with -s, -c, or -b");
+ if (to == NULL && (subject != NULL || cc != NULL || bcc != NULL ||
+ fromaddr != NULL))
+ errx(1, "You must specify direct recipients with -s, -c, -b, "
+ "or -r");
/*
* Block SIGINT except where we install an explicit handler for it.
*/