diff --git a/client/allocrunner/taskrunner/getter/util_default.go b/client/allocrunner/taskrunner/getter/util_default.go index 2c738e62e..c32effcad 100644 --- a/client/allocrunner/taskrunner/getter/util_default.go +++ b/client/allocrunner/taskrunner/getter/util_default.go @@ -7,23 +7,19 @@ import ( "syscall" ) -// attributes returns the system process attributes to run -// the sandbox process with +// attributes is not implemented by default func attributes() *syscall.SysProcAttr { - uid, gid := credentials() - return &syscall.SysProcAttr{ - Credential: &syscall.Credential{ - Uid: uid, - Gid: gid, - }, - } + return nil } -// credentials returns the credentials of the user Nomad is running as +// credentials is not implemented by default func credentials() (uint32, uint32) { - uid := syscall.Getuid() - gid := syscall.Getgid() - return uint32(uid), uint32(gid) + return 0, 0 +} + +// lockdown is not implemented by default +func lockdown(string, string) error { + return nil } // defaultEnvironment is the default minimal environment variables for Unix-like @@ -35,8 +31,3 @@ func defaultEnvironment(taskDir string) map[string]string { "TMPDIR": tmpDir, } } - -// lockdown applies only to Linux -func lockdown(string, string) error { - return nil -} diff --git a/client/allocrunner/taskrunner/getter/util_windows.go b/client/allocrunner/taskrunner/getter/util_windows.go index 639b24b45..b78cc9117 100644 --- a/client/allocrunner/taskrunner/getter/util_windows.go +++ b/client/allocrunner/taskrunner/getter/util_windows.go @@ -8,17 +8,17 @@ import ( "syscall" ) -// attributes returns the system process attributes to run -// the sandbox process with +// attributes is not implemented on Windows func attributes() *syscall.SysProcAttr { - return &syscall.SysProcAttr{} + return nil } +// credentials is not implemented on Windows func credentials() (uint32, uint32) { return 0, 0 } -// lockdown has no effect on windows +// lockdown is not implemented on Windows func lockdown(string, string) error { return nil }