diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2022-03-07 16:24:04 +0100 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2022-03-08 17:37:09 +0100 |
| commit | ff31d0b0233dffa7ec2e05bc1a4f849831fe63f3 (patch) | |
| tree | da244effaa33c1ff8cb5741f5d966245ece75be2 /src/wrapped/wrappedlibc.c | |
| parent | 652e8318e66d3a7eea6257aca4b3fadf27c0522c (diff) | |
| download | box64-ff31d0b0233dffa7ec2e05bc1a4f849831fe63f3.tar.gz box64-ff31d0b0233dffa7ec2e05bc1a4f849831fe63f3.zip | |
Better handling of environ and envp in execve
Diffstat (limited to 'src/wrapped/wrappedlibc.c')
| -rwxr-xr-x | src/wrapped/wrappedlibc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c index 61429120..a3828b96 100755 --- a/src/wrapped/wrappedlibc.c +++ b/src/wrapped/wrappedlibc.c @@ -1697,6 +1697,10 @@ EXPORT int32_t my_execve(x64emu_t* emu, const char* path, char* const argv[], ch int self = isProcSelf(path, "exe"); int x64 = FileIsX64ELF(path); int x86 = my_context->box86path?FileIsX86ELF(path):0; + // hack to update the environ var if needed + if(envp == my_context->envv && environ) { + envp = environ; + } printf_log(LOG_DEBUG, "execve(\"%s\", %p, %p) is x64=%d x86=%d\n", path, argv, envp, x64, x86); #if 1 if (x64 || x86 || self) { |