fix: harden IPC transport and process-local settings store

Serialize IPC_Client with a per-target mutex and full-frame send/recv plus
NUL-terminated payloads. Escape reply JSON vars, null-check daemon FS paths,
handle BREW_UTIL_TEST_CONNECTION, and track BREW_LAST_RET from the last reply.

Introduce SettingsStore (mutex snapshot/update), dual-path config mtime gating,
and fan IPC persistence to twin config files. Stop cold-start toolbox delay on
util_booted; fix jailbreak hijack retry to stop only when dead or maxed.

Add host tests for IPC wire helpers, toolbox timing policy, and hijack retry.
This commit is contained in:
Hexwell committed 2026-07-10 17:56:21 +08:00
1 parent c3027f2c67
commit ece77ea433
32 files changed
+805 -171

No files matched your search

+4 -3
View File
@@ -73,9 +73,10 @@ static int test_ipc_format_reply_body(void) {
std::string ok = ipc_format_reply_body(false, "Nothing");
std::string err = ipc_format_reply_body(true, "fail");
std::string tid = ipc_format_reply_body(false, "CUSA12345");
TEST_ASSERT_STREQ("{\"res\":0, \"var\":\"Nothing\"}", ok.c_str());
TEST_ASSERT_STREQ("{\"res\":-1, \"var\":\"fail\"}", err.c_str());
TEST_ASSERT_STREQ("{\"res\":0, \"var\":\"CUSA12345\"}", tid.c_str());
/* Compact JSON; var is escaped (no space after colon). */
TEST_ASSERT_STREQ("{\"res\":0,\"var\":\"Nothing\"}", ok.c_str());
TEST_ASSERT_STREQ("{\"res\":-1,\"var\":\"fail\"}", err.c_str());
TEST_ASSERT_STREQ("{\"res\":0,\"var\":\"CUSA12345\"}", tid.c_str());
return 0;
}