loopback: fix Utimens on symlinks
The problem was that os.Chtimes() operates on the target of the symlink and not on the symlink itself. When tar extracts an archive containing a symlink, it actually wants to set the times on the symlink. This can also be tested using "touch -h". This patch adds a wrapper for the Linux utimensat(2) syscall that allows passing flags along with a unit test. It uses the flag AT_SYMLINK_NOFOLLOW to implement loopbackFileSystem.Utimens() properly. It also add handling for UTIME_NOW and UTIME_OMIT that was already present in loopbackFile.Utimens() but missing in loopbackFileSystem. Fixes issue 81 ( https://github.com/hanwen/go-fuse/issues/81 ).
Showing
fuse/pathfs/syscall_test.go
0 → 100644
Please register or sign in to comment