diff --git a/.gitignore b/.gitignore index 89bc8dd..780a522 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/udisks-2.7.3.tar.bz2 +SOURCES/udisks-2.8.4.tar.bz2 diff --git a/.udisks2.metadata b/.udisks2.metadata index c81af9b..91e4047 100644 --- a/.udisks2.metadata +++ b/.udisks2.metadata @@ -1 +1 @@ -dd8daa649796a6737ef3f0fd3fe3f536714b9fba SOURCES/udisks-2.7.3.tar.bz2 +d904eaeeb6af1ad7c4246d7fa879f80849f6c0f2 SOURCES/udisks-2.8.4.tar.bz2 diff --git a/SOURCES/fix_mpoin_cleanup_1384796.patch b/SOURCES/fix_mpoin_cleanup_1384796.patch deleted file mode 100644 index 2c6499e..0000000 --- a/SOURCES/fix_mpoin_cleanup_1384796.patch +++ /dev/null @@ -1,93 +0,0 @@ -From aad98b87513f9e277258c8bc9c3bc7db7a8442ba Mon Sep 17 00:00:00 2001 -From: Vojtech Trefny -Date: Thu, 18 Jan 2018 13:59:11 +0100 -Subject: [PATCH] Fix escaping mountpoint for the cleanup service - -We need to use the 'systemd-escape' command -- it escapes more -symbols and manually escaping only slashes isn't enough. - -Resolves: rhbz#1384796 -(cherry picked from commit 4d982bb6b81afcd17b0a42b6c1256c22ff444ee5) ---- - src/udiskslinuxfilesystem.c | 38 +++++++++++++++++++++++++++----------- - 1 file changed, 27 insertions(+), 11 deletions(-) - -diff --git a/src/udiskslinuxfilesystem.c b/src/udiskslinuxfilesystem.c -index 2910181..e2b7e18 100644 ---- a/src/udiskslinuxfilesystem.c -+++ b/src/udiskslinuxfilesystem.c -@@ -1144,10 +1144,11 @@ is_system_managed (UDisksBlock *block, - - static void trigger_mpoint_cleanup (const gchar *mount_point) - { -- const gchar *argv[] = {"systemctl", "start", NULL, NULL}; -+ const gchar *service_argv[] = {"systemctl", "start", NULL, NULL}; -+ const gchar *escape_argv[] = {"systemd-escape", NULL, NULL}; - GError *error = NULL; - gchar *escaped_mpoint = NULL; -- gsize len = 0; -+ size_t len = 0; - - if (g_str_has_prefix (mount_point, "/")) - mount_point++; -@@ -1155,14 +1156,27 @@ static void trigger_mpoint_cleanup (const gchar *mount_point) - udisks_warning ("Invalid mount point given to trigger_mpoint_cleanup(): %s", - mount_point); - -- /* start with the mount point without the leading '/' */ -- escaped_mpoint = g_strdup (mount_point); -+ /* use 'systemd-escape' to escape the mountpoint */ -+ escape_argv[1] = g_strdup (mount_point); - -- /* and replace all '/'s with '-'s */ -- for (gchar *letter = escaped_mpoint; *letter != '\0'; letter++, len++) -+ if (!bd_utils_exec_and_capture_output (escape_argv, NULL, &escaped_mpoint, &error) && (error != NULL)) - { -- if (*letter == '/') -- *letter = '-'; -+ /* this is a best-effort mechanism, if it fails, just log warning and move -+ on */ -+ udisks_warning ("Failed to setup systemd-based mount point cleanup: %s", -+ error->message); -+ g_clear_error (&error); -+ goto out; -+ } -+ -+ /* remove leading/trailing whitespace */ -+ g_strstrip (escaped_mpoint); -+ -+ len = strlen (escaped_mpoint); -+ if (len <= 0) -+ { -+ udisks_warning ("Failed to setup systemd-based mount point cleanup"); -+ goto out; - } - - /* remove the potential trailing '-' (would happen if the given mount_point -@@ -1170,9 +1184,9 @@ static void trigger_mpoint_cleanup (const gchar *mount_point) - if (escaped_mpoint[len - 1] == '-') - escaped_mpoint[len - 1] = '\0'; - -- argv[2] = g_strdup_printf ("clean-mount-point@%s", escaped_mpoint); -+ service_argv[2] = g_strdup_printf ("clean-mount-point@%s", escaped_mpoint); - -- if (!bd_utils_exec_and_report_error (argv, NULL, &error) && (error != NULL)) -+ if (!bd_utils_exec_and_report_error (service_argv, NULL, &error) && (error != NULL)) - { - /* this is a best-effort mechanism, if it fails, just log warning and move - on */ -@@ -1181,8 +1195,10 @@ static void trigger_mpoint_cleanup (const gchar *mount_point) - g_clear_error (&error); - } - -+out: - g_free (escaped_mpoint); -- g_free ((gchar *) argv[2]); -+ g_free ((gchar *) service_argv[2]); -+ g_free ((gchar *) escape_argv[1]); - } - - /* ---------------------------------------------------------------------------------------------------- */ --- -1.8.3.1 - diff --git a/SOURCES/fix_thinpool_size_1534904.patch b/SOURCES/fix_thinpool_size_1534904.patch deleted file mode 100644 index c78320d..0000000 --- a/SOURCES/fix_thinpool_size_1534904.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 34bf5d61e5ea1bd9450db6197fc9791a8e7aa8da Mon Sep 17 00:00:00 2001 -From: Marius Vollmer -Date: Wed, 13 Dec 2017 15:28:23 +0200 -Subject: [PATCH] lvm2: Don't match prefixes in cmp_int_lv_name - -Once the whole internal name has matched, the other name must also be -at the end. Otherwise we might find "lvol0" when looking for -"lvol0_meta", for example. - -The symptom is that the size of a pool is reported as twice its data -size, instead of data plus metadata size, which funnily is exactly the -same symptom fixed by 043edcb. Deja vu... - -(cherry picked from commit 821bc20911e9a446b943cf40abe0e8a8132bf418) ---- - modules/lvm2/udiskslinuxvolumegroupobject.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/modules/lvm2/udiskslinuxvolumegroupobject.c b/modules/lvm2/udiskslinuxvolumegroupobject.c -index 617af04..3f622a6 100644 ---- a/modules/lvm2/udiskslinuxvolumegroupobject.c -+++ b/modules/lvm2/udiskslinuxvolumegroupobject.c -@@ -530,7 +530,7 @@ cmp_int_lv_name (const gchar *int_lv_name, const gchar *lv_name) - - if (*c == ']') - c++; -- if (*c == '\0') -+ if (*c == '\0' && lv_name[c - int_lv_name] == '\0') - return TRUE; - - return FALSE; --- -1.8.3.1 - diff --git a/SOURCES/lsm-complete-led_control-call.patch b/SOURCES/lsm-complete-led_control-call.patch deleted file mode 100644 index 8daf9f9..0000000 --- a/SOURCES/lsm-complete-led_control-call.patch +++ /dev/null @@ -1,25 +0,0 @@ -From df19070c930b28df271944e9d6ee5de42e16f2b4 Mon Sep 17 00:00:00 2001 -From: Tomas Bzatek -Date: Fri, 3 Aug 2018 11:40:48 +0200 -Subject: [PATCH] lsm: Properly complete incoming method calls - -Returning TRUE from a method call handler is not enough to finish -the method call and send reply back to caller. ---- - modules/lsm/lsm_local.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/modules/lsm/lsm_local.c b/modules/lsm/lsm_local.c -index a2a46442c..e3fc0162a 100644 ---- a/modules/lsm/lsm_local.c -+++ b/modules/lsm/lsm_local.c -@@ -180,6 +180,9 @@ led_control (UDisksDriveLsmLocal *ud_drv_lsm_local, - goto out; - } - -+ /* success, complete the method call in a generic way */ -+ g_dbus_method_invocation_return_value (invocation, g_variant_new ("()")); -+ - out: - g_free ((gchar *) blk_path); - if (lsm_err != NULL) diff --git a/SOURCES/lsm-relicense.patch b/SOURCES/lsm-relicense.patch deleted file mode 100644 index 6aecaa2..0000000 --- a/SOURCES/lsm-relicense.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 248db65a09498be8e2a294cbf5af675a463ee2a0 Mon Sep 17 00:00:00 2001 -From: Tomas Bzatek -Date: Fri, 10 Aug 2018 14:00:01 +0200 -Subject: [PATCH] lsm: Relicense to GPLv2+ - ---- - modules/lsm/lsm_data.c | 7 ++++--- - modules/lsm/lsm_data.h | 7 ++++--- - 2 files changed, 8 insertions(+), 6 deletions(-) - -diff --git a/modules/lsm/lsm_data.c b/modules/lsm/lsm_data.c -index 729467509..5b33c04a5 100644 ---- a/modules/lsm/lsm_data.c -+++ b/modules/lsm/lsm_data.c -@@ -2,9 +2,9 @@ - * - * Copyright (C) 2015 Red Hat, Inc. - * -- * This program is free software: you can redistribute it and/or modify -+ * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by -- * the Free Software Foundation, either version 3 of the License, or -+ * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, -@@ -13,7 +13,8 @@ - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License -- * along with this program. If not, see . -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Author: Gris Ge - * -diff --git a/modules/lsm/lsm_data.h b/modules/lsm/lsm_data.h -index c5c3162e9..0b71d630d 100644 ---- a/modules/lsm/lsm_data.h -+++ b/modules/lsm/lsm_data.h -@@ -2,9 +2,9 @@ - * - * Copyright (C) 2015 Red Hat, Inc. - * -- * This program is free software: you can redistribute it and/or modify -+ * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by -- * the Free Software Foundation, either version 3 of the License, or -+ * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, -@@ -13,7 +13,8 @@ - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License -- * along with this program. If not, see . -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Author: Gris Ge - * diff --git a/SOURCES/lsm_local-gerror.patch b/SOURCES/lsm_local-gerror.patch deleted file mode 100644 index 92b3f94..0000000 --- a/SOURCES/lsm_local-gerror.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 53a21faf97723b0e4d6c2ec9a32f61fecfa2f246 Mon Sep 17 00:00:00 2001 -From: Tomas Bzatek -Date: Fri, 3 Aug 2018 11:26:16 +0200 -Subject: [PATCH] lsm: Prevent overwriting already set error - ---- - modules/lsm/lsm_local.c | 9 ++++++--- - 1 file changed, 6 insertions(+), 3 deletions(-) - -diff --git a/modules/lsm/lsm_local.c b/modules/lsm/lsm_local.c -index 33ff198fd..a2a46442c 100644 ---- a/modules/lsm/lsm_local.c -+++ b/modules/lsm/lsm_local.c -@@ -132,6 +132,12 @@ get_blk_path (UDisksDriveLsmLocal *ud_drv_lsm_local, - - ud_blk = udisks_object_get_block (UDISKS_OBJECT (ud_lx_blk_obj)); - blk_path = udisks_block_dup_device (ud_blk); -+ if (blk_path == NULL) -+ { -+ g_dbus_method_invocation_return_error (invocation, UDISKS_ERROR, UDISKS_ERROR_FAILED, -+ "Failed to retrieve block path of specified disk drive"); -+ goto out; -+ } - - out: - g_clear_object (&ud_blk); -@@ -156,9 +162,6 @@ led_control (UDisksDriveLsmLocal *ud_drv_lsm_local, - blk_path = get_blk_path(ud_drv_lsm_local, invocation); - if (blk_path == NULL) - { -- g_dbus_method_invocation_return_error -- (invocation, UDISKS_ERROR, UDISKS_ERROR_FAILED, -- "Failed to retrieve block path of specified disk drive"); - goto out; - } - diff --git a/SOURCES/luks_resize_1567992.patch b/SOURCES/luks_resize_1567992.patch deleted file mode 100644 index 22985ea..0000000 --- a/SOURCES/luks_resize_1567992.patch +++ /dev/null @@ -1,232 +0,0 @@ -From 9f749a4ea6129c256bb3522291eaa43f63c961c1 Mon Sep 17 00:00:00 2001 -From: Marius Vollmer -Date: Tue, 5 Dec 2017 17:17:40 +0200 -Subject: [PATCH] core: Add Encrypted.Resize method - -To go with Filesystem.Resize. ---- - data/org.freedesktop.UDisks2.xml | 16 ++++ - doc/udisks2-sections.txt.in.in | 4 + - src/udiskslinuxencrypted.c | 134 ++++++++++++++++++++++++++++++ - udisks/udisksclient.c | 1 + - 4 files changed, 155 insertions(+) - -diff --git a/data/org.freedesktop.UDisks2.xml b/data/org.freedesktop.UDisks2.xml -index fa53a72..75ec0ea 100644 ---- a/data/org.freedesktop.UDisks2.xml -+++ b/data/org.freedesktop.UDisks2.xml -@@ -2059,6 +2059,20 @@ - - - -+ -+ -+ -+ -+ -+ - - - -@@ -2451,6 +2465,8 @@ - Locking encrypted device. - encrypted-modify - Modifying encrypted device. -+ encrypted-resize -+ Resizing encrypted device. - swapspace-start - Starting swapspace. - swapspace-stop -diff --git a/doc/udisks2-sections.txt.in.in b/doc/udisks2-sections.txt.in.in -index 5860d43..13cf728 100644 ---- a/doc/udisks2-sections.txt.in.in -+++ b/doc/udisks2-sections.txt.in.in -@@ -1036,6 +1036,10 @@ udisks_encrypted_call_change_passphrase - udisks_encrypted_call_change_passphrase_finish - udisks_encrypted_call_change_passphrase_sync - udisks_encrypted_complete_change_passphrase -+udisks_encrypted_call_resize -+udisks_encrypted_call_resize_finish -+udisks_encrypted_call_resize_sync -+udisks_encrypted_complete_resize - UDisksEncryptedProxy - UDisksEncryptedProxyClass - udisks_encrypted_proxy_new -diff --git a/src/udiskslinuxencrypted.c b/src/udiskslinuxencrypted.c -index 7b19e84..08e59d1 100644 ---- a/src/udiskslinuxencrypted.c -+++ b/src/udiskslinuxencrypted.c -@@ -43,6 +43,7 @@ - #include "udiskscrypttabentry.h" - #include "udiskscrypttabmonitor.h" - #include "udisksspawnedjob.h" -+#include "udiskssimplejob.h" - - /** - * SECTION:udiskslinuxencrypted -@@ -802,10 +803,143 @@ handle_change_passphrase (UDisksEncrypted *encrypted, - - /* ---------------------------------------------------------------------------------------------------- */ - -+/* runs in thread dedicated to handling method call */ -+static gboolean -+handle_resize (UDisksEncrypted *encrypted, -+ GDBusMethodInvocation *invocation, -+ guint64 size, -+ GVariant *options) -+{ -+ UDisksObject *object = NULL; -+ UDisksBlock *block; -+ UDisksObject *cleartext_object = NULL; -+ UDisksBlock *cleartext_block; -+ UDisksDaemon *daemon; -+ uid_t caller_uid; -+ const gchar *action_id = NULL; -+ const gchar *message = NULL; -+ GError *error = NULL; -+ UDisksBaseJob *job = NULL; -+ -+ object = udisks_daemon_util_dup_object (encrypted, &error); -+ if (object == NULL) -+ { -+ g_dbus_method_invocation_take_error (invocation, error); -+ goto out; -+ } -+ -+ block = udisks_object_peek_block (object); -+ daemon = udisks_linux_block_object_get_daemon (UDISKS_LINUX_BLOCK_OBJECT (object)); -+ -+ /* Fail if the device is not a LUKS device */ -+ if (!(g_strcmp0 (udisks_block_get_id_usage (block), "crypto") == 0 && -+ g_strcmp0 (udisks_block_get_id_type (block), "crypto_LUKS") == 0)) -+ { -+ g_dbus_method_invocation_return_error (invocation, -+ UDISKS_ERROR, -+ UDISKS_ERROR_FAILED, -+ "Device %s does not appear to be a LUKS device", -+ udisks_block_get_device (block)); -+ goto out; -+ } -+ -+ error = NULL; -+ if (!udisks_daemon_util_get_caller_uid_sync (daemon, invocation, NULL /* GCancellable */, &caller_uid, NULL, NULL, &error)) -+ { -+ g_dbus_method_invocation_return_gerror (invocation, error); -+ g_clear_error (&error); -+ goto out; -+ } -+ -+ /* Fail if device is not unlocked */ -+ cleartext_object = udisks_daemon_wait_for_object_sync (daemon, -+ wait_for_cleartext_object, -+ g_strdup (g_dbus_object_get_object_path (G_DBUS_OBJECT (object))), -+ g_free, -+ 0, /* timeout_seconds */ -+ NULL); /* error */ -+ if (cleartext_object == NULL) -+ { -+ g_dbus_method_invocation_return_error (invocation, -+ UDISKS_ERROR, -+ UDISKS_ERROR_FAILED, -+ "Device %s is not unlocked", -+ udisks_block_get_device (block)); -+ goto out; -+ } -+ cleartext_block = udisks_object_peek_block (cleartext_object); -+ -+ action_id = "org.freedesktop.udisks2.modify-device"; -+ /* Translators: Shown in authentication dialog when the user -+ * requests resizing a encrypted block device. -+ * -+ * Do not translate $(drive), it's a placeholder and -+ * will be replaced by the name of the drive/device in question -+ */ -+ message = N_("Authentication is required to resize the encrypted device $(drive)"); -+ if (! udisks_daemon_util_setup_by_user (daemon, object, caller_uid)) -+ { -+ if (udisks_block_get_hint_system (block)) -+ { -+ action_id = "org.freedesktop.udisks2.modify-device-system"; -+ } -+ else if (! udisks_daemon_util_on_user_seat (daemon, UDISKS_OBJECT (object), caller_uid)) -+ { -+ action_id = "org.freedesktop.udisks2.modify-device-other-seat"; -+ } -+ } -+ -+ /* Check that the user is actually authorized to resize the device. */ -+ if (! udisks_daemon_util_check_authorization_sync (daemon, -+ object, -+ action_id, -+ options, -+ message, -+ invocation)) -+ goto out; -+ -+ job = udisks_daemon_launch_simple_job (daemon, -+ UDISKS_OBJECT (object), -+ "encrypted-resize", -+ caller_uid, -+ NULL); -+ if (job == NULL) -+ { -+ g_dbus_method_invocation_return_error (invocation, UDISKS_ERROR, UDISKS_ERROR_FAILED, -+ "Failed to create a job object"); -+ goto out; -+ } -+ -+ /* TODO: implement progress parsing for udisks_job_set_progress(_valid) */ -+ if (! bd_crypto_luks_resize (udisks_block_get_device (cleartext_block), size / 512, &error)) -+ { -+ g_dbus_method_invocation_return_error (invocation, -+ UDISKS_ERROR, -+ UDISKS_ERROR_FAILED, -+ "Error resizing encrypted device %s: %s", -+ udisks_block_get_device (cleartext_block), -+ error->message); -+ udisks_simple_job_complete (UDISKS_SIMPLE_JOB (job), FALSE, error->message); -+ goto out; -+ } -+ -+ udisks_encrypted_complete_resize (encrypted, invocation); -+ udisks_simple_job_complete (UDISKS_SIMPLE_JOB (job), TRUE, NULL); -+ -+ out: -+ g_clear_object (&cleartext_object); -+ g_clear_object (&object); -+ g_clear_error (&error); -+ return TRUE; /* returning TRUE means that we handled the method invocation */ -+} -+ -+/* ---------------------------------------------------------------------------------------------------- */ -+ - static void - encrypted_iface_init (UDisksEncryptedIface *iface) - { - iface->handle_unlock = handle_unlock; - iface->handle_lock = handle_lock; - iface->handle_change_passphrase = handle_change_passphrase; -+ iface->handle_resize = handle_resize; - } -diff --git a/udisks/udisksclient.c b/udisks/udisksclient.c -index 7bd5684..980c941 100644 ---- a/udisks/udisksclient.c -+++ b/udisks/udisksclient.c -@@ -2487,6 +2487,7 @@ udisks_client_get_job_description (UDisksClient *client, - g_hash_table_insert (hash, (gpointer) "encrypted-unlock", (gpointer) C_("job", "Unlocking Device")); - g_hash_table_insert (hash, (gpointer) "encrypted-lock", (gpointer) C_("job", "Locking Device")); - g_hash_table_insert (hash, (gpointer) "encrypted-modify", (gpointer) C_("job", "Modifying Encrypted Device")); -+ g_hash_table_insert (hash, (gpointer) "encrypted-resize", (gpointer) C_("job", "Resizing Encrypted Device")); - g_hash_table_insert (hash, (gpointer) "swapspace-start", (gpointer) C_("job", "Starting Swap Device")); - g_hash_table_insert (hash, (gpointer) "swapspace-stop", (gpointer) C_("job", "Stopping Swap Device")); - g_hash_table_insert (hash, (gpointer) "filesystem-check", (gpointer) C_("job", "Checking Filesystem")); --- -1.8.3.1 diff --git a/SOURCES/no_discard_1516697.patch b/SOURCES/no_discard_1516697.patch deleted file mode 100644 index 65eda10..0000000 --- a/SOURCES/no_discard_1516697.patch +++ /dev/null @@ -1,317 +0,0 @@ -From 50b7a2125f77f23901eff12c76efb80881236513 Mon Sep 17 00:00:00 2001 -From: Marius Vollmer -Date: Thu, 23 Nov 2017 11:40:50 +0200 -Subject: [PATCH] Add 'no-discard' option to formatting methods - -It unfortunately seems to be necessary to use this option in certain -situations. See https://bugzilla.redhat.com/show_bug.cgi?id=1516041 -for example. - -(cherry picked from commit 26ac7429b5ef9b5024e54e6eca25b685c0666eb5) - -Conflicts: - src/udiskslinuxblock.c - -Signed-off-by: Vratislav Podzimek ---- - data/org.freedesktop.UDisks2.xml | 4 ++++ - src/tests/integration-test | 14 +++++++----- - src/udiskslinuxblock.c | 48 ++++++++++++++++++++++++++++------------ - src/udiskslinuxfsinfo.c | 31 ++++++++++++++++++-------- - src/udiskslinuxfsinfo.h | 1 + - 5 files changed, 70 insertions(+), 28 deletions(-) - -diff --git a/data/org.freedesktop.UDisks2.xml b/data/org.freedesktop.UDisks2.xml -index fa53a72..1f71ca1 100644 ---- a/data/org.freedesktop.UDisks2.xml -+++ b/data/org.freedesktop.UDisks2.xml -@@ -1404,6 +1404,10 @@ - this allows a deeper check of the parameters even when - no-block is %TRUE. - -+ If the option no-discard is set to -+ %TRUE then Udisks tells the formatting utility not to issue -+ BLKDISCARD ioctls. -+ - If the option config-items is set, it - should be an array of configuration items suitable for - org.freedesktop.UDisks2.Block.AddConfigurationItem. They will -diff --git a/src/tests/integration-test b/src/tests/integration-test -index f863578..0edbb6a 100755 ---- a/src/tests/integration-test -+++ b/src/tests/integration-test -@@ -825,6 +825,8 @@ class FS(UDisksTestCase): - self._do_udisks_check(fs_type, 'test%stst' % fs_type) - # also test fs_create with an empty label - self._do_udisks_check(fs_type, '') -+ # also test fs_create with the no-discard option -+ self._do_udisks_check(fs_type, '', True) - - def _do_cli_check(self, fs_type, label=None): - """udisks correctly picks up file system changes from command line tools""" -@@ -890,15 +892,17 @@ class FS(UDisksTestCase): - subprocess.call(['umount', mount_a]) - self.assertProperty(fs, 'mount-points', []) - -- def _do_udisks_check(self, fs_type, label=None): -+ def _do_udisks_check(self, fs_type, label=None, no_discard=None): - """udisks API correctly changes file system""" - -+ - # create fs -+ options = { } - if label is not None: -- options = GLib.Variant('a{sv}', {'label': GLib.Variant('s', label)}) -- else: -- options = no_options -- self.fs_create(None, fs_type, options) -+ options['label'] = GLib.Variant('s', label); -+ if no_discard is not None: -+ options['no-discard'] = GLib.Variant('b', no_discard); -+ self.fs_create(None, fs_type, GLib.Variant('a{sv}', options)) - - # properties - b_id = self.blkid() -diff --git a/src/udiskslinuxblock.c b/src/udiskslinuxblock.c -index 3d56577..0de5422 100644 ---- a/src/udiskslinuxblock.c -+++ b/src/udiskslinuxblock.c -@@ -2656,6 +2656,27 @@ add_blocksize (gchar **command, - return TRUE; - } - -+static gchar * -+build_command (const gchar *template, -+ const gchar *device, -+ const gchar *label, -+ const gchar *options, -+ GError **error) -+{ -+ gchar *tmp, *tmp2, *command; -+ tmp = udisks_daemon_util_subst_str_and_escape (template, "$DEVICE", device); -+ tmp2 = udisks_daemon_util_subst_str_and_escape (tmp, "$LABEL", label != NULL ? label : ""); -+ command = udisks_daemon_util_subst_str (tmp2, "$OPTIONS", options != NULL ? options : ""); -+ g_free (tmp); -+ g_free (tmp2); -+ if (strstr (command, "$BLOCKSIZE") && ! add_blocksize (&command, device, error)) -+ { -+ g_free (command); -+ return NULL; -+ } -+ -+ return command; -+} - - void - udisks_linux_block_handle_format (UDisksBlock *block, -@@ -2679,8 +2700,8 @@ udisks_linux_block_handle_format (UDisksBlock *block, - const gchar *action_id; - const gchar *message; - const FSInfo *fs_info; -+ const gchar *command_options = NULL; - gchar *command = NULL; -- gchar *tmp; - gchar *error_message; - GError *error; - int status; -@@ -2700,6 +2721,7 @@ udisks_linux_block_handle_format (UDisksBlock *block, - const gchar *partition_type = NULL; - GVariant *config_items = NULL; - gboolean teardown_flag = FALSE; -+ gboolean no_discard_flag = FALSE; - BDPartTableType part_table_type = BD_PART_TABLE_UNDEF; - - error = NULL; -@@ -2723,6 +2745,7 @@ udisks_linux_block_handle_format (UDisksBlock *block, - g_variant_lookup (options, "dry-run-first", "b", &dry_run_first); - g_variant_lookup (options, "config-items", "@a(sa{sv})", &config_items); - g_variant_lookup (options, "tear-down", "b", &teardown_flag); -+ g_variant_lookup (options, "no-discard", "b", &no_discard_flag); - - partition = udisks_object_get_partition (object); - if (partition != NULL) -@@ -2886,21 +2909,20 @@ udisks_linux_block_handle_format (UDisksBlock *block, - goto out; - } - -+ if (no_discard_flag && fs_info->option_no_discard) -+ command_options = fs_info->option_no_discard; -+ - /* If requested, check whether the ultimate filesystem creation - will succeed before actually getting to work. - */ - if (dry_run_first && fs_info->command_validate_create_fs) - { - const gchar *device = udisks_block_get_device (block); -- tmp = udisks_daemon_util_subst_str_and_escape (fs_info->command_validate_create_fs, "$DEVICE", -- device); -- command = udisks_daemon_util_subst_str_and_escape (tmp, "$LABEL", label != NULL ? label : ""); -- g_free (tmp); -- if (strstr (command, "$BLOCKSIZE") && ! add_blocksize (&command, device, &error)) -- { -- handle_format_failure (invocation, error); -- goto out; -- } -+ command = build_command (fs_info->command_validate_create_fs, device, label, command_options, &error); -+ if (command == NULL) { -+ handle_format_failure (invocation, error); -+ goto out; -+ } - - if (!udisks_daemon_launch_spawned_job_sync (daemon, - object, -@@ -3081,10 +3103,8 @@ udisks_linux_block_handle_format (UDisksBlock *block, - { - /* Build and run mkfs shell command */ - const gchar *device = udisks_block_get_device (block_to_mkfs); -- tmp = udisks_daemon_util_subst_str_and_escape (fs_info->command_create_fs, "$DEVICE", device); -- command = udisks_daemon_util_subst_str_and_escape (tmp, "$LABEL", label != NULL ? label : ""); -- g_free (tmp); -- if (strstr (command, "$BLOCKSIZE") && ! add_blocksize (&command, device, &error)) -+ command = build_command (fs_info->command_create_fs, device, label, command_options, &error); -+ if (command == NULL) - { - handle_format_failure (invocation, error); - goto out; -diff --git a/src/udiskslinuxfsinfo.c b/src/udiskslinuxfsinfo.c -index b7834c0..1556af3 100644 ---- a/src/udiskslinuxfsinfo.c -+++ b/src/udiskslinuxfsinfo.c -@@ -70,8 +70,9 @@ const FSInfo _fs_info[] = - NULL, - TRUE, /* supports_online_label_rename */ - TRUE, /* supports_owners */ -- "mkfs.ext2 -F -L $LABEL $DEVICE", -- "mkfs.ext2 -n -F -L $LABEL $DEVICE", -+ "mkfs.ext2 -F -L $LABEL $OPTIONS $DEVICE", -+ "mkfs.ext2 -n -F -L $LABEL $OPTIONS $DEVICE", -+ "-E nodiscard", /* option_no_discard */ - }, - { - FS_EXT3, -@@ -79,8 +80,9 @@ const FSInfo _fs_info[] = - NULL, - TRUE, /* supports_online_label_rename */ - TRUE, /* supports_owners */ -- "mkfs.ext3 -F -L $LABEL $DEVICE", -- "mkfs.ext3 -n -F -L $LABEL $DEVICE", -+ "mkfs.ext3 -F -L $LABEL $OPTIONS $DEVICE", -+ "mkfs.ext3 -n -F -L $LABEL $OPTIONS $DEVICE", -+ "-E nodiscard", /* option_no_discard */ - }, - { - FS_EXT4, -@@ -88,8 +90,9 @@ const FSInfo _fs_info[] = - NULL, - TRUE, /* supports_online_label_rename */ - TRUE, /* supports_owners */ -- "mkfs.ext4 -F -L $LABEL $DEVICE", -- "mkfs.ext4 -n -F -L $LABEL $DEVICE", -+ "mkfs.ext4 -F -L $LABEL $OPTIONS $DEVICE", -+ "mkfs.ext4 -n -F -L $LABEL $OPTIONS $DEVICE", -+ "-E nodiscard", /* option_no_discard */ - }, - { - FS_VFAT, -@@ -99,6 +102,7 @@ const FSInfo _fs_info[] = - FALSE, /* supports_owners */ - "mkfs.vfat -I -n $LABEL $DEVICE", - NULL, -+ NULL, /* option_no_discard */ - }, - { - FS_NTFS, -@@ -108,6 +112,7 @@ const FSInfo _fs_info[] = - FALSE, /* supports_owners */ - "mkntfs -f -F -L $LABEL $DEVICE", - "mkntfs -n -f -F -L $LABEL $DEVICE", -+ NULL, /* option_no_discard */ - }, - { - FS_EXFAT, -@@ -117,6 +122,7 @@ const FSInfo _fs_info[] = - FALSE, /* supports_owners */ - "mkexfatfs -n $LABEL $DEVICE", - NULL, -+ NULL, /* option_no_discard */ - }, - { - FS_XFS, -@@ -124,8 +130,9 @@ const FSInfo _fs_info[] = - "xfs_admin -L -- $DEVICE", - FALSE, /* supports_online_label_rename */ - TRUE, /* supports_owners */ -- "mkfs.xfs -f -L $LABEL $DEVICE", -- "mkfs.xfs -N -f -L $LABEL $DEVICE" -+ "mkfs.xfs -f -L $LABEL $OPTIONS $DEVICE", -+ "mkfs.xfs -N -f -L $LABEL $OPTIONS $DEVICE", -+ "-K" /* option_no_discard */ - }, - { - FS_REISERFS, -@@ -135,6 +142,7 @@ const FSInfo _fs_info[] = - TRUE, /* supports_owners */ - "mkfs.reiserfs -q -l $LABEL $DEVICE", - NULL, -+ NULL, /* option_no_discard */ - }, - { - FS_NILFS2, -@@ -144,6 +152,7 @@ const FSInfo _fs_info[] = - TRUE, /* supports_owners */ - "mkfs.nilfs2 -L $LABEL $DEVICE", - NULL, -+ NULL, /* option_no_discard */ - }, - { - FS_BTRFS, -@@ -151,8 +160,9 @@ const FSInfo _fs_info[] = - NULL, - FALSE, /* supports_online_label_rename */ - TRUE, /* supports_owners */ -- "mkfs.btrfs -L $LABEL $DEVICE", -+ "mkfs.btrfs -L $LABEL $OPTIONS $DEVICE", - NULL, -+ "-K", /* option_no_discard */ - }, - { - FS_MINIX, -@@ -162,6 +172,7 @@ const FSInfo _fs_info[] = - FALSE, /* supports_owners */ - "mkfs.minix $DEVICE", - NULL, -+ NULL, - }, - { - FS_UDF, -@@ -171,6 +182,7 @@ const FSInfo _fs_info[] = - TRUE, /* supports_owners */ - "mkudffs --utf8 --media-type=hd --udfrev=0x201 --blocksize=$BLOCKSIZE --vid $LABEL --lvid $LABEL $DEVICE", - NULL, -+ NULL, - }, - { - FS_F2FS, -@@ -180,6 +192,7 @@ const FSInfo _fs_info[] = - TRUE, /* supports_owners */ - "mkfs.f2fs -l $LABEL $DEVICE", - NULL, -+ NULL, - }, - /* swap space */ - { -diff --git a/src/udiskslinuxfsinfo.h b/src/udiskslinuxfsinfo.h -index 2daec10..6a7a541 100644 ---- a/src/udiskslinuxfsinfo.h -+++ b/src/udiskslinuxfsinfo.h -@@ -35,6 +35,7 @@ typedef struct - gboolean supports_owners; - const gchar *command_create_fs; /* should have $DEVICE and $LABEL */ - const gchar *command_validate_create_fs; /* should have $DEVICE and $LABEL */ -+ const gchar *option_no_discard; - } FSInfo; - - const FSInfo *get_fs_info (const gchar *fstype); --- -2.9.5 - diff --git a/SOURCES/raid_watchers_1400056.patch b/SOURCES/raid_watchers_1400056.patch deleted file mode 100644 index 544fdcd..0000000 --- a/SOURCES/raid_watchers_1400056.patch +++ /dev/null @@ -1,514 +0,0 @@ -From 5bcb348b17935328a2344d811ddba9847ab3c846 Mon Sep 17 00:00:00 2001 -From: Vojtech Trefny -Date: Mon, 16 Oct 2017 12:33:14 +0200 -Subject: [PATCH 1/5] Move some useful mdraid functions to a helper file - -Related: rhbz#1400056 -Signed-off-by: Vratislav Podzimek ---- - src/Makefile.am | 1 + - src/udiskslinuxmdraid.c | 83 ++------------------------------ - src/udiskslinuxmdraidhelpers.c | 104 +++++++++++++++++++++++++++++++++++++++++ - src/udiskslinuxmdraidhelpers.h | 41 ++++++++++++++++ - 4 files changed, 149 insertions(+), 80 deletions(-) - create mode 100644 src/udiskslinuxmdraidhelpers.c - create mode 100644 src/udiskslinuxmdraidhelpers.h - -diff --git a/src/Makefile.am b/src/Makefile.am -index 396ab4e..9cca8cd 100644 ---- a/src/Makefile.am -+++ b/src/Makefile.am -@@ -66,6 +66,7 @@ libudisks_daemon_la_SOURCES = \ - udiskslinuxdrive.h udiskslinuxdrive.c \ - udiskslinuxdriveata.h udiskslinuxdriveata.c \ - udiskslinuxmdraidobject.h udiskslinuxmdraidobject.c \ -+ udiskslinuxmdraidhelpers.h udiskslinuxmdraidhelpers.c \ - udiskslinuxmdraid.h udiskslinuxmdraid.c \ - udiskslinuxmanager.h udiskslinuxmanager.c \ - udiskslinuxfsinfo.h udiskslinuxfsinfo.c \ -diff --git a/src/udiskslinuxmdraid.c b/src/udiskslinuxmdraid.c -index 9bf6ae9..2dcf0ff 100644 ---- a/src/udiskslinuxmdraid.c -+++ b/src/udiskslinuxmdraid.c -@@ -38,6 +38,7 @@ - #include "udiskslinuxprovider.h" - #include "udiskslinuxmdraidobject.h" - #include "udiskslinuxmdraid.h" -+#include "udiskslinuxmdraidhelpers.h" - #include "udiskslinuxblockobject.h" - #include "udisksdaemon.h" - #include "udisksstate.h" -@@ -128,68 +129,6 @@ udisks_linux_mdraid_new (void) - - /* ---------------------------------------------------------------------------------------------------- */ - --static gchar * --read_sysfs_attr (GUdevDevice *device, -- const gchar *attr) --{ -- gchar *ret = NULL; -- gchar *path = NULL; -- GError *error = NULL; -- -- g_return_val_if_fail (G_UDEV_IS_DEVICE (device), NULL); -- -- path = g_strdup_printf ("%s/%s", g_udev_device_get_sysfs_path (device), attr); -- if (!g_file_get_contents (path, &ret, NULL /* size */, &error)) -- { -- udisks_warning ("Error reading sysfs attr `%s': %s (%s, %d)", -- path, error->message, g_quark_to_string (error->domain), error->code); -- g_clear_error (&error); -- goto out; -- } -- -- out: -- g_free (path); -- return ret; --} -- --static gint --read_sysfs_attr_as_int (GUdevDevice *device, -- const gchar *attr) --{ -- gint ret = 0; -- gchar *str = NULL; -- -- str = read_sysfs_attr (device, attr); -- if (str == NULL) -- goto out; -- -- ret = atoi (str); -- g_free (str); -- -- out: -- return ret; --} -- --static guint64 --read_sysfs_attr_as_uint64 (GUdevDevice *device, -- const gchar *attr) --{ -- guint64 ret = 0; -- gchar *str = NULL; -- -- str = read_sysfs_attr (device, attr); -- if (str == NULL) -- goto out; -- -- ret = atoll (str); -- g_free (str); -- -- out: -- return ret; --} -- --/* ---------------------------------------------------------------------------------------------------- */ -- - static gboolean - on_polling_timout (gpointer user_data) - { -@@ -306,8 +245,6 @@ udisks_linux_mdraid_update (UDisksLinuxMDRaid *mdraid, - guint64 sync_remaining_time = 0; - GVariantBuilder builder; - UDisksDaemon *daemon = NULL; -- gboolean has_redundancy = FALSE; -- gboolean has_stripes = FALSE; - UDisksBaseJob *job = NULL; - - daemon = udisks_linux_mdraid_object_get_daemon (object); -@@ -377,23 +314,9 @@ udisks_linux_mdraid_update (UDisksLinuxMDRaid *mdraid, - - udisks_mdraid_set_running (iface, raid_device != NULL); - -- if (g_strcmp0 (level, "raid1") == 0 || -- g_strcmp0 (level, "raid4") == 0 || -- g_strcmp0 (level, "raid5") == 0 || -- g_strcmp0 (level, "raid6") == 0 || -- g_strcmp0 (level, "raid10") == 0) -- has_redundancy = TRUE; -- -- if (g_strcmp0 (level, "raid0") == 0 || -- g_strcmp0 (level, "raid4") == 0 || -- g_strcmp0 (level, "raid5") == 0 || -- g_strcmp0 (level, "raid6") == 0 || -- g_strcmp0 (level, "raid10") == 0) -- has_stripes = TRUE; -- - if (raid_device != NULL) - { -- if (has_redundancy) -+ if (mdraid_has_redundancy (level)) - { - /* Can't use GUdevDevice methods as they cache the result and these variables vary */ - degraded = read_sysfs_attr_as_int (raid_device->udev_device, "md/degraded"); -@@ -408,7 +331,7 @@ udisks_linux_mdraid_update (UDisksLinuxMDRaid *mdraid, - g_strstrip (bitmap_location); - } - -- if (has_stripes) -+ if (mdraid_has_stripes (level)) - { - chunk_size = read_sysfs_attr_as_uint64 (raid_device->udev_device, "md/chunk_size"); - } -diff --git a/src/udiskslinuxmdraidhelpers.c b/src/udiskslinuxmdraidhelpers.c -new file mode 100644 -index 0000000..dafdddf ---- /dev/null -+++ b/src/udiskslinuxmdraidhelpers.c -@@ -0,0 +1,104 @@ -+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- -+ * -+ * Copyright (C) 2017 Red Hat, Inc. -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -+ * -+ * Author: Vojtech Trefny -+ * -+ */ -+ -+#include -+#include -+#include -+ -+#include "udiskslinuxmdraidhelpers.h" -+#include "udiskslogging.h" -+ -+gboolean -+mdraid_has_redundancy (const gchar *raid_level) -+{ -+ return raid_level != NULL && -+ g_str_has_prefix (raid_level, "raid") && -+ g_strcmp0 (raid_level, "raid0") != 0; -+} -+ -+gboolean -+mdraid_has_stripes (const gchar *raid_level) -+{ -+ return raid_level != NULL && -+ g_str_has_prefix (raid_level, "raid") && -+ g_strcmp0 (raid_level, "raid1") != 0; -+} -+ -+gchar * -+read_sysfs_attr (GUdevDevice *device, -+ const gchar *attr) -+{ -+ gchar *ret = NULL; -+ gchar *path = NULL; -+ GError *error = NULL; -+ -+ g_return_val_if_fail (G_UDEV_IS_DEVICE (device), NULL); -+ -+ path = g_strdup_printf ("%s/%s", g_udev_device_get_sysfs_path (device), attr); -+ if (!g_file_get_contents (path, &ret, NULL /* size */, &error)) -+ { -+ udisks_warning ("Error reading sysfs attr `%s': %s (%s, %d)", -+ path, error->message, g_quark_to_string (error->domain), error->code); -+ g_clear_error (&error); -+ goto out; -+ } -+ -+ out: -+ g_free (path); -+ return ret; -+} -+ -+gint -+read_sysfs_attr_as_int (GUdevDevice *device, -+ const gchar *attr) -+{ -+ gint ret = 0; -+ gchar *str = NULL; -+ -+ str = read_sysfs_attr (device, attr); -+ if (str == NULL) -+ goto out; -+ -+ ret = atoi (str); -+ g_free (str); -+ -+ out: -+ return ret; -+} -+ -+guint64 -+read_sysfs_attr_as_uint64 (GUdevDevice *device, -+ const gchar *attr) -+{ -+ guint64 ret = 0; -+ gchar *str = NULL; -+ -+ str = read_sysfs_attr (device, attr); -+ if (str == NULL) -+ goto out; -+ -+ ret = atoll (str); -+ g_free (str); -+ -+ out: -+ return ret; -+} -diff --git a/src/udiskslinuxmdraidhelpers.h b/src/udiskslinuxmdraidhelpers.h -new file mode 100644 -index 0000000..6d2b714 ---- /dev/null -+++ b/src/udiskslinuxmdraidhelpers.h -@@ -0,0 +1,41 @@ -+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- -+ * -+ * Copyright (C) 2017 Red Hat, Inc. -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -+ * -+ * Author: Vojtech Trefny -+ * -+ */ -+ -+#ifndef __UDISKS_LINUX_MDRAID_HELPERS_H__ -+#define __UDISKS_LINUX_MDRAID_HEPLERS_H__ -+ -+#include -+#include -+ -+ -+G_BEGIN_DECLS -+ -+gboolean mdraid_has_redundancy (const gchar *raid_level); -+gboolean mdraid_has_stripes (const gchar *raid_level); -+gchar *read_sysfs_attr (GUdevDevice *device, const gchar *attr); -+gint read_sysfs_attr_as_int (GUdevDevice *device, const gchar *attr); -+guint64 read_sysfs_attr_as_uint64 (GUdevDevice *device, const gchar *attr); -+ -+G_END_DECLS -+ -+ -+#endif /* __UDISKS_LINUX_MDRAID_HEPLERS_H__ */ --- -2.9.5 - -From 61ff342139f21663958bcc2972a3efa37cf7bc83 Mon Sep 17 00:00:00 2001 -From: Vojtech Trefny -Date: Mon, 16 Oct 2017 12:41:22 +0200 -Subject: [PATCH 2/5] Remove leading/trailing white space in 'read_sysfs_attr' - -So we don't have to call 'g_strstrip' after using it. - -Related: rhbz#1400056 -Signed-off-by: Vratislav Podzimek ---- - src/udiskslinuxmdraid.c | 8 -------- - src/udiskslinuxmdraidhelpers.c | 4 ++++ - 2 files changed, 4 insertions(+), 8 deletions(-) - -diff --git a/src/udiskslinuxmdraid.c b/src/udiskslinuxmdraid.c -index 2dcf0ff..22b4ee4 100644 ---- a/src/udiskslinuxmdraid.c -+++ b/src/udiskslinuxmdraid.c -@@ -321,14 +321,8 @@ udisks_linux_mdraid_update (UDisksLinuxMDRaid *mdraid, - /* Can't use GUdevDevice methods as they cache the result and these variables vary */ - degraded = read_sysfs_attr_as_int (raid_device->udev_device, "md/degraded"); - sync_action = read_sysfs_attr (raid_device->udev_device, "md/sync_action"); -- if (sync_action != NULL) -- g_strstrip (sync_action); - sync_completed = read_sysfs_attr (raid_device->udev_device, "md/sync_completed"); -- if (sync_completed != NULL) -- g_strstrip (sync_completed); - bitmap_location = read_sysfs_attr (raid_device->udev_device, "md/bitmap/location"); -- if (bitmap_location != NULL) -- g_strstrip (bitmap_location); - } - - if (mdraid_has_stripes (level)) -@@ -472,7 +466,6 @@ udisks_linux_mdraid_update (UDisksLinuxMDRaid *mdraid, - member_state = read_sysfs_attr (raid_device->udev_device, buf); - if (member_state != NULL) - { -- g_strstrip (member_state); - member_state_elements = g_strsplit (member_state, ",", 0); - } - else -@@ -486,7 +479,6 @@ udisks_linux_mdraid_update (UDisksLinuxMDRaid *mdraid, - member_slot = read_sysfs_attr (raid_device->udev_device, buf); - if (member_slot != NULL) - { -- g_strstrip (member_slot); - if (g_strcmp0 (member_slot, "none") != 0) - member_slot_as_int = atoi (member_slot); - } -diff --git a/src/udiskslinuxmdraidhelpers.c b/src/udiskslinuxmdraidhelpers.c -index dafdddf..297b1fa 100644 ---- a/src/udiskslinuxmdraidhelpers.c -+++ b/src/udiskslinuxmdraidhelpers.c -@@ -62,6 +62,10 @@ read_sysfs_attr (GUdevDevice *device, - goto out; - } - -+ /* remove newline from the attribute */ -+ if (ret != NULL) -+ g_strstrip (ret); -+ - out: - g_free (path); - return ret; --- -2.9.5 - -From 756571efc1b0d602bca2dd4ff761dca686dc08bd Mon Sep 17 00:00:00 2001 -From: Vojtech Trefny -Date: Mon, 16 Oct 2017 12:42:42 +0200 -Subject: [PATCH 3/5] Do not try to create file watchers for RAIDs without - redundancy - -We are trying to watch 'md/degraded' and 'md/sync_action' sysfs -files for all RAIDs but these files exist only for RAIDs with -redundancy -- we shouldn't do this for raid0, containers and linear -RAIDs. - -Resolves: rhbz#1400056 -Signed-off-by: Vratislav Podzimek ---- - src/udiskslinuxmdraidobject.c | 19 +++++++++++++++++++ - 1 file changed, 19 insertions(+) - -diff --git a/src/udiskslinuxmdraidobject.c b/src/udiskslinuxmdraidobject.c -index 493145e..1d2f07a 100644 ---- a/src/udiskslinuxmdraidobject.c -+++ b/src/udiskslinuxmdraidobject.c -@@ -30,6 +30,7 @@ - #include "udisksdaemonutil.h" - #include "udiskslinuxprovider.h" - #include "udiskslinuxmdraidobject.h" -+#include "udiskslinuxmdraidhelpers.h" - #include "udiskslinuxmdraid.h" - #include "udiskslinuxblockobject.h" - #include "udiskslinuxdevice.h" -@@ -552,9 +553,18 @@ static void - raid_device_added (UDisksLinuxMDRaidObject *object, - UDisksLinuxDevice *device) - { -+ gchar *level = NULL; -+ - g_assert (object->sync_action_source == NULL); - g_assert (object->degraded_source == NULL); - -+ if (!UDISKS_IS_LINUX_DEVICE (device)) -+ goto out; -+ -+ level = read_sysfs_attr (device->udev_device, "md/level"); -+ if (level == NULL || !mdraid_has_redundancy (level)) -+ goto out; -+ - /* udisks_debug ("start watching %s", g_udev_device_get_sysfs_path (device->udev_device)); */ - object->sync_action_source = watch_attr (device, - "md/sync_action", -@@ -564,6 +574,9 @@ raid_device_added (UDisksLinuxMDRaidObject *object, - "md/degraded", - (GSourceFunc) attr_changed, - object); -+ -+ out: -+ g_free (level); - } - - static void -@@ -684,6 +697,12 @@ udisks_linux_mdraid_object_uevent (UDisksLinuxMDRaidObject *object, - object->raid_device = g_object_ref (device); - raid_device_added (object, object->raid_device); - } -+ else if (object->sync_action_source == NULL && object->degraded_source == NULL) -+ { -+ /* we don't have file watchers, adding them may failed because -+ we were unable to get raid level, let's try again */ -+ raid_device_added (object, object->raid_device); -+ } - } - } - } --- -2.9.5 - -From ab6ee79abac6a75eddd0ecfba7fc5111663bc50f Mon Sep 17 00:00:00 2001 -From: Vojtech Trefny -Date: Mon, 16 Oct 2017 15:26:16 +0200 -Subject: [PATCH 5/5] Try to use libblockdev to get RAID array size - -If reading size from sysfs fails, try to use libblockdev to read -it from mdadm --examine data. - -Signed-off-by: Vratislav Podzimek ---- - src/udiskslinuxmdraid.c | 15 ++++++++++++++- - 1 file changed, 14 insertions(+), 1 deletion(-) - -diff --git a/src/udiskslinuxmdraid.c b/src/udiskslinuxmdraid.c -index 22b4ee4..6c94a2b 100644 ---- a/src/udiskslinuxmdraid.c -+++ b/src/udiskslinuxmdraid.c -@@ -246,6 +246,8 @@ udisks_linux_mdraid_update (UDisksLinuxMDRaid *mdraid, - GVariantBuilder builder; - UDisksDaemon *daemon = NULL; - UDisksBaseJob *job = NULL; -+ GError *error = NULL; -+ BDMDExamineData *raid_data = NULL; - - daemon = udisks_linux_mdraid_object_get_daemon (object); - -@@ -303,7 +305,15 @@ udisks_linux_mdraid_update (UDisksLinuxMDRaid *mdraid, - } - else - { -- /* TODO: need MD_ARRAY_SIZE, see https://bugs.freedesktop.org/show_bug.cgi?id=53239#c5 */ -+ raid_data = bd_md_examine (g_udev_device_get_device_file (device->udev_device), -+ &error); -+ if (raid_data == NULL) -+ { -+ udisks_debug ("Failed to read array size: %s", error->message); -+ g_clear_error (&error); -+ } -+ else -+ size = raid_data->size; - } - - udisks_mdraid_set_uuid (iface, uuid); -@@ -523,11 +533,14 @@ udisks_linux_mdraid_update (UDisksLinuxMDRaid *mdraid, - uuid)); - - out: -+ if (raid_data) -+ bd_md_examine_data_free (raid_data); - g_free (sync_completed); - g_free (sync_action); - g_free (bitmap_location); - g_list_free_full (member_devices, g_object_unref); - g_clear_object (&raid_device); -+ g_clear_error (&error); - return ret; - } - --- -2.9.5 - diff --git a/SOURCES/reboot_mpoint_cleanup_1384796.patch b/SOURCES/reboot_mpoint_cleanup_1384796.patch deleted file mode 100644 index 2b68e95..0000000 --- a/SOURCES/reboot_mpoint_cleanup_1384796.patch +++ /dev/null @@ -1,212 +0,0 @@ -From 6121d5437d7800876567fd08b6020ca1d72eeaac Mon Sep 17 00:00:00 2001 -From: Vratislav Podzimek -Date: Fri, 20 Oct 2017 13:24:20 +0200 -Subject: [PATCH] Add and use a service for cleaning up mount point directories - -When udisks2 is used for mounting devices, it may need to create -the mount point directory. If unmount happens later, udisks2 -cleans after itself and removes the mount point -directory. However, if the unmount happens during reboot, the -udisks2 daemon may already be terminated not having a chance to -do the cleanup. We need a different mechanism to do the job in -such cases. - -systemd provides us with such a mechanism so let's make use of -it. - -Resolves: rhbz#1384796 -Signed-off-by: Vratislav Podzimek ---- - data/Makefile.am | 6 ++-- - data/clean-mount-point@.service | 10 +++++++ - packaging/udisks2.spec | 1 + - src/Makefile.am | 3 +- - src/udiskslinuxfilesystem.c | 61 +++++++++++++++++++++++++++++++++++++++-- - 5 files changed, 74 insertions(+), 7 deletions(-) - create mode 100644 data/clean-mount-point@.service - -diff --git a/data/Makefile.am b/data/Makefile.am -index 83af330..9b8073a 100644 ---- a/data/Makefile.am -+++ b/data/Makefile.am -@@ -15,14 +15,14 @@ dbusconf_DATA = $(dbusconf_in_files:.conf.in=.conf) - $(dbusconf_DATA): $(dbusconf_in_files) Makefile - cp $< $@ - --systemdservice_in_files = udisks2.service.in -+systemdservice_in_files = udisks2.service.in clean-mount-point@.service - - if HAVE_SYSTEMD - systemdservicedir = $(systemdsystemunitdir) - systemdservice_DATA = $(systemdservice_in_files:.service.in=.service) - --$(systemdservice_DATA): $(systemdservice_in_files) Makefile -- @sed -e "s|\@udisksdprivdir\@|$(libexecdir)/udisks2|" $< > $@ -+$(systemdservice_DATA): udisks2.service.in Makefile -+ @sed -e "s|\@udisksdprivdir\@|$(libexecdir)/udisks2|" udisks2.service.in > udisks2.service - endif - - udevrulesdir = $(udevdir)/rules.d -diff --git a/data/clean-mount-point@.service b/data/clean-mount-point@.service -new file mode 100644 -index 0000000..83edceb ---- /dev/null -+++ b/data/clean-mount-point@.service -@@ -0,0 +1,10 @@ -+[Unit] -+Description=Clean the %f mount point -+Before=%i.mount -+BindsTo=%i.mount -+DefaultDependencies=no -+ -+[Service] -+Type=oneshot -+RemainAfterExit=true -+ExecStop=/bin/rm -fd %f -diff --git a/src/Makefile.am b/src/Makefile.am -index 396ab4e..3b22cca 100644 ---- a/src/Makefile.am -+++ b/src/Makefile.am -@@ -113,7 +113,8 @@ libudisks_daemon_la_LIBADD = \ - $(GIO_LIBS) \ - $(GMODULE_LIBS) \ - $(GUDEV_LIBS) \ -- $(BLOCKDEV_LIBS) \ -+ $(BLOCKDEV_LIBS) \ -+ -lbd_utils \ - $(LIBATASMART_LIBS) \ - $(POLKIT_GOBJECT_1_LIBS) \ - $(ACL_LIBS) \ -diff --git a/src/udiskslinuxfilesystem.c b/src/udiskslinuxfilesystem.c -index 4cd2784..2910181 100644 ---- a/src/udiskslinuxfilesystem.c -+++ b/src/udiskslinuxfilesystem.c -@@ -86,9 +86,11 @@ G_DEFINE_TYPE_WITH_CODE (UDisksLinuxFilesystem, udisks_linux_filesystem, UDISKS_ - G_IMPLEMENT_INTERFACE (UDISKS_TYPE_FILESYSTEM, filesystem_iface_init)); - - #ifdef HAVE_FHS_MEDIA --# define MOUNT_BASE "/media" -+#define MOUNT_BASE "/media" -+#define MOUNT_BASE_PERSISTENT TRUE - #else --# define MOUNT_BASE "/run/media" -+#define MOUNT_BASE "/run/media" -+#define MOUNT_BASE_PERSISTENT FALSE - #endif - - /* ---------------------------------------------------------------------------------------------------- */ -@@ -833,6 +835,7 @@ add_acl (const gchar *path, - * @gid: group id of the calling user - * @user_name: user name of the calling user - * @fs_type: The file system type to mount with -+ * @persistent: if the mount point is persistent (survives reboot) or not - * @error: Return location for error or %NULL. - * - * Calculates the mount point to use. -@@ -846,6 +849,7 @@ calculate_mount_point (UDisksDaemon *daemon, - gid_t gid, - const gchar *user_name, - const gchar *fs_type, -+ gboolean *persistent, - GError **error) - { - UDisksLinuxBlockObject *object = NULL; -@@ -889,6 +893,7 @@ calculate_mount_point (UDisksDaemon *daemon, - if (!fs_shared && (user_name != NULL && strstr (user_name, "/") == NULL)) - { - mount_dir = g_strdup_printf (MOUNT_BASE "/%s", user_name); -+ *persistent = MOUNT_BASE_PERSISTENT; - if (!g_file_test (mount_dir, G_FILE_TEST_EXISTS)) - { - /* First ensure that MOUNT_BASE exists */ -@@ -933,8 +938,10 @@ calculate_mount_point (UDisksDaemon *daemon, - } - } - /* otherwise fall back to mounting in /media */ -- if (mount_dir == NULL) -+ if (mount_dir == NULL) { - mount_dir = g_strdup ("/media"); -+ *persistent = TRUE; -+ } - - /* NOTE: UTF-8 has the nice property that valid UTF-8 strings only contains - * the byte 0x2F if it's for the '/' character (U+002F SOLIDUS). -@@ -1135,6 +1142,49 @@ is_system_managed (UDisksBlock *block, - return ret; - } - -+static void trigger_mpoint_cleanup (const gchar *mount_point) -+{ -+ const gchar *argv[] = {"systemctl", "start", NULL, NULL}; -+ GError *error = NULL; -+ gchar *escaped_mpoint = NULL; -+ gsize len = 0; -+ -+ if (g_str_has_prefix (mount_point, "/")) -+ mount_point++; -+ else -+ udisks_warning ("Invalid mount point given to trigger_mpoint_cleanup(): %s", -+ mount_point); -+ -+ /* start with the mount point without the leading '/' */ -+ escaped_mpoint = g_strdup (mount_point); -+ -+ /* and replace all '/'s with '-'s */ -+ for (gchar *letter = escaped_mpoint; *letter != '\0'; letter++, len++) -+ { -+ if (*letter == '/') -+ *letter = '-'; -+ } -+ -+ /* remove the potential trailing '-' (would happen if the given mount_point -+ has a trailing '/') */ -+ if (escaped_mpoint[len - 1] == '-') -+ escaped_mpoint[len - 1] = '\0'; -+ -+ argv[2] = g_strdup_printf ("clean-mount-point@%s", escaped_mpoint); -+ -+ if (!bd_utils_exec_and_report_error (argv, NULL, &error) && (error != NULL)) -+ { -+ /* this is a best-effort mechanism, if it fails, just log warning and move -+ on */ -+ udisks_warning ("Failed to setup systemd-based mount point cleanup: %s", -+ error->message); -+ g_clear_error (&error); -+ } -+ -+ g_free (escaped_mpoint); -+ g_free ((gchar *) argv[2]); -+} -+ - /* ---------------------------------------------------------------------------------------------------- */ - - /* runs in thread dedicated to handling @invocation */ -@@ -1154,6 +1204,7 @@ handle_mount (UDisksFilesystem *filesystem, - gchar *fs_type_to_use = NULL; - gchar *mount_options_to_use = NULL; - gchar *mount_point_to_use = NULL; -+ gboolean mpoint_persistent = TRUE; - gchar *fstab_mount_options = NULL; - gchar *caller_user_name = NULL; - GError *error = NULL; -@@ -1443,6 +1494,7 @@ handle_mount (UDisksFilesystem *filesystem, - caller_gid, - caller_user_name, - fs_type_to_use, -+ &mpoint_persistent, - &error); - if (mount_point_to_use == NULL) - { -@@ -1487,6 +1539,9 @@ handle_mount (UDisksFilesystem *filesystem, - else - udisks_simple_job_complete (UDISKS_SIMPLE_JOB (job), TRUE, NULL); - -+ if (mpoint_persistent) -+ trigger_mpoint_cleanup (mount_point_to_use); -+ - /* update the mounted-fs file */ - udisks_state_add_mounted_fs (state, - mount_point_to_use, --- -2.9.5 - diff --git a/SOURCES/tests_add_targetcli_config_1511986.patch b/SOURCES/tests_add_targetcli_config_1511986.patch deleted file mode 100644 index 505c07d..0000000 --- a/SOURCES/tests_add_targetcli_config_1511986.patch +++ /dev/null @@ -1,630 +0,0 @@ -From 76168cd9244fc47193760a0401bf42f1a8b06db6 Mon Sep 17 00:00:00 2001 -From: Iain Lane -Date: Thu, 19 Apr 2018 12:41:27 +0100 -Subject: [PATCH 1/2] tests: Pass absolute path to targetcli_config.json - -If the integration tests are run from a different directory, we will -fail to find targetcli_config.json with an error like - -Related: rhbz#1511986 ---- - src/tests/integration-test | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/src/tests/integration-test b/src/tests/integration-test -index f863578..bca5239 100755 ---- a/src/tests/integration-test -+++ b/src/tests/integration-test -@@ -1649,9 +1649,12 @@ def setup_lio(): - re.match(r'sd[a-z]+$', dev)} - - # create fake SCSI hard drives -+ our_path = os.path.abspath(__file__) -+ our_dir = os.path.dirname(our_path) -+ json_path = os.path.join(our_dir, 'dbus-tests', 'targetcli_config.json') - assert subprocess.call( - ["targetcli", -- "restoreconfig dbus-tests/targetcli_config.json"]) == 0 -+ "restoreconfig %s" % json_path]) == 0 - time.sleep(0.1) - - devs = {dev for dev in os.listdir("/dev") if --- -1.8.3.1 - - -From f8fef004a8ce9bc64bea1d89dcce0d7465e583ed Mon Sep 17 00:00:00 2001 -From: Vojtech Trefny -Date: Fri, 22 Jun 2018 12:37:17 +0200 -Subject: [PATCH 2/2] Fix failing MDRAID integration test - -Test is failing because 'targetcli_config.json' is not included -in the archive, so we need to add it manually using a patch. - -Resolves: rhbz#1511986 ---- - src/tests/integration-test | 2 +- - src/tests/targetcli_config.json | 558 ++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 559 insertions(+), 1 deletion(-) - create mode 100644 src/tests/targetcli_config.json - -diff --git a/src/tests/integration-test b/src/tests/integration-test -index bca5239..b6b1103 100755 ---- a/src/tests/integration-test -+++ b/src/tests/integration-test -@@ -1651,7 +1651,7 @@ def setup_lio(): - # create fake SCSI hard drives - our_path = os.path.abspath(__file__) - our_dir = os.path.dirname(our_path) -- json_path = os.path.join(our_dir, 'dbus-tests', 'targetcli_config.json') -+ json_path = os.path.join(our_dir, 'targetcli_config.json') - assert subprocess.call( - ["targetcli", - "restoreconfig %s" % json_path]) == 0 -diff --git a/src/tests/targetcli_config.json b/src/tests/targetcli_config.json -new file mode 100644 -index 0000000..25d506b ---- /dev/null -+++ b/src/tests/targetcli_config.json -@@ -0,0 +1,558 @@ -+{ -+ "fabric_modules": [], -+ "storage_objects": [ -+ { -+ "attributes": { -+ "block_size": 512, -+ "emulate_3pc": 1, -+ "emulate_caw": 1, -+ "emulate_fua_write": 1, -+ "emulate_model_alias": 1, -+ "emulate_rest_reord": 0, -+ "emulate_tas": 1, -+ "emulate_tpu": 0, -+ "emulate_tpws": 0, -+ "emulate_ua_intlck_ctrl": 0, -+ "emulate_write_cache": 1, -+ "enforce_pr_isids": 1, -+ "force_pr_aptpl": 0, -+ "is_nonrot": 0, -+ "max_unmap_block_desc_count": 1, -+ "max_unmap_lba_count": 8192, -+ "max_write_same_len": 4096, -+ "optimal_sectors": 2048, -+ "pi_prot_format": 0, -+ "pi_prot_type": 0, -+ "queue_depth": 128, -+ "unmap_granularity": 1, -+ "unmap_granularity_alignment": 0 -+ }, -+ "dev": "/var/tmp/udisks_test_disk4", -+ "name": "udisks_test_disk4", -+ "plugin": "fileio", -+ "size": 524288000, -+ "write_back": true, -+ "wwn": "65541bbc-0ffc-42cb-b639-6ce91a818511" -+ }, -+ { -+ "attributes": { -+ "block_size": 512, -+ "emulate_3pc": 1, -+ "emulate_caw": 1, -+ "emulate_fua_write": 1, -+ "emulate_model_alias": 1, -+ "emulate_rest_reord": 0, -+ "emulate_tas": 1, -+ "emulate_tpu": 0, -+ "emulate_tpws": 0, -+ "emulate_ua_intlck_ctrl": 0, -+ "emulate_write_cache": 1, -+ "enforce_pr_isids": 1, -+ "force_pr_aptpl": 0, -+ "is_nonrot": 0, -+ "max_unmap_block_desc_count": 1, -+ "max_unmap_lba_count": 8192, -+ "max_write_same_len": 4096, -+ "optimal_sectors": 2048, -+ "pi_prot_format": 0, -+ "pi_prot_type": 0, -+ "queue_depth": 128, -+ "unmap_granularity": 1, -+ "unmap_granularity_alignment": 0 -+ }, -+ "dev": "/var/tmp/udisks_test_disk3", -+ "name": "udisks_test_disk3", -+ "plugin": "fileio", -+ "size": 524288000, -+ "write_back": true, -+ "wwn": "5282611e-2e74-4019-8ca5-d8ceb09dfa15" -+ }, -+ { -+ "attributes": { -+ "block_size": 512, -+ "emulate_3pc": 1, -+ "emulate_caw": 1, -+ "emulate_fua_write": 1, -+ "emulate_model_alias": 1, -+ "emulate_rest_reord": 0, -+ "emulate_tas": 1, -+ "emulate_tpu": 0, -+ "emulate_tpws": 0, -+ "emulate_ua_intlck_ctrl": 0, -+ "emulate_write_cache": 1, -+ "enforce_pr_isids": 1, -+ "force_pr_aptpl": 0, -+ "is_nonrot": 0, -+ "max_unmap_block_desc_count": 1, -+ "max_unmap_lba_count": 8192, -+ "max_write_same_len": 4096, -+ "optimal_sectors": 2048, -+ "pi_prot_format": 0, -+ "pi_prot_type": 0, -+ "queue_depth": 128, -+ "unmap_granularity": 1, -+ "unmap_granularity_alignment": 0 -+ }, -+ "dev": "/var/tmp/udisks_test_disk2", -+ "name": "udisks_test_disk2", -+ "plugin": "fileio", -+ "size": 524288000, -+ "write_back": true, -+ "wwn": "dd927109-b9e7-462c-b95a-ae7878623713" -+ }, -+ { -+ "attributes": { -+ "block_size": 512, -+ "emulate_3pc": 1, -+ "emulate_caw": 1, -+ "emulate_fua_write": 1, -+ "emulate_model_alias": 1, -+ "emulate_rest_reord": 0, -+ "emulate_tas": 1, -+ "emulate_tpu": 0, -+ "emulate_tpws": 0, -+ "emulate_ua_intlck_ctrl": 0, -+ "emulate_write_cache": 1, -+ "enforce_pr_isids": 1, -+ "force_pr_aptpl": 0, -+ "is_nonrot": 0, -+ "max_unmap_block_desc_count": 1, -+ "max_unmap_lba_count": 8192, -+ "max_write_same_len": 4096, -+ "optimal_sectors": 2048, -+ "pi_prot_format": 0, -+ "pi_prot_type": 0, -+ "queue_depth": 128, -+ "unmap_granularity": 1, -+ "unmap_granularity_alignment": 0 -+ }, -+ "dev": "/var/tmp/udisks_test_disk1", -+ "name": "udisks_test_disk1", -+ "plugin": "fileio", -+ "size": 524288000, -+ "write_back": true, -+ "wwn": "0604a813-ce79-45fa-a9ff-eaf82188594e" -+ }, -+ { -+ "attributes": { -+ "block_size": 512, -+ "emulate_3pc": 1, -+ "emulate_caw": 1, -+ "emulate_fua_write": 1, -+ "emulate_model_alias": 1, -+ "emulate_rest_reord": 0, -+ "emulate_tas": 1, -+ "emulate_tpu": 0, -+ "emulate_tpws": 0, -+ "emulate_ua_intlck_ctrl": 0, -+ "emulate_write_cache": 1, -+ "enforce_pr_isids": 1, -+ "force_pr_aptpl": 0, -+ "is_nonrot": 0, -+ "max_unmap_block_desc_count": 1, -+ "max_unmap_lba_count": 8192, -+ "max_write_same_len": 4096, -+ "optimal_sectors": 2048, -+ "pi_prot_format": 0, -+ "pi_prot_type": 0, -+ "queue_depth": 128, -+ "unmap_granularity": 1, -+ "unmap_granularity_alignment": 0 -+ }, -+ "dev": "/var/tmp/udisks_test_disk_iscsi1", -+ "name": "udisks_test_iscsi1", -+ "plugin": "fileio", -+ "size": 524288000, -+ "write_back": true, -+ "wwn": "ee5473b7-93ce-4002-8141-2ef990f7ba04" -+ }, -+ { -+ "attributes": { -+ "block_size": 512, -+ "emulate_3pc": 1, -+ "emulate_caw": 1, -+ "emulate_fua_write": 1, -+ "emulate_model_alias": 1, -+ "emulate_rest_reord": 0, -+ "emulate_tas": 1, -+ "emulate_tpu": 0, -+ "emulate_tpws": 0, -+ "emulate_ua_intlck_ctrl": 0, -+ "emulate_write_cache": 1, -+ "enforce_pr_isids": 1, -+ "force_pr_aptpl": 0, -+ "is_nonrot": 0, -+ "max_unmap_block_desc_count": 1, -+ "max_unmap_lba_count": 8192, -+ "max_write_same_len": 4096, -+ "optimal_sectors": 2048, -+ "pi_prot_format": 0, -+ "pi_prot_type": 0, -+ "queue_depth": 128, -+ "unmap_granularity": 1, -+ "unmap_granularity_alignment": 0 -+ }, -+ "dev": "/var/tmp/udisks_test_disk_iscsi2", -+ "name": "udisks_test_iscsi2", -+ "plugin": "fileio", -+ "size": 524288000, -+ "write_back": true, -+ "wwn": "ee5473b7-93ce-4002-8141-2ef990f7ba04" -+ }, -+ { -+ "attributes": { -+ "block_size": 512, -+ "emulate_3pc": 1, -+ "emulate_caw": 1, -+ "emulate_fua_write": 1, -+ "emulate_model_alias": 1, -+ "emulate_rest_reord": 0, -+ "emulate_tas": 1, -+ "emulate_tpu": 0, -+ "emulate_tpws": 0, -+ "emulate_ua_intlck_ctrl": 0, -+ "emulate_write_cache": 1, -+ "enforce_pr_isids": 1, -+ "force_pr_aptpl": 0, -+ "is_nonrot": 0, -+ "max_unmap_block_desc_count": 1, -+ "max_unmap_lba_count": 8192, -+ "max_write_same_len": 4096, -+ "optimal_sectors": 2048, -+ "pi_prot_format": 0, -+ "pi_prot_type": 0, -+ "queue_depth": 128, -+ "unmap_granularity": 1, -+ "unmap_granularity_alignment": 0 -+ }, -+ "dev": "/var/tmp/udisks_test_disk_iscsi3", -+ "name": "udisks_test_iscsi3", -+ "plugin": "fileio", -+ "size": 524288000, -+ "write_back": true, -+ "wwn": "ee5473b7-93ce-4002-8141-2ef990f7ba04" -+ } -+ ], -+ "targets": [ -+ { -+ "fabric": "loopback", -+ "tpgs": [ -+ { -+ "attributes": { -+ }, -+ "enable": true, -+ "luns": [ -+ { -+ "alias": "ea4c386be4", -+ "index": 0, -+ "storage_object": "/backstores/fileio/udisks_test_disk4" -+ } -+ ], -+ "node_acls": [], -+ "portals": [], -+ "tag": 1 -+ } -+ ], -+ "wwn": "naa.50014055ba294ff9" -+ }, -+ { -+ "fabric": "loopback", -+ "tpgs": [ -+ { -+ "attributes": { -+ }, -+ "enable": true, -+ "luns": [ -+ { -+ "alias": "7a8a8952a0", -+ "index": 0, -+ "storage_object": "/backstores/fileio/udisks_test_disk3" -+ } -+ ], -+ "node_acls": [], -+ "portals": [], -+ "tag": 1 -+ } -+ ], -+ "wwn": "naa.5001405929853f55" -+ }, -+ { -+ "fabric": "loopback", -+ "tpgs": [ -+ { -+ "attributes": { -+ }, -+ "enable": true, -+ "luns": [ -+ { -+ "alias": "d0173d579b", -+ "index": 0, -+ "storage_object": "/backstores/fileio/udisks_test_disk2" -+ } -+ ], -+ "node_acls": [], -+ "portals": [], -+ "tag": 1 -+ } -+ ], -+ "wwn": "naa.50014054a77f7fa2" -+ }, -+ { -+ "fabric": "loopback", -+ "tpgs": [ -+ { -+ "attributes": { -+ }, -+ "enable": true, -+ "luns": [ -+ { -+ "alias": "d4a2f5275c", -+ "index": 0, -+ "storage_object": "/backstores/fileio/udisks_test_disk1" -+ } -+ ], -+ "node_acls": [], -+ "portals": [], -+ "tag": 1 -+ } -+ ], -+ "wwn": "naa.5001405cf0711e93" -+ }, -+ { -+ "fabric": "iscsi", -+ "tpgs": [ -+ { -+ "attributes": { -+ "authentication": 0, -+ "cache_dynamic_acls": 1, -+ "default_cmdsn_depth": 64, -+ "default_erl": 0, -+ "demo_mode_discovery": 1, -+ "demo_mode_write_protect": 0, -+ "generate_node_acls": 1, -+ "login_timeout": 15, -+ "netif_timeout": 2, -+ "prod_mode_write_protect": 0, -+ "t10_pi": 0, -+ "tpg_enabled_sendtargets": 1 -+ }, -+ "enable": true, -+ "luns": [ -+ { -+ "alias": "121c69c714", -+ "index": 0, -+ "storage_object": "/backstores/fileio/udisks_test_iscsi1" -+ } -+ ], -+ "node_acls": [], -+ "parameters": { -+ "AuthMethod": "CHAP,None", -+ "DataDigest": "CRC32C,None", -+ "DataPDUInOrder": "Yes", -+ "DataSequenceInOrder": "Yes", -+ "DefaultTime2Retain": "20", -+ "DefaultTime2Wait": "2", -+ "ErrorRecoveryLevel": "0", -+ "FirstBurstLength": "65536", -+ "HeaderDigest": "CRC32C,None", -+ "IFMarkInt": "Reject", -+ "IFMarker": "No", -+ "ImmediateData": "Yes", -+ "InitialR2T": "Yes", -+ "MaxBurstLength": "262144", -+ "MaxConnections": "1", -+ "MaxOutstandingR2T": "1", -+ "MaxRecvDataSegmentLength": "8192", -+ "MaxXmitDataSegmentLength": "262144", -+ "OFMarkInt": "Reject", -+ "OFMarker": "No", -+ "TargetAlias": "LIO Target" -+ }, -+ "portals": [ -+ { -+ "ip_address": "0.0.0.0", -+ "iser": false, -+ "port": 3260 -+ } -+ ], -+ "tag": 1 -+ } -+ ], -+ "wwn": "iqn.2003-01.udisks.test:iscsi-test-noauth" -+ }, -+ { -+ "fabric": "iscsi", -+ "tpgs": [ -+ { -+ "attributes": { -+ "authentication": 0, -+ "cache_dynamic_acls": 0, -+ "default_cmdsn_depth": 64, -+ "default_erl": 0, -+ "demo_mode_discovery": 1, -+ "demo_mode_write_protect": 1, -+ "generate_node_acls": 0, -+ "login_timeout": 15, -+ "netif_timeout": 2, -+ "prod_mode_write_protect": 0, -+ "t10_pi": 0, -+ "tpg_enabled_sendtargets": 1 -+ }, -+ "enable": true, -+ "luns": [ -+ { -+ "alias": "f466bcd8fb", -+ "index": 0, -+ "storage_object": "/backstores/fileio/udisks_test_iscsi2" -+ } -+ ], -+ "node_acls": [ -+ { -+ "attributes": { -+ "dataout_timeout": 3, -+ "dataout_timeout_retries": 5, -+ "default_erl": 0, -+ "nopin_response_timeout": 30, -+ "nopin_timeout": 15, -+ "random_datain_pdu_offsets": 0, -+ "random_datain_seq_offsets": 0, -+ "random_r2t_offsets": 0 -+ }, -+ "chap_password": "udisks", -+ "chap_userid": "iqn.1994-05.com.redhat:iscsi-test", -+ "mapped_luns": [ -+ { -+ "alias": "2387cf5a50", -+ "index": 0, -+ "tpg_lun": 0, -+ "write_protect": false -+ } -+ ], -+ "node_wwn": "iqn.1994-05.com.redhat:iscsi-test" -+ } -+ ], -+ "parameters": { -+ "AuthMethod": "CHAP,None", -+ "DataDigest": "CRC32C,None", -+ "DataPDUInOrder": "Yes", -+ "DataSequenceInOrder": "Yes", -+ "DefaultTime2Retain": "20", -+ "DefaultTime2Wait": "2", -+ "ErrorRecoveryLevel": "0", -+ "FirstBurstLength": "65536", -+ "HeaderDigest": "CRC32C,None", -+ "IFMarkInt": "Reject", -+ "IFMarker": "No", -+ "ImmediateData": "Yes", -+ "InitialR2T": "Yes", -+ "MaxBurstLength": "262144", -+ "MaxConnections": "1", -+ "MaxOutstandingR2T": "1", -+ "MaxRecvDataSegmentLength": "8192", -+ "MaxXmitDataSegmentLength": "262144", -+ "OFMarkInt": "Reject", -+ "OFMarker": "No", -+ "TargetAlias": "LIO Target" -+ }, -+ "portals": [ -+ { -+ "ip_address": "0.0.0.0", -+ "iser": false, -+ "port": 3260 -+ } -+ ], -+ "tag": 1 -+ } -+ ], -+ "wwn": "iqn.2003-01.udisks.test:iscsi-test-chap" -+ }, -+ { -+ "fabric": "iscsi", -+ "tpgs": [ -+ { -+ "attributes": { -+ "authentication": 0, -+ "cache_dynamic_acls": 0, -+ "default_cmdsn_depth": 64, -+ "default_erl": 0, -+ "demo_mode_discovery": 1, -+ "demo_mode_write_protect": 1, -+ "generate_node_acls": 0, -+ "login_timeout": 15, -+ "netif_timeout": 2, -+ "prod_mode_write_protect": 0, -+ "t10_pi": 0, -+ "tpg_enabled_sendtargets": 1 -+ }, -+ "enable": true, -+ "luns": [ -+ { -+ "alias": "f466bcd8fb", -+ "index": 0, -+ "storage_object": "/backstores/fileio/udisks_test_iscsi3" -+ } -+ ], -+ "node_acls": [ -+ { -+ "attributes": { -+ "dataout_timeout": 3, -+ "dataout_timeout_retries": 5, -+ "default_erl": 0, -+ "nopin_response_timeout": 30, -+ "nopin_timeout": 15, -+ "random_datain_pdu_offsets": 0, -+ "random_datain_seq_offsets": 0, -+ "random_r2t_offsets": 0 -+ }, -+ "chap_password": "udisks", -+ "chap_userid": "iqn.1994-05.com.redhat:iscsi-test", -+ "chap_mutual_password": "udisks-mutual", -+ "chap_mutual_userid": "iqn.2003-01.udisks.test:iscsi-test-mutual", -+ "mapped_luns": [ -+ { -+ "alias": "2387cf5a50", -+ "index": 0, -+ "tpg_lun": 0, -+ "write_protect": false -+ } -+ ], -+ "node_wwn": "iqn.1994-05.com.redhat:iscsi-test" -+ } -+ ], -+ "parameters": { -+ "AuthMethod": "CHAP,None", -+ "DataDigest": "CRC32C,None", -+ "DataPDUInOrder": "Yes", -+ "DataSequenceInOrder": "Yes", -+ "DefaultTime2Retain": "20", -+ "DefaultTime2Wait": "2", -+ "ErrorRecoveryLevel": "0", -+ "FirstBurstLength": "65536", -+ "HeaderDigest": "CRC32C,None", -+ "IFMarkInt": "Reject", -+ "IFMarker": "No", -+ "ImmediateData": "Yes", -+ "InitialR2T": "Yes", -+ "MaxBurstLength": "262144", -+ "MaxConnections": "1", -+ "MaxOutstandingR2T": "1", -+ "MaxRecvDataSegmentLength": "8192", -+ "MaxXmitDataSegmentLength": "262144", -+ "OFMarkInt": "Reject", -+ "OFMarker": "No", -+ "TargetAlias": "LIO Target" -+ }, -+ "portals": [ -+ { -+ "ip_address": "0.0.0.0", -+ "iser": false, -+ "port": 3260 -+ } -+ ], -+ "tag": 1 -+ } -+ ], -+ "wwn": "iqn.2003-01.udisks.test:iscsi-test-mutual" -+ } -+ ] -+} --- -1.8.3.1 - diff --git a/SOURCES/tests_distro_check_1508385.patch b/SOURCES/tests_distro_check_1508385.patch deleted file mode 100644 index ec85549..0000000 --- a/SOURCES/tests_distro_check_1508385.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 6ad2d39f31e9efbbd0ab4f48e5796e9d0485c59f Mon Sep 17 00:00:00 2001 -From: Vojtech Trefny -Date: Thu, 2 Nov 2017 14:00:12 +0100 -Subject: [PATCH] Fix checking for distribution and version in integration - tests - -And also don't try to run the tests if we fail to detect the -distribution and/or version. - -Resolves: rhbz#1508385 ---- - src/tests/integration-test | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/src/tests/integration-test b/src/tests/integration-test -index 019a8dc..44ddec5 100755 ---- a/src/tests/integration-test -+++ b/src/tests/integration-test -@@ -1747,7 +1747,11 @@ class MDRaid(UDisksTestCase): - def get_distro_version(): - # 3rd to 6th fields from e.g. "CPE OS Name: cpe:/o:fedoraproject:fedora:27" or "CPE OS Name: cpe:/o:centos:centos:7" - out = subprocess.check_output('hostnamectl status | grep "CPE OS Name"', shell=True).decode().strip() -- _project, distro, version = tuple(out.split(":")[3:65]) -+ try: -+ _project, distro, version = tuple(out.split(":")[3:6]) -+ except ValueError: -+ print('Failed to get distribution and version from "%s". Aborting.' % out) -+ sys.exit(1) - - return (distro, version) - --- -1.8.3.1 - diff --git a/SOURCES/tests_dont_skip_1511974.patch b/SOURCES/tests_dont_skip_1511974.patch deleted file mode 100644 index e298a52..0000000 --- a/SOURCES/tests_dont_skip_1511974.patch +++ /dev/null @@ -1,51 +0,0 @@ -From c48f2594f2cca37bc1335d354961202db7baee17 Mon Sep 17 00:00:00 2001 -From: Vratislav Podzimek -Date: Fri, 24 Nov 2017 15:16:25 +0100 -Subject: [PATCH] Do not skip integration tests on CentOS/RHEL - -The scsi_debug module doesn't seem to be causing kernel panics -anymore. - -Resolves: rhbz#1511974 ---- - src/tests/integration-test | 17 ----------------- - 1 file changed, 17 deletions(-) - -diff --git a/src/tests/integration-test b/src/tests/integration-test -index 44ddec5..f863578 100755 ---- a/src/tests/integration-test -+++ b/src/tests/integration-test -@@ -1744,17 +1744,6 @@ class MDRaid(UDisksTestCase): - # ---------------------------------------------------------------------------- - - --def get_distro_version(): -- # 3rd to 6th fields from e.g. "CPE OS Name: cpe:/o:fedoraproject:fedora:27" or "CPE OS Name: cpe:/o:centos:centos:7" -- out = subprocess.check_output('hostnamectl status | grep "CPE OS Name"', shell=True).decode().strip() -- try: -- _project, distro, version = tuple(out.split(":")[3:6]) -- except ValueError: -- print('Failed to get distribution and version from "%s". Aborting.' % out) -- sys.exit(1) -- -- return (distro, version) -- - if __name__ == '__main__': - argparser = argparse.ArgumentParser(description='udisks2 integration test suite') - argparser.add_argument('-l', '--log-file', dest='logfile', -@@ -1763,12 +1752,6 @@ if __name__ == '__main__': - help='name of test class or method (e. g. "Drive", "FS.test_ext2")') - cli_args = argparser.parse_args() - -- distro, version = get_distro_version() -- if distro in ('centos', 'enterprise_linux'): -- print('Skipping integration tests on "%s %s".'\ -- 'SCSI debug devices causing kernel panic.' % (distro, version)) -- sys.exit(0) -- - UDisksTestCase.init(logfile=cli_args.logfile) - if cli_args.testname: - tests = unittest.TestLoader().loadTestsFromNames( --- -1.8.3.1 - diff --git a/SOURCES/udisks-2.7.4-bd_dep_check.patch b/SOURCES/udisks-2.7.4-bd_dep_check.patch deleted file mode 100644 index 66c39c5..0000000 --- a/SOURCES/udisks-2.7.4-bd_dep_check.patch +++ /dev/null @@ -1,68 +0,0 @@ -From e31199054797ca8de62d9d1f32a46a58f2211159 Mon Sep 17 00:00:00 2001 -From: Vojtech Trefny -Date: Wed, 4 Oct 2017 09:24:08 +0200 -Subject: [PATCH] Use new libblockdev functionality to disable checks during - init - -Loading a plugin shouldn't fail because one of its runtime -dependecies is missing. Libblockdev can now skip dependency checks -during init and only return an error if the dependency is still -missing when a function that needs it is called. ---- - src/udisksdaemon.c | 35 ++++++++++++++++++++++------------- - 1 file changed, 22 insertions(+), 13 deletions(-) - -diff --git a/src/udisksdaemon.c b/src/udisksdaemon.c -index a15e5c42..9a013ec9 100644 ---- a/src/udisksdaemon.c -+++ b/src/udisksdaemon.c -@@ -263,27 +263,36 @@ udisks_daemon_constructed (GObject *object) - BDPluginSpec **plugin_p = NULL; - error = NULL; - -- ret = bd_try_init (plugins, NULL, NULL, &error); -+ /* Skip runtime dependency checks when initializing libblockdev. Plugin -+ shouldn't fail to load just because some if its dependencies is missing. -+ */ -+ ret = bd_switch_init_checks (FALSE, &error); - if (!ret) -- { -- if (error) - { - udisks_error ("Error initializing libblockdev library: %s (%s, %d)", - error->message, g_quark_to_string (error->domain), error->code); - g_clear_error (&error); - } -- else -+ -+ ret = bd_try_init (plugins, NULL, NULL, &error); -+ if (!ret) - { -- /* a missing plugin is okay, calling functions from it will fail, but -- until that happens, life will just be great */ -- for (plugin_p=plugins; *plugin_p; plugin_p++) -- if (!bd_is_plugin_available ((*plugin_p)->name)) -- /* TODO: log plugin names when the function below is available */ -- /* udisks_warning ("Failed to load the '%s' libblockdev plugin", */ -- /* bd_get_plugin_name ((*plugin_p)->name)); */ -- udisks_warning ("Failed to load a libblockdev plugin"); -+ if (error) -+ { -+ udisks_error ("Error initializing libblockdev library: %s (%s, %d)", -+ error->message, g_quark_to_string (error->domain), error->code); -+ g_clear_error (&error); -+ } -+ else -+ { -+ /* a missing plugin is okay, calling functions from it will fail, but -+ until that happens, life will just be great */ -+ for (plugin_p=plugins; *plugin_p; plugin_p++) -+ if (!bd_is_plugin_available ((*plugin_p)->name)) -+ udisks_warning ("Failed to load the '%s' libblockdev plugin", -+ bd_get_plugin_name ((*plugin_p)->name)); -+ } - } -- } - - daemon->authority = polkit_authority_get_sync (NULL, &error); - if (daemon->authority == NULL) diff --git a/SOURCES/udisks-2.7.7-g_source_remove.patch b/SOURCES/udisks-2.7.7-g_source_remove.patch deleted file mode 100644 index 0bdf40a..0000000 --- a/SOURCES/udisks-2.7.7-g_source_remove.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 4e26232e5a207b3a5269a5f6d735f1a32b31a4e8 Mon Sep 17 00:00:00 2001 -From: Andrea Azzarone -Date: Fri, 30 Mar 2018 09:15:30 +0000 -Subject: [PATCH] main.c: Properly remove sigint source - -Revert d9f7b05 and properly fix the critical warning. ---- - src/main.c | 18 ++++++------------ - 1 file changed, 6 insertions(+), 12 deletions(-) - -diff --git a/src/main.c b/src/main.c -index 88f3dafac..0444e0179 100644 ---- a/src/main.c -+++ b/src/main.c -@@ -93,7 +93,7 @@ on_sigint (gpointer user_data) - { - udisks_info ("Caught SIGINT. Initiating shutdown"); - g_main_loop_quit (loop); -- return FALSE; -+ return G_SOURCE_CONTINUE; /* We will manually remove the source using g_source_remove */ - } - - int -@@ -104,12 +104,13 @@ main (int argc, - GOptionContext *opt_context; - gint ret; - guint name_owner_id; -- GSource *sigint_source = NULL; -+ guint sigint_id; - - ret = 1; - loop = NULL; - opt_context = NULL; - name_owner_id = 0; -+ sigint_id = 0; - - /* avoid gvfs (http://bugzilla.gnome.org/show_bug.cgi?id=526454) */ - if (!g_setenv ("GIO_USE_VFS", "local", TRUE)) -@@ -148,13 +149,11 @@ main (int argc, - - if (!opt_no_sigint) - { -- guint sigint_id = g_unix_signal_add_full (G_PRIORITY_DEFAULT, -+ sigint_id = g_unix_signal_add_full (G_PRIORITY_DEFAULT, - SIGINT, - on_sigint, - NULL, /* user_data */ - NULL); /* GDestroyNotify */ -- if (sigint_id) -- sigint_source = g_main_context_find_source_by_id (NULL, sigint_id); - } - - name_owner_id = g_bus_own_name (G_BUS_TYPE_SYSTEM, -@@ -175,13 +174,8 @@ main (int argc, - ret = 0; - - out: -- if (sigint_source) -- { -- if(! g_source_is_destroyed(sigint_source)) -- { -- g_source_destroy (sigint_source); -- } -- } -+ if (sigint_id > 0) -+ g_source_remove (sigint_id); - if (the_daemon != NULL) - g_object_unref (the_daemon); - if (name_owner_id != 0) diff --git a/SOURCES/udisks-2.8.1-string-format-vulnerability_CVE-2018-17336.patch b/SOURCES/udisks-2.8.1-string-format-vulnerability_CVE-2018-17336.patch deleted file mode 100644 index b70ba17..0000000 --- a/SOURCES/udisks-2.8.1-string-format-vulnerability_CVE-2018-17336.patch +++ /dev/null @@ -1,32 +0,0 @@ -From e369a9b4b08e9373c814c05328b366c938284eb5 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Kai=20L=C3=BCke?= -Date: Tue, 18 Sep 2018 13:12:14 +0200 -Subject: [PATCH] Fix string format vulnerability - -If the message in g_log_structured itself -contained format sequences like %d or %n they -were applied again, leading to leaked stack contents -and possibly memory corruption. It can be triggered -e.g. by a volume label containing format sequences. - -Print the message argument itself into a "%s" string -to avoid intepreting format sequences. - -https://github.com/storaged-project/udisks/issues/578 ---- - src/udiskslogging.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/udiskslogging.c b/src/udiskslogging.c -index ab49fcbf4..47a3af23a 100644 ---- a/src/udiskslogging.c -+++ b/src/udiskslogging.c -@@ -60,7 +60,7 @@ udisks_log (UDisksLogLevel level, - - #if GLIB_CHECK_VERSION(2, 50, 0) - g_log_structured ("udisks", (GLogLevelFlags) level, -- "MESSAGE", message, "THREAD_ID", "%d", (gint) syscall (SYS_gettid), -+ "MESSAGE", "%s", message, "THREAD_ID", "%d", (gint) syscall (SYS_gettid), - "CODE_FUNC", function, "CODE_FILE", location); - #else - g_log ("udisks", level, "[%d]: %s [%s, %s()]", (gint) syscall (SYS_gettid), message, location, function); diff --git a/SOURCES/udisks-2.8.2-THREAD_ID-logging.patch b/SOURCES/udisks-2.8.2-THREAD_ID-logging.patch deleted file mode 100644 index 125c04a..0000000 --- a/SOURCES/udisks-2.8.2-THREAD_ID-logging.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 61e3d7a38e7b0efc0d19a0340da2624a1f720b3c Mon Sep 17 00:00:00 2001 -From: Tomas Bzatek -Date: Thu, 1 Nov 2018 13:44:34 +0100 -Subject: [PATCH] udiskslogging: Fix THREAD_ID field logging - -The call to g_log_structured() was not conforming the rules stated in the -documentation: "The MESSAGE-format pair has to be the last of the key-value -pairs, and MESSAGE is the only field for which printf()-style formatting -is supported." ---- - src/udiskslogging.c | 8 ++++++-- - 1 file changed, 6 insertions(+), 2 deletions(-) - -diff --git a/src/udiskslogging.c b/src/udiskslogging.c -index 47a3af23a..0cb8d959d 100644 ---- a/src/udiskslogging.c -+++ b/src/udiskslogging.c -@@ -53,15 +53,19 @@ udisks_log (UDisksLogLevel level, - { - va_list var_args; - gchar *message; -+ gchar *thread_id; - - va_start (var_args, format); - message = g_strdup_vprintf (format, var_args); - va_end (var_args); - - #if GLIB_CHECK_VERSION(2, 50, 0) -+ thread_id = g_strdup_printf ("%d", (gint) syscall (SYS_gettid)); - g_log_structured ("udisks", (GLogLevelFlags) level, -- "MESSAGE", "%s", message, "THREAD_ID", "%d", (gint) syscall (SYS_gettid), -- "CODE_FUNC", function, "CODE_FILE", location); -+ "THREAD_ID", thread_id, -+ "CODE_FUNC", function, "CODE_FILE", location, -+ "MESSAGE", "%s", message); -+ g_free (thread_id); - #else - g_log ("udisks", level, "[%d]: %s [%s, %s()]", (gint) syscall (SYS_gettid), message, location, function); - #endif diff --git a/SOURCES/udisks-2.8.2-udisksctl-manpage-update.patch b/SOURCES/udisks-2.8.2-udisksctl-manpage-update.patch deleted file mode 100644 index c496b83..0000000 --- a/SOURCES/udisks-2.8.2-udisksctl-manpage-update.patch +++ /dev/null @@ -1,243 +0,0 @@ -From ae41997ebc01621c40e74a7fd29cd93b8f7fc790 Mon Sep 17 00:00:00 2001 -From: Vojtech Trefny -Date: Mon, 10 Dec 2018 10:43:44 +0100 -Subject: [PATCH] man: Describe command options in the udisksctl man page - -Added short description for the "device" options (--object-path -and --block-device) and for options for specific commands. - -Resolves: rhbz#1568269 ---- - doc/man/udisksctl.xml.in | 157 +++++++++++++++++++++++++++++++++++++-- - 1 file changed, 149 insertions(+), 8 deletions(-) - -diff --git a/doc/man/udisksctl.xml.in b/doc/man/udisksctl.xml.in -index 41a1410d3..3ecbafe99 100644 ---- a/doc/man/udisksctl.xml.in -+++ b/doc/man/udisksctl.xml.in -@@ -34,6 +34,7 @@ - - --object-path OBJECT - --block-device DEVICE -+ --drive DRIVE - - - -@@ -168,8 +169,9 @@ - - - Shows detailed information about -- OBJECT or -- DEVICE. -+ OBJECT, -+ DEVICE or -+ DRIVE. - - - -@@ -179,21 +181,40 @@ - - - Mounts a device. The device will be mounted in a -- subdirectory in the /media hierarchy -+ subdirectory in the /run/media hierarchy - - upon successful completion, the mount point will be - printed to standard output. - -- -+ -+ -+ -+ -+ -+ -+ -+ Filesystem type to use. If not specified, autodetected filesystem -+ type will be used. -+ -+ -+ -+ -+ -+ -+ -+ -+ - The device will be mounted with a safe set of default - options. You can influence the options passed to the - mount8 -- command with . Note that only -+ command using this option. Note that only - safe options are allowed - requests with inherently unsafe - options such as suid or - dev that would allow the caller to - gain additional privileges, are rejected. -- -- -+ -+ -+ -+ - - - -@@ -206,6 +227,18 @@ - references exists. - - -+ -+ -+ -+ -+ -+ -+ Lazy unmount. Detach the filesystem from the file hierarchy -+ now, and clean up all references to this filesystem as soon -+ as it is not busy anymore. -+ -+ -+ - - - -@@ -218,6 +251,15 @@ - printed to standard output. - - -+ -+ -+ -+ -+ -+ Read passphrase from the given file. -+ -+ -+ - - - -@@ -237,6 +279,48 @@ - Sets up a loop device backed by FILE. - - -+ -+ -+ -+ -+ -+ -+ File to set up a loop device for. -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ Set up a read-only loop device. -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ The data start is moved OFFSET bytes -+ into the specified file. -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ The data end is set to no more than SIZE -+ bytes after the data start. -+ -+ -+ - - - -@@ -285,6 +369,16 @@ - a disk is failing. - - -+ -+ -+ -+ -+ -+ -+ File with the libatasmart blob. -+ -+ -+ - - - -@@ -311,10 +405,57 @@ - - - -+ -+ DEVICE SPECIFICATION -+ -+ For commands that require a device as an argument following options -+ can be used to specify it. -+ -+ -+ -+ -+ -+ -+ -+ -+ Specify a device by its device file path. For example -+ /dev/sda. -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ Specify a device by the UDisks internal object path without the -+ /org/freedesktop/UDisks2 prefix. For example -+ block_devices/sda -+ for the /dev/sda disk. -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ Specify a drive by name, for example VirtIO_Disk. -+ This can be currently used only together with the -+ command. -+ -+ -+ -+ -+ -+ -+ - - COMMON OPTIONS - -- The option can be used -+ The option can be used - to request that no interaction (such as the user being - presented with an authentication dialog) must occur when - checking with diff --git a/SPECS/udisks2.spec b/SPECS/udisks2.spec index d398430..a619154 100644 --- a/SPECS/udisks2.spec +++ b/SPECS/udisks2.spec @@ -13,39 +13,13 @@ Name: udisks2 Summary: Disk Manager -Version: 2.7.3 -Release: 9%{?dist} +Version: 2.8.4 +Release: 1%{?dist} License: GPLv2+ 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 -Patch0: reboot_mpoint_cleanup_1384796.patch -Patch1: raid_watchers_1400056.patch -Patch2: no_discard_1516697.patch -Patch3: fix_thinpool_size_1534904.patch -Patch4: fix_mpoin_cleanup_1384796.patch -Patch5: luks_resize_1567992.patch -Patch6: tests_distro_check_1508385.patch -Patch7: tests_dont_skip_1511974.patch -Patch8: tests_add_targetcli_config_1511986.patch -Patch9: udisks-2.7.4-bd_dep_check.patch -# https://bugzilla.redhat.com/show_bug.cgi?id=1672664 -# Package udisks2-lsm -Patch10: lsm-relicense.patch -Patch11: lsm_local-gerror.patch -Patch12: lsm-complete-led_control-call.patch -# https://bugzilla.redhat.com/show_bug.cgi?id=1643350 -# udisksd core dump -Patch13: udisks-2.7.7-g_source_remove.patch -# https://bugzilla.redhat.com/show_bug.cgi?id=1637427 -# CVE-2018-17336 Format string vulnerability in udisks_log in udiskslogging.c -Patch14: udisks-2.8.1-string-format-vulnerability_CVE-2018-17336.patch -Patch15: udisks-2.8.2-THREAD_ID-logging.patch -# https://bugzilla.redhat.com/show_bug.cgi?id=1568269 -# man page improvement for udisksctl -Patch16: udisks-2.8.2-udisksctl-manpage-update.patch - BuildRequires: glib2-devel >= %{glib2_version} BuildRequires: gobject-introspection-devel >= %{gobject_introspection_version} BuildRequires: libgudev1-devel >= %{systemd_version} @@ -174,25 +148,9 @@ dynamic library, which provides access to the udisksd daemon. %prep %setup -q -n udisks-%{version} -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 -%patch6 -p1 -%patch7 -p1 -%patch8 -p1 -%patch9 -p1 -%patch10 -p1 -%patch11 -p1 -%patch12 -p1 -%patch13 -p1 -%patch14 -p1 -%patch15 -p1 -%patch16 -p1 %build +sed -i 's/blockdev >= 2.19/blockdev >= 2.18/' configure.ac autoreconf -ivf # we can't use _hardened_build here, see # https://bugzilla.redhat.com/show_bug.cgi?id=892837 @@ -249,8 +207,9 @@ udevadm trigger %dir %{_sysconfdir}/udisks2 %{_sysconfdir}/udisks2/udisks2.conf -%{_sysconfdir}/dbus-1/system.d/org.freedesktop.UDisks2.conf +%{_datadir}/dbus-1/system.d/org.freedesktop.UDisks2.conf %{_datadir}/bash-completion/completions/udisksctl +%{_tmpfilesdir}/%{name}.conf %{_unitdir}/udisks2.service %{_unitdir}/clean-mount-point@.service %{_udevrulesdir}/80-udisks2.rules @@ -310,6 +269,9 @@ udevadm trigger # Note: please don't forget the %{?dist} in the changelog. Thanks %changelog +* Fri Aug 16 2019 Tomas Bzatek - 2.8.4-1 +- Rebase to upstream 2.8.4 release (#1684917) + * Thu Feb 28 2019 Tomas Bzatek - 2.7.3-9 - Build udisks2-lsm subpackage (#1672664) - Fix sigint source removal on daemon exit (#1643350)