[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 05/16] virtiofsd: Fix check of chown()'s return value
From: |
Laurent Vivier |
Subject: |
[PULL 05/16] virtiofsd: Fix check of chown()'s return value |
Date: |
Sat, 15 May 2021 12:03:24 +0200 |
From: Greg Kurz <groug@kaod.org>
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: f6698f2b03b0 ("tools/virtiofsd: add support for --socket-group")
Signed-off-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <162040394890.714971.15502455176528384778.stgit@bahia.lan>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
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 1170f375a57a..9efdbd8ffd0a 100644
--- a/tools/virtiofsd/fuse_virtio.c
+++ b/tools/virtiofsd/fuse_virtio.c
@@ -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);
}
}
--
2.31.1
- [PULL 00/16] Trivial branch for 6.1 patches, Laurent Vivier, 2021/05/15
- [PULL 06/16] qapi: spelling fix (addtional), Laurent Vivier, 2021/05/15
- [PULL 02/16] hw/virtio: Pass virtio_feature_get_config_size() a const argument, Laurent Vivier, 2021/05/15
- [PULL 01/16] backends/tpm: Replace qemu_mutex_lock calls with QEMU_LOCK_GUARD, Laurent Vivier, 2021/05/15
- [PULL 03/16] virtio-blk: Constify VirtIOFeature feature_sizes[], Laurent Vivier, 2021/05/15
- [PULL 04/16] virtio-net: Constify VirtIOFeature feature_sizes[], Laurent Vivier, 2021/05/15
- [PULL 05/16] virtiofsd: Fix check of chown()'s return value,
Laurent Vivier <=
- [PULL 10/16] cutils: fix memory leak in get_relocated_path(), Laurent Vivier, 2021/05/15
- [PULL 07/16] hw/gpio/aspeed: spelling fix (addtional), Laurent Vivier, 2021/05/15
- [PULL 11/16] hw/mem/meson: Fix linking sparse-mem device with fuzzer, Laurent Vivier, 2021/05/15
- [PULL 14/16] target/sh4: Return error if CPUClass::get_phys_page_debug() fails, Laurent Vivier, 2021/05/15
- [PULL 16/16] target/avr: Ignore unimplemented WDR opcode, Laurent Vivier, 2021/05/15
- [PULL 08/16] hw/timer/etraxfs_timer: Convert to 3-phase reset (Resettable interface), Laurent Vivier, 2021/05/15
- [PULL 09/16] hw/rtc/mc146818rtc: Convert to 3-phase reset (Resettable interface), Laurent Vivier, 2021/05/15
- [PULL 13/16] multi-process: Avoid logical AND of mutually exclusive tests, Laurent Vivier, 2021/05/15
- [PULL 12/16] hw/pci-host: Do not build gpex-acpi.c if GPEX is not selected, Laurent Vivier, 2021/05/15
- [PULL 15/16] hw/avr/atmega.c: use the avr51 cpu for atmega1280, Laurent Vivier, 2021/05/15