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

wrap: Bundle command-line options for bwrap into a memfd


This avoids overrunning command-line length limits if we have a lot of
arguments.

Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent 8bfa23d7
No related branches found
No related tags found
No related merge requests found
......@@ -2040,15 +2040,30 @@ main (int argc,
}
}
if (opt_verbose)
{
g_message ("%s options before bundling:", bwrap_executable);
for (i = 0; i < bwrap->argv->len; i++)
{
g_autofree gchar *quoted = NULL;
quoted = g_shell_quote (g_ptr_array_index (bwrap->argv, i));
g_message ("\t%s", quoted);
}
}
if (!flatpak_bwrap_bundle_args (bwrap, 1, -1, FALSE, error))
goto out;
g_debug ("Adding wrapped command...");
flatpak_bwrap_append_args (bwrap, wrapped_command->argv);
flatpak_bwrap_finish (bwrap);
if (opt_verbose)
{
g_message ("%s options:", bwrap_executable);
g_message ("Final %s options:", bwrap_executable);
for (i = 0; i < bwrap->argv->len - 1; i++)
for (i = 0; i < bwrap->argv->len; i++)
{
g_autofree gchar *quoted = NULL;
......@@ -2067,6 +2082,8 @@ main (int argc,
}
}
flatpak_bwrap_finish (bwrap);
/* flatpak_bwrap_finish did this */
g_assert (g_ptr_array_index (bwrap->argv, bwrap->argv->len - 1) == NULL);
......
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