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

debug_bash_helper: Use eval as busybox systems have problems #2583

Merged
merged 1 commit into from Nov 15, 2019

Conversation

@JohnVillalovos
Copy link
Contributor

JohnVillalovos commented Nov 12, 2019

In _debug_bash_helper use eval as we are seeing issues with busybox
systems having issues with array access. Even though they aren't
actually running the code they appear to be parsing it and failing.

Resolves: #2579

@Neilpang

This comment has been minimized.

Copy link
Owner

Neilpang commented Nov 13, 2019

Have you tested that this is still working as expected?

Thanks.

@JohnVillalovos

This comment has been minimized.

Copy link
Contributor Author

JohnVillalovos commented Nov 13, 2019

Have you tested that this is still working as expected?

Yes it is still working as expected.

Here is a test in an Ubuntu 18.04 container with bash:

root@3d062642351c:~# acme.sh --issue --debug 1
[Wed Nov 13 16:50:18 UTC 2019] Lets find script dir.
[Wed Nov 13 16:50:18 UTC 2019] _SCRIPT_='/root/.acme.sh/acme.sh'
[Wed Nov 13 16:50:18 UTC 2019] _script='/root/.acme.sh/acme.sh'
[Wed Nov 13 16:50:18 UTC 2019] _script_home='/root/.acme.sh'
[Wed Nov 13 16:50:18 UTC 2019] Using config home:/root/.acme.sh
https://github.com/Neilpang/acme.sh
v2.8.4
[Wed Nov 13 16:50:18 UTC 2019] Running cmd: issue
Usage: acme.sh --issue  -d  a.com  -w /path/to/webroot/a.com/

root@3d062642351c:~# acme.sh --issue --debug 2
[Wed Nov 13 16:50:21 UTC 2019] Lets find script dir.
[Wed Nov 13 16:50:21 UTC 2019] _SCRIPT_='/root/.acme.sh/acme.sh'
[Wed Nov 13 16:50:21 UTC 2019] _script='/root/.acme.sh/acme.sh'
[Wed Nov 13 16:50:21 UTC 2019] _script_home='/root/.acme.sh'
[Wed Nov 13 16:50:21 UTC 2019] Using config home:/root/.acme.sh
[Wed Nov 13 16:50:21 UTC 2019] LE_WORKING_DIR='/root/.acme.sh'
https://github.com/Neilpang/acme.sh
v2.8.4
[Wed Nov 13 16:50:21 UTC 2019] Running cmd: issue
Usage: acme.sh --issue  -d  a.com  -w /path/to/webroot/a.com/

root@3d062642351c:~# acme.sh --issue --debug 3
[Wed Nov 13 16:50:23 UTC 2019] /root/.acme.sh/acme.sh:_exists:492       readlink exists=0
[Wed Nov 13 16:50:23 UTC 2019] /root/.acme.sh/acme.sh:_exists:492       dirname exists=0
[Wed Nov 13 16:50:23 UTC 2019] /root/.acme.sh/acme.sh:__initHome:2368   Lets find script dir.
[Wed Nov 13 16:50:23 UTC 2019] /root/.acme.sh/acme.sh:__initHome:2369   _SCRIPT_='/root/.acme.sh/acme.sh'
[Wed Nov 13 16:50:23 UTC 2019] /root/.acme.sh/acme.sh:__initHome:2371   _script='/root/.acme.sh/acme.sh'
[Wed Nov 13 16:50:23 UTC 2019] acme.sh:__initHome:2373                  _script_home='/root/.acme.sh'
[Wed Nov 13 16:50:23 UTC 2019] acme.sh:__initHome:2400                  Using config home:/root/.acme.sh
[Wed Nov 13 16:50:23 UTC 2019] acme.sh:_process:6948                    LE_WORKING_DIR='/root/.acme.sh'
https://github.com/Neilpang/acme.sh
v2.8.4
[Wed Nov 13 16:50:23 UTC 2019] acme.sh:_process:6956                    Running cmd: issue
Usage: acme.sh --issue  -d  a.com  -w /path/to/webroot/a.com/

Using dash as the shell

root@3d062642351c:~# head -n 1 ~/.acme.sh/acme.sh
#!/bin/sh

root@3d062642351c:~# acme.sh --issue --debug 1
[Wed Nov 13 08:56:45 PST 2019] Lets find script dir.
[Wed Nov 13 08:56:45 PST 2019] _SCRIPT_='/root/.acme.sh/acme.sh'
[Wed Nov 13 08:56:45 PST 2019] _script='/root/.acme.sh/acme.sh'
[Wed Nov 13 08:56:45 PST 2019] _script_home='/root/.acme.sh'
[Wed Nov 13 08:56:45 PST 2019] Using config home:/root/.acme.sh
https://github.com/Neilpang/acme.sh
v2.8.4
[Wed Nov 13 08:56:45 PST 2019] Running cmd: issue
Usage: acme.sh --issue  -d  a.com  -w /path/to/webroot/a.com/

root@3d062642351c:~# acme.sh --issue --debug 2
[Wed Nov 13 08:56:53 PST 2019] Lets find script dir.
[Wed Nov 13 08:56:53 PST 2019] _SCRIPT_='/root/.acme.sh/acme.sh'
[Wed Nov 13 08:56:53 PST 2019] _script='/root/.acme.sh/acme.sh'
[Wed Nov 13 08:56:53 PST 2019] _script_home='/root/.acme.sh'
[Wed Nov 13 08:56:53 PST 2019] Using config home:/root/.acme.sh
[Wed Nov 13 08:56:53 PST 2019] LE_WORKING_DIR='/root/.acme.sh'
https://github.com/Neilpang/acme.sh
v2.8.4
[Wed Nov 13 08:56:53 PST 2019] Running cmd: issue
Usage: acme.sh --issue  -d  a.com  -w /path/to/webroot/a.com/

root@3d062642351c:~# acme.sh --issue --debug 3
[Wed Nov 13 08:56:55 PST 2019] readlink exists=0
[Wed Nov 13 08:56:55 PST 2019] dirname exists=0
[Wed Nov 13 08:56:55 PST 2019] Lets find script dir.
[Wed Nov 13 08:56:55 PST 2019] _SCRIPT_='/root/.acme.sh/acme.sh'
[Wed Nov 13 08:56:55 PST 2019] _script='/root/.acme.sh/acme.sh'
[Wed Nov 13 08:56:55 PST 2019] _script_home='/root/.acme.sh'
[Wed Nov 13 08:56:55 PST 2019] Using config home:/root/.acme.sh
[Wed Nov 13 08:56:55 PST 2019] LE_WORKING_DIR='/root/.acme.sh'
https://github.com/Neilpang/acme.sh
v2.8.4
[Wed Nov 13 08:56:55 PST 2019] Running cmd: issue
Usage: acme.sh --issue  -d  a.com  -w /path/to/webroot/a.com/
In _debug_bash_helper use eval as we are seeing issues with busybox
systems having issues with array access. Even though they aren't
actually running the code they appear to be parsing it and failing.

Also older versions of busybox have a bug with eval and double quotes,
so make sure to use single quotes when using eval.

Resolves: #2579
@JohnVillalovos JohnVillalovos force-pushed the JohnVillalovos:dev branch from 0b7bda1 to adce8f5 Nov 13, 2019
@Neilpang

This comment has been minimized.

Copy link
Owner

Neilpang commented Nov 15, 2019

thank you.

@Neilpang Neilpang merged commit aac9f08 into Neilpang:dev Nov 15, 2019
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.