diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2020-08-22 00:41:48 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2020-08-22 00:41:52 -0500 |
commit | 0acb5e87d0b6baade234da2f01701003b65f5dda (patch) | |
tree | 22145a45160b90e89f9a5db31c3343c40562cac6 /libgcompat | |
parent | 4ac4d7f60f04ffac3385f0e005260194733acf0a (diff) | |
download | gcompat-0acb5e87d0b6baade234da2f01701003b65f5dda.tar.gz gcompat-0acb5e87d0b6baade234da2f01701003b65f5dda.tar.bz2 gcompat-0acb5e87d0b6baade234da2f01701003b65f5dda.tar.xz gcompat-0acb5e87d0b6baade234da2f01701003b65f5dda.zip |
unistd: Update execve shim with loader changes
Ensure aarch64 bug doesn't appear here either.
Diffstat (limited to 'libgcompat')
-rw-r--r-- | libgcompat/unistd.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libgcompat/unistd.c b/libgcompat/unistd.c index d632eee..e40fb6e 100644 --- a/libgcompat/unistd.c +++ b/libgcompat/unistd.c @@ -210,14 +210,15 @@ int execve(const char *pathname, char *const argv[], char *const envp[]) { return -1; } - new_argv = calloc(argc + 6, sizeof(char *)); + new_argv = calloc(argc + 7, sizeof(char *)); new_argv[0] = LOADER; new_argv[1] = "--argv0"; new_argv[2] = argv[0]; new_argv[3] = "--preload"; new_argv[4] = "/lib/libgcompat.so.0"; - new_argv[5] = target; - for(int j = 1, i = 6; j < argc; ++i, ++j) { + new_argv[5] = "--"; + new_argv[6] = target; + for(int j = 1, i = 7; j < argc; ++i, ++j) { new_argv[i] = argv[j]; } return execve(LINKER, new_argv, envp); |