From patchwork Thu Nov 1 21:06:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony Liguori X-Patchwork-Id: 196380 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C3C192C034C for ; Fri, 2 Nov 2012 08:07:01 +1100 (EST) Received: from localhost ([::1]:34493 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TU1yb-0005pa-Tf for incoming@patchwork.ozlabs.org; Thu, 01 Nov 2012 17:06:57 -0400 Received: from eggs.gnu.org ([208.118.235.92]:37779) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TU1yS-0005pB-9Y for qemu-devel@nongnu.org; Thu, 01 Nov 2012 17:06:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TU1yR-00015f-Bq for qemu-devel@nongnu.org; Thu, 01 Nov 2012 17:06:48 -0400 Received: from e28smtp08.in.ibm.com ([122.248.162.8]:56641) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TU1yQ-00014Y-MN for qemu-devel@nongnu.org; Thu, 01 Nov 2012 17:06:47 -0400 Received: from /spool/local by e28smtp08.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 2 Nov 2012 02:36:37 +0530 Received: from d28relay03.in.ibm.com (9.184.220.60) by e28smtp08.in.ibm.com (192.168.1.138) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 2 Nov 2012 02:36:34 +0530 Received: from d28av04.in.ibm.com (d28av04.in.ibm.com [9.184.220.66]) by d28relay03.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id qA1L6XCF33620026 for ; Fri, 2 Nov 2012 02:36:34 +0530 Received: from d28av04.in.ibm.com (loopback [127.0.0.1]) by d28av04.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id qA22aOGo029471 for ; Fri, 2 Nov 2012 13:36:24 +1100 Received: from titi.austin.ibm.com (titi.austin.ibm.com [9.41.105.211]) by d28av04.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id qA22aMPO029403; Fri, 2 Nov 2012 13:36:23 +1100 From: Anthony Liguori To: qemu-devel@nongnu.org Date: Thu, 1 Nov 2012 16:06:30 -0500 Message-Id: <1351803990-12983-1-git-send-email-aliguori@us.ibm.com> X-Mailer: git-send-email 1.8.0 x-cbid: 12110121-2000-0000-0000-000009B3E901 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 122.248.162.8 Cc: Gerhard Wiesinger , Anthony Liguori , "M. Mohan Kumar" Subject: [Qemu-devel] [PATCH] Fix build error in virtfs-proxy-helper X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org I don't have a kernel with the necessary syscalls so this is completely untested. Cc: "M. Mohan Kumar" Cc: Gerhard Wiesinger Reported-by: Gerhard Wiesinger Signed-off-by: Anthony Liguori --- fsdev/virtfs-proxy-helper.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fsdev/virtfs-proxy-helper.c b/fsdev/virtfs-proxy-helper.c index f9a8270..bc50e3e3 100644 --- a/fsdev/virtfs-proxy-helper.c +++ b/fsdev/virtfs-proxy-helper.c @@ -286,12 +286,16 @@ static int setfsugid(int uid, int gid) * We still need DAC_OVERRIDE because we don't change * supplementary group ids, and hence may be subjected DAC rules */ + int ret; cap_value_t cap_list[] = { CAP_DAC_OVERRIDE, }; - setfsgid(gid); - setfsuid(uid); + ret = setfsgid(gid); + g_assert(ret != -1); + + ret = setfsuid(uid); + g_assert(ret != -1); if (uid != 0 || gid != 0) { return do_cap_set(cap_list, ARRAY_SIZE(cap_list), 0);