public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: "Michael S. Tsirkin" <mst@redhat.com>,
	kvm@vger.kernel.org, gleb@redhat.com
Subject: Re: [PATCH qemu-kvm] virtfs-proxy: fix build with F18
Date: Thu, 28 Feb 2013 14:28:54 +0530	[thread overview]
Message-ID: <87ppzk4xwx.fsf@linux.vnet.ibm.com> (raw)
In-Reply-To: <20130228070047.GA22780@redhat.com>

"Michael S. Tsirkin" <mst@redhat.com> writes:

> Ignoring return value of setfsgid(gid) and setfsuid(uid) causes
> warnings on F18. Check the return value: man page says
> glibc returns -1 on error.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
>  fsdev/virtfs-proxy-helper.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/fsdev/virtfs-proxy-helper.c b/fsdev/virtfs-proxy-helper.c
> index f9a8270..2f0d2b3 100644
> --- a/fsdev/virtfs-proxy-helper.c
> +++ b/fsdev/virtfs-proxy-helper.c
> @@ -282,6 +282,7 @@ static int send_status(int sockfd, struct iovec *iovec, int status)
>   */
>  static int setfsugid(int uid, int gid)
>  {
> +    int ret;
>      /*
>       * We still need DAC_OVERRIDE because  we don't change
>       * supplementary group ids, and hence may be subjected DAC rules
> @@ -290,8 +291,10 @@ static int setfsugid(int uid, int gid)
>          CAP_DAC_OVERRIDE,
>      };
>
> -    setfsgid(gid);
> -    setfsuid(uid);
> +    ret = setfsgid(gid);
> +    assert(ret != -1);
> +    ret = setfsuid(uid);
> +    assert(ret != -1);
>
>      if (uid != 0 || gid != 0) {
>          return do_cap_set(cap_list, ARRAY_SIZE(cap_list), 0);
> -- 
> MST


This got fixed upstream.

http://git.qemu.org/?p=qemu.git;a=commitdiff;h=9fd2ecdc8cb2dc1a8a7c57b6c9c60bc9947b6a73

-aneesh


  reply	other threads:[~2013-02-28  8:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-28  7:00 [PATCH qemu-kvm] virtfs-proxy: fix build with F18 Michael S. Tsirkin
2013-02-28  8:58 ` Aneesh Kumar K.V [this message]
2013-02-28  9:00 ` Gleb Natapov

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=87ppzk4xwx.fsf@linux.vnet.ibm.com \
    --to=aneesh.kumar@linux.vnet.ibm.com \
    --cc=gleb@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mst@redhat.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