Fix PATH in non-privileged mode

This commit is contained in:
Radon Rosborough 2020-10-17 08:39:35 -07:00
parent 5c7d91dfb5
commit 1d6254c0a2
1 changed files with 2 additions and 1 deletions

View File

@ -5,6 +5,7 @@ import * as process from "process";
import * as appRoot from "app-root-path";
import { quote } from "shell-quote";
import { PRIVILEGED } from "./config";
import { MIN_UID, MAX_UID } from "./users";
export interface Options extends SpawnOptions {
@ -51,7 +52,7 @@ function getEnv({ uid, uuid }: Context) {
LANG: process.env.LANG || "",
LC_ALL: process.env.LC_ALL || "",
LOGNAME: username,
PATH: path.join(":"),
PATH: PRIVILEGED ? path.join(":") : process.env.PATH || "",
PWD: cwd,
SHELL: "/usr/bin/bash",
TERM: "xterm-256color",