[libvirt PATCH 3/3] qemu: virtiofs: error out if getting the group or user name fails

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Ján Tomko <jtomko@xxxxxxxxxx>
---
 src/qemu/qemu_virtiofs.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/qemu/qemu_virtiofs.c b/src/qemu/qemu_virtiofs.c
index d80cddd3ba..78897d8177 100644
--- a/src/qemu/qemu_virtiofs.c
+++ b/src/qemu/qemu_virtiofs.c
@@ -388,6 +388,9 @@ qemuVirtioFSPrepareIdMap(virDomainFSDef *fs)
     username = virGetUserName(euid);
     groupname = virGetGroupName(egid);
 
+    if (!username || !groupname)
+        return -1;
+
     fs->idmap.uidmap = g_new0(virDomainIdMapEntry, 2);
     fs->idmap.gidmap = g_new0(virDomainIdMapEntry, 2);
 
-- 
2.44.0
_______________________________________________
Devel mailing list -- devel@xxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxx




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux