qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Manos Pitsidianakis <el13635@mail.ntua.gr>
To: qemu-devel@nongnu.org, qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [Qemu-block] [PATCH] block: curl: Allow passing cookies via QCryptoSecret
Date: Tue, 9 May 2017 23:03:16 +0300	[thread overview]
Message-ID: <20170509200316.hibznxhc4dph6wxy@post> (raw)
In-Reply-To: <61e0501a-6ebc-cef0-5a2b-a26b4481eceb@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1175 bytes --]

On Tue, May 09, 2017 at 02:52:38PM -0500, Eric Blake wrote:
>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.

Ah yes, g_strdup(NULL) returns NULL. Apologies for the noise.


>-- 
>Eric Blake, Principal Software Engineer
>Red Hat, Inc.           +1-919-301-3266
>Virtualization:  qemu.org | libvirt.org
>



[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

      reply	other threads:[~2017-05-09 20:03 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
2017-05-09 20:03       ` Manos Pitsidianakis [this message]

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=20170509200316.hibznxhc4dph6wxy@post \
    --to=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).