Skip to content

Commit

Permalink
enter: No need to fail if a pid is specified that it is not the prima…
Browse files Browse the repository at this point in the history
…ry pid.

We can enter from any pid in the sandbox.
  • Loading branch information
alexlarsson committed Nov 20, 2019
1 parent f568a06 commit a0cb7f6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions app/flatpak-builtins-enter.c
Expand Up @@ -109,15 +109,17 @@ flatpak_builtin_enter (int argc,
return FALSE;
}

pid = 0;
pid_s = argv[rest_argv_start];
i = atoi (pid_s);
pid = atoi (pid_s);

/* Check to see if it matches some running instance, otherwise use
as pid if it looks as a number. */
instances = flatpak_instance_get_all ();
for (j = 0; j < instances->len; j++)
{
FlatpakInstance *instance = (FlatpakInstance *) g_ptr_array_index (instances, j);

if (i == flatpak_instance_get_pid (instance) ||
if (pid == flatpak_instance_get_pid (instance) ||
strcmp (pid_s, flatpak_instance_get_app (instance)) == 0 ||
strcmp (pid_s, flatpak_instance_get_id (instance)) == 0)
{
Expand Down

0 comments on commit a0cb7f6

Please sign in to comment.