2022-12-07 22:02:25 +00:00
|
|
|
//go:build windows
|
|
|
|
|
|
|
|
package getter
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"path/filepath"
|
|
|
|
"syscall"
|
|
|
|
)
|
|
|
|
|
|
|
|
// attributes returns the system process attributes to run
|
|
|
|
// the sandbox process with
|
|
|
|
func attributes() *syscall.SysProcAttr {
|
|
|
|
return &syscall.SysProcAttr{}
|
|
|
|
}
|
|
|
|
|
|
|
|
func credentials() (uint32, uint32) {
|
|
|
|
return 0, 0
|
|
|
|
}
|
|
|
|
|
|
|
|
// lockdown has no effect on windows
|
2023-01-09 15:46:32 +00:00
|
|
|
func lockdown(string, string) error {
|
2022-12-07 22:02:25 +00:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2022-12-09 21:46:07 +00:00
|
|
|
// defaultEnvironment is the default minimal environment variables for Windows.
|
|
|
|
func defaultEnvironment(taskDir string) map[string]string {
|
2022-12-07 22:02:25 +00:00
|
|
|
tmpDir := filepath.Join(taskDir, "tmp")
|
2022-12-09 21:46:07 +00:00
|
|
|
return map[string]string{
|
|
|
|
"HOMEPATH": os.Getenv("HOMEPATH"),
|
|
|
|
"HOMEDRIVE": os.Getenv("HOMEDRIVE"),
|
|
|
|
"USERPROFILE": os.Getenv("USERPROFILE"),
|
|
|
|
"PATH": os.Getenv("PATH"),
|
|
|
|
"TMP": tmpDir,
|
|
|
|
"TEMP": tmpDir,
|
2022-12-07 22:02:25 +00:00
|
|
|
}
|
|
|
|
}
|