6dfc81ea910bf3 introduced a shortcut in allowed(). The first part of the && conditionals can never be true since then. Remove the unreachable code. --- src/security.c | 13 ------------- 1 file changed, 13 deletions(-)
diff --git a/src/security.c b/src/security.c index d61fb2a..7d0ad9a 100644 --- a/src/security.c +++ b/src/security.c @@ -710,7 +710,6 @@ int allowed(const char *username, const char *allow_file, const char *deny_file) { FILE *fp; int isallowed; - char buf[128];
if (getuid() == 0) return TRUE; @@ -718,22 +717,10 @@ int allowed(const char *username, const char *allow_file, if ((fp = fopen(allow_file, "r")) != NULL) { isallowed = in_file(username, fp, FALSE); fclose(fp); - if ((getuid() == 0) && (!isallowed)) { - snprintf(buf, sizeof (buf), - "root used -u for user %s not in cron.allow", username); - log_it("crontab", getpid(), "warning", buf, 0); - isallowed = TRUE; - } } else if ((fp = fopen(deny_file, "r")) != NULL) { isallowed = !in_file(username, fp, FALSE); fclose(fp); - if ((getuid() == 0) && (!isallowed)) { - snprintf(buf, sizeof (buf), - "root used -u for user %s in cron.deny", username); - log_it("crontab", getpid(), "warning", buf, 0); - isallowed = TRUE; - } } #ifdef WITH_AUDIT if (isallowed == FALSE) { -- 2.30.2