Check restore_perms() return value in all cases, pushing the

return value back up the call stack.
This commit is contained in:
Todd C. Miller
2015-06-25 11:12:36 -06:00
parent c5ed416a70
commit 81f94499bf
10 changed files with 154 additions and 86 deletions

View File

@@ -243,8 +243,10 @@ log_denial(int status, bool inform_user)
if (def_logfile && !do_logfile(logline))
rval = false;
if (uid_changed)
restore_perms();
if (uid_changed) {
if (!restore_perms())
rval = false; /* XXX - return -1 instead? */
}
free(logline);
@@ -385,8 +387,10 @@ log_allowed(int status)
if (def_logfile && !do_logfile(logline))
rval = false;
if (uid_changed)
restore_perms();
if (uid_changed) {
if (!restore_perms())
rval = false; /* XXX - return -1 instead? */
}
free(logline);