// Set up the attributes for the process
Set up the attributes for the process
// Set up the attributes for the process
func Attributes(account *accounts.Account, command *Command) *syscall.ProcAttr {
	cwd := ""              
	env_vars := []string{} 
	filepath := command.Filepath
	output := OutputFile(filepath)
	if output == nil {
		output = os.Stderr
	}
	files := []uintptr{os.Stdin.Fd(), output.Fd(), output.Fd()} 
	sys := &syscall.SysProcAttr{}
	if account.Uid != uint32(os.Getuid()) || account.Gid != uint32(os.Getgid()) {
		sys.Credential = &syscall.Credential{Uid: account.Uid, Gid: account.Gid}
	}
	proc_attr := &syscall.ProcAttr{
		Dir:   cwd,
		Env:   env_vars,
		Files: files,
		Sys:   sys,
	}
	return proc_attr
}
func Attributes ( account * accounts . Account , command * Command ) * syscall . ProcAttr { cwd := " " env_vars := [ ] string { } filepath := command . Filepath output := OutputFile ( filepath ) if output == nil { output = os . Stderr } files := [ ] uintptr { os . Stdin . Fd ( ) , output . Fd ( ) , output . Fd ( ) } sys := & syscall . SysProcAttr { } if account . Uid != uint32 ( os . Getuid ( ) ) || account . Gid != uint32 ( os . Getgid ( ) ) { sys . Credential = & syscall . Credential { Uid : account . Uid , Gid : account . Gid } } proc_attr := & syscall . ProcAttr { Dir : cwd , Env : env_vars , Files : files , Sys : sys , } return proc_attr }
Set up the attributes for the process
Set up the attributes for the process
//cwd := account.Directory // Set at registration // Set at registration // Pass through stuff for config reasons? //jobid := command.JobId // If we can't open the output file, log the contents to the server // TODO: Not the server's stdin, but nil ... // Stop in, combine out+err