Received: from eggs.gnu.org ([208.118.235.92]:52801) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TLyyi-0006iR-Bc for qemu-devel@nongnu.org; Wed, 10 Oct 2012 12:17:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TLyyZ-0004rF-5h for qemu-devel@nongnu.org; Wed, 10 Oct 2012 12:17:48 -0400 Message-ID: <50759F9E.3060800@redhat.com> Date: Wed, 10 Oct 2012 18:17:34 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1349868762-10021-1-git-send-email-pbonzini@redhat.com> <50759EEC.8070308@weilnetz.de> In-Reply-To: <50759EEC.8070308@weilnetz.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] virtfs-proxy-helper: check return code of setfsgid/setfsuid List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Weil Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org Il 10/10/2012 18:14, Stefan Weil ha scritto: >> >> >> diff --git a/fsdev/virtfs-proxy-helper.c b/fsdev/virtfs-proxy-helper.c >> index f9a8270..b34a84a 100644 >> --- a/fsdev/virtfs-proxy-helper.c >> +++ b/fsdev/virtfs-proxy-helper.c >> @@ -290,8 +290,12 @@ static int setfsugid(int uid, int gid) >> CAP_DAC_OVERRIDE, >> }; >> - setfsgid(gid); >> - setfsuid(uid); >> + if (setfsgid(gid) != 0) { >> + return -1; >> + } > > Wouldn't setfsgid(gid) == gid be also ok? Of course, it should be < 0. I have no idea how to test this thing... Paolo