From b1e1aa6343b390693a40fa63479a82046c5fd908 Mon Sep 17 00:00:00 2001 From: Thibault Godouet Date: Sun, 3 Feb 2013 10:34:53 +0000 Subject: [PATCH] Inline runas wouldn't work with Vixie-cron style shortcut lines. --- fileconf.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/fileconf.c b/fileconf.c index 2b446ab..3605a7d 100644 --- a/fileconf.c +++ b/fileconf.c @@ -1343,6 +1343,19 @@ read_shortcut(char *ptr, cf_t * cf) return 0; } + /* The next char must be a space (no other option allowed when using + * a shortcut: if the user wants to use options, they should use the + * native fcron lines */ + if ( ! isspace((int) *ptr) ) { + fprintf(stderr, "%s:%d: No space after shortcut: skipping line.\n", + file_name, line); + goto exiterr; + } + + /* skip spaces before the username / shell command */ + while (isspace((int) *ptr)) + ptr++; + /* check for inline runas */ ptr = check_username(ptr, cf, cl); -- 2.47.3