diffstat for libvirt-dbus-1.4.0 libvirt-dbus-1.4.0

 changelog |    7 +++++++
 control   |    3 ++-
 postinst  |   53 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 62 insertions(+), 1 deletion(-)

diff -Nru libvirt-dbus-1.4.0/debian/changelog libvirt-dbus-1.4.0/debian/changelog
--- libvirt-dbus-1.4.0/debian/changelog	2020-11-06 10:47:28.000000000 +0000
+++ libvirt-dbus-1.4.0/debian/changelog	2021-04-23 10:25:41.000000000 +0000
@@ -1,3 +1,10 @@
+libvirt-dbus (1.4.0-2ubuntu0.21.04.1) hirsute; urgency=medium
+
+  * d/postinst: add libvirtdbus to group libvirt to be able to access the
+    sockets of libvirtd (LP: #1802005)
+
+ -- Christian Ehrhardt <christian.ehrhardt@canonical.com>  Fri, 23 Apr 2021 12:25:41 +0200
+
 libvirt-dbus (1.4.0-2) unstable; urgency=medium
 
   * [3d0e87e] patches: Backport recent fixes (Closes: #971171)
diff -Nru libvirt-dbus-1.4.0/debian/control libvirt-dbus-1.4.0/debian/control
--- libvirt-dbus-1.4.0/debian/control	2020-11-06 10:47:28.000000000 +0000
+++ libvirt-dbus-1.4.0/debian/control	2021-04-23 10:25:41.000000000 +0000
@@ -1,7 +1,8 @@
 Source: libvirt-dbus
 Section: admin
 Priority: optional
-Maintainer: Debian Libvirt Maintainers <pkg-libvirt-maintainers@lists.alioth.debian.org>
+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
+XSBC-Original-Maintainer: Debian Libvirt Maintainers <pkg-libvirt-maintainers@lists.alioth.debian.org>
 Uploaders: Andrea Bolognani <eof@kiyuko.org>
 Homepage: https://libvirt.org/
 Vcs-Git: https://salsa.debian.org/libvirt-team/libvirt-dbus.git
diff -Nru libvirt-dbus-1.4.0/debian/postinst libvirt-dbus-1.4.0/debian/postinst
--- libvirt-dbus-1.4.0/debian/postinst	1970-01-01 00:00:00.000000000 +0000
+++ libvirt-dbus-1.4.0/debian/postinst	2021-04-23 10:25:02.000000000 +0000
@@ -0,0 +1,53 @@
+#!/bin/sh
+# postinst script for libvirt-dbus
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <postinst> `configure' <most-recently-configured-version>
+#        * <old-postinst> `abort-upgrade' <new version>
+#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+#          <new-version>
+#        * <postinst> `abort-remove'
+#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+#          <failed-install-package> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see https://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+    configure)
+    ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+    ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+case "$1" in
+    configure)
+        # after users are created by dh_sysuser: add user to libvirt group
+        # if policykit isn't used to manage access to libvirt sockets then it
+        # will use group based permission management with the group "libvirt"
+        # being the one to gain access.
+        # libvirt-dbus is safe via /usr/share/dbus-1/system.d/org.libvirt.conf
+        # so we can allow that by default
+        if getent group libvirt >/dev/null; then
+            usermod -a -G libvirt libvirtdbus
+        fi
+    ;;
+esac
+
+exit 0
