All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kurz <groug@kaod.org>
To: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [PATCH] virtiofsd: Fix check of chown()'s return value
Date: Mon, 10 May 2021 16:23:00 +0200	[thread overview]
Message-ID: <20210510162300.546af5cb@bahia.lan> (raw)
In-Reply-To: <YJlAN+eLMASsJxsL@work-vm>

On Mon, 10 May 2021 15:16:23 +0100
"Dr. David Alan Gilbert" <dgilbert@redhat.com> wrote:

> * Greg Kurz (groug@kaod.org) wrote:
> > Otherwise you always get this warning when using --socket-group=users
> > 
> >  vhost socket failed to set group to users (100)
> > 
> > While here, print out the error if chown() fails.
> > 
> > Signed-off-by: Greg Kurz <groug@kaod.org>
> 
> probably needs a fixes:  but yes.
> 

Fixes: f6698f2b03b0 ("tools/virtiofsd: add support for --socket-group")

> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> 
> > ---
> >  tools/virtiofsd/fuse_virtio.c |    4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/tools/virtiofsd/fuse_virtio.c b/tools/virtiofsd/fuse_virtio.c
> > index 3e13997406bf..638d3ffe2f8a 100644
> > --- a/tools/virtiofsd/fuse_virtio.c
> > +++ b/tools/virtiofsd/fuse_virtio.c
> > @@ -978,9 +978,9 @@ static int fv_create_listen_socket(struct fuse_session *se)
> >      if (se->vu_socket_group) {
> >          struct group *g = getgrnam(se->vu_socket_group);
> >          if (g) {
> > -            if (!chown(se->vu_socket_path, -1, g->gr_gid)) {
> > +            if (chown(se->vu_socket_path, -1, g->gr_gid) == -1) {
> >                  fuse_log(FUSE_LOG_WARNING,
> > -                         "vhost socket failed to set group to %s (%d)\n",
> > +                         "vhost socket failed to set group to %s (%d): %m\n",
> >                           se->vu_socket_group, g->gr_gid);
> >              }
> >          }
> > 
> > 



  reply	other threads:[~2021-05-10 14:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-07 16:12 [PATCH] virtiofsd: Fix check of chown()'s return value Greg Kurz
2021-05-07 16:19 ` Eric Blake
2021-05-07 16:34   ` Greg Kurz
2021-05-10 14:16 ` Dr. David Alan Gilbert
2021-05-10 14:23   ` Greg Kurz [this message]
2021-05-13 15:49     ` Laurent Vivier

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=20210510162300.546af5cb@bahia.lan \
    --to=groug@kaod.org \
    --cc=dgilbert@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@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 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.