Skip to content
Snippets Groups Projects
Commit 4962b312 authored by Greg Kurz's avatar Greg Kurz Committed by Laurent Vivier
Browse files

virtiofsd: Fix check of chown()'s return value


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.

Fixes: f6698f2b ("tools/virtiofsd: add support for --socket-group")
Signed-off-by: default avatarGreg Kurz <groug@kaod.org>
Reviewed-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <162040394890.714971.15502455176528384778.stgit@bahia.lan>
Signed-off-by: default avatarLaurent Vivier <laurent@vivier.eu>
parent 28cbc87b
No related branches found
No related tags found
No related merge requests found
......@@ -1024,9 +1024,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);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment