From owner-freebsd-arch@FreeBSD.ORG Mon Jun 23 05:08:21 2014 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7DF77D25 for ; Mon, 23 Jun 2014 05:08:21 +0000 (UTC) Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 00B772CAC for ; Mon, 23 Jun 2014 05:08:20 +0000 (UTC) Received: from [192.168.0.100] ([87.139.233.65]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0LdZAI-1WGDnd0JxC-00ijqD; Mon, 23 Jun 2014 07:08:11 +0200 Message-ID: <53A7B645.3000801@gmx.de> Date: Mon, 23 Jun 2014 07:08:21 +0200 From: olli hauer User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: =?UTF-8?B?VG9tZWsgV2HFgmFzemVr?= Subject: Re: Improve cron(8) References: In-Reply-To: X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:Gxd3hIkR5lQii2D2OuvOBZvxEPfatOb4U3ga0UC5hz0/YD1pTD2 /bCup11AZF1WtaKVsPJF4yhrzPdEZKPKAOeqNL7fJ7F/l0+Xyt1d2TLb8wnVDWeecifvc5+ AGnbSOsKZ+w1SMOwtrHGDJkeVwrbVBAcYYTt5apKZcOPxHhSnCoTtu+NYySESzGDkR50Iz5 At+WOy34j6vLJi0dDq1RA== Cc: freebsd-arch@freebsd.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jun 2014 05:08:21 -0000 On 2014-06-13 09:04, Eitan Adler wrote: > +arch since hackers@ seems to be silent. > > On 11 June 2014 23:56, Tomek WaƂaszek wrote: >> Hello, >> I saw on the FreeBSD Ideas page topic about cron :). >> I've started updating the 'original' FreeBSD cron from sources to vixi cron >> 4.1. I think (well I hope :P) most of the features that were done in >> FreeBSD cron are now ported into vixi cron 4.1, there are unfortunately >> some missing features at the moment: >> - @every_second - this need to be done >> - -s and -o, in vixi cron 4.1 daylight time switches are enabled by >> default, at the moment there is no -s and -o options. So you need to remove >> '-s' from the cron rc script >> >> I've also added one feature from OpenBSD, crontab is poking cron using >> unix-domain socket so we don't need to have suid on crontab. >> >> Path is in the attachment. I'm testing it on my FreeBSD box and it looks >> good but anyway don't try it on production machines :). >> >> After the installation we have to do a few things: >> - Add crontab group >> - Change group to crontab on /var/cron/tabs >> - Add sticky bit on /var/cron/tabs >> - Add group write permissions on /var/cron/tabs >> >> This is still work in progress but if someone could have a look on this and >> give me some feedback it would be great. >> >> Regards, >> Tomasz Walaszek >> Hi Thomaz, having only a quick look into the diff but see there are also changes from snprintf to sprintf :( see the following snippet ). Anyway it seems no one is looking into PR's against cron so I like the idea to start with updating and looking into the PR's for cron. - if (mailto) { - register char **env; - auto char mailcmd[MAX_COMMAND]; - auto char hostname[MAXHOSTNAMELEN]; - - (void) gethostname(hostname, MAXHOSTNAMELEN); - (void) snprintf(mailcmd, sizeof(mailcmd), - MAILARGS, MAILCMD); + if (mailto && safe_p(usernm, mailto)) { + char **env; + char mailcmd[MAX_COMMAND]; + char hostname[MAXHOSTNAMELEN]; + + gethostname(hostname, MAXHOSTNAMELEN); + if (strlens(MAILFMT, MAILARG, NULL) + 1 + >= sizeof mailcmd) { + fprintf(stderr, "mailcmd too long\n"); + (void) _exit(ERROR_EXIT); + } + (void)sprintf(mailcmd, MAILFMT, MAILARG); -- olli