From nobody Sun May 19 03:12:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1553601000112475.18673280023427; Tue, 26 Mar 2019 04:50:00 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C75DD83F3D; Tue, 26 Mar 2019 11:49:57 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8F84A5DAAD; Tue, 26 Mar 2019 11:49:56 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 9565F18005C9; Tue, 26 Mar 2019 11:49:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x2QBnW3t000476 for ; Tue, 26 Mar 2019 07:49:32 -0400 Received: by smtp.corp.redhat.com (Postfix) id E89E61001E6F; Tue, 26 Mar 2019 11:49:32 +0000 (UTC) Received: from kinshicho.brq.redhat.com (unknown [10.43.2.212]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 702961001E74 for ; Tue, 26 Mar 2019 11:49:30 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Tue, 26 Mar 2019 12:49:28 +0100 Message-Id: <20190326114928.11033-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] m4: Change default QEMU credentials to qemu:qemu X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 26 Mar 2019 11:49:58 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Our current defaults are root:wheel on FreeBSD and macOS, root:root everywhere else. Looking at what downstream distributions actually do, we can see that these defaults are overriden the vast majority of the time, with a number of variations showing up in the wild: * qemu:qemu -> Used by CentOS, Fedora, Gentoo, OpenSUSE, RHEL and... As it turns out, our very own spec file :) * libvirt-qemu:libvirt-qemu -> Used by Debian. * libvirt-qemu:kvm -> Used by Ubuntu. * nobody:nobody -> Used by Arch Linux. Based on the above, we can conclude that qemu:qemu are the preferred credentials to be used when spawning a QEMU process, while our current defaults get very little love. Changing our defaults aligns with what most downstreams are actually doing, promotes running QEMU under a non-root user - which is a very good idea anyway - and shields random people building libvirt from source from unwittingly running their guests as root. Note that there are a very small number of downstreams that don't override our defaults: Alpine Linux, FreeBSD and macOS. Of those, only Alpine Linux is affected by this change; all three should arguably have been setting --with-qemu-user and --with-qemu-group explicitly regardless of this change. Signed-off-by: Andrea Bolognani --- Proof that I'm not making any of this up ;) * Alpine Linux https://github.com/alpinelinux/aports/blob/master/main/libvirt/APKBUILD * Arch Linux https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=3Dlibvirt-git#n1= 13 * CentOS https://git.centos.org/blob/rpms!libvirt.git/8d86411e5109d791edf49c7f43= c08a06b80896af/SPECS!libvirt.spec#L226 * Debian https://salsa.debian.org/libvirt-team/libvirt/blob/debian/sid/debian/ru= les#L94-95 * Fedora https://src.fedoraproject.org/rpms/libvirt/blob/f29/f/libvirt.spec#_204 * FreeBSD https://github.com/freebsd/freebsd-ports/blob/master/devel/libvirt/Make= file * Gentoo https://github.com/gentoo/gentoo/blob/master/app-emulation/libvirt/libv= irt-5.1.0.ebuild#L296-L297 * macOS (Homebrew) https://github.com/Homebrew/homebrew-core/blob/master/Formula/libvirt.rb * OpenSUSE https://build.opensuse.org/package/view_file/openSUSE:Leap:15.0:Update/= libvirt/libvirt.spec?expand=3D1 * Ubuntu https://git.launchpad.net/ubuntu/+source/libvirt/tree/debian/rules?h=3D= ubuntu/disco#n99 * Upstream https://libvirt.org/git/?p=3Dlibvirt.git;a=3Dblob;f=3Dlibvirt.spec.in;h= =3Db7a35a0fb14f3360eb795c4ec9b0e46171d2e4ec;hb=3DHEAD#l196 m4/virt-driver-qemu.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/m4/virt-driver-qemu.m4 b/m4/virt-driver-qemu.m4 index cb05c34265..2a1b86e891 100644 --- a/m4/virt-driver-qemu.m4 +++ b/m4/virt-driver-qemu.m4 @@ -44,8 +44,8 @@ AC_DEFUN([LIBVIRT_DRIVER_CHECK_QEMU], [ default_qemu_user=3Droot default_qemu_group=3Dwheel else - default_qemu_user=3Droot - default_qemu_group=3Droot + default_qemu_user=3Dqemu + default_qemu_group=3Dqemu fi =20 if test "x$with_qemu_user" =3D "xplatform dependent" ; then --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list