Commit Graph

25895 Commits

Author SHA1 Message Date
Emmanuele Bassi
ab189ecfed Merge branch 'wip/chergert/fix-2708' into 'main'
gmain: close pidfd when finalizing GChildWatchSource

Closes #2708

See merge request GNOME/glib!2847
2022-08-02 19:53:44 +00:00
Christian Hergert
b62745fe8e gmain: close pidfd when finalizing GChildWatchSource
A file-descriptor was created with the introduction of pidfd_getfd() but
nothing is closing it when the source finalizes. The GChildWatchSource is
the creator and consumer of this FD and therefore responsible for closing
it on finalization.

The pidfd leak was introduced in !2408.

This fixes issues with Builder where anon_inode:[pidfd] exhaust the
available FD limit for the process.

Fixes #2708
2022-08-02 12:35:56 -07:00
Luca Bacci
477ff949e1 gspawn-win32: Provide thread-safe wrappers for _wspawn*e functions
_wspawn*e functions are not thread safe on the MSVCRT.dll and
the pre-2015 MSVC runtime DLLs (msvcrXXX.dll).
2022-08-02 18:47:05 +02:00
Luca Bacci
0cb43a4965 Merge branch 'g-win32-app-info-launched-signal-actually-report-pid' into 'main'
GWin32AppInfo: Fix PID reporting in launched signal

See merge request GNOME/glib!2299
2022-08-02 14:51:26 +00:00
Luca Bacci
45bdeeddff GWin32AppInfo: Actually report the GPid in the GAppLaunchContext::launched signal
We need to pass the G_SPAWN_DO_NOT_REAP_CHILD flag to g_spawn_async,
otherwise the returned child_pid will always be 0.
2022-08-02 16:38:32 +02:00
Yuri Chornoivan
ba5e403785 Update Ukrainian translation 2022-08-02 11:40:13 +00:00
Marco Trevisan
14736065c8 Merge branch 'ebassi/resource-no-display-name' into 'main'
Implement GFileIface.set_display_name() for resource files

Closes #2705

See merge request GNOME/glib!2844
2022-08-01 22:52:32 +00:00
Aleksandr Melman
985ffc3b4e Update Russian translation 2022-08-01 13:10:46 +00:00
codeboybebop
ece66f11fc gio-tool: -d option to delete attribute
gio tool has support for deleting attributes of the file. To delete attribute user
should specify type '--type="unset"'. This is not mentioned in help and therefore not
intuitive. By adding '-d' option, we make this process more obvious.

closes #2588
2022-07-31 13:19:50 -05:00
Asier Sarasua Garmendia
ecdbe3c324 Update Basque translation 2022-07-31 16:51:52 +00:00
Emmanuele Bassi
a9394bd68e Implement GFileIface.set_display_name() for resource files
Resource files cannot be renamed, and GFileIface.set_display_name() is
mandatory.

Fixes: #2705
2022-07-30 20:06:07 +01:00
Nart Tlisha
a775578b96 Update Abkhazian translation 2022-07-28 19:23:21 +00:00
Zurab Kargareteli
dea174ec67 Update Georgian translation 2022-07-28 19:14:24 +00:00
Yuri Chornoivan
9bc9a9b62a Update Ukrainian translation 2022-07-26 20:03:24 +00:00
Emmanuele Bassi
7eb791db52 Merge branch 's390x-gregex-prce2-fix' into 'main'
gregex: use correct size for pcre2_pattern_info

Closes #2699

See merge request GNOME/glib!2840
2022-07-26 15:38:21 +00:00
Hugo Carvalho
5121b9882b Update Portuguese translation 2022-07-26 14:00:48 +00:00
Hugo Carvalho
bb0f0734e5 Update Portuguese translation 2022-07-26 13:58:07 +00:00
Mamoru TASAKA
710ccee65c gregex: use correct size for pcre2_pattern_info
man pcre2_pattern_info says that the 3rd argument must
point to uint32_t variable (except for some 2nd argument value),
so correctly use it. Especially using wrong size can cause
unexpected result on big endian.

closes: #2699
2022-07-26 21:51:45 +09:00
Philip Withnall
2b21a30a59 Merge branch 'main' into 'main'
Implement xattr attribute removal

Closes #1187

See merge request GNOME/glib!2831
2022-07-26 07:58:32 +00:00
madmurphy
b295c53769 gfileinfo: Implement xattr attribute removal
Fixes: #1187
2022-07-26 07:58:32 +00:00
Emmanuele Bassi
f839eae274 Merge branch 'ebassi/application-flags' into 'main'
Introduce G_APPLICATION_DEFAULT_FLAGS

See merge request GNOME/glib!2835
2022-07-25 22:44:37 +00:00
Emmanuele Bassi
8f68c1e646 Rename G_MARKUP_PARSE_FLAGS_NONE
The prefix for GMarkupParseFlags enumeration members is G_MARKUP; this
means that G_MARKUP_PARSE_FLAGS_NONE gets split into
GLib.MarkupParseFlags.PARSE_FLAGS_NONE by the introspection scanner.

The `/*< nick=none >*/` trigraph attribute is a glib-mkenum thing, and
does not affect the introspection scanner; it would also only affect the
GEnumValue nickname, which is not used by language bindings to resolve
the name of the enumeration member. Plus, GMarkupParseFlags does not
have a corresponding GType anyway.
2022-07-25 22:30:22 +01:00
Emmanuele Bassi
aa65fc2537 Rename G_TLS_CERTIFICATE_FLAGS_NONE
The prefix is G_TLS_CERTIFICATE, not G_TLS_CERTIFICATE_FLAGS. Having
G_TLS_CERTIFICATE_FLAGS_NONE leads to a FLAGS_NONE nick in the GType,
and a FLAGS_NONE member name in the introspection data.
2022-07-25 22:30:22 +01:00
Emmanuele Bassi
09234b50fe Introduce G_APPLICATION_DEFAULT_FLAGS
Enumeration members should either have the name of the type as their
prefix, or they should all have the same prefix.

The "default flags" enumeration member for GApplicationFlags is
unfortunately named G_APPLICATION_FLAGS_NONE, while every other member
of the same type has a G_APPLICATION prefix. The result is that the nick
name of the enumeration member is "flags-none", and that language
bindings will have to use something like
Gio.ApplicationFlags.FLAGS_NONE.

To fix this API wart, we can deprecate the FLAGS_NONE member, and add a
new DEFAULT_FLAGS.
2022-07-25 22:30:22 +01:00
Philip Withnall
6629948adc Merge branch 'rybalkin-gregex-remove-match-context-limits' into 'main'
gregex: do not set match and recursion limits on match context

Closes #2700

