Commit Graph

23917 Commits

Author SHA1 Message Date
Anders Jonsson
b3a333814d Update Swedish translation 2021-11-24 16:24:14 +00:00
Sebastian Dröge
12b613b582 Merge branch 'backport-2364-freebsd-objcopy-glib-2-70' into 'glib-2-70'
Backport !2364 “tests: Allow `objcopy --help` to fail, because it fails on FreeBSD” to glib-2-70

See merge request GNOME/glib!2366
2021-11-24 15:50:52 +00:00
Philip Withnall
05340ad8b4 tests: Allow objcopy --help to fail, because it fails on FreeBSD
This is a partial revert of b248f3481c. Eventually, this commit can be
dropped once `objcopy --help` doesn’t exit with a non-zero status on
FreeBSD.

See: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2360#note_1318608

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-11-24 15:20:25 +00:00
Sebastian Dröge
3562c9e16d Merge branch 'backport-2360-meson-check-glib-2-70' into 'glib-2-70'
Backport !2360 “meson: specify when commands need to succeed in run_command” to glib-2-70

See merge request GNOME/glib!2363
2021-11-24 10:53:59 +00:00
Eli Schwartz
f80da352c9 meson: specify when commands need to succeed in run_command
meson in git master now warns about a missing `check:` kwarg, and may
eventually change the default from false to true.

Take the opportunity to require `objcopy --help` to succeed -- it is
unlikely to fail, but if it does something insane happened.
2021-11-24 10:32:30 +00:00
Philip Withnall
485dd16dc1 Merge branch 'improve-win32-version-2-70' into 'glib-2-70'
gutils.c: Improve g_get_os_info() for Windows 10/Server 2019+

See merge request GNOME/glib!2359
2021-11-24 10:29:27 +00:00
Yuri Chornoivan
0b021116b9 Update Ukrainian translation 2021-11-24 10:27:12 +00:00
Sebastian Dröge
a911cf837a Merge branch 'backport-2354-test-dbus-glib-2-70' into 'glib-2-70'
Backport !2354 “gtestdbus: Print the dbus address on a specific FD intead of stdout” to glib-2-70

See merge request GNOME/glib!2361
2021-11-24 10:24:28 +00:00
Marco Trevisan (Treviño)
5afc7d5b77 gtestdbus: Print the dbus address on a specific FD intead of stdout
We used to use a pipe for the dbus daemon stdout to read the defined
address, but that was already requiring a workaround to ensure that dbus
daemon children were then able to write to stdout.
However the current implementation is still causing troubles in some
cases in which the daemon is very verbose, leading to hangs when writing
to stdout.

As per this, just don't handle stdout ourself, but use instead a
specific pipe to get the address address. That can now be safely closed
once we've received the data we need.

This reverts commit d80adeaa96.

Fixes: #2537
2021-11-24 09:54:25 +00:00
Chun-wei Fan
e5917c67ba gutils.c: Improve Windows 10/Server 2019 20H2+ detection
This improves how we obtain the Windows release versions in
get_windows_version(), in turn g_get_os_info() for Windows 10/Server
2019 20H2 (2009) and later and Windows 11, by doing the following:

*  Check the build number for non-server versions of Windows.
   For Windows 11, the build number is 22000+, so we now correctly
   indicate on Windows 11 that we are indeed running Windows 11.
*  Check the DisplayVersion entry in the registry under
   SOFTWARE\Microsoft\Windows NT\CurrentVersion if we obtained "2009"
   from the ReleaseId entry, since DisplayVersion replaces ReleaseId
   after Windows 10/Server 2019 20H2 (2009).  This makes things more
   clear for Windows releases after 20H2, where previously 20H2
   and 21H1 were all identified as Windows 10 [Server] 2009.

This should fix issue #2443.
2021-11-24 10:44:16 +08:00
Chun-wei Fan
2e99a15291 gwin32.c: Split out call to RtlGetVersion()
Unfortunately, we may well be likely to need to call RtlGetVersion() via
GetModuleHandle() + GetProcAddress(), so split out the call to RtlGetVersion()
into a private function of its own, so that we can reuse the same code in other
parts of GLib, so that we can:

