Re: [PATCH ima-evm-utils v4 02/17] log and reset 'errno' after failure to open non-critical files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2022-11-02 at 17:02 -0400, Stefan Berger wrote:
> 
> On 11/1/22 16:17, Mimi Zohar wrote:
> > Define a log_errno_reset macro to emit the errno string at or near the
> > time of error, similar to the existing log_errno macro, but also reset
> > errno to avoid dangling or duplicate errno messages on exit.
> > 
> > The initial usage is for non-critical file open failures.
> 
> After looking just at the fopen() in evmctl.c at the end of this
> series there are some that are left over that show no error message
> (read_binary_bios_measurements) others that still use log_err() then.
> Should they not all be converted/extended and use log_errno_reset()?
> 

No, log_errno_reset() is meant for the specific case where the program
continues to execute, but the errno message is delayed and emitted on
program exit.  In the case of read_binary_bios_measurements(), the
caller emits an error message and immediately exits.  There's no delay
between the error and the errno message.

Calling log_err() to emit an error mesage and then exiting seems to be
fine.

-- 
thanks,

Mimi




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux Kernel]     [Linux Kernel Hardening]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux