Commit Graph

32396 Commits

Author SHA1 Message Date
Philip Withnall
b78f524030 ci: Enable the gobject-introspection build for the debian-stable-i386 job
So the introspection tests which check architecture-specific things are
run on an i386 architecture. This gives the best check we have that the
libgirepository code is actually architecture independent.

This requires adding some missing dependencies to the Debian Dockerfile
which gobject-introspection.git needs. It also means enabling `sudo` on
those containers.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2025-11-27 23:28:36 +00:00
Michael Catanzaro
3e1ba29cff Merge branch 'installed-tests-fix' into 'main'
tests: Fix static-link test when running installed

See merge request GNOME/glib!4920
2025-11-25 11:06:18 -06:00
Philip Withnall
bfdd7031e0 tests: Update Meson subcommand usage in static-link test
This just silences a few warnings from Meson about using deprecated
subcommands.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2025-11-25 15:25:38 +00:00
Philip Withnall
8f0c9b2fe1 tests: Fix static-link test when running installed
This effectively reverts commit 663ee11fda
for this `meson.build` file. This `meson.build` file isn’t actually
pulled into the main GLib (or GIO) build; it’s actually just installed
and then later called from a `meson` subprocess of `static-link.py`.

So it doesn’t have access to the `app_profile_dep` variable, which is
internal to GLib.

Fixes this CI failure: https://gitlab.gnome.org/GNOME/glib/-/jobs/5834610

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2025-11-25 15:08:30 +00:00
Marco Trevisan
1d40d3bd86 Merge branch 'wip/chergert/ignore-more-fs-types' into 'main'
gio/gunixmounts: mark some file-system types as system

See merge request GNOME/glib!4916
2025-11-21 22:15:11 +01:00
Christian Hergert
f1a90a67c3 gio/gunixmounts: mark some file-system types as system
Since this list was originally created, more file system types have
become commonly used and would benefit from being marked as a system
file-system type.

This was found while tracking down some performance issues in
gnome-settings-daemon trash handling.
2025-11-21 12:32:07 -08:00
Philip Withnall
a9c0feac4b Merge branch '3827-filename-to-uri-strings' into 'main'
gconvert: Error out if g_escape_uri_string() would overflow

Closes #3827

See merge request GNOME/glib!4914
2025-11-21 13:30:01 +00:00
Philip Withnall
a13c8d710d Merge branch 'mcatanzaro/dbus-path-length' into 'main'
gdbusprivate: check length of path to GDBus binary

See merge request GNOME/glib!4913
2025-11-21 11:53:55 +00:00
Michael Catanzaro
356f211a6c gdbusprivate: replace an else clause with a goto
This allows us to remove one level of nested indentation.
2025-11-20 15:06:12 -06:00
Michael Catanzaro
cd0c2e8de1 gdbusprivate: check length of path to GDBus binary
The code assumes that find_dbus_process_path() will return a wide
character string that is no longer than MAX_PATH. But this might not be
guaranteed to be true.

This was flagged in #YWH-PGM9867-119. The vulnerability hunter failed to
find any way to reach this code, so maybe it's not actually possible,
but we might as well check the size to be safe.
2025-11-20 15:06:12 -06:00
Philip Withnall
bb7cec29f7 Merge branch 'os-profile' into 'main'
Add app-profile static lib for Windows

Closes #3733

See merge request GNOME/glib!4788
2025-11-20 16:36:56 +00:00
Philip Withnall
a74ee4fb5c Merge branch 'wip/Jehan/gimp-issue-15239' into 'main'
Issue #3819: G_FILE_MONITOR_WATCH_HARD_LINK does not monitor files on Windows.

Closes #3819

See merge request GNOME/glib!4901
2025-11-20 15:46:25 +00:00
Marco Trevisan
faea0d7d5c Merge branch '3818-main-context-checks' into 'main'
gmain: Allow the context to be NULL in g_main_context_check()

Closes #3818

See merge request GNOME/glib!4911
2025-11-20 16:39:05 +01:00
Michael Catanzaro
f2fa68cb3d Merge branch 'ci-issue-bot-use-var' into 'main'
ci: Use issue bot native support for $ISSUE_BOT_API_TOKEN_FILE

See merge request GNOME/glib!4910
2025-11-20 09:16:46 -06:00
Luca Bacci
e1a7b54f8b Win32: Add test for safe stdio flushing
Test the two-phase flushing implemented in app_profile_dep.
2025-11-20 16:02:34 +01:00
Michiel Jan Laurens de Hoon
74eb5c7cb0 gmain: Allow the context to be NULL in g_main_context_check()
Includes significant changes to the unit test by Philip Withnall.

Fixes: #3818
2025-11-20 14:51:42 +00:00
Luca Bacci
15eeef71e3 Win32: Add test for OS compatibility section in manifest XML
Check that executables() get a proper manifest resource
2025-11-20 14:53:27 +01:00
Luca Bacci
2d9fc41586 Win32: Add test for stderr buffering mode
Verify that stderr is not fully-buffered.

