Glib2 cause qga command 'guest-ssh-get-authorized-keys' failed

Resolves: RHEL-151748

Signed-off-by: Konstantin Kostiuk <kkostiuk@redhat.com>
This commit is contained in:
Konstantin Kostiuk 2026-02-25 15:11:31 +02:00
parent 83f9547200
commit 99f1a41e46
2 changed files with 766 additions and 1 deletions

View File

@ -0,0 +1,758 @@
From 0754df10a2ce7dcfbbcb498071cb81e8642182a5 Mon Sep 17 00:00:00 2001
From: Kostiantyn Kostiuk <kkostiuk@redhat.com>
Date: Wed, 25 Feb 2026 14:38:06 +0200
Subject: [PATCH] Revert "gstdio: Add support for the `e` flag (O_CLOEXEC) to
g_fopen()"
This reverts commit f9a7ac11f59927642a7df6beabec129fe463cb23.
---
gio/gdbus-tool.c | 3 +-
gio/gdbusaddress.c | 8 +-
gio/gdbusprivate.c | 2 +-
gio/glib-compile-resources.c | 4 +-
gio/gunixmounts.c | 5 +-
gio/tests/g-file-info.c | 6 +-
gio/tests/live-g-file.c | 3 +-
girepository/compiler/compiler.c | 2 +-
girepository/gdump.c | 5 +-
girepository/girwriter.c | 2 +-
glib/deprecated/gcompletion.c | 3 +-
glib/gcharset.c | 3 +-
glib/gfileutils.c | 4 +-
glib/glib-mirroring-tab/gen-mirroring-tab.c | 3 +-
glib/grand.c | 87 ++++++++++-----------
glib/gstdio.c | 23 +-----
glib/tests/fileutils.c | 6 +-
glib/tests/unicode.c | 5 +-
18 files changed, 75 insertions(+), 99 deletions(-)
diff --git a/gio/gdbus-tool.c b/gio/gdbus-tool.c
index 56597d3f2..5e6c172dc 100644
--- a/gio/gdbus-tool.c
+++ b/gio/gdbus-tool.c
@@ -34,7 +34,6 @@
#endif
#include <gi18n.h>
-#include <glib/gstdio.h>
#ifdef G_OS_WIN32
#include "glib/glib-private.h"
@@ -72,7 +71,7 @@ completion_debug (const gchar *format, ...)
s = g_strdup_vprintf (format, var_args);
if (f == NULL)
{
- f = g_fopen ("/tmp/gdbus-completion-debug.txt", "a+e");
+ f = fopen ("/tmp/gdbus-completion-debug.txt", "a+");
}
fprintf (f, "%s\n", s);
g_free (s);
diff --git a/gio/gdbusaddress.c b/gio/gdbusaddress.c
index 4db3fc3c1..1b62247fa 100644
--- a/gio/gdbusaddress.c
+++ b/gio/gdbusaddress.c
@@ -53,6 +53,12 @@
#include <windows.h>
#endif
+#ifdef G_OS_WIN32
+#define FO_CLOEXEC ""
+#else
+#define FO_CLOEXEC "e"
+#endif
+
#include "glibintl.h"
/**
@@ -714,7 +720,7 @@ g_dbus_address_connect (const gchar *address_entry,
int errsv;
/* be careful to read only 16 bytes - we also check that the file is only 16 bytes long */
- f = g_fopen (nonce_file, "rbe");
+ f = fopen (nonce_file, "rb" FO_CLOEXEC);
errsv = errno;
if (f == NULL)
{
diff --git a/gio/gdbusprivate.c b/gio/gdbusprivate.c
index c68e3f620..28083e4ed 100644
--- a/gio/gdbusprivate.c
+++ b/gio/gdbusprivate.c
@@ -2195,7 +2195,7 @@ unpublish_session_bus (void)
static void
wait_console_window (void)
{
- FILE *console = g_fopen ("CONOUT$", "we");
+ FILE *console = fopen ("CONOUT$", "w");
SetConsoleTitleW (L"gdbus-daemon output. Type any character to close this window.");
fprintf (console, _("(Type any character to close this window)\n"));
diff --git a/gio/glib-compile-resources.c b/gio/glib-compile-resources.c
index ecf53b934..2329c627a 100644
--- a/gio/glib-compile-resources.c
+++ b/gio/glib-compile-resources.c
@@ -1132,7 +1132,7 @@ main (int argc, char **argv)
{
FILE *file;
- file = g_fopen (target, "we");
+ file = fopen (target, "w");
if (file == NULL)
{
g_printerr ("can't write to file %s", target);
@@ -1181,7 +1181,7 @@ main (int argc, char **argv)
}
g_unlink (binary_target);
- file = g_fopen (target, "we");
+ file = fopen (target, "w");
if (file == NULL)
{
g_printerr ("can't write to file %s", target);
diff --git a/gio/gunixmounts.c b/gio/gunixmounts.c
index 45a938933..0f327ec18 100644
--- a/gio/gunixmounts.c
+++ b/gio/gunixmounts.c
@@ -79,7 +79,6 @@ extern char* hasmntopt(const struct mntent* mnt, const char* opt);
#include "gfilemonitor.h"
#include "glibintl.h"
#include "glocalfile.h"
-#include "gstdio.h"
#include "gthemedicon.h"
#include "gcontextspecificgroup.h"
@@ -203,7 +202,7 @@ static GSource *proc_mounts_watch_source = NULL;
#endif
#ifndef HAVE_SETMNTENT
-#define setmntent(f,m) g_fopen (f, m)
+#define setmntent(f,m) fopen(f,m)
#endif
#ifndef HAVE_ENDMNTENT
#define endmntent(f) fclose(f)
@@ -3967,7 +3966,7 @@ _resolve_dev_root (void)
/* see if device with similar major:minor as /dev/root is mention
* in /etc/mtab (it usually is)
*/
- f = g_fopen ("/etc/mtab", "re");
+ f = fopen ("/etc/mtab", "re");
if (f != NULL)
{
struct mntent *entp;
diff --git a/gio/tests/g-file-info.c b/gio/tests/g-file-info.c
index 51e6aa534..9d97d5ac4 100644
--- a/gio/tests/g-file-info.c
+++ b/gio/tests/g-file-info.c
@@ -792,7 +792,7 @@ test_internal_enhanced_stdio (void)
g_remove (ps);
- f = g_fopen (ps, "wbe");
+ f = g_fopen (ps, "wb");
g_assert_nonnull (f);
h = (HANDLE) _get_osfhandle (fileno (f));
@@ -875,7 +875,7 @@ test_internal_enhanced_stdio (void)
g_assert_true (SystemTimeToFileTime (&st, &ft));
- f = g_fopen (p0, "we");
+ f = g_fopen (p0, "w");
g_assert_nonnull (f);
h = (HANDLE) _get_osfhandle (fileno (f));
@@ -888,7 +888,7 @@ test_internal_enhanced_stdio (void)
fclose (f);
- f = g_fopen (p1, "we");
+ f = g_fopen (p1, "w");
g_assert_nonnull (f);
fclose (f);
diff --git a/gio/tests/live-g-file.c b/gio/tests/live-g-file.c
index 5edc9b673..c96f9db94 100644
--- a/gio/tests/live-g-file.c
+++ b/gio/tests/live-g-file.c
@@ -23,7 +23,6 @@
*/
#include <glib/glib.h>
-#include <glib/gstdio.h>
#include <gio/gio.h>
#include <errno.h>
#include <stdlib.h>
@@ -306,7 +305,7 @@ test_create_structure (gconstpointer test_data)
basename = g_path_get_basename (item.filename);
path = g_build_filename (test_data, dir, ".hidden", NULL);
- f = g_fopen (path, "ae");
+ f = fopen (path, "a");
fprintf (f, "%s\n", basename);
fclose (f);
diff --git a/girepository/compiler/compiler.c b/girepository/compiler/compiler.c
index f9d588d52..0c8315399 100644
--- a/girepository/compiler/compiler.c
+++ b/girepository/compiler/compiler.c
@@ -86,7 +86,7 @@ write_out_typelib (gchar *prefix,
file_obj = g_file_new_for_path (filename);
tmp_filename = g_strdup_printf ("%s.tmp", filename);
tmp_file_obj = g_file_new_for_path (tmp_filename);
- file = file_owned = g_fopen (tmp_filename, "wbe");
+ file = g_fopen (tmp_filename, "wb");
if (file == NULL)
{
diff --git a/girepository/gdump.c b/girepository/gdump.c
index 8569b9d8f..e4adffee9 100644
--- a/girepository/gdump.c
+++ b/girepository/gdump.c
@@ -33,7 +33,6 @@
#include <glib.h>
#include <glib-object.h>
-#include <glib/gstdio.h>
#include <gmodule.h>
#include <stdlib.h>
@@ -657,7 +656,7 @@ gi_repository_dump (const char *input_filename,
return FALSE;
}
- input = g_fopen (input_filename, "rbe");
+ input = fopen (input_filename, "rb");
if (input == NULL)
{
int saved_errno = errno;
@@ -669,7 +668,7 @@ gi_repository_dump (const char *input_filename,
return FALSE;
}
- output = g_fopen (output_filename, "wbe");
+ output = fopen (output_filename, "wb");
if (output == NULL)
{
int saved_errno = errno;
diff --git a/girepository/girwriter.c b/girepository/girwriter.c
index 9c36db0f7..b2bd6395d 100644
--- a/girepository/girwriter.c
+++ b/girepository/girwriter.c
@@ -1368,7 +1368,7 @@ gi_ir_writer_write (GIRepository *repository,
full_filename = g_strdup_printf ("%s-%s", ns, filename);
else
full_filename = g_strdup (filename);
- ofile = g_fopen (filename, "we");
+ ofile = g_fopen (filename, "w");
if (ofile == NULL)
{
diff --git a/glib/deprecated/gcompletion.c b/glib/deprecated/gcompletion.c
index fa09a97fb..73192894f 100644
--- a/glib/deprecated/gcompletion.c
+++ b/glib/deprecated/gcompletion.c
@@ -39,7 +39,6 @@
#include <glib/gstrfuncs.h>
#include <glib/gmessages.h>
-#include <glib/gstdio.h>
#include <glib/gunicode.h>
#include <string.h>
@@ -468,7 +467,7 @@ main (int argc,
return 1;
}
- file = g_fopen (argv[1], "re");
+ file = fopen (argv[1], "r");
if (!file)
{
g_warning ("Cannot open %s", argv[1]);
diff --git a/glib/gcharset.c b/glib/gcharset.c
index 13d6270a0..c384c4b53 100644
--- a/glib/gcharset.c
+++ b/glib/gcharset.c
@@ -28,7 +28,6 @@
#include "ghash.h"
#include "glib-private.h"
#include "gmessages.h"
-#include "gstdio.h"
#include "gstrfuncs.h"
#include "gthread.h"
#include "gthreadprivate.h"
@@ -448,7 +447,7 @@ read_aliases (const gchar *file,
FILE *fp;
char buf[256];
- fp = g_fopen (file, "re");
+ fp = fopen (file, "re");
if (!fp)
return;
while (fgets (buf, 256, fp))
diff --git a/glib/gfileutils.c b/glib/gfileutils.c
index 8b70ddd7d..62fc3255c 100644
--- a/glib/gfileutils.c
+++ b/glib/gfileutils.c
@@ -938,7 +938,7 @@ get_contents_posix (const gchar *filename,
FILE *f;
gboolean retval;
- f = fdopen (fd, "re");
+ f = fdopen (fd, "r");
if (f == NULL)
{
@@ -969,7 +969,7 @@ get_contents_win32 (const gchar *filename,
FILE *f;
gboolean retval;
- f = g_fopen (filename, "rbe");
+ f = g_fopen (filename, "rb");
if (f == NULL)
{
diff --git a/glib/glib-mirroring-tab/gen-mirroring-tab.c b/glib/glib-mirroring-tab/gen-mirroring-tab.c
index 54935b4af..19efbecf3 100644
--- a/glib/glib-mirroring-tab/gen-mirroring-tab.c
+++ b/glib/glib-mirroring-tab/gen-mirroring-tab.c
@@ -30,7 +30,6 @@
*/
#include <glib.h>
-#include <glib/gstdio.h>
#include <stdlib.h>
#include <stdio.h>
@@ -157,7 +156,7 @@ read_data (
FILE *f;
fprintf (stderr, "Reading '%s'\n", data_file_name);
- if (!(f = g_fopen (data_file_name, "rte")))
+ if (!(f = fopen (data_file_name, "rt")))
die2 ("error: cannot open '%s' for reading", data_file_name);
if (!strcmp (data_file_type, "BidiMirroring.txt"))
diff --git a/glib/grand.c b/glib/grand.c
index 0a1d82eb1..32ece34a4 100644
--- a/glib/grand.c
+++ b/glib/grand.c
@@ -49,7 +49,6 @@
#include "genviron.h"
#include "gmain.h"
#include "gmem.h"
-#include "gstdio.h"
#include "gtestutils.h"
#include "gthread.h"
#include "gtimer.h"
@@ -73,14 +72,14 @@
G_LOCK_DEFINE_STATIC (global_random);
-/* Period parameters */
+/* Period parameters */
#define N 624
#define M 397
#define MATRIX_A 0x9908b0df /* constant vector a */
#define UPPER_MASK 0x80000000 /* most significant w-r bits */
#define LOWER_MASK 0x7fffffff /* least significant r bits */
-/* Tempering parameters */
+/* Tempering parameters */
#define TEMPERING_MASK_B 0x9d2c5680
#define TEMPERING_MASK_C 0xefc60000
#define TEMPERING_SHIFT_U(y) (y >> 11)
@@ -97,7 +96,7 @@ get_random_version (void)
if (g_once_init_enter (&initialized))
{
const gchar *version_string = g_getenv ("G_RANDOM_VERSION");
- if (!version_string || version_string[0] == '\000' ||
+ if (!version_string || version_string[0] == '\000' ||
strcmp (version_string, "2.2") == 0)
random_version = 22;
else if (strcmp (version_string, "2.0") == 0)
@@ -110,22 +109,22 @@ get_random_version (void)
}
g_once_init_leave (&initialized, TRUE);
}
-
+
return random_version;
}
struct _GRand
{
guint32 mt[N]; /* the array for the state vector */
- guint mti;
+ guint mti;
};
/**
* g_rand_new_with_seed: (constructor)
* @seed: a value to initialize the random number generator
- *
+ *
* Creates a new random number generator initialized with @seed.
- *
+ *
* Returns: (transfer full): the new #GRand
**/
GRand*
@@ -141,9 +140,9 @@ g_rand_new_with_seed (guint32 seed)
* @seed: an array of seeds to initialize the random number generator
* @seed_length: an array of seeds to initialize the random number
* generator
- *
+ *
* Creates a new random number generator initialized with @seed.
- *
+ *
* Returns: (transfer full): the new #GRand
*
* Since: 2.4
@@ -159,16 +158,16 @@ g_rand_new_with_seed_array (const guint32 *seed,
/**
* g_rand_new: (constructor)
- *
+ *
* Creates a new random number generator initialized with a seed taken
* either from `/dev/urandom` (if existing) or from the current time
* (as a fallback).
*
* On Windows, the seed is taken from rand_s().
- *
+ *
* Returns: (transfer full): the new #GRand
*/
-GRand*
+GRand*
g_rand_new (void)
{
guint32 seed[4];
@@ -195,7 +194,7 @@ g_rand_new (void)
dev_urandom_exists = FALSE;
close (dev_urandom);
- }
+ }
else
dev_urandom_exists = FALSE;
}
@@ -292,24 +291,24 @@ g_rand_set_seed (GRand *rand,
/* the generator Line 25 of Table 1 in */
/* [KNUTH 1981, The Art of Computer Programming */
/* Vol. 2 (2nd Ed.), pp102] */
-
+
if (seed == 0) /* This would make the PRNG produce only zeros */
seed = 0x6b842128; /* Just set it to another number */
-
+
rand->mt[0]= seed;
for (rand->mti=1; rand->mti<N; rand->mti++)
rand->mt[rand->mti] = (69069 * rand->mt[rand->mti-1]);
-
+
break;
case 22:
/* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */
/* In the previous version (see above), MSBs of the */
/* seed affect only MSBs of the array mt[]. */
-
+
rand->mt[0]= seed;
for (rand->mti=1; rand->mti<N; rand->mti++)
- rand->mt[rand->mti] = 1812433253UL *
- (rand->mt[rand->mti-1] ^ (rand->mt[rand->mti-1] >> 30)) + rand->mti;
+ rand->mt[rand->mti] = 1812433253UL *
+ (rand->mt[rand->mti-1] ^ (rand->mt[rand->mti-1] >> 30)) + rand->mti;
break;
default:
g_assert_not_reached ();
@@ -373,7 +372,7 @@ g_rand_set_seed_array (GRand *rand,
}
}
- rand->mt[0] = 0x80000000UL; /* MSB is 1; assuring non-zero initial array */
+ rand->mt[0] = 0x80000000UL; /* MSB is 1; assuring non-zero initial array */
}
/**
@@ -405,7 +404,7 @@ g_rand_int (GRand *rand)
if (rand->mti >= N) { /* generate N words at one time */
int kk;
-
+
for (kk = 0; kk < N - M; kk++) {
y = (rand->mt[kk]&UPPER_MASK)|(rand->mt[kk+1]&LOWER_MASK);
rand->mt[kk] = rand->mt[kk+M] ^ (y >> 1) ^ mag01[y & 0x1];
@@ -416,17 +415,17 @@ g_rand_int (GRand *rand)
}
y = (rand->mt[N-1]&UPPER_MASK)|(rand->mt[0]&LOWER_MASK);
rand->mt[N-1] = rand->mt[M-1] ^ (y >> 1) ^ mag01[y & 0x1];
-
+
rand->mti = 0;
}
-
+
y = rand->mt[rand->mti++];
y ^= TEMPERING_SHIFT_U(y);
y ^= TEMPERING_SHIFT_S(y) & TEMPERING_MASK_B;
y ^= TEMPERING_SHIFT_T(y) & TEMPERING_MASK_C;
y ^= TEMPERING_SHIFT_L(y);
-
- return y;
+
+ return y;
}
/* transform [0..2^32] -> [0..1] */
@@ -443,7 +442,7 @@ g_rand_int (GRand *rand)
*
* Returns: a random number
*/
-gint32
+gint32
g_rand_int_range (GRand *rand,
gint32 begin,
gint32 end)
@@ -465,13 +464,13 @@ g_rand_int_range (GRand *rand,
*
* We are using (trans + trans * trans), because g_rand_int only
* covers [0..2^32-1] and thus g_rand_int * trans only covers
- * [0..1-2^-32], but the biggest double < 1 is 1-2^-52.
+ * [0..1-2^-32], but the biggest double < 1 is 1-2^-52.
*/
-
- gdouble double_rand = g_rand_int (rand) *
+
+ gdouble double_rand = g_rand_int (rand) *
(G_RAND_DOUBLE_TRANSFORM +
G_RAND_DOUBLE_TRANSFORM * G_RAND_DOUBLE_TRANSFORM);
-
+
random = (gint32) (double_rand * dist);
}
else
@@ -486,7 +485,7 @@ g_rand_int_range (GRand *rand,
case 22:
if (dist == 0)
random = 0;
- else
+ else
{
/* maxvalue is set to the predecessor of the greatest
* multiple of dist less or equal 2^32.
@@ -501,18 +500,18 @@ g_rand_int_range (GRand *rand,
}
else
maxvalue = dist - 1;
-
+
do
random = g_rand_int (rand);
while (random > maxvalue);
-
+
random %= dist;
}
break;
default:
g_assert_not_reached ();
- }
-
+ }
+
return begin + random;
}
@@ -525,9 +524,9 @@ g_rand_int_range (GRand *rand,
*
* Returns: a random number
*/
-gdouble
+gdouble
g_rand_double (GRand *rand)
-{
+{
/* We set all 52 bits after the point for this, not only the first
32. That's why we need two calls to g_rand_int */
gdouble retval = g_rand_int (rand) * G_RAND_DOUBLE_TRANSFORM;
@@ -535,7 +534,7 @@ g_rand_double (GRand *rand)
/* The following might happen due to very bad rounding luck, but
* actually this should be more than rare, we just try again then */
- if (retval >= 1.0)
+ if (retval >= 1.0)
return g_rand_double (rand);
return retval;
@@ -552,7 +551,7 @@ g_rand_double (GRand *rand)
*
* Returns: a random number
*/
-gdouble
+gdouble
g_rand_double_range (GRand *rand,
gdouble begin,
gdouble end)
@@ -612,7 +611,7 @@ g_random_int (void)
*
* Returns: a random number
*/
-gint32
+gint32
g_random_int_range (gint32 begin,
gint32 end)
{
@@ -630,7 +629,7 @@ g_random_int_range (gint32 begin,
*
* Returns: a random number
*/
-gdouble
+gdouble
g_random_double (void)
{
double result;
@@ -650,7 +649,7 @@ g_random_double (void)
*
* Returns: a random number
*/
-gdouble
+gdouble
g_random_double_range (gdouble begin,
gdouble end)
{
@@ -664,7 +663,7 @@ g_random_double_range (gdouble begin,
/**
* g_random_set_seed:
* @seed: a value to reinitialize the global random number generator
- *
+ *
* Sets the seed for the global random number generator, which is used
* by the g_random_* functions, to @seed.
*/
diff --git a/glib/gstdio.c b/glib/gstdio.c
index f5c9448ed..9a27324e0 100644
--- a/glib/gstdio.c
+++ b/glib/gstdio.c
@@ -145,15 +145,11 @@ w32_error_to_errno (DWORD error_code)
* "wb+". The 'b' needs to be appended to "w+", i.e. "w+b". Note
* that otherwise these 2 modes are supposed to be aliases, hence
* swappable at will. TODO: Is this still true?
- *
- * It also doesnt accept `e`, which Unix uses for O_CLOEXEC. This function
- * rewrites that to `N` — see
- * https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/fopen-wfopen?view=msvc-170
*/
static void
_g_win32_fix_mode (wchar_t *mode)
{
- wchar_t *ptr, *e_ptr, *comma_ptr;
+ wchar_t *ptr;
wchar_t temp;
ptr = wcschr (mode, L'+');
@@ -163,13 +159,6 @@ _g_win32_fix_mode (wchar_t *mode)
mode[1] = *ptr;
*ptr = temp;
}
-
- /* Rewrite `e` (O_CLOEXEC) to `N`, if it occurs before any extended attributes
- * (https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/fopen-wfopen?view=msvc-170#unicode-support) */
- e_ptr = wcschr (mode, L'e');
- comma_ptr = wcschr (mode, L',');
- if (e_ptr != NULL && (comma_ptr == NULL || e_ptr < comma_ptr))
- *e_ptr = L'N';
}
/* From
@@ -1573,13 +1562,6 @@ g_rmdir (const gchar *filename)
* used by GLib are different. Convenience functions like g_file_set_contents_full()
* avoid this problem.
*
- * Since GLib 2.86, the `e` option is supported in @mode on all platforms. On
- * Unix platforms it will set `O_CLOEXEC` on the opened file descriptor. On
- * Windows platforms it will be converted to the
- * [`N` modifier](https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/fopen-wfopen?view=msvc-170).
- * It is recommended to set `e` unconditionally, unless you know the returned
- * file should be shared between this process and a new fork.
- *
* Returns: A `FILE*` if the file was successfully opened, or %NULL if
* an error occurred
*
@@ -1636,9 +1618,6 @@ g_fopen (const gchar *filename,
*
* See your C library manual for more details about freopen().
*
- * Since GLib 2.86, the `e` option is supported in @mode on all platforms. See
- * the documentation for [func@GLib.fopen] for more details.
- *
* Returns: A FILE* if the file was successfully opened, or %NULL if
* an error occurred.
*
diff --git a/glib/tests/fileutils.c b/glib/tests/fileutils.c
index b0f99949b..b27ea54c8 100644
--- a/glib/tests/fileutils.c
+++ b/glib/tests/fileutils.c
@@ -705,7 +705,7 @@ test_mkdir_with_parents_1 (const gchar *base)
if (g_file_test (p1, G_FILE_TEST_EXISTS))
g_error ("failed, did g_rmdir(%s), but %s is still there", p1, p1);
- f = g_fopen (p1, "we");
+ f = g_fopen (p1, "w");
if (f == NULL)
g_error ("failed, couldn't create file %s", p1);
fclose (f);
@@ -1446,7 +1446,7 @@ test_get_contents (void)
char *filename = g_build_filename (g_get_tmp_dir (), "file-test-get-contents", NULL);
gsize bytes_written;
- f = g_fopen (filename, "we");
+ f = g_fopen (filename, "w");
bytes_written = fwrite (text, 1, strlen (text), f);
g_assert_cmpint (bytes_written, ==, strlen (text));
fclose (f);
@@ -2042,7 +2042,7 @@ test_read_link (void)
g_free (newpath);
g_free (badpath);
- file = g_fopen (filename, "we");
+ file = fopen (filename, "w");
g_assert_nonnull (file);
fclose (file);
diff --git a/glib/tests/unicode.c b/glib/tests/unicode.c
index 4717a43dc..44d4ae904 100644
--- a/glib/tests/unicode.c
+++ b/glib/tests/unicode.c
@@ -33,7 +33,6 @@
#include <stdio.h>
#include "glib.h"
-#include "glib/gstdio.h"
#include "glib/gunidecomp.h"
@@ -638,7 +637,7 @@ test_casemap_and_casefold (void)
save_and_clear_env ("LANG", &old_lang);
filename = g_test_build_filename (G_TEST_DIST, "casemap.txt", NULL);
- infile = g_fopen (filename, "re");
+ infile = fopen (filename, "r");
g_assert (infile != NULL);
while (fgets (buffer, sizeof (buffer), infile))
@@ -702,7 +701,7 @@ test_casemap_and_casefold (void)
g_free (filename);
filename = g_test_build_filename (G_TEST_DIST, "casefold.txt", NULL);
- infile = g_fopen (filename, "re");
+ infile = fopen (filename, "r");
g_assert (infile != NULL);
while (fgets (buffer, sizeof (buffer), infile))
--
2.52.0

View File

@ -2,7 +2,7 @@
Name: mingw-glib2
Version: 2.87.0
Release: 1%{?dist}
Release: 2%{?dist}
Summary: MinGW Windows GLib2 library
License: LGPL-2.0-or-later
@ -56,6 +56,10 @@ Patch2: CVE-2025-13601-gconvert-Error-out-if-g_escape_uri_string-would-o
# https://bugzilla.gnome.org/show_bug.cgi?id=698118
#Patch5: glib-prefer-constructors-over-DllMain.patch
# https://gitlab.gnome.org/GNOME/glib/-/issues/3898
# https://issues.redhat.com/browse/RHEL-151748
Patch3: 0001-Revert-gstdio-Add-support-for-the-e-flag-O_CLOEXEC-t.patch
%description
MinGW Windows Glib2 library.
@ -302,6 +306,9 @@ find %{buildroot} -name "*.la" -delete
%changelog
* Wed Feb 25 2026 Konstantin Kostiuk <kkostiuk@redhat.com> - 2.87.0-2
- RHEL-151748 - Glib2 cause qga command 'guest-ssh-get-authorized-keys' failed
* Mon Dec 1 2025 Konstantin Kostiuk <kkostiuk@redhat.com> - 2.87.0-1
- Update to 2.87.0
- RHEL-130993 - CVE-2025-13601 mingw-glib2: Integer overflow in in g_escape_uri_string()