Bug 132135 - [PATCH] etc/crontab: HOME setting overrides
Summary: [PATCH] etc/crontab: HOME setting overrides
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: conf (show other bugs)
Version: 7.1-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: brian
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-26 19:30 UTC by leres
Modified: 2009-07-05 07:30 UTC (History)
0 users

See Also:


Attachments
file.diff (227 bytes, patch)
2009-02-26 19:30 UTC, leres
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description leres 2009-02-26 19:30:00 UTC
	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."

Fix: The attached patch removes the offending line.

===================================================================
RCS file: RCS/crontab,v
retrieving revision 1.1
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.
Comment 1 brian freebsd_committer 2009-06-14 07:36:47 UTC
State Changed
From-To: open->patched

Fixed in r194170.  I'll MFC in 3 weeks.
Comment 2 dfilter freebsd_committer 2009-06-14 07:37:33 UTC
Author: brian
Date: Sun Jun 14 06:37:19 2009
New Revision: 194170
URL: http://svn.freebsd.org/changeset/base/194170

Log:
  Remove HOME= - this has surprised me several times in the past.
  
  PR:		132135
  Submitted by:	Craig Leres
  MFC after:	3 weeks

Modified:
  head/etc/crontab

Modified: head/etc/crontab
==============================================================================
--- head/etc/crontab	Sun Jun 14 06:36:50 2009	(r194169)
+++ head/etc/crontab	Sun Jun 14 06:37:19 2009	(r194170)
@@ -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
 #
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
Comment 3 dfilter freebsd_committer 2009-07-05 07:28:38 UTC
Author: brian
Date: Sun Jul  5 06:28:23 2009
New Revision: 195348
URL: http://svn.freebsd.org/changeset/base/195348

Log:
  MFC: Remove HOME=
  
  PR:		132135

Modified:
  stable/7/etc/   (props changed)
  stable/7/etc/crontab

Modified: stable/7/etc/crontab
==============================================================================
--- stable/7/etc/crontab	Sun Jul  5 06:24:06 2009	(r195347)
+++ stable/7/etc/crontab	Sun Jul  5 06:28:23 2009	(r195348)
@@ -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
 #
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
Comment 4 brian freebsd_committer 2009-07-05 07:28:43 UTC
State Changed
From-To: patched->closed

Fix merged to stable/7 - r195348 


Comment 5 brian freebsd_committer 2009-07-05 07:28:43 UTC
Responsible Changed
From-To: freebsd-bugs->brian

Fix merged to stable/7 - r195348