24959 Commits

Author SHA1 Message Date
Simon McVittie
e62f5222bb Merge branch 'backport-2565-meson-python-fix-glib-2-72' into 'glib-2-72'
Backport !2565 “Revert "meson: simplify lookup of python command"” to glib-2-72

See merge request GNOME/glib!2574
2022-04-05 14:22:32 +00:00
Simon McVittie
49910134c8 Merge branch 'backport-2583-portal-trashing-dirs-glib-2-72' into 'glib-2-72'
Backport !2583 “Fix trashing sandboxed directories” to glib-2-72

See merge request GNOME/glib!2587
2022-04-05 14:18:02 +00:00
Philip Withnall
880f974b96 Merge branch 'backport-2582-win32-gui-spawn-glib-2-72' into 'glib-2-72'
Backport !2582 “glib/win32: fix spawn from GUI regression” to glib-2-72

See merge request GNOME/glib!2588
2022-04-05 13:10:20 +00:00
Marc-André Lureau
44a82bf84c glib/win32: fix spawn from GUI regression
In commit 674072b13 ("glib/win32: check if dup() failed in helper
process"), I happily added checks for dup() calls in the spawn helper.
However, I didn't realize that GUI applications do not necessarily have
a console attached, and will now fail spawning processes.

One way to check that is via a _fileno() call, as explained in:
https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/fileno?view=msvc-170#return-value

Fixes:
https://gitlab.gnome.org/GNOME/glib/-/issues/2628

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-04-05 13:13:52 +01:00
Matthias Clasen
cdf74f8169 Fix trashing sandboxed directories
We must not open the fd with O_PATH|O_NOFOLLOW,
since the portal rejects that combination. Leaving
out O_NOFOLLOW is fine in this case - we know it
is a directory, we just received EISDIR.

Fixes: #2629
2022-04-05 13:00:16 +01:00
Philip Withnall
ce71974576 Revert "meson: simplify lookup of python command"
This reverts commit 4a4d9eb6624b69328fa9749236c0b4236932ceb8.

It seems to cause build failures with `VsDevCmd.bat` 2022:
```
..\meson.build:2274:0: ERROR: Command "C:\Program Files\Meson\meson.exe runpython --version" failed with status 2.
```

Revert it for now until this can be fixed in Meson.

See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2541#note_1410521
2022-03-29 12:36:36 +01:00
Haruka Ma
1738e25375 meson: Set BROKEN_POLL in macOS builds 2022-03-28 13:02:59 +01:00
Andre Klapper
edd0bdbc93 Fix invalid markup in Bulgarian translation 2022-03-28 13:02:59 +01:00
Philip Withnall
e951bf1ae3 docs: Improve formatting for some file monitor documentation
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-03-23 15:34:19 +00:00
Philip Withnall
bbf1dca06a docs: Drop reference to G_LOCAL_DIRECTORY_MONITOR_EXTENSION_POINT_NAME
Support for separate directory monitors was dropped in commit
b995c08bf32cb701b92bd8c98651de2d77cade9e, in 2015.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-03-23 15:32:37 +00:00
Emin Tufan Çetin
cffbd11437 Update Turkish translation 2022-03-23 08:08:22 +00:00
Jordi Mas
f0f3a489d5 Update Catalan translation 2022-03-23 07:41:35 +01:00
Hugo Carvalho
fe95865267 Update Portuguese translation 2022-03-22 22:19:28 +00:00
Aurimas Černius
1b0841a591 Updated Lithuanian translation 2022-03-22 21:16:29 +02:00
Matej Urbančič
8dcb0409ca Update Slovenian translation 2022-03-22 18:32:32 +00:00
Piotr Drąg
9000a26a06 Update Polish translation 2022-03-22 16:25:37 +00:00
Anders Jonsson
39b5925391 Update Swedish translation 2022-03-22 16:21:16 +00:00
Milo Casagrande
60ee6302e4 Update Italian translation 2022-03-22 16:14:04 +00:00
Yuri Chornoivan
2afdaf82ad Update Ukrainian translation 2022-03-22 15:46:15 +00:00
Philip Withnall
61e2a9afe2 Merge branch 'resolver-tests' into 'main'
tests: Add more tests for GResolver response parsing

See merge request GNOME/glib!2566
2022-03-22 15:18:49 +00:00
Philip Withnall
f9ef3bec68 gthreadedresolver: Only declare private test APIs on Unix
They’re only defined on Unix anyway. `GThreadedResolver` has an entirely
different code path for handling DNS replies on Windows.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-03-22 12:41:08 +00:00
Philip Withnall
e8e8aebcbe resolver: Add SRV support to manual resolver test
This allows for tests like:
```
resolver -t SRV _http._tcp.mxtoolbox.com
```

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-03-22 12:40:12 +00:00
Philip Withnall
33204fe127 tests: Add tests for parsing specific DNS record types
Success and failure tests. This massively increases test coverage for
parsing DNS records, although it doesn’t get it to 100%.

It should now be useful enough to do more fuzzing on, without
immediately getting trivial failures from the fuzzer.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-03-22 12:40:12 +00:00
Philip Withnall
0d42af06e0 gthreadedresolver: Treat query and answer counts as unsigned
They can’t be negative.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-03-22 12:40:12 +00:00
Philip Withnall
08dee06b59 gthreadedresolver: Limit length of each record to its stated rdlength
Rather than limiting them to the full length of the answer, which may
include subsequent records.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-03-22 12:40:12 +00:00
Philip Withnall
023fab80f9 gthreadedresolver: Add error checking to all record parsing
This should catch all kinds of invalid records, and correctly report
them as errors.

Heavily based on work by Patrick Griffis in !2134.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-03-22 12:40:12 +00:00
Philip Withnall
81193c5aac gthreadedresolver: Don’t warn on unrecognised record types
Otherwise the code isn’t forwards-compatible, and may be DOSed by
servers returning unknown records, if `G_DEBUG=fatal-warnings` is
enabled for some reason.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-03-22 12:40:12 +00:00
Philip Withnall
51f70fe62e tests: Add tests for invalid DNS response header parsing
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-03-22 12:40:12 +00:00
Philip Withnall
2a7b4db243 gthreadedresolver: Expose g_resolver_record_type_to_rrtype()
So that it can be used in the tests.

It’s not part of the public, documented, supported API.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-03-22 12:40:12 +00:00
Philip Withnall
8b73d7bbf9 gthreadedresolver: Handle error returns from dn_expand() in headers
It is possible for `dn_expand()` to fail; if so, it’ll return `-1`,
which will mess up subsequent parsing.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-03-22 12:40:12 +00:00
Philip Withnall
263ca69da8 gthreadedresolver: Check header length when parsing response
Otherwise we could read off the end of an invalid response.

oss-fuzz#42538
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-03-22 12:40:12 +00:00
Patrick Griffis
5cdacced3f tests: Add basic test framework for GResolver DNS parsing
Split out from https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2134
by Philip Withnall so it can be used in advance of HTTPS DNS record
support landing.

Reworked to no longer use test fixtures, as it’s simple enough to build
the response header in each test.

The tests are built on Unix only, as they test the parsing code in
`g_resolver_records_from_res_query()`, which is Unix-specific. The
Windows DNS APIs provide much more structured results which don’t need
parsing.
2022-03-22 12:40:12 +00:00
Philip Withnall
94179de2d9 Merge branch 'slice_tests' into 'main'
Move test files on slices from tests/ to glib/tests/

See merge request GNOME/glib!2564
2022-03-22 12:22:57 +00:00
Emmanuel Fleury
5931ed8c2b Move test files on slices from tests/ to glib/tests/
slice-color.c and slice-concurrent.c are moved from tests/ to glib/tests/

Related to issue #1434
2022-03-22 11:42:33 +00:00
Emmanuel Fleury
1f2f3d7f37 Convert tests/slice-concurrent.c to glib test framework 2022-03-22 11:42:33 +00:00
Emmanuel Fleury
6211971c41 Convert tests/slice-color.c to glib test framework 2022-03-22 11:42:33 +00:00
Emmanuel Fleury
495508cf84 Enabling disabled slice-color test case 2022-03-22 11:42:33 +00:00
Alexander Shopov
32b5f405bc Update Bulgarian translation 2022-03-22 10:30:56 +00:00
Philip Withnall
56a3747038 Merge branch 'wip/carlosg/gdatetime-before-y1000' into 'main'
glib: Format GDateTime ISO8601 years as %C%y

See merge request GNOME/glib!2563
2022-03-21 13:47:48 +00:00
Carlos Garnacho
16fcd0814e glib: Add tests for far away GDateTimes
Poke near the limits (years 9 and 9990) to ensure these also
result in a correct ISO8601 format.
2022-03-21 12:56:42 +00:00
Carlos Garnacho
c3cc6bf5eb glib: Format GDateTime ISO8601 years as %C%y
The current use of %Y does not take into account that %Y will
not pad the year with 0's, meanwhile ISO8601 does expect a full
YYYY format for all dates. This breaks the formatting with dates
prior to the year 1000.

Split this into %C%y so 2-digit, 0-padded century and year are
printed separately, this gives the expected YYYY format.
2022-03-21 12:56:42 +00:00
Alexander Shopov
96efd662c9 Update Bulgarian translation 2022-03-21 12:43:03 +00:00
Philip Withnall
2e940e125f Merge branch 'w32-skips' into 'main'
Various win32 tests skip & fixes

See merge request GNOME/glib!2540
2022-03-21 12:19:24 +00:00
Philip Withnall
48a3e8f7f2 Merge branch 'move_g_basename_test' into 'main'
Move unit test on g_basename() function to glib/tests/fileutils.c

See merge request GNOME/glib!2558
2022-03-21 12:14:59 +00:00
Philip Withnall
47f905d2f6 Merge branch 'move_relation_tests' into 'main'
Move tests/relation-test.c to glib/tests/relation.c

See merge request GNOME/glib!2559
2022-03-21 12:12:38 +00:00
Andre Klapper
513afbb09f Fix invalid markup in Bulgarian translation 2022-03-19 20:32:49 +01:00
Alexander Shopov
596fa06aaf Update Bulgarian translation 2022-03-19 16:46:07 +00:00
Sebastian Dröge
c5e12d9577 Merge branch 'wip/pwithnall/update-other-cis' into 'main'
ci: Update Coverity, mingw and Android CI images to Fedora 34

See merge request GNOME/glib!2560
2022-03-18 11:45:34 +00:00
Philip Withnall
c53129911c Merge branch 'power-profile-monitor-docs' into 'main'
gpowerprofilemonitor: Tweak wording of documentation to make more sense

See merge request GNOME/glib!2534
2022-03-18 11:34:47 +00:00
Philip Withnall
46c6ed231e ci: Update Android NDK image to Fedora 34
Don’t take the opportunity to add support for Android API 31 or update
the version of the Android NDK we’re using to r23b, though, as I
couldn’t quickly get that to work and ran out of time.

Bumping the Fedora version will at least reduce our CI repository disk
usage through sharing the base image.

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

Helps: #2605
2022-03-18 11:27:02 +00:00