]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tools: add sysusers file to create 'virtlogin' group
authorDaniel P. Berrangé <berrange@redhat.com>
Wed, 29 Jan 2025 15:37:46 +0000 (15:37 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Mon, 3 Feb 2025 14:45:09 +0000 (14:45 +0000)
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>
libvirt.spec.in
tools/libvirt-login-shell.sysusers.conf [new file with mode: 0644]
tools/meson.build

index 5c5d36966d7172b111a85dfeae4c8a616d2ce341..5825de7cf1a2326974af6b5d1513aa63f9da0a9e 100644 (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
 
diff --git a/tools/libvirt-login-shell.sysusers.conf b/tools/libvirt-login-shell.sysusers.conf
new file mode 100644 (file)
index 0000000..5459fd9
--- /dev/null
@@ -0,0 +1 @@
+g virtlogin -
index 3f4e2a3c4bfe6d575470e77117c414f1d8fc87c6..4d5c9e4bbacc459390c01c3c9fe20c1a9ce157dc 100644 (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'