I don't have a kernel with the necessary syscalls so this is completely untested.
Cc: "M. Mohan Kumar" <[email protected]> Cc: Gerhard Wiesinger <[email protected]> Reported-by: Gerhard Wiesinger <[email protected]> Signed-off-by: Anthony Liguori <[email protected]> --- 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); -- 1.8.0
