Commit Graph

24432 Commits

Author SHA1 Message Date
Philip Withnall
ea0fa26029 Merge branch 'fix-gi-suproject' into 'main'
gi: expose some files as variable for gobject-introspection

See merge request GNOME/glib!2465
2022-01-28 16:44:20 +00:00
Andoni Morales Alastruey
b1ed9907c2 gi: expose some files as variable for gobject-introspection
see:
https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/313
2022-01-28 16:16:29 +01:00
Philip Withnall
88f4514a92 Merge branch 'SuibianP-main-patch-88562' into 'main'
Amend g_bus_get* documentation regarding private connection

See merge request GNOME/glib!2464
2022-01-28 13:11:36 +00:00
Hu Jialun
7f044ba9c0 Amend g_bus_get* documentation regarding private connection 2022-01-28 13:11:34 +00:00
Aleksandr Melman
7a759e18c9 Update Russian translation 2022-01-28 11:06:16 +00:00
Rafael Fontenelle
c2ac44b261 Update Brazilian Portuguese translation 2022-01-27 15:33:59 +00:00
Philip Withnall
4bd23d1b26 2.71.1
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-01-27 15:22:23 +00:00
Yuri Chornoivan
80b6aad868 Update Ukrainian translation 2022-01-27 14:52:54 +00:00
Philip Withnall
e01e6ef771 Merge branch 'windows-static-build-postfixes' into 'main'
Fix tests with static build on Windows

See merge request GNOME/glib!2442
2022-01-27 14:33:40 +00:00
Sebastian Dröge
a542c10ee4 Merge branch 'revert-7f2de9ab' into 'main'
Revert "Merge branch 'fix-windows-pc' into 'main'"

See merge request GNOME/glib!2463
2022-01-27 14:10:24 +00:00
Philip Withnall
cdda7bb59a Revert "Merge branch 'fix-windows-pc' into 'main'"
This reverts merge request !2459
2022-01-27 13:04:12 +00:00
Hugo Carvalho
73aebf3887 Update Portuguese translation 2022-01-27 12:53:46 +00:00
Loic Le Page
cbbc9206aa Fix exported symbols in proxy-libintl subproject 2022-01-27 12:10:13 +01:00
Loic Le Page
4f6673fb58 Fix glib/tests/completion test
GLists compare pointers values and not strings content.
2022-01-27 12:10:13 +01:00
Loic Le Page
38abadab3d Fix dbus process autolaunch with static build on Windows
On Windows, dbus is launched by spawning the gdbus.exe executable on
demand from the gio module. When linked dynamically, the executable
path is guessed relatively to the gio DLL path. But when linked
statically, the only reference path available is the current
executable path. In this case, gdbus.exe is not necessarily in the same
folder as the current executable.

This patch solves the issue using the same algorithm as the one used
with process spawning in glib core source code two commits above.
2022-01-27 12:10:13 +01:00
Loic Le Page
41f8bbd02d Fix process spawning with static build on Windows
On Windows, process spawning needs an external helper exe which is found
relatively to the glib DLL file. If glib has been built statically this
file doesn't exist anymore and reference path is not the DLL path
anymore but the current executable path.

This patch searches for the helper exe taking as starting point the
current executable path, relative 'bin', 'lib', 'glib' and 'gio' folders
and then gets one level up until the root path. If this search doesn't
give result then the helper exe is searched using the PATH variable.
2022-01-27 12:10:13 +01:00
Philip Withnall
94f4ec85c6 Merge branch 'fix-memleak-gdbusauthmechanismsha1' into 'main'
Fix memory leak in gio/gdbusauthmechanismsha1.c

See merge request GNOME/glib!2461
2022-01-27 11:05:45 +00:00
Philip Withnall
f242299b3e Merge branch 'windows-static-resource' into 'main'
Windows: Do not link DLL specific resources when doing a static build

Closes #2585

See merge request GNOME/glib!2457
2022-01-27 11:02:34 +00:00
Philip Withnall
7f519624e2 Merge branch '1190-debug-interface' into 'main'
gdebugcontroller: Add debug controller API and D-Bus implementation

Closes #1190

