📄 changes
字号:
Vixie Cron Changes from V2 to V3Paul Vixie29-Dec-1993The crontab command now conforms to POSIX 1003.2. This means that when youinstall it, if you have any "crontab" command lines floating around in shellscripts (such as /etc/rc or /etc/rc.local), you will need to change them.I have integrated several changes made by BSDi for their BSD/386 operatingsystem; these were offerred to me before I started consulting for them, soit is safe to say that they were intended for publication. Most notably,the name of the cron daemon has changed from "crond" to "cron". This wasdone for compatibility with 4.3BSD. Another change made for the same reasonis the ability to read in an /etc/crontab file which has an extra field ineach entry, between the time fields and the command. This field is a username, and it permits the /etc/crontab command to contain commands which areto be run by any user on the system. /etc/crontab is not "installed" viathe crontab(1) command; it is automatically read at startup time and it willbe reread whenever it changes.I also added a "-e" option to crontab(1). Nine people also sent me diffsto add this option, but I had already implemented it on my own. I actuallyreleased an interrim version (V2.2, I think) for limited testing, and got achance to fix a bad security bug in the "-e" option thanks to XXX.The daemon used to be extraordinarily sloppy in its use of file descriptors.A heck of a lot of them were left open in spawned jobs, which caused problemsfor the daemon and also caused problems with the spawned jobs if they were shell scripts since "sh" and "csh" have traditionally used hidden filedescriptors to pass information to subshells, and cron was causing them tothink they were subshells. If you had trouble with "sh" or "csh" scripts inV2, chances are good that V3 will fix your problems.About a dozen people have reminded me that I forgot to initialize"crontab_fd" in database.c. Keith Cantrell was the first, so he gets thepoint.Steve Simmons reminded me that once an account has been deleted from thesystem, "crontab -u USER -d" will not work. My solution is to suggest toall of you that before you delete a user's account, you first delete thatuser's crontab file if any. From cron's point of view, usernames can neverbe treated as arbitrary strings. Either they are valid user names, or theyare not. I will not make an exception for the "-d" case, for securityreasons that I consider reasonable. It is trivial for a root user to deletethe entry by hand if necessary.Dan O'Neil reminded me that I forgot to reset "log_fd" in misc.c. A lot ofothers also reminded me of this, but Dan gets the point. I didn't fix itthere, since the real bug was that it should have been open in the parent.Peter Kabal reminded me that I forgot to "#ifdef DEBUGGING" some code inmisc.c. Hans Trompert actually told me first, but Peter sent the patch sohe gets the point.Russell Nelson told me that I'd forgotten to "#include <syslog.h>" in misc.c,which explains why a lot of other people complained that it wasn't usingsyslog even when they configured it that way :-). Steve Simmons told mefirst, though, so he gets the point.An interrim version of the daemon tried to "stat" every file beforeexecuting it; this turned out to be a horribly bad idea since finding thename of a file from a shell command is a hard job (that's why we haveshells, right?) I removed this bogus code. Dave Burgess gets the point.Dennis R. Conley sent a suggestion for MMDF systems, which I've added to thecomments in cron.h.Mike Heisler noted that I use comments in the CONVERSION file which aredocumented as illegal in the man pages. Thanks, Mike.Irving Wolfe sent me some very cheerful changes for a NeXT system, but Iconsider the system itself broken and I can't bring myself to #ifdef forsomething as screwed up as this system seems to be. However, various othersdid send me smaller patches which appear to have cause cron to build and runcorrectly on (the latest) NeXT machines, with or without the "-posix" CFLAG.Irving also asked for a per-job MAILTO, and this was finally added later whenI integrated the BSD/386 changes contributed by BSDi, and generalized some ofthe parsing.Lots of folks complained that the autogenerated "Date:" header wasn't inARPA format. I didn't understand this -- either folks will use Sendmail andnot generate a Date: at all (since Sendmail will do it), or folks will usesomething other than Sendmail which won't care about Date: formats. ButI've "fixed" it anyway...Several people suggested that "*" should be able to take a "/step". One personsuggested that "N/step" ought to mean "N-last/step", but that's stretching thingsa bit far. "*/step" seems quite intuitive to me, so I've added it. Colin Plumbsent in the first and most polite request for this feature.As with every release of Cron, BIND, and seemingly everything else I do, oneuser stands out with the most critical but also the most useful analysis.Cron V3's high score belongs to Peter Holzer, who sent in the nicest lookingpatch for the "%" interpretation problem and also helped me understand atricky bit of badness in the "log_fd" problem.agulbra@flode.nvg.unit.no wins the honors for being the first to point out thenasty security hole in "crontab -r". 'Nuff said.Several folks pointed out that log_it() needed to exist even if logging wasdisabled. Some day I will create a tool that will compile a subsystem withevery possible combination and permutation of #ifdef options, but meanwhilethanks to everybody.job_runqueue() was using storage after freeing it, since Jordan told me backin 1983 that C let you do that, and I believed him in 1986 when I wrote allthis junk. Linux was the first to die from this error, and the Linux peoplesent me the most amazing, um, collection of patches for this problem. Thanksfor all the fish.Jeremy Bettis reminded me that popen() isn't safe. I grabbed Ken Arnold's version of popen/pclose from the ftpd and hacked it to taste. We're safe now,from this at least.Branko Lankester sent me a very timely and helpful fix for a looming securityproblem in my "crontab -e" implementation.--------Vixie Cron Changes from V1 to V2Paul Vixie8-Feb-1988Many changes were made in a rash of activity about six months ago, the exactlist of which is no longer clear in my memory. I know that V1 used a filecalled POKECRON in /usr/spool/cron to tell it that it was time to re-readall the crontab files; V2 uses the modtime the crontab directory as a flag tocheck out the crontab files; those whose modtime has changed will be re-read,and the others left alone. Note that the crontab(1) command will do a utimescall to make sure the mtime of the dir changes, since the filename/inode willoften remain the same after a replacement and the mtime wouldn't change inthat case.8-Feb-88: made it possible to use much larger environment variable strings. V1 allowed 100 characters; V2 allows 1000. This was needed for PATH variables on some systems. Thanks to Toerless Eckert for this idea. E-mail: UUCP: ...pyramid!fauern!faui10!eckert16-Feb-88: added allow/deny, moved /usr/spool/cron/crontabs to /usr/lib/cron/tabs. allow and deny are /usr/lib/cron/{allow,deny}, since the sysv naming for this depends on 'at' using the same dir, which would be stupid (hint: use /usr/{lib,spool}/at).22-Feb-88: made it read the spool directory for crontabs and look each one up using getpwnam() rather than reading all passwds with getpwent() and trying to open each crontab.9-Dec-88: made it sync to :00 after the minute, makes cron predictable. added logging to /var/cron/log.14-Apr-90: (actually, changes since December 1989) fixed a number of bugs reported from the net and from John Gilmore. added syslog per Keith Bostic. security features including not being willing to run a command owned or writable by other than the owner of the crontab 9not working well yet)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -