]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
cron: consume blanks in system crontabs before options
authorOleksandr Tymoshenko <gonzo@FreeBSD.org>
Thu, 4 Mar 2021 07:23:31 +0000 (23:23 -0800)
committerOleksandr Tymoshenko <gonzo@FreeBSD.org>
Thu, 4 Mar 2021 07:23:31 +0000 (23:23 -0800)
commit37cd6c20dbcf251e38d6dfb9d3e02022941f6fc7
tree542d9239eec3cd638e1dfbf7685a4f1043acddce
parent483c6da3a20b2064cd655f7cb19e6b98dee677ff
cron: consume blanks in system crontabs before options

On system crontabs, multiple blanks are not being consumed after reading the
username. This change adds blank consumption before parsing any -[qn] options.
Without this change, an entry like:

  * * * * * username  -n true  # Two spaces between username and option.

will fail, as the shell will try to execute (' -n true'), while an entry like:

  * * * * * username -n true   # One space between username and option.

works as expected (executes 'true').

For user crontabs, this is not an issue as the preceding (day of week
or @shortcut) processing consumes any leading whitespace.

PR: 253699
Submitted by: Eric A. Borisch <eborisch@gmail.com>
MFC after: 1 week
usr.sbin/cron/lib/entry.c