See merge request GNOME/glib!2330
2022-01-27 11:00:40 +00:00
Sebastian Dröge
13ee46538f Merge branch 'fix-g_find_program_in_path' into 'main'
gutils: Fix g_find_program_in_path() to return an absolute path

Closes #2586

See merge request GNOME/glib!2460
2022-01-27 10:50:36 +00:00
Loic Le Page
6ec432386e Fix memory leak in gio/gdbusauthmechanismsha1.c 2022-01-27 10:39:49 +01:00
Sebastian Dröge
7f2de9ab83 Merge branch 'fix-windows-pc' into 'main'
gio: add missing zlib dependency in gio-windows-2.0.pc

See merge request GNOME/glib!2459
2022-01-27 08:45:53 +00:00
Christoph Niethammer
78dc1cc3cd gutils: Fix g_find_program_in_path() to return an absolute path
Fix a possibility of returning a relative path, in case PATH contains
a relative path. According to the doc, the function should return an
absolute path.

Signed-off-by: Christoph Niethammer <christoph.niethammer@gmail.com>
2022-01-27 03:54:01 +01:00
Leônidas Araújo
4d97fef04c Update Brazilian Portuguese translation 2022-01-26 19:29:01 +00:00
Rafael Fontenelle
2e4eccb872 Update Brazilian Portuguese translation
(cherry picked from commit 22e9237d02)
2022-01-26 19:22:41 +00:00
Fran Dieguez
d36390778b Update Galician translation 2022-01-26 18:47:41 +00:00
Simon McVittie
2eb1eb1649 Merge branch 'glib-compile-resources-build-improvements' into 'main'
tests: Pass --internal and -z noexecstack to glib-compile-resources tests

See merge request GNOME/glib!2456
2022-01-26 18:13:05 +00:00
Andoni Morales Alastruey
d2ab2bcefd gio: add missing zlib dependency in gio-windows-2.0.pc 2022-01-26 18:13:05 +01:00
Hugo Carvalho
34458a7f2a Update Portuguese translation 2022-01-26 15:47:11 +00:00
Philip Withnall
0c8f7de55a gdebugcontroller: Add debug controller API and D-Bus implementation
This is intended to provide a uniform interface for controlling whether
the debug output from an application (or service) is emitted, typically
to journald, but actually to wherever the application chooses to output
it.

The main implementation of `GDebugController` is `GDebugControllerDBus`,
which is intended to be used on Linux. Other implementations may be
added in future for other platforms, or larger applications may want to
provide their own implementation which integrates with their ecosystem.

The `GDebugControllerDBus` implementation exposes a D-Bus interface at
`/org/gtk/Debugging` with a method to enable or disable debug
output at runtime.

This could be used by external harnesses, such as GNOME Builder or
systemd, to give a uniform way to get debug output from an application.

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

Fixes: #1190
2022-01-26 15:19:27 +00:00
Philip Withnall
bb4bec0921 gmessages: Expose a property for enabling debug message output
This is an API analogue of the G_MESSAGES_DEBUG environment variable. It
is intended to be exposed outside applications (for example, as a D-Bus
interface — see follow-up commits) so that there is a uniform interface
for controlling the debug output of an application.

Helps: #1190
2022-01-26 15:17:02 +00:00
Philip Withnall
70c116e602 Merge branch 'win32-afunix' into 'main'
gio: Add some AF_UNIX support on Windows

Closes #2487

See merge request GNOME/glib!2445
2022-01-26 15:11:48 +00:00
Xavier Claessens
9159e84ce5 Windows: Do not link DLL specific resources when doing a static build
Fixes: #2585
2022-01-26 09:49:30 -05:00
Philip Withnall
9cde484b9f tests: Mark compiled resource file as not having an executable stack
As with the previous commit, this isn’t needed for GLib’s tests to work
correctly, but is probably needed in other projects which might be
tempted to copy and paste the Meson tooling from GLib.

Inspired by https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/4330

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-01-26 14:28:46 +00:00
Hugo Carvalho
51e6e4fc2f Update Portuguese translation 2022-01-26 14:28:38 +00:00
Philip Withnall
55fa866cc8 tests: Pass --internal to glib-compile-resources tests
This isn’t needed to make the tests any better (it doesn’t really affect
them), but is probably needed for anyone who copies this Meson code in
order to add `glib-compile-resources` support to their project. It’s
pretty unlikely that someone would want to compile *and export* a
resource from a shared library.

Inspired by https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/4334

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-01-26 14:27:38 +00:00
Marc-André Lureau
9a9e2b5d7d gio: enable unix: address on win32
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-01-26 18:19:44 +04:00
Marc-André Lureau
e796124b31 gio: tests AF_UNIX socket credentials on win32
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-01-26 18:19:44 +04:00
Marc-André Lureau
95c3e28af5 gio: add G_CREDENTIALS_TYPE_WIN32_PID
Credentials are often used to check peer processes details.

With AF_UNIX sockets on Windows, SIO_AF_UNIX_GETPEERPID can
be used to retrive the peer PID.

We will probably introduce more advanced mechanisms later on, though,
but I am not a Windows API expert.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-01-26 18:19:44 +04:00
Marc-André Lureau
568f00d65f gio/tests: enable most AF_UNIX tests on all platforms
The main difference is that g_socket_new_from_fd() requires bound
sockets on Win32.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-01-26 18:19:44 +04:00
Marc-André Lureau
2f8a9196b8 gio: return G_IO_NVAL if the socket is already closed
For consistency with Unix behaviour, as checked in the tests/socket.c.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-01-26 18:19:44 +04:00
Marc-André Lureau
83d45c4f35 gio: compile GUnixConnection on all platforms
On !UNIX, return an error for send_fd() & receive_fd().
(the unixfdmessage unit is not compiled on !UNIX)

The header is installed under the common GIO include directory.

Ensure G_TYPE_UNIX_CONNECTION is registered on all platforms.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-01-26 18:19:44 +04:00
Marc-André Lureau
af1777d3d3 meson: compile GUnixCredentialsMessage on all platforms
The header is now also installed under the common GIO include directory.

Sorry if it breaks any build, you had to use the correct header path.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-01-26 18:19:44 +04:00
Marc-André Lureau
37cab227fd gio: compile GSocketAddress with AF_UNIX on all platforms
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-01-26 18:19:44 +04:00
Marc-André Lureau
3308cfb020 gio: compile GUnixSocketAddress on all platforms
Move the header under the common GIO include directory.

Sorry if it breaks any build, you had to use the correct header path.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-01-26 18:19:44 +04:00
Marc-André Lureau
4339192b53 gio: add fallback afunix.h header
afunix.h is only recently distributed with Windows SDK & MinGW.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-01-26 18:19:23 +04:00
Marc-André Lureau
fd1e2c8019 meson: check for win32 afunix.h
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-01-26 18:19:23 +04:00
Philip Withnall
34bd3fc5cc Merge branch 'security-fixes-main' into 'main'
gdbusmessage, gvariant and garray fixes

Closes #2557, #2572, and #2578

See merge request GNOME/glib!2454
2022-01-26 13:39:37 +00:00
Tobias Stoeckmann
374a1895b6 garray: Fix integer overflows in element capacity calculations
Integer overflows in size calculations of buffers (GArray and GPtrArray)
allow subsequent buffer overflows. This happens due to conversions
between gsize and guint.

Proof of concept demonstrations of the overflows can be found in issue
2578. They are not being added as unit tests as they require too much
memory to test.

This will affect `GArray`s which are 4GB in size, or `GPtrArray`s which
are 48GB in size.

Fixes: #2578
2022-01-26 13:06:26 +00:00
Sebastian Wilhelmi
c74177337d gdbusmessage: Disallow zero-length elements in arrays
They are not allowed in the specification, and can lead to infinite
loops when parsing.

That’s a security issue if your application is accepting D-Bus messages
from untrusted peers (perhaps in a peer-to-peer connection). It’s not
exploitable when your application is connected to a bus (such as the
system or session buses), as the bus daemons (dbus-daemon or
dbus-broker) filter out such broken messages and don’t forward them.

Arrays of zero-length elements are disallowed in the D-Bus
specification: https://dbus.freedesktop.org/doc/dbus-specification.html#container-types

oss-fuzz#41428, #41435
Fixes: #2557
2022-01-26 13:04:49 +00:00