*  Determine better in a more fine-tuned way to determine whether we are on
   Windows 10/11 and/or Server 2016/2019/2022, since we need to rely on the
   build number.

*  Just call RtlGetVersion() once, when needed, as that is all that is needed.
   We could re-use the same function once to compare what we got when we
   called RtlGetVersion() and do what is necessary there.
2021-11-24 10:44:01 +08:00
Philip Withnall
0926864f6f Merge branch 'backport-2355-dbus-message-truncation-glib-2-70' into 'glib-2-70'
Backport !2355 “gdbusmessage: Add more bounds checking when parsing D-Bus messages” to glib-2-70

See merge request GNOME/glib!2356
2021-11-23 13:26:00 +00:00
Philip Withnall
a5f53c7d00 gdbusmessage: Remove arbitrary restriction on minimum D-Bus blob length
The code in `g_dbus_message_new_from_blob()` has now been fixed to
correctly error out on all truncated messages, so there’s no need for an
arbitrary programmer error if the input is too short to contain a valid
D-Bus message header.

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

Helps: #2528
2021-11-23 12:59:20 +00:00
Sebastian Wilhelmi
0956ef613a tests: Add test cases for truncated D-Bus messages
(Minor code formatting tweaks and leak fixes by Philip Withnall.)

Helps: #2528
2021-11-23 12:59:20 +00:00
Sebastian Wilhelmi
a7f7880b86 gdbusmessage: Add more bounds checking when parsing D-Bus messages
Perform strict bounds checking when reading data from the D-Bus message,
and propagate errors to the callers.

Previously, truncated D-Bus messages could cause out-of-bounds reads.

This is a security issue, but one which is only exploitable when
communicating with an untrusted peer (who might send malicious
messages). Almost all D-Bus traffic is with a session or system bus,
where the dbus-daemon or dbus-broker is trusted, and is known to have
already rejected malformed (malicious) messages.

Accordingly, this is only exploitable with peer-to-peer D-Bus
conversations with an untrusted peer.

(Includes some minor cleanups from Philip Withnall.)

oss-fuzz#17408
Fixes: #2528
2021-11-23 12:59:20 +00:00
Sebastian Dröge
eba304f9ca Merge branch 'backport-2327-uri-normalization-glib-2-70' into 'glib-2-70'
Backport !2327 “guri: Improve performance of remove_dot_segments() algorithm” to glib-2-70

See merge request GNOME/glib!2344
2021-11-22 13:57:58 +00:00
Sebastian Wilhelmi
d4ef27b3ba guri: Improve performance of remove_dot_segments() algorithm 2021-11-17 15:22:48 +00:00
Sebastian Dröge
ae0a0d0dd5 Merge branch 'backport-2338-journald-namespaced-glib-2-70' into 'glib-2-70'
Backport !2338 “gmessages: Support namespaced journals” to glib-2-70

See merge request GNOME/glib!2340
2021-11-16 16:26:49 +00:00
Philip Withnall
04507fcaff gmessages: Support namespaced journals
Spotted and diagnosed by Ilya Basin.

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

Fixes: #2530
2021-11-16 15:15:29 +00:00
Sebastian Dröge
54130f153a Merge branch 'backport-2325-macos-settings-fix-glib-2-70' into 'glib-2-70'
Backport !2325 “Fix GSettings dict error macOS” to glib-2-70

See merge request GNOME/glib!2337
2021-11-16 15:00:01 +00:00
Maurice
8035c5a37f Fix GSettings dict error macOS 2021-11-16 14:22:19 +00:00
Emmanuele Bassi
5d67d83046 Merge branch 'backport-2324-pcre-tarball-glib-2-70' into 'glib-2-70'
Backport !2324 “Fix link to pcre-8.37.tar.bz2” to glib-2-70

See merge request GNOME/glib!2335
2021-11-16 13:04:41 +00:00
Albert Astals Cid
529c4eb312 Fix link to pcre-8.37.tar.bz2
ftp.pcre.org FTP site is no longer available
2021-11-16 12:45:39 +00:00
Xavier Claessens
397f8b6253 Merge branch 'backport-2309-pcre-blah-blah-glib-2-70' into 'glib-2-70'
Backport !2309 “Rename libpcre.wrap to pcre.wrap” to glib-2-70

See merge request GNOME/glib!2316
2021-11-11 17:00:37 +00:00
Goran Vidović
c6e9028f09 Update Croatian translation 2021-11-11 09:46:23 +00:00
Milo Casagrande
46737f3702 Update Italian translation 2021-11-09 08:15:31 +00:00
Sebastian Dröge
a28c93003b Merge branch 'backport-2161-delayed-settings-null-handling-glib-2-70' into 'glib-2-70'
Backport !2161 “gdelayedsettingsbackend: Fix applying after calling g_settings_reset()” to glib-2-70

See merge request GNOME/glib!2320
2021-11-04 10:52:37 +00:00
Philip Withnall
e665cc94c4 gsettings: Drop internal delayed member
This introduces no functional changes; it only simplifies the code.

Instead of maintaining a separate pointer to the backend iff it’s a
`GDelayedSettingsBackend`, just test the `backend` pointer’s type.

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

Helps: #2426
2021-11-04 10:21:13 +00:00
Philip Withnall
f941329b56 gsettings: Clarify that g_settings_get_child() inherits delay-apply
Previously, the delay-apply status of the parent `GSettings` object
would be partially inherited: `settings->priv->backend` in the child
`GSettings` object would point to a `GDelayedSettingsBackend`, but
`settings->priv->delayed` would be `NULL`.

The expectation from https://bugzilla.gnome.org/show_bug.cgi?id=720891
was that `get_child()` would fully inherit delay-apply status.

So, ensure that `settings->priv->delayed` is correctly set to point to
the delayed backend when constructing any `GSettings`. Update the tests
to work again (presumably the inverted test was an oversight in the
original changes).

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

Fixes: #2426
2021-11-04 10:21:11 +00:00
Philip Withnall
51e16afcbf gsettings: Improve documentation formatting slightly
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-11-04 10:20:35 +00:00
Philip Withnall
62a1f3b9b5 tests: Use a helper macro to drop redundant code in gsettings test
This introduces no functional changes.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-11-04 10:20:35 +00:00
Philip Withnall
21b1767af6 gdelayedsettingsbackend: Fix applying after calling g_settings_reset()
`g_settings_reset()` changes the value of the setting to `NULL`;
`add_to_tree()` was not handling that correctly.

Add a unit test.

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

Fixes: #2426
2021-11-04 10:20:35 +00:00
Xavier Claessens
562295c286 Rename libpcre.wrap to pcre.wrap
It is exactly the same wrap as the one in WrapDB but with a different
name. That fix error when multiple projects uses pcre and they don't
have the same wrap name:

meson.build:1:0: ERROR: Multiple wrap files provide 'libpcre' dependency: pcre.wrap and libpcre.wrap
2021-11-01 18:24:26 +00:00
Philip Withnall
eaf3169a4b Merge branch 'backport-2260-win32-registry-assert-glib-2-70' into 'glib-2-70'
Backport !2260 “GWin32AppInfo: Remove assertion on the opened registry key” to glib-2-70

See merge request GNOME/glib!2313
2021-11-01 15:34:54 +00:00
Luca Bacci
eb3bcf8ba0 GWin32AppInfo: Remove assertion on the opened registry key
Relax assertion about opened registry key as it may have been removed
in the meantime between enumeration and when opening, or (more likely)
we may not have the required permissions to open the some enumerated
keys (i.e. RegOpenKeyExW fails and returns ERROR_ACCESS_DENIED).

Fixes https://gitlab.com/inkscape/inbox/-/issues/5669
2021-11-01 14:33:13 +00:00
Sebastian Dröge
2aca2cfbcc Merge branch 'backport-2308-volatile-glib-2-70' into 'glib-2-70'
Backport !2308 “gthread-win32: Remove an unnecessary volatile qualifier” to glib-2-70

See merge request GNOME/glib!2314
2021-11-01 12:36:23 +00:00
Philip Withnall
66a195bb78 gthread-win32: Remove an unnecessary volatile qualifier
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-11-01 12:00:50 +00:00
Philip Withnall
2be5416a35 2.70.1
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-10-28 13:29:17 +01:00
Philip Withnall
359a837ee4 Merge branch 'fatal-meson-warnings' into 'glib-2-70'
meson: fix warnings for extract_all_objects function

See merge request GNOME/glib!2304
2021-10-21 09:35:16 +00:00
Eli Schwartz
a1a3a41bea
update the proxy-libintl subproject to the latest release
0.2 was just tagged, which includes a commit from 2018 that fixes a
meson warning which caused the project to fail to build on Windows with
--fatal-meson-warnings enabled.

(cherry picked from commit 9255f1b2a9)
2021-10-20 15:35:24 -04:00
Eli Schwartz
397840eb18
meson: fix warnings for extract_all_objects function
The "recursive:" kwarg is available in the targeted minimum version of
meson, and is basically required if you want to not emit warnings and
maybe error with --fatal-meson-warnings.

The current default behavior is false, so explicitly opt in to that value.
None of these internal libraries use recursive objects anyway.

In commit c74d87e44038925baf37367ce124c027e225c11e we went a different
route, and upgraded the minimum meson version and dropped the TODO
workarounds in these files. But for a stable branch this is not
desirable.
2021-10-20 15:33:19 -04:00
Sebastian Dröge
7c9b1781e4 Merge branch 'backport-2293-msvc-analyser-fix-glib-2-70' into 'glib-2-70'
Backport !2293 “glib-private: Fix MSVC build with AddressSanitizer” to glib-2-70

See merge request GNOME/glib!2301
2021-10-19 06:30:41 +00:00
Sebastian Dröge
476895b85f Merge branch 'backport-2274-getpwnam-glib-2-70' into 'glib-2-70'
Backport !2274 “Do not try to access errno after calling getpwnam_r.” to glib-2-70

See merge request GNOME/glib!2276
2021-10-19 06:25:07 +00:00
Sebastian Dröge
494062b36f Merge branch 'backport-2251-string-performance-glib-2-70' into 'glib-2-70'
Backport !2251 “GString: Bump minimum size” to glib-2-70

See merge request GNOME/glib!2253
2021-10-19 06:21:55 +00:00
Sebastian Dröge
39183abe81 Merge branch 'backport-2285-svace-fixes-glib-2-70' into 'glib-2-70'
Backport !2285 “fix issues found by svace static code analyzer” to glib-2-70

See merge request GNOME/glib!2300
2021-10-19 06:21:23 +00:00
Sebastian Dröge
7513af8f07 Merge branch 'backport-2291-nm-properties-changed-glib-2-70' into 'glib-2-70'
Backport !2291 “gnetworkmonitornm: Stop using removed PropertiesChanged signal” to glib-2-70

See merge request GNOME/glib!2302
2021-10-19 06:20:54 +00:00
Julian Andres Klode
20fedaf01d gnetworkmonitornm: Do not re-update cached property
GDBusProxy already takes care of updating the cached property
before emitting the signal, so there is no need to do this
a second time ourselves.
2021-10-18 13:22:09 +01:00
Julian Andres Klode
8fc462f761 gnetworkmonitornm: Stop using removed PropertiesChanged signal
Use the org.freedesktop.DBus.Properties interface to listen
to PropertiesChanged signals on /org/freedesktop/NetworkManager.

NetworkManager used to provide its own legacy PropertiesChanged
signal, but that was dropped in
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/853

This requires NetworkManager >= 1.2 (2016)

Fixes: #2505
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1946196
2021-10-18 13:22:09 +01:00
Seungha Yang
376c9c360d glib-private: Fix MSVC build with AddressSanitizer
MSVC supports AddressSanitizer as well via "/fsanitize=address" option,
but __lsan_ignore_object() equivalent feature is not supported.
Note that there's __declspec(no_sanitize_address) specifier which
provides a similar feature but that's not runtime behavior
so it's not directly applicable to g_ignore_leak() family.

See also https://docs.microsoft.com/en-us/cpp/sanitizers/asan-building?view=msvc-160
2021-10-18 13:21:29 +01:00
Egor Bychin
2f8e17ad84 add OOM handling in mimemagic 2021-10-18 13:20:48 +01:00