rootless_linux.c: use shortcut for system commands

There doesn't seem any reason why the system commands should not join
the userns. In particular the main commands use ParentNSRequired and
UnshareNSRequired when they don't want to be joined to the main userns.
Since the system command don't set these the go code does the join and
re-exec anyway so might as well use the shortcut to speed that up.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger
2025-11-25 15:58:44 +01:00
parent aaadb4726d
commit b9a1f87b9e

View File

@@ -384,8 +384,7 @@ can_use_shortcut (char **argv)
|| strcmp (argv[argc], "version") == 0 || strcmp (argv[argc], "version") == 0
|| strcmp (argv[argc], "context") == 0 || strcmp (argv[argc], "context") == 0
|| strcmp (argv[argc], "search") == 0 || strcmp (argv[argc], "search") == 0
|| strcmp (argv[argc], "compose") == 0 || strcmp (argv[argc], "compose") == 0)
|| (strcmp (argv[argc], "system") == 0 && argv[argc+1] && strcmp (argv[argc+1], "service") != 0))
{ {
ret = false; ret = false;
break; break;