From 3b693a769d637ad1baddb838b28a585df775f0d0 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Thu, 1 Aug 2019 13:07:05 -0400 Subject: [PATCH] import libvirt-dbus-1.2.0-2.module+el8.1.0+2983+b2ae9c0a --- .gitignore | 1 + .libvirt-dbus.metadata | 1 + ...dbus-util-fix-virtDBusUtilDecodeUUID.patch | 44 +++++++++++ SPECS/libvirt-dbus.spec | 73 +++++++++++++++++++ 4 files changed, 119 insertions(+) create mode 100644 .gitignore create mode 100644 .libvirt-dbus.metadata create mode 100644 SOURCES/libvirt-dbus-util-fix-virtDBusUtilDecodeUUID.patch create mode 100644 SPECS/libvirt-dbus.spec diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e463050 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/libvirt-dbus-1.2.0.tar.xz diff --git a/.libvirt-dbus.metadata b/.libvirt-dbus.metadata new file mode 100644 index 0000000..6e57f86 --- /dev/null +++ b/.libvirt-dbus.metadata @@ -0,0 +1 @@ +6a7f476bc8343256e69f34642df6070be4e37b6c SOURCES/libvirt-dbus-1.2.0.tar.xz diff --git a/SOURCES/libvirt-dbus-util-fix-virtDBusUtilDecodeUUID.patch b/SOURCES/libvirt-dbus-util-fix-virtDBusUtilDecodeUUID.patch new file mode 100644 index 0000000..cdd7a90 --- /dev/null +++ b/SOURCES/libvirt-dbus-util-fix-virtDBusUtilDecodeUUID.patch @@ -0,0 +1,44 @@ +From 68b2ff91b88fd2588db1770addab2f2ccf5a1aa8 Mon Sep 17 00:00:00 2001 +Message-Id: <68b2ff91b88fd2588db1770addab2f2ccf5a1aa8@dist-git> +From: Pavel Hrdina +Date: Mon, 7 Jan 2019 14:12:15 +0100 +Subject: [PATCH] util: fix virtDBusUtilDecodeUUID + +This function is supposed to convert ASCII character into its hex +representation, however the current implementation was wrong because +the first comparison would be false for all printable characters. In +most cases it worked but for example '$' which is 0x24 in HEX would be +incorrectly converted to 0x2[ which is obviously wrong. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1647823 + +Signed-off-by: Pavel Hrdina +(cherry picked from commit f70ba7cb4dc08052f025f0217cc54a2ff36bc69d) +Reviewed-by: Andrea Bolognani +Signed-off-by: Pavel Hrdina +--- + src/util.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/src/util.c b/src/util.c +index 8c822f2..31ee959 100644 +--- a/src/util.c ++++ b/src/util.c +@@ -182,11 +182,12 @@ virtDBusUtilDecodeUUID(const gchar *uuid) + } + + static guchar +-virtDBusUtilNumToHexchar(const guchar c) ++virtDBusUtilNumToHexchar(const guchar n) + { ++ guchar c = n & 0x0f; + if (c < 10) + return '0' + c; +- return 'a' + (c & 0x0f) - 10; ++ return 'a' + c - 10; + } + + static guchar +-- +2.20.1 + diff --git a/SPECS/libvirt-dbus.spec b/SPECS/libvirt-dbus.spec new file mode 100644 index 0000000..7ca7ed8 --- /dev/null +++ b/SPECS/libvirt-dbus.spec @@ -0,0 +1,73 @@ +# -*- rpm-spec -*- + +%global glib2_version 2.44.0 +%global libvirt_version 3.0.0 +%global libvirt_glib_version 0.0.7 +%global system_user libvirtdbus + +Name: libvirt-dbus +Version: 1.2.0 +Release: 2%{?dist}%{?extra_release} +Summary: libvirt D-Bus API binding +License: LGPLv2+ +URL: https://libvirt.org/ +Source0: https://libvirt.org/sources/dbus/%{name}-%{version}.tar.xz +Patch1: libvirt-dbus-util-fix-virtDBusUtilDecodeUUID.patch + + +BuildRequires: git +BuildRequires: gcc +BuildRequires: libtool +BuildRequires: glib2-devel >= %{glib2_version} +BuildRequires: libvirt-devel >= %{libvirt_version} +BuildRequires: libvirt-glib-devel >= %{libvirt_glib_version} +BuildRequires: /usr/bin/pod2man + +Requires: dbus +Requires: glib2 >= %{glib2_version} +Requires: libvirt-libs >= %{libvirt_version} +Requires: libvirt-glib >= %{libvirt_glib_version} +Requires: polkit + +Requires(pre): shadow-utils + +%description +This package provides D-Bus API for libvirt + +%prep +%autosetup -S git + +%build +%configure +%make_build + +%install +%make_install + +%pre +getent group %{system_user} >/dev/null || groupadd -r %{system_user} +getent passwd %{system_user} >/dev/null || \ + useradd -r -g %{system_user} -d / -s /sbin/nologin \ + -c "Libvirt D-Bus bridge" %{system_user} +exit 0 + +%files +%doc README.md HACKING.md AUTHORS NEWS +%license COPYING +%{_bindir}/libvirt-dbus +%{_datadir}/dbus-1/services/org.libvirt.service +%{_datadir}/dbus-1/system-services/org.libvirt.service +%{_datadir}/dbus-1/system.d/org.libvirt.conf +%{_datadir}/dbus-1/interfaces/org.libvirt.*.xml +%{_datadir}/polkit-1/rules.d/libvirt-dbus.rules +%{_mandir}/man8/libvirt-dbus.8* + +%changelog +* Fri Jan 18 2019 Pavel Hrdina - 1.2.0-2 +- util: fix virtDBusUtilDecodeUUID (rhbz#1647823) + +* Thu Sep 20 2018 Pavel Hrdina - 1.2.0-1 +- Rebased to libvirt-dbus-1.2.0 (rhbz#1630196) + +* Thu May 17 2018 Pavel Hrdina - 1.0.0-1 +- Rebase from Fedora