






















@@ -275,6 +275,22 @@ describe("config observe recovery", () => {
275275});
276276});
277277278+it("hardens async backup restores to owner-only config permissions", async () => {
279+if (process.platform === "win32") {
280+return;
281+}
282+await withSuiteHome(async (home) => {
283+const { deps, configPath } = makeDeps(home);
284+await seedConfigBackup(configPath, recoverableTelegramConfig);
285+await writeClobberedUpdateChannel(configPath);
286+await fsp.chmod(configPath, 0o644);
287+288+await recoverClobberedUpdateChannel({ deps, configPath });
289+290+expect((await fsp.stat(configPath)).mode & 0o777).toBe(0o600);
291+});
292+});
293+278294it("auto-restores after a large size drop against last-good config", async () => {
279295await withSuiteHome(async (home) => {
280296const { deps, configPath, auditPath } = makeDeps(home);
@@ -456,6 +472,22 @@ describe("config observe recovery", () => {
456472});
457473});
458474475+it("hardens sync backup restores to owner-only config permissions", async () => {
476+if (process.platform === "win32") {
477+return;
478+}
479+await withSuiteHome(async (home) => {
480+const { deps, configPath } = makeDeps(home);
481+await seedConfigBackup(configPath, recoverableTelegramConfig);
482+await writeClobberedUpdateChannel(configPath);
483+await fsp.chmod(configPath, 0o644);
484+485+recoverClobberedUpdateChannelSync({ deps, configPath });
486+487+expect((await fsp.stat(configPath)).mode & 0o777).toBe(0o600);
488+});
489+});
490+459491it("logs async health-state write failures", async () => {
460492await withSuiteHome(async (home) => {
461493const { deps, configPath, warn } = makeDeps(home);
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。