]> granicus.if.org Git - fcron/commitdiff
Inline runas wouldn't work with Vixie-cron style shortcut lines.
authorThibault Godouet <fcron@free.fr>
Sun, 3 Feb 2013 10:34:53 +0000 (10:34 +0000)
committerThibault Godouet <fcron@free.fr>
Sun, 3 Feb 2013 10:34:53 +0000 (10:34 +0000)
fileconf.c

index 2b446ab1b7b5f3656c89c78686eaf0b48bff3a0f..3605a7dbf7a72b46d72670726684ede1f0f3b6c6 100644 (file)
@@ -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);