5809a843c8
Installing a plugin no longer needs unzip or tar on PATH, and entry paths are vetted in Lua instead of trusting an external tool. Add arti-pack.archive: a zip reader over zzlib's inflate and a tar reader over its gunzip. Reject absolute, parent-walking, backslashed and NUL-bearing entry names, and any entry that is not a regular file or directory. Verify every zip entry's CRC32 and size, and fail the install on mismatch. Carry only the executable bit from archive modes. Replace fs.extract_cmd with fs.extract and call it synchronously. Drop unzip from the test pipeline and the stated requirements.
16 lines
420 B
Lua
16 lines
420 B
Lua
local root = vim.fn.fnamemodify(debug.getinfo(1, 'S').source:sub(2), ':p:h:h')
|
|
package.path = table.concat({
|
|
root .. '/lua/?.lua',
|
|
root .. '/lua/?/init.lua',
|
|
root .. '/?.lua',
|
|
package.path,
|
|
}, ';')
|
|
|
|
local t = require('tests.harness')
|
|
|
|
for _, name in ipairs({ 'spec_spec', 'fs_spec', 'archive_spec', 'lock_spec', 'installer_spec', 'init_spec' }) do
|
|
require('tests.' .. name)
|
|
end
|
|
|
|
os.exit(t.report() and 0 or 1)
|