fix darwin
This commit is contained in:
		
							
								
								
									
										16
									
								
								agent/agent_darwin.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								agent/agent_darwin.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,16 @@
 | 
			
		||||
/*
 | 
			
		||||
Copyright 2022 AmidaWare LLC.
 | 
			
		||||
 | 
			
		||||
Licensed under the Tactical RMM License Version 1.0 (the “License”).
 | 
			
		||||
You may only use the Licensed Software in accordance with the License.
 | 
			
		||||
A copy of the License is available at:
 | 
			
		||||
 | 
			
		||||
https://license.tacticalrmm.com
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
package agent
 | 
			
		||||
 | 
			
		||||
func tmpNoExec() bool {
 | 
			
		||||
	return false
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										30
									
								
								agent/agent_linux.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								agent/agent_linux.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,30 @@
 | 
			
		||||
/*
 | 
			
		||||
Copyright 2022 AmidaWare LLC.
 | 
			
		||||
 | 
			
		||||
Licensed under the Tactical RMM License Version 1.0 (the “License”).
 | 
			
		||||
You may only use the Licensed Software in accordance with the License.
 | 
			
		||||
A copy of the License is available at:
 | 
			
		||||
 | 
			
		||||
https://license.tacticalrmm.com
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
package agent
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"os"
 | 
			
		||||
	"syscall"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
func tmpNoExec() bool {
 | 
			
		||||
	var stat syscall.Statfs_t
 | 
			
		||||
	var noexec bool
 | 
			
		||||
 | 
			
		||||
	tmpdir := os.TempDir()
 | 
			
		||||
	if err := syscall.Statfs(tmpdir, &stat); err == nil {
 | 
			
		||||
		if stat.Flags&syscall.MS_NOEXEC != 0 {
 | 
			
		||||
			noexec = true
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return noexec
 | 
			
		||||
}
 | 
			
		||||
@@ -492,19 +492,6 @@ func (a *Agent) GetWMIInfo() map[string]interface{} {
 | 
			
		||||
	return wmiInfo
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func tmpNoExec() bool {
 | 
			
		||||
	var stat syscall.Statfs_t
 | 
			
		||||
	var noexec bool
 | 
			
		||||
 | 
			
		||||
	tmpdir := os.TempDir()
 | 
			
		||||
	if err := syscall.Statfs(tmpdir, &stat); err == nil {
 | 
			
		||||
		if stat.Flags&syscall.MS_NOEXEC != 0 {
 | 
			
		||||
			noexec = true
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return noexec
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func createNixTmpFile() (*os.File, error) {
 | 
			
		||||
	var f *os.File
 | 
			
		||||
	noexec := tmpNoExec()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user