Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility to spawn_ptrace #11

Closed
Beiri22 opened this issue Nov 12, 2020 · 4 comments · Fixed by #21
Closed

Compatibility to spawn_ptrace #11

Beiri22 opened this issue Nov 12, 2020 · 4 comments · Fixed by #21

Comments

@Beiri22
Copy link

Beiri22 commented Nov 12, 2020

Hi there,

your Command structure is not as powerful as the one shipped with rust when is comes to stdou-stdin-piping. But with the crate spawn_ptrace you can activate ptrace for the default rust command structure. I needed some hack to allow pete to work with the resulting process, because pete has no option to add an already attached pid. Maybe you have a look!

@ranweiler
Copy link
Owner

Thanks for the suggestion. I recently realized we can likely just get rid of pete::Command by using the CommandExt trait in std. I'm assuming that would be enough for your use case?

FWIW, I do hope to add ATTACH and SEIZE support, it is just lower priority for now.

@Beiri22
Copy link
Author

Beiri22 commented Nov 13, 2020

Sounds great.

ranweiler added a commit that referenced this issue Nov 15, 2020
Accept a `std::process::Command` in `Ptracer::spawn()`, and return a `Child` instead of a `Tracee`. This makes the ctor do much less work, and in particular, prevents hanging on `wait()`. Move the existing `set_options()` call into our interpretation of `SIGTRAP` stops. This uses the new `Spawning` state to help interpret the legacy `SIGTRAP` issued for the `execve(2)` from the self-attached tracee.

Closes #11.
@ranweiler
Copy link
Owner

@Beiri22, the work in #21 should now address your use case. Thanks for motivating me to follow up on that idea. If there's something still blocking you, please do open another issue.

I'm going to do a little internal cleanup (replacing panics with Result values), then will publish the recent changes as 0.4.0.

@ranweiler
Copy link
Owner

Published in 0.4.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants