mirror of
https://github.com/fosslinux/live-bootstrap.git
synced 2026-03-23 11:36:32 +01:00
reset environment in wrap.c
This commit is contained in:
parent
1fb704334c
commit
c4e12161b7
1 changed files with 15 additions and 1 deletions
16
sysa/wrap.c
16
sysa/wrap.c
|
|
@ -225,5 +225,19 @@ int main(int argc, char **argv, char **envp) {
|
||||||
chroot (".");
|
chroot (".");
|
||||||
}
|
}
|
||||||
free(cwd);
|
free(cwd);
|
||||||
return execve (argv[1], argv + sizeof(char *) , envp);
|
char **newenv = malloc(3 * sizeof(char *));
|
||||||
|
char *ARCH = getenv("ARCH");
|
||||||
|
newenv[0] = malloc(6 + strlen(ARCH));
|
||||||
|
strcpy(newenv[0], "ARCH=");
|
||||||
|
strcpy(newenv[0] + 5, ARCH);
|
||||||
|
char *ARCH_DIR = getenv("ARCH_DIR");
|
||||||
|
newenv[1] = malloc(10 + strlen(ARCH_DIR));
|
||||||
|
strcpy(newenv[1], "ARCH_DIR=");
|
||||||
|
strcpy(newenv[1] + 9, ARCH_DIR);
|
||||||
|
newenv[2] = NULL;
|
||||||
|
#ifdef __M2__
|
||||||
|
return execve (argv[1], argv + sizeof(char *) , newenv);
|
||||||
|
#else
|
||||||
|
return execve (argv[1], argv + 1, newenv);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue