mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 11:07:45 +00:00
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
beaae6b420
.
This commit is contained in:
parent
b863332415
commit
edd847798a
1 changed files with 2 additions and 2 deletions
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
static ErrorOr<pid_t> pipe_to_pager(DeprecatedString const& command)
|
static ErrorOr<pid_t> 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));
|
auto stdout_pipe = TRY(Core::System::pipe2(O_CLOEXEC));
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ static ErrorOr<pid_t> pipe_to_pager(DeprecatedString const& command)
|
||||||
posix_spawn_file_actions_init(&action);
|
posix_spawn_file_actions_init(&action);
|
||||||
posix_spawn_file_actions_adddup2(&action, stdout_pipe[0], STDIN_FILENO);
|
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<char**>(argv), environ));
|
pid_t pid = TRY(Core::System::posix_spawnp("/bin/Shell"sv, &action, nullptr, const_cast<char**>(argv), environ));
|
||||||
posix_spawn_file_actions_destroy(&action);
|
posix_spawn_file_actions_destroy(&action);
|
||||||
|
|
||||||
TRY(Core::System::dup2(stdout_pipe[1], STDOUT_FILENO));
|
TRY(Core::System::dup2(stdout_pipe[1], STDOUT_FILENO));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue