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

Properly execute tools (like chrpath) witth execveinstead of system #41

Open
cipriancraciun opened this issue Dec 4, 2021 · 1 comment
Labels

Comments

@cipriancraciun
Copy link

At the moment, when invoking chrpath or strip, the tool seems to be using popen, which underneath just calls system with a command as a string.

chrpath_cmd << chrpath_path << " -c -r \"" << rpath << "\" " << deploy_path;

Unfortunately that command is not properly escapend, since if a library happens to include a quote, it basically allows "shell injection".

Moreover the deploy_path doesn't seem to be quoted at all.

(Granted, it is very unlikely that a library contains "strange" characters, like say libunsafe"; rm -Rf .;.so, however a tool should be safe regardless.)

@haampie
Copy link
Owner

haampie commented Dec 4, 2021

Yeah, this is how it's supposed to go. If someone doesn't already pick this up, I'll try to get to it soon.

@haampie haampie added the 2.x label Dec 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants