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