CRTs before the Unversal CRT can open stderr in full buffering
mode (depending on the output type). That's not desirable and
we have a workaround in app_profile_dep.
2025-11-20 14:53:27 +01:00
Luca Bacci
e37fb2a398 gtestutils: Add new G_TEST_SUBPROCESS_INHERIT_DESCRIPTORS flag 2025-11-20 14:53:20 +01:00
Philip Withnall
8c2ce2bb7a Merge branch 'macos-testfilemonitor-fix' into 'main'
testfilemonitor: treat `CHANGES_DONE_HINT` as optional when events don’t match

Closes #1181

See merge request GNOME/glib!4905
2025-11-20 13:25:47 +00:00
Luca Bacci
ef0edb01ad Use template library RC file 2025-11-20 11:00:59 +01:00
Luca Bacci
d1f36fefb2 Add template rc for libraries 2025-11-20 11:00:59 +01:00
Luca Bacci
59135a3d98 Revert "tools: Add script to create UAC manifests for Windows"
This reverts commit ab732692a0.

We now embed a proper manifest in all executables
2025-11-20 11:00:59 +01:00
Luca Bacci
8e504845f2 Revert "gobject tests: Fix running custom-dispatch on 32-bit Windows"
This reverts commit cb1eb57581.

We now embed a proper manifest in all executables
2025-11-20 11:00:59 +01:00
Luca Bacci
663ee11fda Add OS profile app to executables
Fixes #3733
2025-11-20 11:00:59 +01:00
Luca Bacci
c836a71114 Add OS profile sources for Windows 2025-11-20 11:00:53 +01:00
Marco Trevisan (Treviño)
cf6d4c398a ci: Use issue bot native support for $ISSUE_BOT_API_TOKEN_FILE
This has landed upstream as part of [1], so we can drop temporary
our workaround (for once, it was really temporary! 🥳).

Partially reverts:
 - bba1f8ac03
 - 41a5228ee6

[1] https://gitlab.com/gitlab-org/distribution/issue-bot/-/merge_requests/27
2025-11-19 16:34:05 +01:00
Philip Withnall
9764f3f094 Merge branch 'use-rules-drop-deprecated-only-except' into 'main'
ci: Do not use anymore only/except deprecated syntax

See merge request GNOME/glib!4883
2025-11-19 14:37:38 +00:00
Philip Withnall
b71e443f38 Merge branch 'win32_file_trash_user_cancelled' into 'main'
glocalfile: Fix trash user cancellation not reported on Windows

See merge request GNOME/glib!4909
2025-11-19 14:30:41 +00:00
g.willems
373fd1079a glocalfile: Fix trash user cancellation not reported
`SHFileOperationW()` may not always return success in case of
user-aborted operation, `ERROR_CANCELLED` was also observed
when cancelling a move-to-recycle-bin confirmation dialog.

Ensure `G_IO_ERROR_CANCELLED` is properly reported to the application,
instead of the generic `G_IO_ERROR_FAILED`.
2025-11-18 21:08:40 +01:00
Marco Trevisan (Treviño)
7d3ae117a1 ci: Only run C style checks on c files changes
Also remove the dependency of pages job on it since none of the results
seem to be used there
2025-11-18 21:07:33 +01:00
Marco Trevisan (Treviño)
773815f727 ci: Apply GNOME templates default rules
Re-use rules from https://gitlab.gnome.org/GNOME/citemplates/ default-rules
template, but without importing them to ensure that changes in the
citemplates project won't affect us directly

So we have some basic control on what should trigger a workflow,
auto-retry and auto-replace on subsequent pushes
2025-11-18 21:07:33 +01:00
Marco Trevisan (Treviño)
332b6898ef ci: Do not use anymore only/except deprecated syntax
These keywords are deprecated [1] for a while, and they are breaking the
usage of more complex `rules:` when mixed, so let's rewrite the CI jobs
rules to use non-deprecated syntax

[1] https://docs.gitlab.com/ci/yaml/deprecated_keywords/#only--except
2025-11-18 21:07:33 +01:00
Philip Withnall
a0631ca294 Merge branch 'ignore_case_in_genums' into 'main'
gobject: Make enum/flags value lookups case-insensitive

Closes #74

See merge request GNOME/glib!4906
2025-11-17 23:23:28 +00:00
Emmanuel Fleury
c4718596c2 gobject: Make enum/flags value lookups case-insensitive
Make g_enum_get_value_by_name(), g_flags_get_value_by_name(),
g_enum_get_value_by_nick() and g_flags_get_value_by_nick() perform ASCII
case-insensitive comparisons when matching names and nicks. This aligns
behavior with common expectations for user-visible nicks and reduces
rejections of mixed-case inputs.

Implementation switches from strcmp() to strcmp_ignore_case() when
comparing the provided name/nick to registered values.

