neil / rpms / udisks2

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