From: "Marcus Hüwe" <suse-tux@gmx.de>
To: luca.boccassi@gmail.com
Cc: linux-fscrypt@vger.kernel.org
Subject: Re: [fsverity-utils RFC PATCH] Add libfsverity_enable() API
Date: Fri, 13 Nov 2020 23:54:21 +0100 [thread overview]
Message-ID: <20201113225421.552sw2aguupcrvkp@linux> (raw)
In-Reply-To: <20201113143527.1097499-1-luca.boccassi@gmail.com>
On 2020-11-13 14:35:27 +0000, luca.boccassi@gmail.com 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
next prev parent reply other threads:[~2020-11-13 22:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-13 14:35 [fsverity-utils RFC PATCH] Add libfsverity_enable() API luca.boccassi
2020-11-13 22:54 ` Marcus Hüwe [this message]
2020-11-14 0:21 ` Eric Biggers
2020-11-16 11:53 ` Luca Boccassi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201113225421.552sw2aguupcrvkp@linux \
--to=suse-tux@gmx.de \
--cc=linux-fscrypt@vger.kernel.org \
--cc=luca.boccassi@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox