Files
Firelink/scripts/repack-linux-appimage-engines.node-test.js
T
NimBold ce31dccd88 fix(appimage): harden packaging for catalog compatibility
- Normalize and verify launcher, AppDir, and GTK hook permissions before and after repacking.

- Reject unsupported target triples before deriving or deleting payload paths.

- Align the published AppImage filename with catalog discovery and document the host glibc floor.

- Add regression coverage for permission, layout, symlink, and target traversal failures.
2026-09-29 14:14:54 +03:30

25 lines
898 B
JavaScript

import assert from 'node:assert/strict';
import { spawnSync } from 'node:child_process';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { test } from 'node:test';
const repositoryRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
const repackScript = path.join(repositoryRoot, 'scripts', 'repack-linux-appimage-engines.js');
test('repack rejects targets that could escape the engine payload path', () => {
const result = spawnSync(process.execPath, [repackScript, '--target', '../../../../../../tmp'], {
cwd: repositoryRoot,
env: {
...process.env,
FIRELINK_TARGET_TRIPLE: '',
TAURI_ENV_TARGET_TRIPLE: '',
},
encoding: 'utf8',
});
assert.equal(result.status, 1);
assert.match(result.stderr, /Unsupported AppImage target: \.\.\/\.\./);
assert.doesNotMatch(result.stderr, /ENOENT|appimagetool/);
});