From 9806e216375e4158a0e2b6cbd8473b61fd1ee1d0 Mon Sep 17 00:00:00 2001 From: qhw01063182 Date: Fri, 27 Sep 2024 17:51:42 +0800 Subject: [PATCH] file name cloud be UTF-8 Signed-off-by: qhw01063182 --- 0001-file-name-cloud-be-UTF-8.patch | 40 +++++++++++++++++++++++++++++ glib2.spec | 6 ++++- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 0001-file-name-cloud-be-UTF-8.patch diff --git a/0001-file-name-cloud-be-UTF-8.patch b/0001-file-name-cloud-be-UTF-8.patch new file mode 100644 index 0000000..a6b293c --- /dev/null +++ b/0001-file-name-cloud-be-UTF-8.patch @@ -0,0 +1,40 @@ +From e4fef16537e99141de1763368d03c98456a17a00 Mon Sep 17 00:00:00 2001 +From: Liwei Ge +Date: Thu, 4 Jul 2024 21:16:47 +0800 +Subject: [PATCH] file name cloud be UTF-8 + +--- + glib/goption.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/glib/goption.c b/glib/goption.c +index 0b3a05e..7af7770 100644 +--- a/glib/goption.c ++++ b/glib/goption.c +@@ -1287,7 +1287,10 @@ parse_arg (GOptionContext *context, + else + data = g_strdup (value); + #else +- data = g_locale_to_utf8 (value, -1, NULL, NULL, error); ++ if (!g_utf8_validate (value, -1, NULL)) ++ data = g_locale_to_utf8 (value, -1, NULL, NULL, error); ++ else ++ data = g_strdup (value); + #endif + + if (!data) +@@ -1316,7 +1319,10 @@ parse_arg (GOptionContext *context, + else + data = g_strdup (value); + #else +- data = g_locale_to_utf8 (value, -1, NULL, NULL, error); ++ if (!g_utf8_validate (value, -1, NULL)) ++ data = g_locale_to_utf8 (value, -1, NULL, NULL, error); ++ else ++ data = g_strdup (value); + #endif + + if (!data) +-- +2.39.3 + diff --git a/glib2.spec b/glib2.spec index bcf2986..f71850b 100644 --- a/glib2.spec +++ b/glib2.spec @@ -1,4 +1,4 @@ -%define anolis_release .0.1 +%define anolis_release .0.2 Name: glib2 Version: 2.68.4 Release: 14%{anolis_release}%{?dist} @@ -61,6 +61,7 @@ Patch15: 3845.patch # https://gitlab.gnome.org/GNOME/glib/-/merge_requests/4057 Patch16: 4038.patch +Patch1000: 0001-file-name-cloud-be-UTF-8.patch BuildRequires: chrpath BuildRequires: gcc BuildRequires: gcc-c++ @@ -280,6 +281,9 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || : %{_datadir}/installed-tests %changelog +* Fri Sep 27 2024 Liwei Ge - 2.68.4-14.0.2 +- file name cloud be UTF-8 + * Wed Sep 25 2024 yangxinyu - 2.68.4-14.0.1 - fix cve-2024-34397 -- Gitee