qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Juan Quintela <quintela@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 01/72] fix virtfs
Date: Thu, 18 Oct 2012 09:26:42 +0200	[thread overview]
Message-ID: <1350545303-22754-2-git-send-email-quintela@redhat.com> (raw)
In-Reply-To: <1350545303-22754-1-git-send-email-quintela@redhat.com>

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

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);
-- 
1.7.11.7

      reply	other threads:[~2012-10-18  7:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-18  7:26 [Qemu-devel] [PATCH 00/30] Migration thread 20121017 edition Juan Quintela
2012-10-18  7:26 ` Juan Quintela [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1350545303-22754-2-git-send-email-quintela@redhat.com \
    --to=quintela@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).