Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
094fcd37d3
!67 [sync] PR-64: udiskslinuxblock: Fix leaking string
From: @openeuler-sync-bot 
Reviewed-by: @swf504 
Signed-off-by: @swf504
2024-08-31 01:41:52 +00:00
cenhuilin
cbc8693957 udiskslinuxblock: Fix leaking string
(cherry picked from commit f4b5e096f0e7a0f1164f46a8116bacfaf35c01da)
2024-08-27 19:45:44 +08:00
openeuler-ci-bot
47ab530f39
!61 [sync] PR-57: udiskslinuxmanager:use dbus interface after free
From: @openeuler-sync-bot 
Reviewed-by: @swf504 
Signed-off-by: @swf504
2024-07-05 03:50:01 +00:00
cenhuilin
3aab25856f udiskslinuxmanager:use dbus interface after free
(cherry picked from commit 33f421a7f360d5ab58800b99fcd02f9d71d116de)
2024-07-05 10:48:59 +08:00
openeuler-ci-bot
ac6647c8c9
!52 [sync] PR-51: mdraid: Expose "consistency_policy" sysfs value
From: @openeuler-sync-bot 
Reviewed-by: @swf504 
Signed-off-by: @swf504
2024-06-17 01:31:51 +00:00
fandeyuan
d1dd1c6f85 mdraid: Expose "consistency_policy" sysfs value
(cherry picked from commit 69546428bb14cdc8c90bbec33efcf99b6be1aa53)
2024-06-15 18:00:47 +08:00
openeuler-ci-bot
7acab4dc7b
!43 update to version 2.10.1
From: @Venland 
Reviewed-by: @swf504 
Signed-off-by: @swf504
2024-02-22 08:06:51 +00:00
li weigang
b4b8f48049 update to version 2.10.1 2024-02-22 11:11:53 +08:00
openeuler-ci-bot
cdcbb61959
!36 [sync] PR-35: fix coredump while udisks2 stop
From: @openeuler-sync-bot 
Reviewed-by: @liuzhiqiang26 
Signed-off-by: @liuzhiqiang26
2023-02-21 10:51:20 +00:00
miaoguanqin
659121b959 fix coredump with udisks2 stop
(cherry picked from commit 381bac1a4250658a05a433714c1b8fd2f726b7f2)
2023-02-21 17:22:52 +08:00
7 changed files with 283 additions and 175 deletions

View File

