Guilherme, agreed just looking into a specific directory explicitly is nicer than saving environ, changing environ, restoring environ; good idea. However I think we should try current PATH first (i.e. not prepend the dir) as this allows overriding commands.
James, I think we can assume sudo will reset the PATH and will include sbin in it; if we want to support other things than sbin, we indeed need to make sure than we pass the directory across sudo too, but sudo chroot/explicit-dir/binary should work.
Guilherme, agreed just looking into a specific directory explicitly is nicer than saving environ, changing environ, restoring environ; good idea. However I think we should try current PATH first (i.e. not prepend the dir) as this allows overriding commands.
James, I think we can assume sudo will reset the PATH and will include sbin in it; if we want to support other things than sbin, we indeed need to make sure than we pass the directory across sudo too, but sudo chroot/ explicit- dir/binary should work.