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

Call interpreters with a login shell env to fix "command not found" on macOS #9

Closed
wants to merge 2 commits into from

Conversation

YSaxon
Copy link

@YSaxon YSaxon commented Jun 28, 2024

This is to fix #8, where the extension does not work on macOS. That issue is caused by the Popen call in execution.py having for whatever reason a very restricted PATH var. This pull request fixes it by executing env under a login shell once at init, and then passing that environment to all subsequent Popen calls to python, node, or java, so Popen can find them.

@YSaxon
Copy link
Author

YSaxon commented Jun 28, 2024

See my comment on the issue for more detail: #8 (comment)

@Anof-cyber
Copy link
Owner

The pull request has multiple error, the extension will not load in the Burp Suite.

  1. The errorlogcheckbox import is removed

login_env = get_login_shell_env() File "PyCript-PATCH\pycript\execution.py", line 27, in get_login_shell_env logerrors(str(e)) File "PyCript-PATCH\pycript\gui.py", line 28, in logerrors if errorlogcheckbox.isSelected(): NameError: global name 'errorlogcheckbox' is not defined

  1. The error which you are trying to fix is not a PyCript error. The documentation clearly mentions that one requirement is that the binary of the language should be accessible from anywhere in the system.

The extension is tested on both M1 and M2, Ubuntu and Windows, It works without any error as long as the requirements are fulfilled.

If you are getting a command not found for Node Python etc. you have to make sure it is available in the env of the system not part of PyCript to check the env.

This is one of the example

You can check documentation for requirements

@Anof-cyber
Copy link
Owner

The extension has been tested with multiple scenarios especially to test again high memory usage or slow working of the extension.

Adding a check for env which is not necessary and can be handled by OS user env directly. Adding this would cause a 1.2-second delay in the process which is significant considering the the working of the extension

@Anof-cyber Anof-cyber closed this Jul 1, 2024
@YSaxon
Copy link
Author

YSaxon commented Jul 1, 2024

I did in fact have a couple of problems with my code, but not quite the ones you said. I realize that you have no intention of recognizing this as a problem since it works in your environment somehow, but I'm leaving an improved version in https://github.com/YSaxon/PyCript/tree/PATCH for anyone else who comes across this problem.

@Anof-cyber
Copy link
Owner

Its not because it works on my system. It works on multiple systems with properly configured as per the requirement.
I have checked with multiple people using pycript on m1 m2 and it works fine if env configuration is correct.

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 this pull request may close these issues.

Error Running PyCript on Macbook Air M1 | command not found
2 participants