@ -0,0 +1,72 @@
From d33d1dda277a78dcf63574c567ca24d7c3462f49 Mon Sep 17 00:00:00 2001
From: Marius Vollmer <mvollmer@redhat.com>
Date: Tue, 30 Apr 2024 14:39:13 +0300
Subject: [PATCH] mdraid: Expose "consistency_policy" sysfs value
---
data/org.freedesktop.UDisks2.xml | 12 ++++++++++++
src/udiskslinuxmdraid.c | 4 ++++
2 files changed, 16 insertions(+)
diff --git a/data/org.freedesktop.UDisks2.xml b/data/org.freedesktop.UDisks2.xml
index 53194c7..5d34901 100644
--- a/data/org.freedesktop.UDisks2.xml
+++ b/data/org.freedesktop.UDisks2.xml
@@ -3137,6 +3137,18 @@
-->
<property name="Degraded" type="u" access="read"/>
+ <!-- ConsistencyPolicy:
+ @since: 2.11.0
+ The consistency policy of the array.
+
+ If the RAID array does not support consistency policies (for
+ example RAID-0 arrays), this is empty.
+
+ This property corresponds to the
+ <literal>consistency_policy</literal> sysfs file.
+ -->
+ <property name="ConsistencyPolicy" type="s" access="read"/>
+
<!-- BitmapLocation:
The location of a write-intent bitmap (empty if the array is not running), if any.
diff --git a/src/udiskslinuxmdraid.c b/src/udiskslinuxmdraid.c
index 900cd65..46ee77e 100644
--- a/src/udiskslinuxmdraid.c
+++ b/src/udiskslinuxmdraid.c
@@ -237,6 +237,7 @@ udisks_linux_mdraid_update (UDisksLinuxMDRaid *mdraid,
const gchar *name = NULL;
gchar *sync_action = NULL;
gchar *sync_completed = NULL;
+ gchar *consistency_policy = NULL;
gchar *bitmap_location = NULL;
guint degraded = 0;
guint64 chunk_size = 0;
@@ -316,6 +317,7 @@ udisks_linux_mdraid_update (UDisksLinuxMDRaid *mdraid,
degraded = udisks_linux_device_read_sysfs_attr_as_int (raid_device, "md/degraded", NULL);
sync_action = udisks_linux_device_read_sysfs_attr (raid_device, "md/sync_action", NULL);
sync_completed = udisks_linux_device_read_sysfs_attr (raid_device, "md/sync_completed", NULL);
+ consistency_policy = udisks_linux_device_read_sysfs_attr (raid_device, "md/consistency_policy", NULL);
bitmap_location = udisks_linux_device_read_sysfs_attr (raid_device, "md/bitmap/location", NULL);
}
@@ -326,6 +328,7 @@ udisks_linux_mdraid_update (UDisksLinuxMDRaid *mdraid,
}
udisks_mdraid_set_degraded (iface, degraded);
udisks_mdraid_set_sync_action (iface, sync_action);
+ udisks_mdraid_set_consistency_policy (iface, consistency_policy);
udisks_mdraid_set_bitmap_location (iface, bitmap_location);
udisks_mdraid_set_chunk_size (iface, chunk_size);
@@ -517,6 +520,7 @@ udisks_linux_mdraid_update (UDisksLinuxMDRaid *mdraid,
bd_md_examine_data_free (raid_data);
g_free (sync_completed);
g_free (sync_action);
+ g_free (consistency_policy);
g_free (bitmap_location);
g_list_free_full (member_devices, g_object_unref);
g_clear_object (&raid_device);
--
2.33.0

View File

@ -0,0 +1,115 @@
From 3dc036fb5045fc068c6abfbe4e62d0871d7ca82a Mon Sep 17 00:00:00 2001
From: xinpeng wang <wangxinpeng@uniontech.com>
Date: Tue, 18 Jun 2024 16:32:39 +0800
Subject: [PATCH] udiskslinuxmanager:use dbus interface after free
In handle_get_block_devices, call get_block_objects to obtain iface_block_device
of all current UDisksLinuxBlockObject, and then obtain the corresponding
UDisksLinuxBlockObject's object_path through iface_block_device.iface_block_device
is a GDBusInterfaceSkeleton, which saves the object through
g_dbus_interface_skeleton_set_object. g_object_add_weak_pointer is used here. This
function is not thread-safe.At this time, if other threads are releasing the object,
the program will crash.
This scene can be reproduced by quickly plugging and unplugging the USB disk.
The core is as follows (the redundant stack is omitted):
When accessing object in thread 1, the object is released by thread 2
info threads
Id Target Id Frame
* 1 Thread 0x7f80979e70 (LWP 24559) 0x0000007f8a48dda0 in
g_dbus_object_get_object_path (object=0x0) at ../../../gio/gdbusobject.c:109
2 Thread 0x7f88a43010 (LWP 1159) 0x0000007f8a0a6ae8 in __GI___libc_free
(mem=0x556a919c80) at malloc.c:3093
thread 1
(gdb) bt
0 0x0000007f8a48dda0 in g_dbus_object_get_object_path (object=0x0) at
../../../gio/gdbusobject.c:109
1 0x000000556a56911c in handle_get_block_devices (object=0x7f7c007ed0, invocation=
0x7f74016f20 [GDBusMethodInvocation], arg_options=<optimized out>)
at udiskslinuxmanager.c:1063
(gdb) p ((GObject*)(blocks_p->data))->ref_count
$3 = 1
(gdb) p *((GDBusInterfaceSkeleton*)(blocks_p->data))
$6 = {parent_instance = {g_type_instance = {g_class = 0x556a64e740
[g_type: UDisksLinuxBlock/UDisksBlockSkeleton/GDBusInterfaceSkeleton]}, ref_count = 1,
qdata = 0x0}, priv = 0x7f7c004ac0}
(gdb) p *((GDBusInterfaceSkeleton*)(blocks_p->data))->priv
$7 = {lock = {p = 0x0, i = {0, 0}}, object = 0x0,
flags = G_DBUS_INTERFACE_SKELETON_FLAGS_HANDLE_METHOD_INVOCATIONS_IN_THREAD,
connections = 0x0, object_path = 0x0, hooked_vtable = 0x556a62b9f0}
thread 2
(gdb) bt
0 0x0000007f8a0a6ae8 in __GI___libc_free (mem=0x556a919c80) at malloc.c:3093
1 0x0000007f89ff1224 in () at /lib/aarch64-linux-gnu/libudev.so.1
2 0x0000007f89ff1348 in () at /lib/aarch64-linux-gnu/libudev.so.1
3 0x0000007f89ff5520 in () at /lib/aarch64-linux-gnu/libudev.so.1
4 0x0000007f89fff878 in udev_device_unref () at /lib/aarch64-linux-gnu/libudev.so.1
5 0x0000007f8a7aeb74 in () at /lib/aarch64-linux-gnu/libgudev-1.0.so.0
6 0x0000007f8a3193f8 in g_object_unref (_object=<optimized out>) at
../../../gobject/gobject.c:3346
7 0x0000007f8a3193f8 in g_object_unref (_object=0x7f680038a0) at
../../../gobject/gobject.c:3238
8 0x000000556a57700c in udisks_linux_device_finalize (object=0x7f5c005730
[UDisksLinuxDevice]) at udiskslinuxdevice.c:75
9 0x0000007f8a3193f8 in g_object_unref (_object=<optimized out>) at
../../../gobject/gobject.c:3346
10 0x0000007f8a3193f8 in g_object_unref (_object=0x7f5c005730) at
../../../gobject/gobject.c:3238
11 0x000000556a55d0fc in udisks_linux_drive_object_uevent
(object=object@entry=0x556a5df370 [UDisksLinuxDriveObject],
action=action@entry=0x556a87b120
"remove",device=device@entry=0x7f74007610 [UDisksLinuxDevice])
at udiskslinuxdriveobject.c:715
12 0x000000556a54840c in handle_block_uevent_for_drive
(provider=provider@entry=0x556a5c8200 [UDisksLinuxProvider],
action=action@entry=0x556a87b120 "remove",device=device@entry=0x7f74007610
[UDisksLinuxDevice]) at udiskslinuxprovider.c:1035
13 0x000000556a548ab8 in handle_block_uevent (device=0x7f74007610 [UDisksLinuxDevice],
action=0x556a87b120 "remove", provider=0x556a5c8200 [UDisksLinuxProvider]) at
udiskslinuxprovider.c:1349
14 0x000000556a548ab8 in udisks_linux_provider_handle_uevent
(provider=0x556a5c8200 [UDisksLinuxProvider], action=0x556a87b120 "remove",
device=0x7f74007610 [UDisksLinuxDevice]) at udiskslinuxprovider.c:1399
15 0x000000556a548cac in on_idle_with_probed_uevent (user_data=0x556a7e65a0) at
udiskslinuxprovider.c:230
---
src/udiskslinuxmanager.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/src/udiskslinuxmanager.c b/src/udiskslinuxmanager.c
index 5bfeec1..491edb9 100644
--- a/src/udiskslinuxmanager.c
+++ b/src/udiskslinuxmanager.c
@@ -1196,8 +1196,11 @@ handle_get_block_devices (UDisksManager *object,
blocks = get_block_objects (object, &num_blocks);
block_paths = g_new0 (const gchar *, num_blocks + 1);
- for (i = 0,blocks_p = blocks; blocks_p != NULL; blocks_p = blocks_p->next, i++)
- block_paths[i] = g_dbus_object_get_object_path (g_dbus_interface_get_object (G_DBUS_INTERFACE (blocks_p->data)));
+ for (blocks_p = blocks; blocks_p != NULL; blocks_p = blocks_p->next) {
+ GDBusObject * block_object = g_dbus_interface_get_object (G_DBUS_INTERFACE (blocks_p->data));
+ if (block_object)
+ block_paths[i++] = g_dbus_object_get_object_path (block_object);
+ }
udisks_manager_complete_get_block_devices (object,
invocation,
@@ -1284,9 +1287,11 @@ handle_resolve_device (UDisksManager *object,
}
ret_paths = g_new0 (const gchar *, num_found + 1);
- for (i = 0,ret_p = ret; ret_p != NULL; ret_p = ret_p->next, i++)
+ for (i = 0,ret_p = ret; ret_p != NULL; ret_p = ret_p->next)
{
- ret_paths[i] = g_dbus_object_get_object_path (g_dbus_interface_get_object (G_DBUS_INTERFACE (ret_p->data)));
+ GDBusObject *block_object = g_dbus_interface_get_object (G_DBUS_INTERFACE (ret_p->data));
+ if (block_object)
+ ret_paths[i++] = g_dbus_object_get_object_path (block_object);
}
udisks_manager_complete_resolve_device (object,
--
2.33.0

View File

@ -0,0 +1,24 @@
From 43e30c01c709412b1a905f3997b63017c205471a Mon Sep 17 00:00:00 2001
From: Tomas Bzatek <tbzatek@redhat.com>
Date: Tue, 13 Aug 2024 17:24:28 +0800
Subject: [PATCH] udiskslinuxblock: Fix leaking string
---
src/udiskslinuxblock.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/udiskslinuxblock.c b/src/udiskslinuxblock.c
index 829dd5f..be5c340 100644
--- a/src/udiskslinuxblock.c
+++ b/src/udiskslinuxblock.c
@@ -1244,6 +1244,7 @@ udisks_linux_block_update (UDisksLinuxBlock *block,
bitlk_info = bd_crypto_bitlk_info (device_file, &error);
if (bitlk_info)
{
+ g_free (s);
s = g_strdup (bitlk_info->uuid);
bd_crypto_bitlk_info_free (bitlk_info);
}
--
2.33.0

BIN
udisks-2.10.1.tar.bz2 Normal file

Binary file not shown.

Binary file not shown.

View File

@ -1,82 +1,48 @@
%global glib2_version 2.36
%global glib2_version 2.68
%global gobject_introspection_version 1.30.0
%global polkit_version 0.102
%global systemd_version 208
%global libatasmart_version 0.17
%global dbus_version 1.4.0
%global with_gtk_doc 1
%global libblockdev_version 2.19
%global libblockdev_version 3.0
%define with_bcache 1
%define with_btrfs 1
%define with_vdo 1
%define with_lsm 1
%define with_zram 1
%define with_lvmcache 1
# valid options are 'luks1' or 'luks2'
%define default_luks_encryption luks1
%define is_fedora (0%{?rhel} == 0) && (0%{?openeuler} == 0)
%define is_git %(git show > /dev/null 2>&1 && echo 1 || echo 0)
%define git_hash %(git log -1 --pretty=format:"%h" || true)
%define build_date %(date '+%Y%m%d')
# bcache is not available on RHEL
%if (0%{?rhel}) || (0%{?openeuler}) || %{with_bcache} == 0
%define with_bcache 0
%endif
# btrfs is not available on RHEL > 7
%if 0%{?rhel} > 7 || 0%{?openeuler} || %{with_btrfs} == 0
%define with_btrfs 0
%endif
# vdo is not available on Fedora
%if (0%{?fedora}) || %{with_vdo} == 0
%define with_vdo 0
%endif
# vdo is not available on i686
%ifnarch x86_64 aarch64 ppc64le s390x
%define with_vdo 0
%endif
# feature parity with existing RHEL 7 packages
%if (0%{?rhel}) && (0%{?rhel} <= 7) && (0%{?openeuler} == 0)
%define with_lsm 0
%define with_zram 0
%define with_lvmcache 0
%endif
# default to LUKS2 for RHEL > 7
%if 0%{?rhel} > 7 || 0%{?openeuler}
%define default_luks_encryption luks2
%endif
Name: udisks2
Summary: Disk Manager
Version: 2.9.4
Release: 3
Version: 2.10.1
Release: 4
License: GPL-2.0+ and LGPL-2.0+
Group: System Environment/Libraries
URL: https://github.com/storaged-project/udisks
Source0: https://github.com/storaged-project/udisks/releases/download/udisks-%{version}/udisks-%{version}.tar.bz2
Patch0001: 0001-mdraid-Expose-consistency_policy-sysfs-value.patch
Patch0002: 0002-udiskslinuxmanager-use-dbus-interface-after-free.patch
Patch0003: 0003-udiskslinuxblock-Fix-leaking-string.patch
BuildRequires: make
BuildRequires: glib2-devel >= %{glib2_version}
BuildRequires: gobject-introspection-devel >= %{gobject_introspection_version}
BuildRequires: libgudev1-devel >= %{systemd_version}
BuildRequires: libatasmart-devel >= %{libatasmart_version}
BuildRequires: polkit-devel >= %{polkit_version}
BuildRequires: systemd >= %{systemd_version}
BuildRequires: systemd-devel >= %{systemd_version}
BuildRequires: gnome-common
BuildRequires: libacl-devel
BuildRequires: chrpath
BuildRequires: gtk-doc
BuildRequires: intltool
BuildRequires: system-rpm-config
BuildRequires: gettext-devel
BuildRequires: libblockdev-devel >= %{libblockdev_version}
BuildRequires: libblockdev-part-devel >= %{libblockdev_version}
BuildRequires: libblockdev-loop-devel >= %{libblockdev_version}
@ -84,7 +50,9 @@ BuildRequires: libblockdev-swap-devel >= %{libblockdev_version}
BuildRequires: libblockdev-mdraid-devel >= %{libblockdev_version}
BuildRequires: libblockdev-fs-devel >= %{libblockdev_version}
BuildRequires: libblockdev-crypto-devel >= %{libblockdev_version}
#BuildRequires: libblockdev-nvme-devel >= %{libblockdev_version}
BuildRequires: libmount-devel
BuildRequires: libuuid-devel
Requires: libblockdev >= %{libblockdev_version}
Requires: libblockdev-part >= %{libblockdev_version}
@ -93,10 +61,9 @@ Requires: libblockdev-swap >= %{libblockdev_version}
Requires: libblockdev-mdraid >= %{libblockdev_version}
Requires: libblockdev-fs >= %{libblockdev_version}
Requires: libblockdev-crypto >= %{libblockdev_version}
#Requires: libblockdev-nvme >= %{libblockdev_version}
# Needed for the systemd-related macros used in this file
%{?systemd_requires}
BuildRequires: systemd
Requires: lib%{name}%{?_isa} = %{version}-%{release}
# Needed to pull in the system bus daemon
Requires: dbus >= %{dbus_version}
@ -107,31 +74,39 @@ Requires: libatasmart >= %{libatasmart_version}
# For mount, umount, mkswap
Requires: util-linux
# For mkfs.ext3, mkfs.ext3, e2label
Requires: e2fsprogs
Recommends: e2fsprogs
# For mkfs.xfs, xfs_admin
Requires: xfsprogs
Recommends: xfsprogs
# For mkfs.vfat
Requires: dosfstools
Requires: gdisk
Recommends: dosfstools
# For exfat
Recommends: exfatprogs
# For UDF
Recommends: udftools
# For ejecting removable disks
Requires: eject
Recommends: eject
# For utab monitor
Requires: libmount
# The actual polkit agent
Requires: polkit >= %{polkit_version}
Requires: lib%{name}%{?_isa} = %{version}-%{release}
# For mkntfs (not available on rhel or on ppc/ppc64)
%if ! 0%{?rhel} && ! 0%{?openeuler}
# For mkntfs (not available on rhel or on ppc/ppc64) and f2fs
%if %{is_fedora}
Recommends: f2fs-tools
Recommends: nilfs-utils
%ifnarch ppc ppc64
Requires: ntfsprogs
Recommends: ntfsprogs
%endif
%endif
Recommends: ntfs-3g
# For /proc/self/mountinfo, only available in 2.6.26 or higher
Conflicts: kernel < 2.6.26
# btrfs
%if 0%{?with_btrfs}
Recommends: btrfs-progs
%endif
Provides: storaged = %{version}-%{release}
Obsoletes: storaged
Obsoletes: storaged < %{version}-%{release}
%description
The Udisks project provides a daemon, tools and libraries to access and
@ -139,10 +114,9 @@ manipulate disks, storage devices and technologies.
%package -n lib%{name}
Summary: Dynamic library to access the udisksd daemon
Group: System Environment/Libraries
License: LGPLv2+
Provides: libstoraged = %{version}-%{release}
Obsoletes: libstoraged
Obsoletes: libstoraged < %{version}-%{release}
%description -n lib%{name}
This package contains the dynamic library, which provides
@ -150,56 +124,37 @@ access to the udisksd daemon.
%package -n %{name}-lvm2
Summary: Module for LVM2
Group: System Environment/Libraries
Requires: %{name}%{?_isa} = %{version}-%{release}
License: LGPLv2+
Requires: lvm2
Requires: libblockdev-lvm >= %{libblockdev_version}
BuildRequires: lvm2-devel
BuildRequires: libblockdev-lvm-devel >= %{libblockdev_version}
Provides: storaged-lvm2 = %{version}-%{release}
Obsoletes: storaged-lvm2
Obsoletes: storaged-lvm2 < %{version}-%{release}
%description -n %{name}-lvm2
This package contains module for LVM2 configuration.
%package -n lib%{name}-devel
Summary: Development files for lib%{name}
Group: Development/Libraries
Requires: lib%{name}%{?_isa} = %{version}-%{release}
License: LGPLv2+
Provides: libstoraged-devel = %{version}-%{release}
Obsoletes: libstoraged-devel
Obsoletes: libstoraged-devel < %{version}-%{release}
%description -n lib%{name}-devel
This package contains the development files for the library lib%{name}, a
dynamic library, which provides access to the udisksd daemon.
%if 0%{?with_bcache}
%package -n %{name}-bcache
Summary: Module for Bcache
Group: System Environment/Libraries
Requires: %{name}%{?_isa} = %{version}-%{release}
License: LGPLv2+
Requires: libblockdev-kbd >= %{libblockdev_version}
BuildRequires: libblockdev-kbd-devel >= %{libblockdev_version}
Provides: storaged-bcache = %{version}-%{release}
Obsoletes: storaged-bcache
%description -n %{name}-bcache
This package contains module for Bcache configuration.
%endif
This package contains the development files for the library lib%{name},
a dynamic library, which provides access to the udisksd daemon.
%if 0%{?with_btrfs}
%package -n %{name}-btrfs
Summary: Module for BTRFS
Group: System Environment/Libraries
Requires: %{name}%{?_isa} = %{version}-%{release}
License: LGPLv2+
Requires: libblockdev-btrfs >= %{libblockdev_version}
BuildRequires: libblockdev-btrfs-devel >= %{libblockdev_version}
Provides: storaged-btrfs = %{version}-%{release}
Obsoletes: storaged-btrfs
Obsoletes: storaged-btrfs < %{version}-%{release}
%description -n %{name}-btrfs
This package contains module for BTRFS configuration.
@ -208,81 +163,39 @@ This package contains module for BTRFS configuration.
%if 0%{?with_lsm}
%package -n %{name}-lsm
Summary: Module for LSM
Group: System Environment/Libraries
Requires: %{name}%{?_isa} = %{version}-%{release}
License: LGPLv2+
Requires: libstoragemgmt
BuildRequires: libstoragemgmt-devel
BuildRequires: libconfig-devel
Provides: storaged-lsm = %{version}-%{release}
Obsoletes: storaged-lsm
Obsoletes: storaged-lsm < %{version}-%{release}
%description -n %{name}-lsm
This package contains module for LSM configuration.
%endif
%if 0%{?with_zram}
%package -n %{name}-zram
Summary: Module for ZRAM
Group: System Environment/Libraries
Requires: %{name}%{?_isa} = %{version}-%{release}
License: LGPLv2+
Requires: libblockdev-kbd >= %{libblockdev_version}
Requires: libblockdev-swap >= %{libblockdev_version}
BuildRequires: libblockdev-kbd-devel >= %{libblockdev_version}
BuildRequires: libblockdev-swap-devel
Provides: storaged-zram = %{version}-%{release}
Obsoletes: storaged-zram
%description -n %{name}-zram
This package contains module for ZRAM configuration.
%endif
%if 0%{?with_vdo}
%package -n %{name}-vdo
Summary: Module for VDO
Group: System Environment/Libraries
Requires: %{name}%{?_isa} = %{version}-%{release}
License: LGPLv2+
Requires: vdo
Requires: libblockdev-vdo >= %{libblockdev_version}
BuildRequires: libblockdev-vdo-devel >= %{libblockdev_version}
%description -n %{name}-vdo
This package contains module for VDO management.
%endif
%prep
%setup -q -n udisks-%{version}
sed -i udisks/udisks2.conf.in -e "s/encryption=luks1/encryption=%{default_luks_encryption}/"
%autosetup -p1 -n udisks-%{version}
rm -f src/tests/dbus-tests/config_h.py
rm -f src/udisks-daemon-resources.{c,h}
# default to ntfs-3g (#2182206)
sed -i data/builtin_mount_options.conf -e 's/ntfs_drivers=ntfs3,ntfs/ntfs_drivers=ntfs,ntfs3/'
%build
autoreconf -ivf
# autoreconf -ivf
# modules need to be explicitly enabled
%configure \
--sysconfdir=/etc \
%if %{with_gtk_doc}
--enable-gtk-doc \
%else
--disable-gtk-doc \
%endif
%if 0%{?with_bcache}
--enable-bcache \
%endif
%if 0%{?with_btrfs}
--enable-btrfs \
%endif
%if 0%{?with_vdo}
--enable-vdo \
%endif
%if 0%{?with_zram}
--enable-zram \
%endif
%if 0%{?with_lsm}
--enable-lsm \
%endif
%if 0%{?with_lvmcache}
--enable-lvmcache \
%endif
--enable-lvm2
make %{?_smp_mflags}
@ -306,7 +219,12 @@ make check
%post -n %{name}
%systemd_post udisks2.service
# skip retriggering if udevd isn't even accessible, e.g. containers or
# rpm-ostree-based systems
if [ -S /run/udev/control ]; then
udevadm control --reload
udevadm trigger
fi
%preun -n %{name}
%systemd_preun udisks2.service
@ -316,14 +234,6 @@ udevadm trigger
%ldconfig_scriptlets -n lib%{name}
%if 0%{?with_zram}
%post -n %{name}-zram
%preun -n %{name}-zram
%postun -n %{name}-zram
%endif
%files -f udisks2.lang
%doc README.md AUTHORS NEWS HACKING
%license COPYING
@ -337,6 +247,7 @@ udevadm trigger
%{_datadir}/dbus-1/system.d/org.freedesktop.UDisks2.conf
%{_datadir}/bash-completion/completions/udisksctl
%{_datadir}/zsh/site-functions/_udisks2
%{_tmpfilesdir}/%{name}.conf
%{_unitdir}/udisks2.service
%{_udevrulesdir}/80-udisks2.rules
@ -383,27 +294,12 @@ udevadm trigger
%endif
%{_libdir}/pkgconfig/udisks2.pc
%{_libdir}/pkgconfig/udisks2-lvm2.pc
%if 0%{?with_bcache}
%{_libdir}/pkgconfig/udisks2-bcache.pc
%endif
%if 0%{?with_btrfs}
%{_libdir}/pkgconfig/udisks2-btrfs.pc
%endif
%if 0%{?with_lsm}
%{_libdir}/pkgconfig/udisks2-lsm.pc
%endif
%if 0%{?with_zram}
%{_libdir}/pkgconfig/udisks2-zram.pc
%endif
%if 0%{?with_vdo}
%{_libdir}/pkgconfig/udisks2-vdo.pc
%endif
%if 0%{?with_bcache}
%files -n %{name}-bcache
%{_libdir}/udisks2/modules/libudisks2_bcache.so
%{_datadir}/polkit-1/actions/org.freedesktop.UDisks2.bcache.policy
%endif
%if 0%{?with_btrfs}
%files -n %{name}-btrfs
@ -420,22 +316,23 @@ udevadm trigger
%attr(0600,root,root) %{_sysconfdir}/udisks2/modules.conf.d/udisks2_lsm.conf
%endif
%if 0%{?with_zram}
%files -n %{name}-zram
%dir %{_sysconfdir}/udisks2/modules.conf.d
%{_libdir}/udisks2/modules/libudisks2_zram.so
%{_datadir}/polkit-1/actions/org.freedesktop.UDisks2.zram.policy
%{_unitdir}/udisks2-zram-setup@.service
%{_udevrulesdir}/90-udisks2-zram.rules
%endif
%if 0%{?with_vdo}
%files -n %{name}-vdo
%{_libdir}/udisks2/modules/libudisks2_vdo.so
%{_datadir}/polkit-1/actions/org.freedesktop.UDisks2.vdo.policy
%endif
%changelog
* Tue Aug 13 2024 cenhuilin <cenhuilin@kylinos.cn> - 2.10.1-4
- udiskslinuxblock: Fix leaking string
* Tue Jun 18 2024 cenhuilin <cenhuilin@kylinos.cn> - 2.10.1-3
- udiskslinuxmanager:use dbus interface after free
* Wed Jun 12 2024 Deyuan Fan <fandeyuan@kylinos.cn> - 2.10.1-2
- mdraid: Expose "consistency_policy" sysfs value
* Mon Oct 30 2023 li weigang <weigangli99@gmail.com> - 2.10.1-1
- update to version 2.10.1
* Tue Feb 21 2023 miaoguanqin <miaoguanqin@huawei.com> - 2.9.4-4
- fix coredump while stop udisks2
* Sat Oct 29 2022 wangzhiqiang <wangzhiqiang95@huawei.com> - 2.9.4-3
- update release

View File

@ -1,4 +1,4 @@
version_control: github
src_repo: storaged-project/udisks
tag_prefix: "udisks-"
seperator: "."
separator: "."