Closed KimonHoffmann closed 1 year ago
@KimonHoffmann can you provide a link to the documentation?
I could not find any official documentation explicitly stating this, but the function signature documented on the manpage as well as in the official GLIBC documentation implies argc
to be greater than, or equal to 1, which is also mirrored by the current GLIBC implementation.
Because of this the condition for argc == 0
never holds and the test results in an infinite loop.
I think my fix is unproblematic, because the test was added to assert that proot does not crash when execlp
is called with the NULL
pointer for arg
and argc
being 0 was just a convenient way to distinguish the parent and child processes.
Thanks for your contribution! I've gone ahead and rebased this change onto the master branch. I'm going to close this PR.
Perfect, thanks!
Newer versions of glibc apparently enforce argv to contain at least one argument, regardless of what what passed to execlp(). This behavioral change resulted in test-0cf405b0 performing an endless loop.
This commit addresses this problem by setting an environment variable to indicate, whether the execlp() call has already been performed.