Patchwork [01/72] fix virtfs

login
register
mail settings
Submitter Juan Quintela
Date Oct. 18, 2012, 7:26 a.m.
Message ID <1350545303-22754-2-git-send-email-quintela@redhat.com>
Download mbox | patch
Permalink /patch/192204/
State New
Headers show

Comments

Juan Quintela - Oct. 18, 2012, 7:26 a.m.
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 fsdev/virtfs-proxy-helper.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

Patch

diff --git a/fsdev/virtfs-proxy-helper.c b/fsdev/virtfs-proxy-helper.c
index f9a8270..771dc4e 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,14 @@  static int setfsugid(int uid, int gid)
         CAP_DAC_OVERRIDE,
     };

-    setfsgid(gid);
-    setfsuid(uid);
+    ret = setfsgid(gid);
+    if (ret < 0) {
+        return ret;
+    }
+    ret = setfsuid(uid);
+    if (ret < 0) {
+        return ret;
+    }

     if (uid != 0 || gid != 0) {
         return do_cap_set(cap_list, ARRAY_SIZE(cap_list), 0);