From: Eric Blake <eblake@redhat.com>
To: Manos Pitsidianakis <el13635@mail.ntua.gr>,
qemu-block@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [Qemu-block] [PATCH] block: curl: Allow passing cookies via QCryptoSecret
Date: Tue, 9 May 2017 14:52:38 -0500 [thread overview]
Message-ID: <61e0501a-6ebc-cef0-5a2b-a26b4481eceb@redhat.com> (raw)
In-Reply-To: <20170509194344.za4abntjp3tkrilt@post>
[-- Attachment #1: Type: text/plain, Size: 1015 bytes --]
On 05/09/2017 02:43 PM, Manos Pitsidianakis wrote:
> On Thu, May 04, 2017 at 04:00:06PM +0200, Peter Krempa wrote:
>> + cookie_secret = qemu_opt_get(opts, CURL_BLOCK_OPT_COOKIE_SECRET);
>> +
>> + if (cookie && cookie_secret) {
>> + error_setg(errp,
>> + "curl driver cannot handle both cookie and cookie
>> secret");
>> + goto out_noclean;
>> + }
>> +
>> + if (cookie_secret) {
>> + s->cookie = qcrypto_secret_lookup_as_utf8(cookie_secret, errp);
>> + if (!s->cookie) {
>> + goto out_noclean;
>> + }
>> + } else {
>> + s->cookie = g_strdup(cookie);
>> + }
>
> There's no check here for if both cookie and cookie_secret are NULL.
Is that a problem? s->cookie ends up as NULL (thanks to g_strdup()
semantics), which merely means there's no cookie to be sent after all.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2017-05-09 19:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-04 14:00 [Qemu-devel] [PATCH] block: curl: Allow passing cookies via QCryptoSecret Peter Krempa
2017-05-04 14:22 ` Eric Blake
2017-05-04 14:34 ` Daniel P. Berrange
2017-05-09 15:06 ` [Qemu-devel] [Qemu-block] " Kevin Wolf
2017-05-09 15:44 ` Jeff Cody
2017-05-09 19:43 ` Manos Pitsidianakis
2017-05-09 19:52 ` Eric Blake [this message]
2017-05-09 20:03 ` Manos Pitsidianakis
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=61e0501a-6ebc-cef0-5a2b-a26b4481eceb@redhat.com \
--to=eblake@redhat.com \
--cc=el13635@mail.ntua.gr \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/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;
as well as URLs for NNTP newsgroup(s).