From e2dc52a9657e530820b2d5b49ad7425b529029ce Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sun, 7 Mar 2021 17:22:29 +0100 Subject: v2api: -sharestorage: disable hard link tracking & add tests Hard link tracking was not correctly disabled since the migration to the go-fuse v2 api. Add a test to ensure it stays off. Fixes https://github.com/rfjakob/gocryptfs/issues/525 --- internal/inomap/inomap.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'internal/inomap') diff --git a/internal/inomap/inomap.go b/internal/inomap/inomap.go index 82d50b0..0977a46 100644 --- a/internal/inomap/inomap.go +++ b/internal/inomap/inomap.go @@ -104,3 +104,14 @@ func (m *InoMap) TranslateStat(st *syscall.Stat_t) { in := QInoFromStat(st) st.Ino = m.Translate(in) } + +type TranslateStater interface { + TranslateStat(st *syscall.Stat_t) +} + +// TranslateStatZero always sets st.Ino to zero. Used for `-sharedstorage`. +type TranslateStatZero struct{} + +func (z TranslateStatZero) TranslateStat(st *syscall.Stat_t) { + st.Ino = 0 +} -- cgit v1.2.3