/[base]/head/usr.sbin/cron/crontab/crontab.c
ViewVC logotype

Log of /head/usr.sbin/cron/crontab/crontab.c

Parent Directory Parent Directory | Revision Log Revision Log


Links to HEAD: (view) (download) (annotate)
Sticky Revision:

Revision 310329 - (view) (download) (annotate) - [select for diffs]
Modified Tue Dec 20 17:12:17 2016 UTC (7 years, 6 months ago) by cem
File length: 14872 byte(s)
Diff to previous 305269
Add a 'force' option for non-interactive crontab removal

Add a '-f' option to force crontab '-r' to be non-interactive.

Submitted by:	Sam Gwydir <sam at samgwydir.com>
Reviewed by:	me, wblock (previous version)
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D8815


Revision 305269 - (view) (download) (annotate) - [select for diffs]
Modified Fri Sep 2 03:15:54 2016 UTC (7 years, 10 months ago) by emaste
File length: 14801 byte(s)
Diff to previous 295672
cron: use existing maximum username constant MAXLOGNAME

Previously cron had its own maximum username length limit, which was
smaller than the system's MAXLOGNAME. This could lead to crontab -u
updating the wrong user's crontab (if the name was truncated, and
matched another user).

PR:		212305
Reported by:	Andrii Kuzik
Reviewed by:	allanjude, jilles
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D7747


Revision 295672 - (view) (download) (annotate) - [select for diffs]
Modified Tue Feb 16 21:19:39 2016 UTC (8 years, 5 months ago) by pfg
File length: 14776 byte(s)
Diff to previous 292606
crontab: ftruncate() with ftello() instead of ftell().

Obtained from:	OpenBSD (CVS rev. 1.47)


Revision 292606 - (view) (download) (annotate) - [select for diffs]
Modified Tue Dec 22 15:30:26 2015 UTC (8 years, 6 months ago) by pfg
File length: 14775 byte(s)
Diff to previous 239991
crontab: properly free an entry

This should close memory leak.

Obtained from:	OpenBSD (rev. 1.62)
CID:		271773


Revision 239991 - (view) (download) (annotate) - [select for diffs]
Modified Sat Sep 1 14:45:15 2012 UTC (11 years, 10 months ago) by ed
File length: 14769 byte(s)
Diff to previous 238024
Rework all non-contributed files that use `struct timezone'.

This structure is not part of POSIX. According to POSIX, gettimeofday()
has the following prototype:

	int gettimeofday(struct timeval *restrict tp, void *restrict tzp);

Also, POSIX states that gettimeofday() shall return 0 (as long as tzp is
not used). Remove dead error handling code. Also use NULL for a
nul-pointer instead of integer 0.

While there, change all pieces of code that only use tv_sec to use
time(3), as this provides less overhead.


Revision 238024 - (view) (download) (annotate) - [select for diffs]
Modified Mon Jul 2 20:27:37 2012 UTC (12 years ago) by jhb
File length: 14790 byte(s)
Diff to previous 232202
Add a one second sleep before touching the spool directory.  If the touch
occurs in the same second as the earlier operations to create the temporary
file and the cron(8) daemon is rescans the spool directory during that
second, then the daemon may miss a cron edit and not properly update its
internal database.

MFC after:	1 month


Revision 232202 - (view) (download) (annotate) - [select for diffs]
Modified Mon Feb 27 05:49:00 2012 UTC (12 years, 4 months ago) by delphij
File length: 14496 byte(s)
Diff to previous 185041
Drop setuid status while doing file operations to prevent potential
information leak.  This changeset is intended to be a minimal one
to make backports easier.

Reviewed by:	kevlo, remko
MFC after:	1 week


Revision 185041 - (view) (download) (annotate) - [select for diffs]
Modified Tue Nov 18 00:39:50 2008 UTC (15 years, 8 months ago) by matteo
File length: 14250 byte(s)
Diff to previous 184809
Be more precise and use sizeof(tn)
Pointed out by: glewis@

MFC after:	3 days


Revision 184809 - (view) (download) (annotate) - [select for diffs]
Modified Mon Nov 10 06:35:30 2008 UTC (15 years, 8 months ago) by matteo
File length: 14249 byte(s)
Diff to previous 184784
Make usr.sbin/cron/crontab and usr.sbin/cron/lib WARNS=3 clean

Tested with: make universe

MFC after:	3 days


Revision 184784 - (view) (download) (annotate) - [select for diffs]
Modified Sun Nov 9 09:01:09 2008 UTC (15 years, 8 months ago) by matteo
File length: 14257 byte(s)
Diff to previous 184780
Revert to previous revision.
I should not commit anything at 3.50 AM.
In addition to danfe's comments, I got others.
I'll work on a better version of the patch.


Revision 184780 - (view) (download) (annotate) - [select for diffs]
Modified Sun Nov 9 07:34:11 2008 UTC (15 years, 8 months ago) by matteo
File length: 14704 byte(s)
Diff to previous 184779
Don't leave files in /var/cront/tabs when interrupted

PR:		17363
MFC after:	3 days


Revision 184779 - (view) (download) (annotate) - [select for diffs]
Modified Sun Nov 9 06:44:53 2008 UTC (15 years, 8 months ago) by matteo
File length: 14238 byte(s)
Diff to previous 184706
Be paranoid and use snprintf

PR:		bin/122137
Submitted by:	Steven Kreuzer <skreuzer@exit2shell.com>
MFC after:	3 days


Revision 184706 - (view) (download) (annotate) - [select for diffs]
Modified Thu Nov 6 04:53:02 2008 UTC (15 years, 8 months ago) by matteo
File length: 14147 byte(s)
Diff to previous 173412
Be paranoid and zero out passwd

PR:	122070
Submitted by:	Steven Kreuzer <skreuzer@exit2shell.com>
Reminded by:    gnn@
MFC after:	3 days


Revision 173412 - (view) (download) (annotate) - [select for diffs]
Modified Wed Nov 7 10:53:41 2007 UTC (16 years, 8 months ago) by kevlo
File length: 14053 byte(s)
Diff to previous 161964
Cleanup of userland __P use


Revision 161964 - (view) (download) (annotate) - [select for diffs]
Modified Sun Sep 3 17:52:19 2006 UTC (17 years, 10 months ago) by ru
File length: 14095 byte(s)
Diff to previous 154166
Use a #define to refer to /etc/crontab.


Revision 154166 - (view) (download) (annotate) - [select for diffs]
Modified Tue Jan 10 05:56:32 2006 UTC (18 years, 6 months ago) by brooks
File length: 14100 byte(s)
Diff to previous 135242
/etc/crontab is similar enough to parse as correct if you run
"crontab /etc/crontab", but not the same format due to the who field.
Add some limited anti-foot-shooting support and refuse to load
/etc/crontab as someone's crontab.  Users wishing shoot their foot in
this manner may copy /etc/crontab elsewhere. :)

MFC After:	1 week


Revision 135242 - (view) (download) (annotate) - [select for diffs]
Modified Tue Sep 14 19:01:19 2004 UTC (19 years, 10 months ago) by dds
File length: 13902 byte(s)
Diff to previous 135174
Ensure that edits that do not span a clock tick are not lost.

PR:	bin/22612
MT5:	4 weeks
MT4:	2 weeks


Revision 135174 - (view) (download) (annotate) - [select for diffs]
Modified Mon Sep 13 21:04:30 2004 UTC (19 years, 10 months ago) by dds
File length: 13700 byte(s)
Diff to previous 135165
Refactoring: move two similar code blocks into a seprate function.


Revision 135165 - (view) (download) (annotate) - [select for diffs]
Modified Mon Sep 13 18:39:04 2004 UTC (19 years, 10 months ago) by dds
File length: 13991 byte(s)
Diff to previous 104326
Fix for the following behavior:
$ crontab -e
[Add an entry with an error in the crontab file.]
crontab: errors in crontab file, can't install
Do you want to retry the same edit? yes
[Exit the editor without any changes.]
crontab: no changes made to crontab
[Entry is lost.]

Now crontab will loop until the error is fixed, or the
user answers no.


Revision 104326 - (view) (download) (annotate) - [select for diffs]
Modified Tue Oct 1 22:59:11 2002 UTC (21 years, 9 months ago) by dd
File length: 13871 byte(s)
Diff to previous 79452
Actually use the exitstatus value that we maintain.

PR:		43562
Submitted by:	Marc Olzheim <marcolz@ilse.nl>


Revision 79452 - (view) (download) (annotate) - [select for diffs]
Modified Mon Jul 9 09:24:06 2001 UTC (23 years ago) by brian
File length: 13862 byte(s)
Diff to previous 78321
Fix the type of the NULL arg to execl()

Idea from: Theo de Raadt <deraadt@openbsd.org>


Revision 78321 - (view) (download) (annotate) - [select for diffs]
Modified Sat Jun 16 03:16:52 2001 UTC (23 years, 1 month ago) by peter
File length: 13854 byte(s)
Diff to previous 75456
Where is the pointy hat?  Fix cut/paste error.  (hey, it compiled! :-)


Revision 75456 - (view) (download) (annotate) - [select for diffs]
Modified Fri Apr 13 01:45:22 2001 UTC (23 years, 3 months ago) by peter
File length: 13863 byte(s)
Diff to previous 69793
Remove the 'DO NOT EDIT THIS FILE' crud that we spit out with 'crontab -l'.
Otherwise, "crontab -l > file; vi file; crontab file" adds an extra set
of "DO NOT EDIT" markers each and every time which is a bit silly.


Revision 69793 - (view) (download) (annotate) - [select for diffs]
Modified Sat Dec 9 09:35:55 2000 UTC (23 years, 7 months ago) by obrien
File length: 13545 byte(s)
Diff to previous 68388
Add `_PATH_DEVZERO'.
Use _PATH_* where where possible.


Revision 68388 - (view) (download) (annotate) - [select for diffs]
Modified Mon Nov 6 11:17:37 2000 UTC (23 years, 8 months ago) by dwmalone
File length: 13522 byte(s)
Diff to previous 67127
Attempt to fix problem with users being able to convince the crontab
program to read any file which is a valid crontab file.

The fix is based on that used in NetBSD and OpenBSD - we keep the
file open while the user is editing it. This means that files must
be edited in place. Cron attempts to warn you if your editor does
not do this. The fact that the file must be edited in place is also
noted in the man page.

This patch has been confirmed to work by atleast one person on
-security and has been tested locally.

Obtained from:	OpenBSD


Revision 67127 - (view) (download) (annotate) - [select for diffs]
Modified Sun Oct 15 00:35:34 2000 UTC (23 years, 9 months ago) by paul
File length: 13261 byte(s)
Diff to previous 50479
Since -e and -r are right next to each other prompt before clobbering
a crontab you were planning to edit.


Revision 50479 - (view) (download) (annotate) - [select for diffs]
Modified Sat Aug 28 01:35:59 1999 UTC (24 years, 10 months ago) by peter
File length: 13028 byte(s)
Diff to previous 29452
$Id$ -> $FreeBSD$


Revision 29452 - (view) (download) (annotate) - [select for diffs]
Modified Mon Sep 15 06:39:25 1997 UTC (26 years, 10 months ago) by charnier
File length: 13069 byte(s)
Diff to previous 24428
Use err(3). Rewrote man page in mdoc format.


Revision 24428 - (view) (download) (annotate) - [select for diffs]
Modified Mon Mar 31 05:11:47 1997 UTC (27 years, 3 months ago) by imp
File length: 14173 byte(s)
Diff to previous 22997
compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.


Revision 22997 - (view) (download) (annotate) - [select for diffs]
Modified Sat Feb 22 16:15:28 1997 UTC (27 years, 4 months ago) by peter
File length: 14126 byte(s)
Diff to previous 21673
Revert $FreeBSD$ to $Id$


Revision 21673 - (view) (download) (annotate) - [select for diffs]
Modified Tue Jan 14 07:20:47 1997 UTC (27 years, 6 months ago) by jkh
File length: 14131 byte(s)
Diff to previous 20573
Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.


Revision 20573 - (view) (download) (annotate) - [select for diffs]
Modified Tue Dec 17 00:55:20 1996 UTC (27 years, 7 months ago) by pst
File length: 14172 byte(s)
Diff to previous 17439
Replace my "inane" usage of snprintf to copy strings with strncpy as
used by OpenBSD.  (Quite frankly, I think it's perfectly reasonable to
use snprintf to copy strings, given that the semantics for strncpy()
are utterly idiotic and there is no POSIX sstrncpy().)

While I'm at it, incorporate some of OpenBSD's bugfixes to cron.

NOT for 2.2


Revision 17439 - (view) (download) (annotate) - [select for diffs]
Modified Mon Aug 5 00:50:02 1996 UTC (27 years, 11 months ago) by pst
File length: 13893 byte(s)
Diff to previous 17436
Gratuitous whitespace change so that I can commit the source of the recent
buffer overflow patch.
Reviewed by:	pst
Submitted by:	Dave Andersen <angio@aros.net>


Revision 17436 - (view) (download) (annotate) - [select for diffs]
Modified Mon Aug 5 00:31:27 1996 UTC (27 years, 11 months ago) by pst
File length: 13899 byte(s)
Diff to previous 15161
Fix up some more buffer overflow problems.


Revision 15161 - (view) (download) (annotate) - [select for diffs]
Modified Tue Apr 9 20:28:16 1996 UTC (28 years, 3 months ago) by scrappy
File length: 13831 byte(s)
Diff to previous 8857
Quick patch to fix a bug where issuing ctl-c while in crontab -e
leaves editor running in background (PR: bin/751)

Submitted by:	 candy@fct.kgc.co.jp (Toshihiro Kanda)


Revision 8857 - (view) (download) (annotate) - [select for diffs]
Modified Tue May 30 03:57:47 1995 UTC (29 years, 1 month ago) by rgrimes
File length: 13687 byte(s)
Diff to previous 5176
Remove trailing whitespace.


Revision 5176 - (view) (download) (annotate) - [select for diffs]
Modified Wed Dec 21 11:06:08 1994 UTC (29 years, 7 months ago) by ache
File length: 13692 byte(s)
Diff to previous 2312
Now crontab works not only for vi editor, i.e. refers to
file name not to file fd


Revision 2312 - (view) (download) (annotate) - [select for diffs]
Modified Sat Aug 27 13:43:04 1994 UTC (29 years, 10 months ago) by jkh
File length: 13703 byte(s)
Copied from: cvs2svn/branches/cron/usr.sbin/cron/crontab/crontab.c revision 2311
Diff to previous 2311
This commit was generated by cvs2svn to compensate for changes in r2311,
which included commits to RCS files with non-trunk default branches.


Revision 2311 - (view) (download) (annotate) - [select for diffs]
Added Sat Aug 27 13:43:04 1994 UTC (29 years, 10 months ago) by jkh
Original Path: cvs2svn/branches/cron/usr.sbin/cron/crontab/crontab.c
File length: 13703 byte(s)
Paul Vixie's cron, version 3.0.  Munged into bmake format.  If this goes
well, expect our two seperate directories for cron and crontab to go away
shortly.
Submitted by:	jkh


This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.

  Diffs between and
  Type of Diff should be a

  ViewVC Help
Powered by ViewVC 1.1.27