From edd847798a063c1532a6ccd3e12f515ba81e61f2 Mon Sep 17 00:00:00 2001 From: Oskar Skog Date: Wed, 7 Jun 2023 13:07:14 +0300 Subject: [PATCH] man: Use /bin/Shell as shell in non-POSIX mode This fixes an issue where man breaks if you symlink `sh` to a different shell because: 1: The target of the symlink isn't `unveil`ed. 2: The option `--skip--shellrc` isn't understood by other shells while at the same time being required for Shell when invoked in POSIX compatibility mode. This also restores the shell used by man to the non-POSIX mode as before beaae6b420cbe85a2d382f8f75447fb49514c20f. --- Userland/Utilities/man.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Utilities/man.cpp b/Userland/Utilities/man.cpp index cc026c21b6..cdd654bbcd 100644 --- a/Userland/Utilities/man.cpp +++ b/Userland/Utilities/man.cpp @@ -23,7 +23,7 @@ static ErrorOr pipe_to_pager(DeprecatedString const& command) { - char const* argv[] = { "sh", "--skip-shellrc", "-c", command.characters(), nullptr }; + char const* argv[] = { "Shell", "-c", command.characters(), nullptr }; auto stdout_pipe = TRY(Core::System::pipe2(O_CLOEXEC)); @@ -31,7 +31,7 @@ static ErrorOr pipe_to_pager(DeprecatedString const& command) posix_spawn_file_actions_init(&action); posix_spawn_file_actions_adddup2(&action, stdout_pipe[0], STDIN_FILENO); - pid_t pid = TRY(Core::System::posix_spawnp("sh"sv, &action, nullptr, const_cast(argv), environ)); + pid_t pid = TRY(Core::System::posix_spawnp("/bin/Shell"sv, &action, nullptr, const_cast(argv), environ)); posix_spawn_file_actions_destroy(&action); TRY(Core::System::dup2(stdout_pipe[1], STDOUT_FILENO));