This is a minor behavior change that only broadens accepted input. Types
with values that differ only by case are now allowed.

Tests: Extend gobject/tests/enums.c to cover mixed-case lookups for both
enums and flags (names and nicks).

Fixes: #74
2025-11-17 18:03:14 +01:00
Philip Withnall
5f256ba23f Merge branch 'faccessat_errno' into 'main'
glocalfile: Complain if `faccessat` sets an unusual error and use AT_FDCWD

See merge request GNOME/glib!4908
2025-11-17 12:58:21 +00:00
Philip Withnall
e438609cba Merge branch 'fix/gsettings-completion-nounset-choices' into 'main'
completion: fix error on nounset mode unknown completions

See merge request GNOME/glib!4907
2025-11-17 12:47:19 +00:00
Colin Kinloch
32f246561e glocalfile: Pass AT_FDCWD to faccessat
`filename` should always be absolute when it's passed to `faccessat` so
this shouldn't change the behavior.

Apparently NetBSD checks the value of `dirfd` even when `pathname` is
absolute which results in an error:
https://gitlab.gnome.org/GNOME/glib/-/issues/3495#note_2605408
2025-11-16 17:01:51 +00:00
Colin Kinloch
8f8e3a43d7 glocalfile: Complain if faccessat sets an unusual error
Many libc implementations seem to be incompatible with this
optimisation.

Printing an error when the error is either `EINVAL` or `EBADF` should
make it easier to identify any more problematic platforms.
2025-11-16 17:01:48 +00:00
Ville Skyttä
b61bdee3bd completion: fix error on nounset mode unknown completions
With the shell in "nounset" mode (`set -u`), an error was output for
unknown completions, for example `gsettings set non existent <TAB>`.
2025-11-16 17:07:32 +02:00
Philip Withnall
7bd3fc3720 fuzzing: Add fuzz tests for g_filename_{to,from}_uri()
These functions could be called on untrusted input data, and since they
do URI escaping/unescaping, they have non-trivial string handling code.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

See: #3827
2025-11-13 18:31:43 +00:00
Philip Withnall
f28340ee62 gconvert: Error out if g_escape_uri_string() would overflow
If the string to escape contains a very large number of unacceptable
characters (which would need escaping), the calculation of the length of
the escaped string could overflow, leading to a potential write off the
end of the newly allocated string.

In addition to that, the number of unacceptable characters was counted
in a signed integer, which would overflow to become negative, making it
easier for an attacker to craft an input string which would cause an
out-of-bounds write.

Fix that by validating the allocation length, and using an unsigned
integer to count the number of unacceptable characters.

Spotted by treeplus. Thanks to the Sovereign Tech Resilience programme
from the Sovereign Tech Agency. ID: #YWH-PGM9867-134

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Fixes: #3827
2025-11-13 18:27:22 +00:00
Philip Withnall
298fa45f90 Merge branch 'glib/no-color-env' into 'main'
glog: guard NO_COLOR environment variable check with a GOnce for performance reasons

See merge request GNOME/glib!4904
2025-11-12 11:24:12 +00:00
André Barnabá Silva
1051394c36 testfilemonitor: treat CHANGES_DONE_HINT as optional when events don’t
match

This expands on the previous fixes to the kqueue backend testing, to
always treat `CHANGES_DONE_HINT` as optional when there is a mismatch
checking the expected events.

Also re-enable the tests for macOS.

Helps: #1392
2025-11-12 04:46:02 -03:00
Aaron Andersen
705de2e714 glog: guard NO_COLOR environment variable check with a GOnce for performance reasons 2025-11-11 20:31:50 -05:00
Philip Withnall
8ebc5b8502 Merge branch 'g_gnuc_flag_enum' into 'main'
Add G_GNUC_FLAG_ENUM

See merge request GNOME/glib!4900
2025-11-11 11:12:03 +00:00
Philip Withnall
91524a98c5 Merge branch 'getenv-invalid-names' into 'main'
genvironment: consider macOS behavior when testing g_getenv

See merge request GNOME/glib!4899
2025-11-09 18:22:32 +00:00
Philip Chimento
9e0736abc9 gregex: Ensure all bits are named in GRegexCompileFlags
This is to avoid the Wflag-enum warning that Clang emits when you have a
flags enum where a multi-bit value encompasses a bit that doesn't have a
corresponding single-bit value.

(I'm not sure why G_REGEX_NEWLINE_ANYCRLF isn't just 1 << 22...)
2025-11-07 22:44:35 -08:00
Philip Chimento
20fa7ec959 ghook: Ensure all bits are named in GHookFlagMask
This is to avoid the Wflag-enum warning that Clang emits when you have a
flags enum where a multi-bit value encompasses a bit that doesn't have a
corresponding single-bit value.
2025-11-07 22:44:35 -08:00
Philip Chimento
0a87b5bc1a all: Apply G_GNUC_FLAG_ENUM to all flags enums 2025-11-07 22:44:35 -08:00