You've already forked ReZygisk
mirror of
https://github.com/PerformanC/ReZygisk.git
synced 2025-09-06 06:37:01 +00:00
fix: close client in RequestLogcatFd; fix: not closing client in error cases
This commit fixes the case where Zygiskd would close the client in "RequestLogcatFd" action, and also fixes the leak of closes for client when handling errors.
This commit is contained in:
@@ -361,7 +361,7 @@ struct __attribute__((__packed__)) MsgHead {
|
|||||||
};
|
};
|
||||||
|
|
||||||
void zygiskd_start(char *restrict argv[]) {
|
void zygiskd_start(char *restrict argv[]) {
|
||||||
LOGI("Welcome to ReZygisk %s!\n", ZKSU_VERSION);
|
LOGI("Welcome to ReZygisk %s Zygiskd!\n", ZKSU_VERSION);
|
||||||
|
|
||||||
enum RootImpl impl = get_impl();
|
enum RootImpl impl = get_impl();
|
||||||
if (impl == None) {
|
if (impl == None) {
|
||||||
@@ -574,6 +574,8 @@ void zygiskd_start(char *restrict argv[]) {
|
|||||||
if (ret == -1) {
|
if (ret == -1) {
|
||||||
LOGE("Failed reading logcat tag.\n");
|
LOGE("Failed reading logcat tag.\n");
|
||||||
|
|
||||||
|
close(client_fd);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -585,6 +587,8 @@ void zygiskd_start(char *restrict argv[]) {
|
|||||||
if (ret == -1) {
|
if (ret == -1) {
|
||||||
LOGE("Failed reading logcat message.\n");
|
LOGE("Failed reading logcat message.\n");
|
||||||
|
|
||||||
|
close(client_fd);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -735,10 +739,17 @@ void zygiskd_start(char *restrict argv[]) {
|
|||||||
|
|
||||||
ret = write_int(client_fd, 0);
|
ret = write_int(client_fd, 0);
|
||||||
ASSURE_SIZE_WRITE_BREAK("RequestCompanionSocket", "response", ret, sizeof(int));
|
ASSURE_SIZE_WRITE_BREAK("RequestCompanionSocket", "response", ret, sizeof(int));
|
||||||
|
|
||||||
|
close(module->companion);
|
||||||
|
module->companion = -1;
|
||||||
|
|
||||||
|
close(client_fd);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ret = write_int(client_fd, 0);
|
ret = write_int(client_fd, 0);
|
||||||
ASSURE_SIZE_WRITE_BREAK("RequestCompanionSocket", "response", ret, sizeof(int));
|
ASSURE_SIZE_WRITE_BREAK("RequestCompanionSocket", "response", ret, sizeof(int));
|
||||||
|
|
||||||
|
close(client_fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
LOGI("ZD++ RequestCompanionSocket\n");
|
LOGI("ZD++ RequestCompanionSocket\n");
|
||||||
@@ -784,7 +795,7 @@ void zygiskd_start(char *restrict argv[]) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (action != RequestCompanionSocket) close(client_fd);
|
if (action != RequestCompanionSocket && action != RequestLogcatFd) close(client_fd);
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user