public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH qemu-kvm] virtfs-proxy: fix build with F18
@ 2013-02-28  7:00 Michael S. Tsirkin
  2013-02-28  8:58 ` Aneesh Kumar K.V
  2013-02-28  9:00 ` Gleb Natapov
  0 siblings, 2 replies; 3+ messages in thread
From: Michael S. Tsirkin @ 2013-02-28  7:00 UTC (permalink / raw)
  To: kvm, gleb; +Cc: Aneesh Kumar K.V

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.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-02-28  9:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-28  7:00 [PATCH qemu-kvm] virtfs-proxy: fix build with F18 Michael S. Tsirkin
2013-02-28  8:58 ` Aneesh Kumar K.V
2013-02-28  9:00 ` Gleb Natapov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox