mirror of
https://github.com/zhaarey/wrapper.git
synced 2025-07-02 08:09:54 +09:00
Merge pull request #23 from Nirzak/patch-1
Adding unshare back to fix hang issue
This commit is contained in:
@ -34,7 +34,12 @@ int main(int argc, char *argv[], char *envp[]) {
|
|||||||
mknod("/dev/urandom", S_IFCHR | 0666, makedev(0x1, 0x9));
|
mknod("/dev/urandom", S_IFCHR | 0666, makedev(0x1, 0x9));
|
||||||
chmod("/system/bin/linker64", 0755);
|
chmod("/system/bin/linker64", 0755);
|
||||||
chmod("/system/bin/main", 0755);
|
chmod("/system/bin/main", 0755);
|
||||||
|
|
||||||
|
if (unshare(CLONE_NEWPID)) {
|
||||||
|
perror("unshare");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
child_proc = fork();
|
child_proc = fork();
|
||||||
if (child_proc == -1) {
|
if (child_proc == -1) {
|
||||||
perror("fork");
|
perror("fork");
|
||||||
@ -53,4 +58,4 @@ int main(int argc, char *argv[], char *envp[]) {
|
|||||||
execve("/system/bin/main", argv, envp);
|
execve("/system/bin/main", argv, envp);
|
||||||
perror("execve");
|
perror("execve");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user