fix: assert traversal-specific error in restore backup test

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Roland Bewick 2026-08-12 20:23:39 +07:00
parent d9a098757e
commit c61d08fbdc

View file

@ -160,7 +160,7 @@ func TestRestoreBackupRejectsPathTraversal(t *testing.T) {
require.NoError(t, zw.Close())
err = theAPI.RestoreBackup(unlockPassword, &buf)
require.Error(t, err)
require.ErrorContains(t, err, "refusing to extract zip entry outside restore directory")
_, statErr := os.Stat(escapeTarget)
require.True(t, os.IsNotExist(statErr), "traversal entry must not be written outside the restore directory")