add default and sane path to container exec

This commit is contained in:
Gregory Kurtzer
2021-09-01 19:26:38 -07:00
parent fc7182d7bd
commit 198791fb10

View File

@@ -62,6 +62,7 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
ps1string := fmt.Sprintf("[%s] Warewulf> ", containerName)
os.Setenv("PS1", ps1string)
os.Setenv("PATH", "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin")
os.Setenv("HISTFILE", "/dev/null")
err := syscall.Exec(args[1], args[1:], os.Environ())