From bc75270909628ebb4bffae7a78cc078071da58d7 Mon Sep 17 00:00:00 2001 From: Ben Dean Date: Wed, 10 Apr 2024 15:12:22 -0400 Subject: [PATCH] check that i.executionSysProcAttr.Credential != nil before using it to change permissions on temp file --- instance.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instance.go b/instance.go index f9b4eb4..18eab97 100644 --- a/instance.go +++ b/instance.go @@ -720,7 +720,7 @@ func (i *Instance) genExecutorTmpFile(codeReader io.Reader) (path string, error } // Need to set the permissions here or the file will be owned by root and the execution will fail - if i.executionSysProcAttr != nil { + if i.executionSysProcAttr != nil && i.executionSysProcAttr.Credential != nil { if err := os.Chown( tmpFile.Name(), int(i.executionSysProcAttr.Credential.Uid),