From 2dd4f594eadb89a856f734f6a40c4769fbde8fde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Wed, 29 Jan 2025 15:37:46 +0000 Subject: [PATCH] tools: add sysusers file to create 'virtlogin' group MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We previously added a sysusers file, but missed the 'virtlogin' group. This group is used to make the virt-login-shell binary setgid, so we shoudl be registering that too. It must be done in a separate sysusers file, however, since it is packaged separately from the daemons. Fixes: a2c3e390f7bedf36f4ddc544d09fe3b8772c5c6f Reviewed-by: Jiri Denemark Signed-off-by: Daniel P. Berrangé --- libvirt.spec.in | 3 +++ tools/libvirt-login-shell.sysusers.conf | 1 + tools/meson.build | 7 +++++++ 3 files changed, 11 insertions(+) create mode 100644 tools/libvirt-login-shell.sysusers.conf diff --git a/libvirt.spec.in b/libvirt.spec.in index 5c5d36966d..5825de7cf1 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1095,6 +1095,8 @@ Wireshark dissector plugin for better analysis of libvirt RPC traffic. %package login-shell Summary: Login shell for connecting users to an LXC container Requires: libvirt-libs = %{version}-%{release} +# For uid creation during pre +Requires(pre): shadow-utils %description login-shell Provides the set-uid virt-login-shell binary that is used to @@ -2533,6 +2535,7 @@ exit 0 %attr(4750, root, virtlogin) %{_bindir}/virt-login-shell %{_libexecdir}/virt-login-shell-helper %config(noreplace) %{_sysconfdir}/libvirt/virt-login-shell.conf +%{_sysusersdir}/libvirt-login-shell.conf %{_mandir}/man1/virt-login-shell.1* %endif diff --git a/tools/libvirt-login-shell.sysusers.conf b/tools/libvirt-login-shell.sysusers.conf new file mode 100644 index 0000000000..5459fd99ce --- /dev/null +++ b/tools/libvirt-login-shell.sysusers.conf @@ -0,0 +1 @@ +g virtlogin - diff --git a/tools/meson.build b/tools/meson.build index 3f4e2a3c4b..4d5c9e4bba 100644 --- a/tools/meson.build +++ b/tools/meson.build @@ -123,6 +123,13 @@ if conf.has('WITH_LOGIN_SHELL') ) install_data('virt-login-shell.conf', install_dir: sysconfdir / 'libvirt') + + # Install the sysuser config for the setgid binary + install_data( + 'libvirt-login-shell.sysusers.conf', + install_dir: sysusersdir, + rename: [ 'libvirt-login-shell.conf' ], + ) endif if host_machine.system() == 'windows'