From: Thibault Godouet Date: Sun, 3 Feb 2013 10:34:53 +0000 (+0000) Subject: Inline runas wouldn't work with Vixie-cron style shortcut lines. X-Git-Tag: ver3_1_2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b1e1aa6343b390693a40fa63479a82046c5fd908;p=thirdparty%2Ffcron.git Inline runas wouldn't work with Vixie-cron style shortcut lines. --- 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);