From: Tomas Mraz Date: Tue, 11 Jun 2013 17:53:59 +0000 (+0200) Subject: Log failures in load_user(). X-Git-Tag: cronie1.4.11~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=acdd31211d9f67c8caafccc994b439d4aaa6af5d;p=cronie Log failures in load_user(). --- diff --git a/src/user.c b/src/user.c index ebe435b..20c0d96 100644 --- a/src/user.c +++ b/src/user.c @@ -77,8 +77,10 @@ load_user (int crontab_fd, struct passwd *pw, const char *uname, Debug(DPARS, ("load_user()\n")); /* file is open. build user entry, then read the crontab file. */ - if ((u = (user *) malloc (sizeof (user))) == NULL) + if ((u = (user *) malloc (sizeof (user))) == NULL) { + save_errno = errno; goto done; + } memset(u, 0, sizeof(*u)); if (((u->name = strdup(fname)) == NULL) @@ -129,6 +131,8 @@ load_user (int crontab_fd, struct passwd *pw, const char *uname, done: if (status == TRUE) { + log_it(uname, getpid(), "FAILED", "loading cron table", + save_errno); free_user(u); u = NULL; }