| 1 |
From: Alessandro Astone <[email protected]> |
| 2 |
Date: Mon, 9 Feb 2026 20:54:58 +0100 |
| 3 |
Subject: validate-{icon,sound}: Print debug logs to stderr only |
| 4 |
|
| 5 |
stdout is used for communicating results to the parent process, so it cannot |
| 6 |
be used to also print debug logs. If G_MESSAGES_DEBUG=all were to be inherited |
| 7 |
from the parent environment, we could be writing random strings to stdout and |
| 8 |
breaking the parsing on the parent side. |
| 9 |
|
| 10 |
Forwarded: https://github.com/flatpak/xdg-desktop-portal/pull/1901 |
| 11 |
Applied-upstream: 1.21.0, commit:68755dffa8e5123aad0a47089ded3aa19e1a891e |
| 12 |
Bug-Debian: https://bugs.debian.org/1129171 |
| 13 |
--- |
| 14 |
src/validate-icon.c | 2 ++ |
| 15 |
src/validate-sound.c | 2 ++ |
| 16 |
2 files changed, 4 insertions(+) |
| 17 |
|
| 18 |
diff --git a/src/validate-icon.c b/src/validate-icon.c |
| 19 |
index 4440543..3ac7a1a 100644 |
| 20 |
--- a/src/validate-icon.c |
| 21 |
+++ b/src/validate-icon.c |
| 22 |
@@ -342,6 +342,8 @@ main (int argc, char *argv[]) |
| 23 |
g_autoptr(GError) error = NULL; |
| 24 |
g_autofd int fd_path = -1; |
| 25 |
|
| 26 |
+ g_log_writer_default_set_use_stderr (TRUE); |
| 27 |
+ |
| 28 |
context = g_option_context_new (NULL); |
| 29 |
g_option_context_add_main_entries (context, entries, NULL); |
| 30 |
if (!g_option_context_parse (context, &argc, &argv, &error)) |
| 31 |
diff --git a/src/validate-sound.c b/src/validate-sound.c |
| 32 |
index db2b2e3..e922e28 100644 |
| 33 |
--- a/src/validate-sound.c |
| 34 |
+++ b/src/validate-sound.c |
| 35 |
@@ -328,6 +328,8 @@ main (int argc, char *argv[]) |
| 36 |
g_autoptr(GOptionContext) context = NULL; |
| 37 |
g_autoptr(GError) error = NULL; |
| 38 |
|
| 39 |
+ g_log_writer_default_set_use_stderr (TRUE); |
| 40 |
+ |
| 41 |
context = g_option_context_new (NULL); |
| 42 |
g_option_context_add_main_entries (context, entries, NULL); |
| 43 |
if (!g_option_context_parse (context, &argc, &argv, &error)) |