[libvirt] [PATCH v3 2/2] m4: Add warning when running QEMU as root

Andrea Bolognani posted 2 patches 6 years, 10 months ago
[libvirt] [PATCH v3 2/2] m4: Add warning when running QEMU as root
Posted by Andrea Bolognani 6 years, 10 months ago
Running QEMU as root is a pretty bad idea, so try to make the
user aware of that as part of the configure summary.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
 m4/virt-driver-qemu.m4 | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/m4/virt-driver-qemu.m4 b/m4/virt-driver-qemu.m4
index 385d5307a9..eeb96f6ee5 100644
--- a/m4/virt-driver-qemu.m4
+++ b/m4/virt-driver-qemu.m4
@@ -112,5 +112,10 @@ AC_DEFUN([LIBVIRT_DRIVER_RESULT_QEMU], [
 ])
 
 AC_DEFUN([LIBVIRT_RESULT_QEMU_PRIVILEGES], [
-  LIBVIRT_RESULT([QEMU], [$QEMU_USER:$QEMU_GROUP])
+  if test "$QEMU_USER" = "root"; then
+    LIBVIRT_RESULT([QEMU], [$QEMU_USER:$QEMU_GROUP],
+                   [!!! running QEMU as root is strongly discouraged !!!])
+  else
+    LIBVIRT_RESULT([QEMU], [$QEMU_USER:$QEMU_GROUP])
+  fi
 ])
-- 
2.20.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v3 2/2] m4: Add warning when running QEMU as root
Posted by Daniel P. Berrangé 6 years, 10 months ago
On Tue, Mar 26, 2019 at 06:01:49PM +0100, Andrea Bolognani wrote:
> Running QEMU as root is a pretty bad idea, so try to make the
> user aware of that as part of the configure summary.
> 
> Signed-off-by: Andrea Bolognani <abologna@redhat.com>
> ---
>  m4/virt-driver-qemu.m4 | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list