Date: Thu, 19 Jan 2012 06:23:00 GMT From: Stefan Schaeckeler <schaecsn@gmx.net> To: freebsd-gnats-submit@FreeBSD.org Subject: bin/164302: mail expands aliases beyond # Message-ID: <201201190623.q0J6N0b2039596@red.freebsd.org> Resent-Message-ID: <201201190630.q0J6UBoj085459@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 164302
>Category: bin
>Synopsis: mail expands aliases beyond #
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Thu Jan 19 06:30:11 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator: Stefan Schaeckeler
>Release: 9.0
>Organization:
>Environment:
FreeBSD taipei 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Mon Jan 16 05:33:35 PST 2012 root@taipei:/usr/obj/usr/src/sys/TAIPEI i386
>Description:
I'm not sure if this is a bug or a feature. For, me, it's a bug :)
/usr/bin/mail parses ~/.mailrc and expands aliases in an unexpected way, e.g. for such an entry
--- snip ---
alias stefan important@internet.com # that's me
--- snip ---
/usr/bin/mail sends out email to 4 recipients:
1. important@internet.com
2. #
3. that's
4. me
I'm also using emacs/rmail which expands aliases from ~/.mailrc, but only up to the #. That's more intuitive.
>How-To-Repeat:
>Fix:
A fix could stop reading beyond # in usr.bin/mail/list.c:getrawlist(). See attachment.
Patch attached with submission follows:
--- list.c.orig 2012-01-19 06:04:25.000000000 -0800
+++ list.c 2012-01-19 05:47:29.000000000 -0800
@@ -393,7 +393,7 @@
for (;;) {
for (; *cp == ' ' || *cp == '\t'; cp++)
;
- if (*cp == '\0')
+ if (*cp == '\0' || *cp == '#')
break;
if (argn >= argc - 1) {
printf(
@@ -402,7 +402,7 @@
}
cp2 = linebuf;
quotec = '\0';
- while ((c = *cp) != '\0') {
+ while ((c = *cp) != '\0' && c != '#') {
/* Allocate more space if necessary */
if (cp2 - linebuf == linebufsize - 1) {
linebufsize += BUFSIZ;
>Release-Note:
>Audit-Trail:
>Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201201190623.q0J6N0b2039596>
