24927 Commits

Author SHA1 Message Date
Goran Vidović
c80dec72c0 Update Croatian translation 2022-04-20 17:44:55 +00:00
Fran Dieguez
77bf623bee Update Galician translation 2022-04-19 06:04:40 +00:00
Ask Hjorth Larsen
d57e17ce9d Updated Danish translation 2022-04-18 19:22:58 +02:00
Enrico Nicoletto
e8cd7d1918 Update Brazilian Portuguese translation 2022-04-15 16:56:16 +00:00
Marc-André Lureau
bda6992fb6 tests: fix protocol test on win32
The pipe must be closed, or the child PID watch doesn't get triggered.

We should remove the message callback source on EOF, as EOF during main
loop run will reach a bad assert in the callback.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-04-14 13:19:17 +01:00
Chun-wei Fan
ccc2a73e86 glib/tests/date.c: Fix 2-digit year test
...for certain Windows locales, since the formats accepted for
g_date_set_parse() will vary depending on the current system locale.  For
instance, g_date_set_parse(gdate, "dd/mm/yy") is accepted on locales such
as zh-HK (Chinese (Hong Kong SAR)) but is rejected on zh-TW (Chinese
(Taiwan)).

One can tell from the "date format" settings in the Windows system
control panel whether there is a "dd/MM/YYYY" or "dd/MM/YY" option from the
drop-down list of date formats to display for the locale, which will indicate
whether g_date_set_parse(gdate, "dd/mm/yy") is accepted, which is true for
zh-HK but is not true for zh-TW.

If g_date_set_parse(gdate, "dd/mm/yy") is not accepted, try again with
g_date_set_parse(gdate, "yy/mm/dd") thereafter for the 2-digit-year tests.
2022-04-14 13:18:36 +01:00
Chun-wei Fan
b47e7b3503 gdate.c: Use standard name if no daylight saving exists
We should normally have a standard name for the time zone even if we don't
have daylight saving in the time zone, so use the standard name also when
GetTimeZoneInformation() returns TIME_ZONE_ID_UNKNOWN[1][2].

[1]: https://docs.microsoft.com/en-us/windows/win32/api/timezoneapi/nf-timezoneapi-gettimezoneinformation
[2]: https://docs.microsoft.com/zh-tw/windows/win32/api/timezoneapi/nf-timezoneapi-settimezoneinformation
2022-04-14 13:18:36 +01:00
Philip Withnall
38d076a5fd 2.72.1
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2.72.1
2022-04-14 12:15:25 +01:00
Kukuh Syafaat
0587ef97fc Update Indonesian translation 2022-04-11 09:08:49 +00:00
Aleksandr Melman
4efe65117d Update Russian translation 2022-04-09 15:35:33 +00:00
Alexander Shopov
06a0c8abd9 Update Bulgarian translation 2022-04-09 07:56:28 +00:00
Sebastian Dröge
d30a726069 Merge branch 'wip/pwithnall/backport-2578-clang-cxx-glib-2-72' into 'glib-2-72'
Backport !2578 “gatomic: Add a C++ variant of g_atomic_int_compare_and_exchange()” to glib-2-72

See merge request GNOME/glib!2593
2022-04-06 13:29:21 +00:00
Philip Withnall
45da15a50c gatomic: Add a C++ variant of g_atomic_int_compare_and_exchange()
The C++ variant implements type safety differently, to avoid warnings
from C++ compilers about:
```
../../../gnome-commander-1.14.2/src/intviewer/searcher.cc:303:5: error: cannot initialize a parameter of type 'gint *' (aka 'int *') with an rvalue of type 'void *'
    g_atomic_int_compare_and_exchange ((gint*)&src->priv->progress_value, oldval, (gint)d);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/mnt/b/yoe/master/build/tmp/work/cortexa72-yoe-linux/gnome-commander/1.14.2-r0/recipe-sysroot/usr/include/glib-2.0/glib/gatomic.h:160:44: note: expanded from macro 'g_atomic_int_compare_and_exchange'
    __atomic_compare_exchange_n ((atomic), (void *) (&(gaicae_oldval)), (newval), FALSE, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST) ? TRUE : FALSE; \
                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
```

This complements the existing C++ variant for
`g_atomic_pointer_compare_and_exchange()`, and fixes a regression on C++
from https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2114.

With the addition of the unit tests in the previous commit, this is
effectively tested by the FreeBSD and macOS CI jobs, as they use
`clang++` in C++ mode. `g++` doesn’t seem to emit a warning about this.

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

Fixes: #2625
2022-04-06 12:34:53 +01:00
Philip Withnall
0e33f1110f tests: Add C++ tests for typechecking with atomic compare and exchanges
The tests have to be conditional on C++11 being enabled, as the default
C++ standard on macOS is (for some reason), C++97 (`__cplusplus` is
defined as `199711L`).

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

Helps: #2625
2022-04-06 12:34:53 +01:00
Philip Withnall
62a60f1d60 tests: Fix a typo in a test skip message
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-04-06 12:34:53 +01:00
Simon McVittie
817fc993c7 Merge branch 'backport-2589-test-dbus-exit-on-close-glib-2-72' into 'glib-2-72'
Backport !2589 “tests: Don’t exit gdbus-method-invocation test early on connection close” to glib-2-72

See merge request GNOME/glib!2590
2022-04-05 16:23:35 +00:00
Philip Withnall
18cb90980e tests: Don’t exit gdbus-method-invocation test early on connection close
There’s (deliberately) a bit of race in implementing/handling
`CloseBeforeReturning()` in `gdbus-method-invocation.c`. If the server
closes the D-Bus connection early, the client may exit with `SIGTERM` if
`GDBusConnection:exit-on-close` is set. We don’t want that, as the test
is trying to check that the default handling of a D-Bus method return
after a connection has closed works.

See https://gnome.pages.gitlab.gnome.org/-/glib/-/jobs/1935191/artifacts/_build/meson-logs/testlog.txt

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-04-05 15:51:20 +01:00
Simon McVittie
d50bc089e2 Merge branch 'backport-translation-fixes-and-2571-glib-2-72' into 'glib-2-72'
Backport translation fixes and !2571 “meson: Set BROKEN_POLL in macOS builds” to glib-2-72

See merge request GNOME/glib!2573
2022-04-05 14:23:33 +00:00
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