diff options
author | Jakob Unterwurzacher | 2025-01-18 14:11:51 +0100 |
---|---|---|
committer | Jakob Unterwurzacher | 2025-01-18 14:13:52 +0100 |
commit | 9eb47cf546d7e2499eab210d70050ef78087475a (patch) | |
tree | 39e74927d89f8d80de46e4edc627e6526a72f2eb /internal | |
parent | c19f986ba09e675a5139b12bcf2687495f2533dd (diff) |
reverse: advance mtime & ctime for virtual files by 10 seconds
With inode number reuse and hard links, we could have returned
wrong data for gocryptfs.diriv and gocryptfs.xyz.longname files, respectively
(https://github.com/rfjakob/gocryptfs/issues/802).
Now that this is fixed, ensure that rsync and similar tools pick up the new
correct files by advancing mtime and ctime by 10 seconds, which should be more
than any filesytems' timestamp granularity (FAT32 has 2 seconds).
Diffstat (limited to 'internal')
-rw-r--r-- | internal/fusefrontend_reverse/virtualnode.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/internal/fusefrontend_reverse/virtualnode.go b/internal/fusefrontend_reverse/virtualnode.go index 732564a..95e71ab 100644 --- a/internal/fusefrontend_reverse/virtualnode.go +++ b/internal/fusefrontend_reverse/virtualnode.go @@ -100,6 +100,15 @@ func (n *Node) newVirtualMemNode(content []byte, parentStat *syscall.Stat_t, ino st.Nlink = 1 var a fuse.Attr a.FromStat(st) + // With inode number reuse and hard links, we could have returned + // wrong data for gocryptfs.diriv and gocryptfs.xyz.longname files, respectively + // (https://github.com/rfjakob/gocryptfs/issues/802). + // + // Now that this is fixed, ensure that rsync and similar tools pick up the new + // correct files by advancing mtime and ctime by 10 seconds, which should be more + // than any filesytems' timestamp granularity (FAT32 has 2 seconds). + a.Mtime += 10 + a.Ctime += 10 if rn.args.ForceOwner != nil { a.Owner = *rn.args.ForceOwner } |