neil / rpms / udisks2

Forked from rpms/udisks2 a year ago
Clone

Blame SOURCES/udisks-2.9.1-teardown-needle-match.patch

140abd
From fdf6b233df960e6903c62b86735d86c59d967d12 Mon Sep 17 00:00:00 2001
140abd
From: Tomas Bzatek <tbzatek@redhat.com>
140abd
Date: Fri, 19 Jun 2020 19:12:07 +0200
140abd
Subject: [PATCH] udiskslinuxblock: Fix fstab records matching by needle
140abd
140abd
Apparently mnt_fs_match_options() is not suitable for this use case.
140abd
---
140abd
 src/udiskslinuxblock.c | 5 ++++-
140abd
 1 file changed, 4 insertions(+), 1 deletion(-)
140abd
140abd
diff --git a/src/udiskslinuxblock.c b/src/udiskslinuxblock.c
140abd
index 888ec634..d5be8e4c 100644
140abd
--- a/src/udiskslinuxblock.c
140abd
+++ b/src/udiskslinuxblock.c
140abd
@@ -575,7 +575,10 @@ find_fstab_entries (UDisksDaemon     *daemon,
140abd
         }
140abd
       else if (needle != NULL)
140abd
         {
140abd
-          if (mnt_fs_match_options (fs, needle) == 0)
140abd
+          const char *opts;
140abd
+
140abd
+          opts = mnt_fs_get_options (fs);
140abd
+          if (! opts || g_strstr_len (opts, -1, needle) == NULL)
140abd
             continue;
140abd
         }
140abd
 
140abd
-- 
140abd
2.26.2
140abd