public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Kalev Lember <klember@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/glib2] cve-2026-58016-f44: Backport glib-mkenums flags annotation parsing fixes
Date: Tue, 11 Aug 2026 10:36:24 GMT	[thread overview]
Message-ID: <178644458460.1.3187248914690151118.rpms-glib2-7601a56f3255@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/glib2
Branch : cve-2026-58016-f44
Commit : 7601a56f325587c5e2c98041cd59e99e2848d544
Author : Kalev Lember <klember@redhat.com>
Date   : 2017-08-01T22:54:29+01:00
Stats  : +99/-1 in 3 file(s)
URL    : https://src.fedoraproject.org/rpms/glib2/c/7601a56f325587c5e2c98041cd59e99e2848d544?branch=cve-2026-58016-f44

Log:
Backport glib-mkenums flags annotation parsing fixes

---
diff --git a/0001-Revert-glib-mkenums-fix-parsing-of-flags-annotation.patch b/0001-Revert-glib-mkenums-fix-parsing-of-flags-annotation.patch
new file mode 100644
index 0000000..c7e34ab
--- /dev/null
+++ b/0001-Revert-glib-mkenums-fix-parsing-of-flags-annotation.patch
@@ -0,0 +1,62 @@
+From ca69df0f16fd0bda99baf609a8ce9f38e1039f65 Mon Sep 17 00:00:00 2001
+From: Emmanuele Bassi <ebassi@gnome.org>
+Date: Tue, 1 Aug 2017 10:11:09 +0100
+Subject: [PATCH 1/2] Revert "glib-mkenums: fix parsing of /*< flags >*/
+ annotation"
+
+This reverts commit 1672678bc48c1c060d1ee6bb3df124b3e4f9ca33.
+
+A more comprehensive fix will follow.
+---
+ gobject/glib-mkenums.in | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/gobject/glib-mkenums.in b/gobject/glib-mkenums.in
+index 9fae3a8a9..a82a374cf 100755
+--- a/gobject/glib-mkenums.in
++++ b/gobject/glib-mkenums.in
+@@ -83,7 +83,7 @@ def write_output(output):
+ 
+ # glib-mkenums.py
+ # Information about the current enumeration
+-flags = False               # Is enumeration a bitmask?
++flags = None # Is enumeration a bitmask?
+ option_underscore_name = '' # Overriden underscore variant of the enum name
+                             # for example to fix the cases we don't get the
+                             # mixed-case -> underscorized transform right.
+@@ -196,7 +196,7 @@ def parse_entries(file, file_name):
+                 value = groups[1]
+             if len(groups) > 2:
+                 options = groups[2]
+-            if not flags and value is not None and '<<' in value:
++            if flags is None and value is not None and '<<' in value:
+                 seenbitshift = 1
+ 
+             if options is not None:
+@@ -449,12 +449,12 @@ def process_file(curfilename):
+                 if 'skip' in options:
+                     continue
+                 enum_prefix = options.get('prefix', None)
+-                flags = 'flags' in options
++                flags = options.get('flags', None)
+                 option_lowercase_name = options.get('lowercase_name', None)
+                 option_underscore_name = options.get('underscore_name', None)
+             else:
+                 enum_prefix = None
+-                flags = False
++                flags = None
+                 option_lowercase_name = None
+                 option_underscore_name = None
+ 
+@@ -479,7 +479,7 @@ def process_file(curfilename):
+             parse_entries(curfile, curfilename)
+ 
+             # figure out if this was a flags or enums enumeration
+-            if not flags:
++            if flags is None:
+                 flags = seenbitshift
+ 
+             # Autogenerate a prefix
+-- 
+2.13.0
+

diff --git a/0002-glib-mkenums-fix-parsing-of-flags-annotation.patch b/0002-glib-mkenums-fix-parsing-of-flags-annotation.patch
new file mode 100644
index 0000000..dfb9520
--- /dev/null
+++ b/0002-glib-mkenums-fix-parsing-of-flags-annotation.patch
@@ -0,0 +1,29 @@
+From 8cc99502022944917f5dd78ce1d1427582081396 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Alberts=20Muktup=C4=81vels?= <alberts.muktupavels@gmail.com>
+Date: Tue, 1 Aug 2017 12:18:42 +0300
+Subject: [PATCH 2/2] glib-mkenums: fix parsing of flags annotation
+
+https://bugzilla.gnome.org/show_bug.cgi?id=779332
+---
+ gobject/glib-mkenums.in | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/gobject/glib-mkenums.in b/gobject/glib-mkenums.in
+index a82a374cf..d4bfd11c3 100755
+--- a/gobject/glib-mkenums.in
++++ b/gobject/glib-mkenums.in
+@@ -450,6 +450,11 @@ def process_file(curfilename):
+                     continue
+                 enum_prefix = options.get('prefix', None)
+                 flags = options.get('flags', None)
++                if 'flags' in options:
++                    if flags is None:
++                        flags = 1
++                    else:
++                        flags = int(flags)
+                 option_lowercase_name = options.get('lowercase_name', None)
+                 option_underscore_name = options.get('underscore_name', None)
+             else:
+-- 
+2.13.0
+

diff --git a/glib2.spec b/glib2.spec
index 8b5b8a3..c62d3e3 100644
--- a/glib2.spec
+++ b/glib2.spec
@@ -5,7 +5,7 @@
 
 Name: glib2
 Version: 2.53.4
-Release: 3%{?dist}
+Release: 4%{?dist}
 Summary: A library of handy utility functions
 
 License: LGPLv2+
@@ -14,6 +14,8 @@ Source0: http://download.gnome.org/sources/glib/2.53/glib-%{version}.tar.xz
 
 # Backported from upstream
 Patch0: 0001-Revert-GKeyFile-Add-array-length-annotations-to-to_d.patch
+Patch1: 0001-Revert-glib-mkenums-fix-parsing-of-flags-annotation.patch
+Patch2: 0002-glib-mkenums-fix-parsing-of-flags-annotation.patch
 
 BuildRequires: chrpath
 BuildRequires: gettext
@@ -85,6 +87,8 @@ the functionality of the installed glib2 package.
 %prep
 %setup -q -n glib-%{version}
 %patch0 -p1
+%patch1 -p1
+%patch2 -p1
 
 %build
 # Bug 1324770: Also explicitly remove PCRE sources since we use --with-pcre=system
@@ -235,6 +239,9 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
 %{_datadir}/installed-tests
 
 %changelog
+* Tue Aug 01 2017 Kalev Lember <klember@redhat.com> - 2.53.4-4
+- Backport glib-mkenums flags annotation parsing fixes
+
 * Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.53.4-3
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
 

                 reply	other threads:[~2026-08-11 10:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178644458460.1.3187248914690151118.rpms-glib2-7601a56f3255@fedoraproject.org \
    --to=klember@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox