You've already forked ReZygisk
mirror of
https://github.com/PerformanC/ReZygisk.git
synced 2025-09-06 06:37:01 +00:00
add: error handling for UpdateMountNamespace
This commit adds the missing error handling for "UpdateMountNamespace" in both libzygisk.so and ReZygiskd, as before it would send a -1 as unsigned, leading to issues.
This commit is contained in:
@@ -647,8 +647,17 @@ void zygiskd_start(char *restrict argv[]) {
|
||||
save_mns_fd(pid, Module, impl);
|
||||
}
|
||||
|
||||
uint32_t clean_namespace_fd = (uint32_t)save_mns_fd(pid, (enum MountNamespaceState)mns_state, impl);
|
||||
ret = write_uint32_t(client_fd, clean_namespace_fd);
|
||||
int clean_namespace_fd = save_mns_fd(pid, (enum MountNamespaceState)mns_state, impl);
|
||||
if (clean_namespace_fd == -1) {
|
||||
LOGE("Failed to save mount namespace fd for pid %d: %s\n", pid, strerror(errno));
|
||||
|
||||
ret = write_uint32_t(client_fd, (uint32_t)0);
|
||||
ASSURE_SIZE_WRITE_BREAK("UpdateMountNamespace", "clean_namespace_fd", ret, sizeof(clean_namespace_fd));
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
ret = write_uint32_t(client_fd, (uint32_t)clean_namespace_fd);
|
||||
ASSURE_SIZE_WRITE_BREAK("UpdateMountNamespace", "clean_namespace_fd", ret, sizeof(clean_namespace_fd));
|
||||
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user