* Warns when an error occurs parsing a user crontab (See: #79037). * user.c: Drop dead code path.
It's unclear how to elegantly handle this during editing (crontab.c); at that point, it should effect a (specific) warning and prompt about "retry the same edit?". diff -u cron-3.0pl1/entry.c cron-3.0pl1/entry.c --- cron-3.0pl1/entry.c +++ cron-3.0pl1/entry.c @@ -319,7 +319,8 @@ */ ch = get_string(cmd, MAX_COMMAND, file, "\n"); - /* a file without a \n before the EOF is rude, so we'll complain... + /* complain about files ending without \n, since they might + * have been truncated. */ if (ch == EOF) { ecode = e_cmd; diff -u cron-3.0pl1/env.c cron-3.0pl1/env.c --- cron-3.0pl1/env.c +++ cron-3.0pl1/env.c @@ -146,8 +146,11 @@ filepos = ftell(f); fileline = LineNumber; skip_comments(f); - if (EOF == get_string(envstr, MAX_ENVSTR - 1, f, "\n")) + if (feof(f)) { return ERR; } + if (EOF == get_string(envstr, MAX_ENVSTR - 1, f, "\n")) { + log_it("CRON",getpid(),"DEBUG","error parsing crontab"); return (ERR); + } envstr[MAX_ENVSTR - 1] = '\0'; diff -u cron-3.0pl1/user.c cron-3.0pl1/user.c --- cron-3.0pl1/user.c +++ cron-3.0pl1/user.c @@ -208,10 +208,6 @@ */ while ((status = load_env(envstr, file)) >= OK) { switch (status) { - case ERR: - free_user(u); - u = NULL; - goto done; case FALSE: #ifdef DEBIAN err_user = fname; -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]