From d12aa577156101a1c6a05765de751f0a54b58aa8 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sat, 29 Jul 2017 16:13:38 +0200 Subject: fusefronted_reverse: fix ino collision between .name and .diriv files A directory with a long name has two associated virtual files: the .name file and the .diriv files. These used to get the same inode number: $ ls -di1 * */* 33313535 gocryptfs.longname.2togDFouca9mrTwtfF1RNW5DZRAQY8alaR7wO_Xd5Zw 1000000000033313535 gocryptfs.longname.2togDFouca9mrTwtfF1RNW5DZRAQY8alaR7wO_Xd5Zw/gocryptfs.diriv 1000000000033313535 gocryptfs.longname.2togDFouca9mrTwtfF1RNW5DZRAQY8alaR7wO_Xd5Zw.name With this change we use another prefix (2 instead of 1) for .name files. $ ls -di1 * */* 33313535 gocryptfs.longname.2togDFouca9mrTwtfF1RNW5DZRAQY8alaR7wO_Xd5Zw 1000000000033313535 gocryptfs.longname.2togDFouca9mrTwtfF1RNW5DZRAQY8alaR7wO_Xd5Zw/gocryptfs.diriv 2000000000033313535 gocryptfs.longname.2togDFouca9mrTwtfF1RNW5DZRAQY8alaR7wO_Xd5Zw.name --- internal/fusefrontend_reverse/reverse_longnames.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'internal/fusefrontend_reverse/reverse_longnames.go') diff --git a/internal/fusefrontend_reverse/reverse_longnames.go b/internal/fusefrontend_reverse/reverse_longnames.go index 7e26c90..3b2ddea 100644 --- a/internal/fusefrontend_reverse/reverse_longnames.go +++ b/internal/fusefrontend_reverse/reverse_longnames.go @@ -100,5 +100,5 @@ func (rfs *ReverseFS) newNameFile(relPath string) (nodefs.File, fuse.Status) { } content := []byte(rfs.nameTransform.EncryptName(pName, dirIV)) parentFile := filepath.Join(rfs.args.Cipherdir, pDir, pName) - return rfs.newVirtualFile(content, parentFile) + return rfs.newVirtualFile(content, parentFile, inoBaseNameFile) } -- cgit v1.2.3