Propagate errors in audit code to caller instead of using fatal().
If we fail to audit an otherwise successful command, return an error from the policy. For Linux audit, sudo may be compiled with audit support but auditing may not be setup, so we don't consider that an error.
This commit is contained in:
@@ -496,7 +496,8 @@ sudoers_policy_main(int argc, char * const argv[], int pwflag, char *env_add[],
|
||||
}
|
||||
|
||||
/* Must audit before uid change. */
|
||||
audit_success(NewArgv);
|
||||
if (audit_success(NewArgv) != 0)
|
||||
goto bad;
|
||||
|
||||
/* Setup execution environment to pass back to front-end. */
|
||||
rval = sudoers_policy_exec_setup(edit_argv ? edit_argv : NewArgv,
|
||||
|
Reference in New Issue
Block a user