See merge request GNOME/glib!2838
2022-07-25 16:35:23 +00:00
Aleksei Rybalkin
a2b5b9e906 gregex: add original test case for issue #2700 2022-07-25 16:57:06 +02:00
Aleksei Rybalkin
6535c77b00 gregex: do not set match and recursion limits on match context
These are not really necessary, and cause breakages (e.g. #2700).
pcre2_set_recursion_limit is also deprecated.

Fixes: #2700
2022-07-25 16:48:03 +02:00
Nart Tlisha
68a6628ffa Add Abkhazian translation 2022-07-25 13:55:56 +00:00
Aleksandr Melman
2292a23f62 Update Russian translation 2022-07-25 13:22:20 +00:00
Philip Withnall
f2aeba9a08 Merge branch 'wip/smcv/gio-launch-desktop-sd-journal' into 'main'
gio-launch-desktop: Only replace fds that point to the Journal

See merge request GNOME/glib!2836
2022-07-25 10:15:20 +00:00
Simon McVittie
94e05f7f28 gio-launch-desktop: Only replace fds that point to the Journal
If stdout is the Journal but stderr is not, then we probably only want
to redirect stdout, or vice versa.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-25 10:21:35 +01:00
Philip Withnall
30c840a755 Merge branch 'wip/smcv/gio-launch-desktop-sd-journal' into 'main'
Bring back gio-launch-desktop, use it to redirect stdout/stderr to the Journal

Closes #2682

See merge request GNOME/glib!2819
2022-07-24 23:31:27 +00:00
Philip Withnall
9c1b2399ec Merge branch 'iss2542' into 'main'
gio-tool: Flatten the outputed string

Closes #2542

See merge request GNOME/glib!2834
2022-07-24 23:13:06 +00:00
Simon McVittie
f736414825 gio-launch-desktop: Don't alter stdout/stderr if not already the Journal
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-25 01:00:54 +02:00
Simon McVittie
6c3e52bb1d gmessages: Factor out _g_fd_is_journal into its own translation unit
I want to use this in gio-launch-desktop, but gio-launch-desktop
doesn't depend on GLib, so I can't just call g_log_writer_is_journald().

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-25 01:00:54 +02:00
Simon McVittie
763643ceaa gio-launch-desktop: Redirect stdout, stderr to systemd Journal
This prevents a launched process's output from being mixed up with the
output of the parent process, which can lead to the wrong program being
blamed for warning messages.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-25 01:00:54 +02:00
Simon McVittie
ae15c800ce Install gio-launch-desktop in a non-PATH location
This is an internal helper executable, which users shouldn't invoke
directly (see glib#1633).

When building for a single-architecture distribution, we can install
it as ${libexecdir}/gio-launch-desktop.

When building for a multiarch distribution, installing it into an
architecture-specific location and packaging it alongside the GLib
library avoids the problem discussed in glib#1633 where it would either
cause a circular dependency between the GLib library and a common
cross-architecture package (libglib2.0-bin in Debian), or require a
separate package just to contain gio-launch-desktop, or cause different
architectures' copies to overwrite each other.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-25 01:00:53 +02:00
Simon McVittie
8157668eac gdesktopappinfo: Don't trust $GIO_LAUNCH_DESKTOP if setuid
gio-launch-desktop was removed before checking GIO for potentially
unsafe environment variable references, so reverting its removal brought
this one back. If a setuid program is using GAppInfo then something is
probably already horribly wrong, but let's be careful anyway.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-25 01:00:53 +02:00
Simon McVittie
e4e21f20e2 gio-launch-desktop: Fix a compiler warning
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-25 01:00:53 +02:00
Simon McVittie
6620d28333 gio-launch-desktop: Add SPDX-License-Identifier
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-25 01:00:53 +02:00
Simon McVittie
6751392934 tests: Avoid using deprecated meson.build_root
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-25 01:00:53 +02:00
Simon McVittie
d0967c1d4a Revert "gdesktopappinfo: Use sh rather than gio-launch-desktop"
A shell one-liner was enough to set GIO_LAUNCHED_DESKTOP_FILE_PID,
but ideally we also want to do the equivalent of sd_journal_stream_fd()
to set up its standard output and standard error streams.

Ideally we would call sd_journal_stream_fd() in a process that will
exec the real program, otherwise it will report the wrong process ID
in the Journal, but we can't easily do that in a forked child when
using posix_spawn() for subprocesses.

This reverts commit 2b533ca99a.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-25 01:00:53 +02:00
Philip Withnall
206be0a8a1 Merge branch 'wip/smcv/multiarch-triggers' into 'main'
gio: Optionally install trigger executables to architecture-specific paths

See merge request GNOME/glib!2818
2022-07-24 22:57:34 +00:00
Philip Withnall
196e3605aa Merge branch 'wip/smcv/gdbus-cross-namespace' into 'main'
GDBus: Use namespace-friendly protocol for Linux message buses, and optionally other connections

See merge request GNOME/glib!2832
2022-07-24 22:55:08 +00:00
codeboybebop
a374b7c806 gio-tool: Flatten the outputed string
Replacing new line in outputed atributes with " ↵ "

closes: #2542
2022-07-24 15:59:43 -05:00
Philip Withnall
101be84d2f Merge branch 'wip/smcv/installed-tests' into 'main'
Fix installed-tests failures

See merge request GNOME/glib!2833
2022-07-24 18:44:11 +00:00
Simon McVittie
72868c026d gobject/tests/performance: Only run a quick version as installed-tests
ginsttest-runner defaults to timing out each test after 5 minutes,
but gobject/tests/performance/performance.c defaults to running each
of 18 tests for 15 seconds. The result is close enough to 5 minutes
that the setup overhead is enough to make it time out.

We're only running these tests to prove that they still work, not to
get meaningful performance numbers, so cut them down to 1 second per
test-case (the result of which is that performance.c takes about a
minute).

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-24 17:34:55 +01:00
Simon McVittie
0714bcb7f4 gobject/tests/performance: Use the other installed-tests template
These are not GTest tests, and don't output TAP.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-24 17:15:47 +01:00
Simon McVittie
a4135b9652 assert-msg-test.py: Look for assert-msg-test relative to this script
When run as an installed-test, assert-msg-test generally won't be in
the PATH, but it will be in the same directory as the installed copy
of this script, so we can find it that way.

This fixes an installed-tests failure in Debian's autopkgtest
environment.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-24 16:33:12 +01:00
Simon McVittie
32b226d1b1 gdbus: Allow cross-namespace connections to Linux session and system buses
The dominant implementations of the well-known session and system
message buses are the reference implementation from the dbus project
(dbus-daemon) and the sd-bus-based reimplementation dbus-broker, both
of which have correct implementations for EXTERNAL authentication with
an unspecified authorization identity.

This makes it reasonably safe to assume that the well-known message
buses can cope with the unspecified authorization identity, even if we
cannot make the same assumption for custom servers such as the ones
used in ibus and gvfs (which might have been started with an older
GLib version before upgrading GLib in-place).

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-24 14:07:02 +01:00