Skip to content
Snippets Groups Projects
Commit c223f4d5 authored by Simon McVittie's avatar Simon McVittie
Browse files

launch: Show more explanatory message if Flatpak is using setuid bwrap

Equivalent to <https://github.com/flatpak/flatpak-xdg-utils/pull/54

>
in flatpak-spawn.

Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent 80b53bf8
No related branches found
No related tags found
1 merge request!345launch: Show more explanatory message if Flatpak is using setuid bwrap
Pipeline #16408 passed
......@@ -472,6 +472,17 @@ get_portal_supports (void)
return supports;
}
#define NOT_SETUID_ROOT_MESSAGE \
"This feature requires Flatpak to be using a bubblewrap (bwrap) executable\n" \
"that is not setuid root.\n" \
"\n" \
"The non-setuid version of bubblewrap requires a kernel that allows\n" \
"unprivileged users to create new user namespaces.\n" \
"\n" \
"For more details please see:\n" \
"https://github.com/flatpak/flatpak/wiki/User-namespace-requirements\n" \
"\n"
static void
check_portal_supports (const char *option, guint32 supports_needed)
{
......@@ -480,6 +491,10 @@ check_portal_supports (const char *option, guint32 supports_needed)
if ((supports & supports_needed) != supports_needed)
{
g_printerr ("--%s not supported by host portal\n", option);
if (supports_needed == FLATPAK_SPAWN_SUPPORT_FLAGS_EXPOSE_PIDS)
g_printerr ("\n%s", NOT_SETUID_ROOT_MESSAGE);
exit (1);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment