Date: Thu, 26 Feb 2009 11:07:14 -0800 From: Craig Leres <leres@ee.lbl.gov> To: freebsd-gnats-submit@FreeBSD.org Subject: misc/132135: [PATCH] etc/crontab: HOME setting overrides Message-ID: <49A6E862.8010706@ee.lbl.gov> Resent-Message-ID: <200902261930.n1QJU1k4024783@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 132135 >Category: misc >Synopsis: [PATCH] etc/crontab: HOME setting overrides >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Feb 26 19:30:00 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Craig Leres >Release: FreeBSD 7.1-RELEASE i386 >Organization: Lawrence Berkeley National Laboratory >Environment: FreeBSD hot.ee.lbl.gov 7.1-RELEASE FreeBSD 7.1-RELEASE #1: Tue Jan 27 19:59:30 PST 2009 leres@hot.ee.lbl.gov:/usr/src/7.1-RELEASE/sys/amd64/compile/LBLSMP amd64 >Description: For some reason, a line to set HOME was added to the default crontab back in revision 1.2 (back in July 1994!) This breaks any scripts or programs that use HOME to reference the home directory of the current account. I did a little investigation as to why this wasn't a problem in my older 6.2-RELEASE systems; it looks like there is some code to prevent HOME in the crontab from overriding the value derived from the passwd file that is not in the 7.1-RELEASE version of cron. In the end, I checked with Paul Vixie and he said, "yes that's a bug in freebsd's default crontab." >How-To-Repeat: Add a crontab entry similar to this: * * * * * leres echo $USER HOME is $HOME and then wait for email that says: leres HOME is /var/log which is clearly wrong. >Fix: The attached patch removes the offending line. --------------040007040402080303020201 Content-Type: text/plain; name="patch.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch.txt" =================================================================== RCS file: RCS/crontab,v retrieving revision 1.1 diff -u -r1.1 crontab --- crontab 2009/02/26 19:03:36 1.1 +++ crontab 2009/02/26 19:03:39 @@ -4,7 +4,6 @@ # SHELL=/bin/sh PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin -HOME=/var/log # #minute hour mday month wday who command # --------------040007040402080303020201-- >Release-Note: >Audit-Trail: >Unformatted: This is a multi-part message in MIME format. --------------040007040402080303020201 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?49A6E862.8010706>