fix(mac): reject invalid codesign args · openclaw/openclaw@e59d0b5
vincentkoc
·
2026-06-21
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -118,6 +118,26 @@ describe("codesign-mac-app temp file hygiene", () => {
|
118 | 118 | expect(entitlementTemps(tempRoot)).toEqual([]); |
119 | 119 | }); |
120 | 120 | |
| 121 | +it("rejects unknown options before app validation", () => { |
| 122 | +const tempRoot = makeTempDir("openclaw-codesign-unknown-"); |
| 123 | +const result = runCodesign(["--wat"], tempRoot); |
| 124 | + |
| 125 | +expect(result.status).toBe(1); |
| 126 | +expect(result.stderr.trim()).toBe("ERROR: Unknown codesign option: --wat"); |
| 127 | +expect(entitlementTemps(tempRoot)).toEqual([]); |
| 128 | +}); |
| 129 | + |
| 130 | +it("rejects extra app bundle arguments before signing", () => { |
| 131 | +const tempRoot = makeTempDir("openclaw-codesign-extra-"); |
| 132 | +const app = path.join(tempRoot, "Fake.app"); |
| 133 | +mkdirSync(path.join(app, "Contents", "MacOS"), { recursive: true }); |
| 134 | +const result = runCodesign([app, "extra"], tempRoot); |
| 135 | + |
| 136 | +expect(result.status).toBe(1); |
| 137 | +expect(result.stderr.trim()).toBe("ERROR: Unexpected codesign argument: extra"); |
| 138 | +expect(entitlementTemps(tempRoot)).toEqual([]); |
| 139 | +}); |
| 140 | + |
121 | 141 | it("cleans entitlement temp files when signing fails", () => { |
122 | 142 | const tempRoot = makeTempDir("openclaw-codesign-fail-"); |
123 | 143 | const app = path.join(tempRoot, "Fake.app"); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。