ioi / isolate

Sandbox for securely executing untrusted programs
Other
1.05k stars 157 forks source link

isolate doesn't use passed home dir if ran from su #102

Closed shadowninja55 closed 3 years ago

shadowninja55 commented 3 years ago

steps: su isolate --init isolate --dir=/home/foo/bar --env=HOME=/box --run /bin/ls ~/bar

result: /bin/ls: cannot access '/root/bar': No such file or directory

it also seems that even if i hardcode in /box/bar to the ls part the directory is still not there. so perhaps it's neither mouting nor setting HOME.

gollux commented 3 years ago

The ~/bar is expanded by the shell from which you run isolate.

/box/bar should not contain the home directory, it should be visiable as /home/foo/bar inside the sandbox.

shadowninja55 commented 3 years ago

ah, that was the issue, thanks a lot!