Re: [fsverity-utils RFC PATCH] Add libfsverity_enable() API

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

 



On 2020-11-13 14:35:27 +0000, luca.boccassi@xxxxxxxxx wrote:
> diff --git a/lib/enable.c b/lib/enable.c
> new file mode 100644
> index 0000000..ad86cc5
> --- /dev/null
> +++ b/lib/enable.c

...

> +static bool open_file(struct filedes *file, const char *filename, int flags, int mode)
> +{
> +	file->fd = open(filename, flags, mode);
> +	if (file->fd < 0) {
> +		libfsverity_error_msg("can't open '%s' for %s", filename,
> +				(flags & O_ACCMODE) == O_RDONLY ? "reading" :
> +				(flags & O_ACCMODE) == O_WRONLY ? "writing" :
> +				"reading and writing");
> +		return false;
> +	}
> +	file->name = strdup(filename);

Hmm we should probably check for NULL.

> +	return true;
> +}

(Otherwise, I cannot really comment on the patch...)


Marcus



[Index of Archives]     [linux Cryptography]     [Asterisk App Development]     [PJ SIP]     [Gnu Gatekeeper]     [IETF Sipping]     [Info Cyrus]     [ALSA User]     [Fedora Linux Users]     [Linux SCTP]     [DCCP]     [Gimp]     [Yosemite News]     [Deep Creek Hot Springs]     [Yosemite Campsites]     [ISDN Cause Codes]

  Powered by Linux