aboutsummaryrefslogtreecommitdiff
path: root/tests/reverse/inomap_test.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2020-05-03 15:22:10 +0200
committerJakob Unterwurzacher2020-05-03 15:22:10 +0200
commit518771e4e247762f60c5594de427a8c86f19bd57 (patch)
tree625aed59393508f8f3b61787963012a684b37d8e /tests/reverse/inomap_test.go
parentdb93a6c54cfd615561207f1bbcf7e665ebc296b6 (diff)
fusefrontend_reverse: use inomap for inode number translation
Gets rid of static inode number value limitations. Fixes https://github.com/rfjakob/gocryptfs/issues/457
Diffstat (limited to 'tests/reverse/inomap_test.go')
-rw-r--r--tests/reverse/inomap_test.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/reverse/inomap_test.go b/tests/reverse/inomap_test.go
index e3bd207..5f7fb45 100644
--- a/tests/reverse/inomap_test.go
+++ b/tests/reverse/inomap_test.go
@@ -128,8 +128,10 @@ func TestVirtualFileIno(t *testing.T) {
if origInos.parent == cipherInos.diriv {
t.Errorf("diriv ino collision: %d == %d", origInos.parent, cipherInos.diriv)
}
- if origInos.parent != cipherInos.diriv-1000000000000000000 {
- t.Errorf("diriv ino mismatch: %d != %d", origInos.parent, cipherInos.diriv)
+ // Lower 48 bits should come from the backing file
+ const mask = 0xffffffffffff
+ if origInos.parent&mask != cipherInos.diriv&mask {
+ t.Errorf("diriv ino mismatch: %#x vs %#x", origInos.parent, cipherInos.diriv)
}
if origInos.child != cipherInos.child {
t.Errorf("child ino mismatch: %d vs %d", origInos.child, cipherInos.child)
@@ -137,7 +139,7 @@ func TestVirtualFileIno(t *testing.T) {
if origInos.child == cipherInos.name {
t.Errorf("name ino collision: %d == %d", origInos.child, cipherInos.name)
}
- if origInos.child != cipherInos.name-2000000000000000000 {
- t.Errorf("name ino mismatch: %d vs %d", origInos.child, cipherInos.name)
+ if origInos.child&mask != cipherInos.name&mask {
+ t.Errorf("name ino mismatch: %#x vs %#x", origInos.child, cipherInos.name)
}
}