tools: add sysusers file to create 'virtlogin' group

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 <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2025-01-29 15:37:46 +00:00
parent ff77c2d596
commit 2dd4f594ea
3 changed files with 11 additions and 0 deletions

View File

@ -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

View File

@ -0,0 +1 @@
g virtlogin -

View File

@ -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'