All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert (git)" <dgilbert@redhat.com>
To: qemu-devel@nongnu.org
Cc: vgoyal@redhat.com
Subject: [PULL 5/5] virtiofsd: Error on bad socket group name
Date: Tue, 26 Oct 2021 11:29:33 +0100	[thread overview]
Message-ID: <20211026102933.103139-6-dgilbert@redhat.com> (raw)
In-Reply-To: <20211026102933.103139-1-dgilbert@redhat.com>

From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>

Make the '--socket-group=' option fail if the group name is unknown:

./tools/virtiofsd/virtiofsd .... --socket-group=zaphod
vhost socket: unable to find group 'zaphod'

Reported-by: Xiaoling Gao <xiagao@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20211014122554.34599-1-dgilbert@redhat.com>
Reviewed-by: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
 tools/virtiofsd/fuse_virtio.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tools/virtiofsd/fuse_virtio.c b/tools/virtiofsd/fuse_virtio.c
index baead08b28..60b96470c5 100644
--- a/tools/virtiofsd/fuse_virtio.c
+++ b/tools/virtiofsd/fuse_virtio.c
@@ -988,6 +988,13 @@ static int fv_create_listen_socket(struct fuse_session *se)
                          "vhost socket failed to set group to %s (%d): %m\n",
                          se->vu_socket_group, g->gr_gid);
             }
+        } else {
+            fuse_log(FUSE_LOG_ERR,
+                     "vhost socket: unable to find group '%s'\n",
+                     se->vu_socket_group);
+            close(listen_sock);
+            umask(old_umask);
+            return -1;
         }
     }
     umask(old_umask);
-- 
2.31.1



  parent reply	other threads:[~2021-10-26 11:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-26 10:29 [PULL 0/5] virtiofs queue Dr. David Alan Gilbert (git)
2021-10-26 10:29 ` [PULL 1/5] virtiofsd: xattr mapping add a new type "unsupported" Dr. David Alan Gilbert (git)
2021-10-26 10:29 ` [PULL 2/5] virtiofsd: Remove unused virtio_fs_config definition Dr. David Alan Gilbert (git)
2021-10-26 10:29 ` [PULL 3/5] virtiofsd: Add a helper to send element on virtqueue Dr. David Alan Gilbert (git)
2021-10-26 10:29 ` [PULL 4/5] virtiofsd: Add a helper to stop all queues Dr. David Alan Gilbert (git)
2021-10-26 10:29 ` Dr. David Alan Gilbert (git) [this message]
2021-10-26 17:12 ` [PULL 0/5] virtiofs queue Richard Henderson

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=20211026102933.103139-6-dgilbert@redhat.com \
    --to=dgilbert@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=vgoyal@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.