37 lines
1.3 KiB
Diff
37 lines
1.3 KiB
Diff
From: Karel Zak <kzak@redhat.com>
|
|
Date: Tue, 1 Apr 2025 17:45:01 +0200
|
|
Subject: libmount: avoid strcasecmp() for ASCII-only strings
|
|
|
|
Use cctype.h for locale-independent string comparison and to avoid
|
|
tricky string conversions like in tr_TR locales.
|
|
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
(cherry picked from commit ea694f8b91b82474c018dac2250b03cb00685b26)
|
|
---
|
|
libmount/src/tab.c | 5 +++--
|
|
1 file changed, 3 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/libmount/src/tab.c b/libmount/src/tab.c
|
|
index 8508715..a5070f8 100644
|
|
--- a/libmount/src/tab.c
|
|
+++ b/libmount/src/tab.c
|
|
@@ -2054,6 +2054,7 @@ int mnt_table_is_fs_mounted(struct libmnt_table *tb, struct libmnt_fs *fstab_fs)
|
|
|
|
#ifdef TEST_PROGRAM
|
|
#include "pathnames.h"
|
|
+#include "cctype.h"
|
|
|
|
static int parser_errcb(struct libmnt_table *tb __attribute__((unused)),
|
|
const char *filename, int line)
|
|
@@ -2229,9 +2230,9 @@ static int test_find(struct libmnt_test *ts __attribute__((unused)),
|
|
mnt_table_set_cache(tb, mpc);
|
|
mnt_unref_cache(mpc);
|
|
|
|
- if (strcasecmp(find, "source") == 0)
|
|
+ if (c_strcasecmp(find, "source") == 0)
|
|
fs = mnt_table_find_source(tb, what, dr);
|
|
- else if (strcasecmp(find, "target") == 0)
|
|
+ else if (c_strcasecmp(find, "target") == 0)
|
|
fs = mnt_table_find_target(tb, what, dr);
|
|
|
|
if (!fs)
|