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
This commit is contained in:
parent
483c6da3a2
commit
37cd6c20db
@ -315,6 +315,9 @@ load_entry(file, error_func, pw, envp)
|
||||
goto eof;
|
||||
}
|
||||
|
||||
/* need to have consumed blanks when checking options below */
|
||||
Skip_Blanks(ch, file)
|
||||
unget_char(ch, file);
|
||||
#ifdef LOGIN_CAP
|
||||
if ((s = strrchr(username, '/')) != NULL) {
|
||||
*s = '\0';
|
||||
|
Loading…
Reference in New Issue
Block a user