Revert "fix(core): prevent SIGHUP kills in PTY environments" (#27401)

This commit is contained in:
Billy Biggs
2026-05-23 16:52:45 -04:00
committed by GitHub
parent a00d03efc6
commit 3cc7e5b096
5 changed files with 11 additions and 145 deletions
@@ -56,11 +56,7 @@ export async function getCommandName(req: SandboxRequest): Promise<string> {
const roots = getCommandRoots(stripped).filter(
(r) => r !== 'shopt' && r !== 'set',
);
// Single-root enforcement: only grant named-command permissions when the
// command is unambiguous. Multi-root chains fall back to basename so that
// a chained command like `git; malicious_cmd` never inherits `git`'s
// sandbox policy for the entire chain.
if (roots.length === 1) {
if (roots.length > 0) {
return roots[0];
}
return path.basename(req.command);