diff options
author | Jakob Unterwurzacher | 2021-03-07 17:22:29 +0100 |
---|---|---|
committer | Jakob Unterwurzacher | 2021-03-07 17:22:29 +0100 |
commit | e2dc52a9657e530820b2d5b49ad7425b529029ce (patch) | |
tree | 75683d1194615dc2774a1b0f99850b798ade2b83 /internal/inomap | |
parent | eaca820e876bfcdc67323eac6dd43ecc420968f2 (diff) |
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
Diffstat (limited to 'internal/inomap')
-rw-r--r-- | internal/inomap/inomap.go | 11 |
1 files changed, 11 insertions, 0 deletions
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 +} |