From 68ffa487eefb4b6318b9b400d486bd6ce054d098 Mon Sep 17 00:00:00 2001 From: Rudi Heitbaum Date: Sat, 9 May 2026 06:37:44 +0000 Subject: [PATCH] dir: fix build when HAVE_LIBSYSTEMD but not USE_SYSTEM_HELPER polkit_subject_to_string() is called inside the HAVE_LIBSYSTEMD guard in flatpak_dir_log(), but is only included when USE_SYSTEM_HELPER is defined. This causes a build failure on configurations that have libsystemd but no system helper. Guard the polkit call with USE_SYSTEM_HELPER and fall back to "(none)" so the subject string is always valid for the sd_journal_send() call. Fixes: f9d5c5c ("dir: Free result of polkit_subject_to_string") Signed-off-by: Rudi Heitbaum --- common/flatpak-dir.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/flatpak-dir.c b/common/flatpak-dir.c index d953fd18..6ba4e738 100644 --- a/common/flatpak-dir.c +++ b/common/flatpak-dir.c @@ -17463,7 +17463,11 @@ static void va_list args; installation = source ? source : flatpak_dir_get_name_cached (self); +#ifdef USE_SYSTEM_HELPER subject = self->subject ? polkit_subject_to_string (self->subject) : g_strdup ("(none)"); +#else + subject = g_strdup ("(none)"); +#endif len = g_snprintf (message, sizeof (message), "%s: ", installation);