diff options
| author | 2004-04-26 17:15:37 +0000 | |
|---|---|---|
| committer | 2004-04-26 17:15:37 +0000 | |
| commit | 3c2f3a1108fe882f95c07ea1c6c49bd27ca92cc3 (patch) | |
| tree | 42cdb933d24ab8ab56fe05b6fb9e415e33a10d58 /usr.sbin/cron/do_command.c | |
| parent | Fix RCSID (diff) | |
| download | wireguard-openbsd-3c2f3a1108fe882f95c07ea1c6c49bd27ca92cc3.tar.xz wireguard-openbsd-3c2f3a1108fe882f95c07ea1c6c49bd27ca92cc3.zip | |
isalnum() does not match '_' so check it explicitly. This allows cron
to send mail to usernames with a '_' in them. From David Gwynne.
Diffstat (limited to 'usr.sbin/cron/do_command.c')
| -rw-r--r-- | usr.sbin/cron/do_command.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.sbin/cron/do_command.c b/usr.sbin/cron/do_command.c index c8545745fde..c43537341c0 100644 --- a/usr.sbin/cron/do_command.c +++ b/usr.sbin/cron/do_command.c @@ -1,4 +1,4 @@ -/* $OpenBSD: do_command.c,v 1.25 2003/07/30 20:20:01 millert Exp $ */ +/* $OpenBSD: do_command.c,v 1.26 2004/04/26 17:15:37 millert Exp $ */ /* Copyright 1988,1990,1993,1994 by Paul Vixie * All rights reserved @@ -22,7 +22,7 @@ */ #if !defined(lint) && !defined(LINT) -static char const rcsid[] = "$OpenBSD: do_command.c,v 1.25 2003/07/30 20:20:01 millert Exp $"; +static char const rcsid[] = "$OpenBSD: do_command.c,v 1.26 2004/04/26 17:15:37 millert Exp $"; #endif #include "cron.h" @@ -509,7 +509,8 @@ safe_p(const char *usernm, const char *s) { for (t = s, first = 1; (ch = *t++) != '\0'; first = 0) { if (isascii(ch) && isprint(ch) && - (isalnum(ch) || (!first && strchr(safe_delim, ch)))) + (isalnum(ch) || ch == '_' || + (!first && strchr(safe_delim, ch)))) continue; log_it(usernm, getpid(), "UNSAFE", s); return (FALSE); |
