diff options
| author | Danilo M. <danix@danix.xyz> | 2026-11-03 08:43:49 +0100 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-11-03 08:43:49 +0100 |
| commit | 84d89854ce02a5833e88bfd9c150b8e90b51b4a5 (patch) | |
| tree | 496494f43f1accf18e787eac89dba3dfcb9e1aa4 /app/src/test/java | |
| parent | 5871d4e73245e179e22286580f4668da69c1484e (diff) | |
| download | HardenedPass-84d89854ce02a5833e88bfd9c150b8e90b51b4a5.tar.gz HardenedPass-84d89854ce02a5833e88bfd9c150b8e90b51b4a5.zip | |
fix(app): harden the editor save path and the picker
- Run the save's write, original delete, autofill and history updates
under NonCancellable so a recreated activity cannot leave a half
done rename.
- fsync the temporary file before the atomic move.
- Move dialog: refuse targets outside the store (symlinks) and moving
a folder into itself or a descendant, with a toast.
- Folder picker: do not navigate into a new folder whose mkdirs failed;
show a toast (new string, en and it).
- Normalize entryFile so "./" and "a/../b" give the same keys as the
list; covered in EditorModelTest.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'app/src/test/java')
| -rw-r--r-- | app/src/test/java/app/passwordstore/ui/editor/EditorModelTest.kt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/src/test/java/app/passwordstore/ui/editor/EditorModelTest.kt b/app/src/test/java/app/passwordstore/ui/editor/EditorModelTest.kt index 81174d05..160434c9 100644 --- a/app/src/test/java/app/passwordstore/ui/editor/EditorModelTest.kt +++ b/app/src/test/java/app/passwordstore/ui/editor/EditorModelTest.kt @@ -77,6 +77,10 @@ class EditorModelTest { entryFile(root, EditorForm(name = " mail ", dir = "work")), ) assertEquals(File(root, "mail.gpg"), entryFile(root, EditorForm(name = "mail"))) + assertEquals( + File(root, "b/mail.gpg"), + entryFile(root, EditorForm(name = "mail", dir = "./a/../b")), + ) } @Test |
