Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 571858 - sys-process/vixie-cron crash if username includes underscore
Summary: sys-process/vixie-cron crash if username includes underscore
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Deadline: 2019-10-11
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords: PATCH, PMASKED
Depends on:
Blocks:
 
Reported: 2016-01-14 10:13 UTC by Alexey Vlasov
Modified: 2019-10-11 15:07 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Vlasov 2016-01-14 10:13:34 UTC
If a username includes the character "-" then cron can not send a mail about its cronjob.

Reproducible: Always

Steps to Reproduce:
1. Create user with charachter "-",
# useradd -m -d /home/w_server-l33_de15649f w_server-l33_de15649f
2. Its cronjob:
$ crontab -l
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.XXXXxBjOSe installed on Wed Jan 13 17:57:30 2016)
# (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp $)
*/1 * * * * date | tee -a $HOME/cron.log
Actual Results:  
# grep w_server-l33_de15649f /var/log/cron.log
Jan 14 03:11:01 l33 cron[29979]: (w_server-l33_de15649f) UNSAFE (w_server-l33_de15649f)

# dmesg | grep cron | grep segfault
[4393074.367688] cron[29979]: segfault at 1 ip 00007fdbc086c7e8 sp 00007ffe1ce22200 error 4 in libc-2.20.so[7fdbc0822000+18f000]

Expected Results:  
The cron has to send a mail to the username w_server-l33_de15649f

--- vixie-cron-3.0.1.orig/do_command.c  2004-08-27 22:09:34.000000000 +0400
+++ vixie-cron-3.0.1/do_command.c       2016-01-14 13:12:57.135798686 +0300
@@ -511,7 +511,7 @@

 static int
 safe_p(const char *usernm, const char *s) {
-       static const char safe_delim[] = "@!:%-.,";     /* conservative! */
+       static const char safe_delim[] = "@!:%-.,_";     /* conservative! */
        const char *t;
        int ch, first;
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-10-11 15:07:59 UTC
Package removed.