Re: cron: better error checking of random values

2023-05-06 Thread Todd C . Miller
Now that the random range changes are committed I would like to revisit this diff. This fixes two issues with the parsing of random values: 1) Garbage after a random value is now detected. This fixes a bug in the random range parsing that handles the optional final number. For example:

Re: cron: better error checking of random values

2023-05-05 Thread Mark Jamsek
On 23-05-05 10:41AM, Todd C. Miller wrote: > On Fri, 05 May 2023 16:13:01 +1000, Mark Jamsek wrote: > > > I found kn's attempted syntax intuitive though; it feels like a natural > > extension of the existing random and step syntax. I also assumed ~/15 > > would run every 15 minutes starting with a

Re: cron: better error checking of random values

2023-05-05 Thread Todd C . Miller
On Fri, 05 May 2023 16:13:01 +1000, Mark Jamsek wrote: > I found kn's attempted syntax intuitive though; it feels like a natural > extension of the existing random and step syntax. I also assumed ~/15 > would run every 15 minutes starting with a random minute, and since > discovering it didn't wor

Re: cron: better error checking of random values

2023-05-05 Thread Peter Hessler
On 2023 May 05 (Fri) at 16:13:01 +1000 (+1000), Mark Jamsek wrote: :On 23-05-04 05:40PM, Todd C. Miller wrote: :> On Thu, 04 May 2023 21:41:26 -, Klemens Nanni wrote: :> :> > On Thu, May 04, 2023 at 03:30:30PM -0600, Todd C. Miller wrote: :> > > This fixes two issues with the parsing of random

Re: cron: better error checking of random values

2023-05-05 Thread Klemens Nanni
On Thu, May 04, 2023 at 05:40:10PM -0600, Todd C. Miller wrote: > I'm fairly certain that doesn't do what you think it does. When I > tested it "~/10" behaved the same as "~". The step value is not > even parsed. Oh I see, it is actually picking a random minute and ignores steps, so entries run

Re: cron: better error checking of random values

2023-05-04 Thread Mark Jamsek
On 23-05-04 05:40PM, Todd C. Miller wrote: > On Thu, 04 May 2023 21:41:26 -, Klemens Nanni wrote: > > > On Thu, May 04, 2023 at 03:30:30PM -0600, Todd C. Miller wrote: > > > This fixes two issues with the parsing of random values: > > > > > > 1) A random value with a step is now rejected. Fo

Re: cron: better error checking of random values

2023-05-04 Thread Todd C . Miller
On Thu, 04 May 2023 21:41:26 -, Klemens Nanni wrote: > On Thu, May 04, 2023 at 03:30:30PM -0600, Todd C. Miller wrote: > > This fixes two issues with the parsing of random values: > > > > 1) A random value with a step is now rejected. For example: > > > > ~/10* * * * echo invalid >

Re: cron: better error checking of random values

2023-05-04 Thread Klemens Nanni
On Thu, May 04, 2023 at 03:30:30PM -0600, Todd C. Miller wrote: > This fixes two issues with the parsing of random values: > > 1) A random value with a step is now rejected. For example: > > ~/10* * * * echo invalid I've ben using ~/10 to randomly distribute four similar tasks so that t

cron: better error checking of random values

2023-05-04 Thread Todd C . Miller
This fixes two issues with the parsing of random values: 1) A random value with a step is now rejected. For example: ~/10* * * * echo invalid 0~59/10 * * * * echo invalid 10~/10 * * * * echo invalid ~40/10 * * * * echo invalid Previously, the '/' would just be discarde