From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH qemu-kvm] virtfs-proxy: fix build with F18 Date: Thu, 28 Feb 2013 11:00:22 +0200 Message-ID: <20130228090021.GS23616@redhat.com> References: <20130228070047.GA22780@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, "Aneesh Kumar K.V" To: "Michael S. Tsirkin" Return-path: Received: from mx1.redhat.com ([209.132.183.28]:61665 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751912Ab3B1JGm (ORCPT ); Thu, 28 Feb 2013 04:06:42 -0500 Content-Disposition: inline In-Reply-To: <20130228070047.GA22780@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Feb 28, 2013 at 09:00:47AM +0200, Michael S. Tsirkin wrote: > 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. > qemu-kvm is no more. It has ceased to be. Not sure what do you want me to do with the patch. > Signed-off-by: Michael S. Tsirkin > --- > 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 -- Gleb.