Skip to content
Snippets Groups Projects

Try to solve #4

Closed Kamil Trzcińśki requested to merge chroot-path into master
1 unresolved thread
1 file
+ 1
1
Compare changes
  • Side-by-side
  • Inline
+ 1
1
@@ -159,7 +159,7 @@ func daemonChroot(cmd *exec.Cmd) (path string, err error) {
// Update command to use chroot
cmd.SysProcAttr.Chroot = wd
cmd.Path = temporaryExecutable.Name()
cmd.Path = "/" + temporaryExecutable.Name()
    • @ayufan the documentation for os/exec states:

      If Path is relative, it is evaluated relative to Dir.

      https://golang.org/pkg/os/exec/#Cmd

      Since we're setting Dir to /, I don't see how this change will make any difference to the user.

      Most likely is that the executable isn't being written - it seems we swallow the error when this doesn't happen. I'll close this MR and fix that problem separately; it should get us closer to fixing #4 (closed)

Please register or sign in to reply
cmd.Dir = "/"
path = filepath.Join(wd, temporaryExecutable.Name())
return
Loading