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

Modify Laucher and Executable names #75

Open
w0nd3r365 opened this issue Jun 15, 2023 · 2 comments
Open

Modify Laucher and Executable names #75

w0nd3r365 opened this issue Jun 15, 2023 · 2 comments

Comments

@w0nd3r365
Copy link

w0nd3r365 commented Jun 15, 2023

  • OS = Kali Linux rolling 2023.2
  • Python 3.11.2
  • exodus-bundler 2.0.4 (From pipx, no --version option in exodus)
  • Binary = /usr/bin/kmod
  • readelf -a /usr/bin/kmod output = readelf-kmod.txt

I created an exodus bundle for kmod program using the following command:

exodus --shell-launchers -o kmod-bundle.tgz -t -v -a /usr/lib/libkmod.la -a /usr/lib/libkmod.so -a /usr/lib/libkmod.so.2 -a /usr/lib/libkmod.so.2.4.0 /usr/bin/depmod /usr/bin/insmod /usr/bin/kmod /usr/bin/lsmod /usr/bin/modinfo /usr/bin/modprobe /usr/bin/rmmod

kmod and its symlinks failed to run, terminating with 254 status code. kmod verifies its argv[0] using program_invocation_short_name() to determine what it will run as, kind of like busybox. To fix this, I renamed launcher scripts in exodus/bundles/3d77fd2.../<launcher> to add a .sh suffix. Then I renamed exodus/bundles/3d77fd2.../<progname>-x to remove -x suffix, hence regaining their original names. I edited the launcher scripts to remove the -x suffix accordingly. This is why I used --shell-launchers instead of binary ones. I then re-symlinked launcher scripts from exodus/bundles/3d77fd2.../<launcher>.sh to exodus/bin/<progname> so they would point to they newly renamed launchers. kmod worked just fine after that.

My suggestion is that launcher files in exodus/bundles/<hash>/<launcher> have a .sh suffix if shell-based or .bin suffix if binary. This way the ported programs in exodus/bundles/<hash>/<progname> will have their original names, incase they use it to determine what to run as. The symlinks to launchers in exodus/bin/<progname> will also have the same original names as the programs ported, so user experience will not be impacted. Also, a --version option would be great in exodus.

@setop
Copy link

setop commented Jun 15, 2023

same symptoms as for #74

and probably a good proposal for a solution

@sanbee
Copy link

sanbee commented Jul 1, 2023

Same issue as in #73 and the proposal seems like a solution.

sanbee pushed a commit to sanbee/exodus_sbfork that referenced this issue Jul 3, 2023
Seems to fix the problem reported in intoli#73.
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

No branches or pull requests

3 participants