github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/client/allocrunner/taskrunner/getter/util_windows.go (about)

     1  //go:build windows
     2  
     3  package getter
     4  
     5  import (
     6  	"os"
     7  	"path/filepath"
     8  	"syscall"
     9  )
    10  
    11  // attributes returns the system process attributes to run
    12  // the sandbox process with
    13  func attributes() *syscall.SysProcAttr {
    14  	return &syscall.SysProcAttr{}
    15  }
    16  
    17  func credentials() (uint32, uint32) {
    18  	return 0, 0
    19  }
    20  
    21  // lockdown has no effect on windows
    22  func lockdown(string) error {
    23  	return nil
    24  }
    25  
    26  // defaultEnvironment is the default minimal environment variables for Windows.
    27  func defaultEnvironment(taskDir string) map[string]string {
    28  	tmpDir := filepath.Join(taskDir, "tmp")
    29  	return map[string]string{
    30  		"HOMEPATH":    os.Getenv("HOMEPATH"),
    31  		"HOMEDRIVE":   os.Getenv("HOMEDRIVE"),
    32  		"USERPROFILE": os.Getenv("USERPROFILE"),
    33  		"PATH":        os.Getenv("PATH"),
    34  		"TMP":         tmpDir,
    35  		"TEMP":        tmpDir,
    36  	}
    37  }