proot-me / proot-rs

Rust implementation of PRoot, a ptrace-based sandbox
GNU General Public License v3.0
129 stars 21 forks source link

Shebang parsing doesn't work for binary files #8

Closed jyn514 closed 3 years ago

jyn514 commented 5 years ago

String only works on valid UTF-8 :(

panicbit commented 4 years ago

I'd like to look into this.

panicbit commented 4 years ago

If this project isn't completely abandoned...

jyn514 commented 4 years ago

@panicbit right - I have an open PR at https://github.com/proot-me/proot-rs/pull/9 but it hasn't been reviewed in a year.

oxr463 commented 4 years ago

@panicbit @jyn514 I would gladly assign either of you maintainer access for this rust implementation. I am currently the only "active" maintainer and to be honest, I barely have bandwidth for the main implementation.

oxr463 commented 3 years ago

@KB5201314 has this been resolved with https://github.com/proot-me/proot-rs/pull/14?

imlk0 commented 3 years ago

@KB5201314 has this been resolved with #14?

No, there still seems to be a problem with this part, because the args are not handled properly.

https://github.com/proot-me/proot-rs/blob/c34c9820afac3ae11eb8372db41102402a54652a/src/kernel/execve/shebang.rs#L168-L170

The current code will process #!/bin/sh -x into /bin/sh/-x

Maybe we have to replace the return value of this function from Result<Option<PathBuf>> with something else. Maybe Result<Option<(PathBuf, Bstring)>>?

imlk0 commented 3 years ago

Fixed in https://github.com/proot-me/proot-rs/pull/47