From patchwork Thu Nov 1 21:06:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Fix build error in virtfs-proxy-helper Date: Thu, 01 Nov 2012 11:06:30 -0000 From: Anthony Liguori X-Patchwork-Id: 196380 Message-Id: <1351803990-12983-1-git-send-email-aliguori@us.ibm.com> To: qemu-devel@nongnu.org Cc: Gerhard Wiesinger , Anthony Liguori , "M. Mohan Kumar" 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);