On Sun, Nov 15, 2015 at 1:25 PM, Todd C. Miller
<[email protected]> wrote:
> On Sun, 15 Nov 2015 09:41:38 -0700, "Todd C. Miller" wrote:
>
>> This cleans up the remaining uses of stderr and perror() and uses
>> warn/err and/or syslog depending on whether stderr is hooked up at
>> the time. Also removes closelog() which is not needed since we are
>> headed for exec.
>
> Here's the diff -uw version for easier reading.
...
This one looks odd to me:
> if (auth_approval(as, lc, pw->pw_name, "cron") <= 0) {
> - fprintf(stderr, "approval failed for %s\n",
> - pw->pw_name);
> + warnx("approval failed for %s", pw->pw_name);
> + syslog(LOG_ERR, "(%s) APPROVAL FAILED (%s)",
> + pw->pw_name, pw->pw_name);
> _exit(EXIT_FAILURE);
> }
The syslog() there repeats the username; I guess you're following the
"(%s) %s (%s)" form of cron's logging, but I would be inclined to put
"cron" in the second parens as that's the approval it's trying to get.
"(guenther) APPROVAL FAILED (cron)" makes more sense to me than
"(guenther) APPROVAL FAILED (guenther)".
But that's below the noise floor. ok guenther@