From 589748548f24429bb30a8aafb3cae0d295b07da0 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Wed, 19 Oct 2016 22:25:54 +0200 Subject: tests: add 1980.tar.gz extract test Test that we get the right timestamp when extracting a tarball. Also simplify the workaround in doTestUtimesNano() and fix the fact that it was running no test at all. --- internal/fusefrontend/file.go | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'internal') diff --git a/internal/fusefrontend/file.go b/internal/fusefrontend/file.go index 2692c70..e021962 100644 --- a/internal/fusefrontend/file.go +++ b/internal/fusefrontend/file.go @@ -386,19 +386,20 @@ func (f *file) GetAttr(a *fuse.Attr) fuse.Status { return fuse.OK } -// BrokenAtimeOmit means that atime support is broken. +// BrokenAtime means that atime support is broken. // TODO drop this once https://github.com/hanwen/go-fuse/pull/131 is // merged -const BrokenAtimeOmit = true +const BrokenAtime = true func (f *file) Utimens(a *time.Time, m *time.Time) fuse.Status { - if BrokenAtimeOmit { - // Band-aid for a nil pointer crash, described in - // https://github.com/rfjakob/gocryptfs/issues/48 - // Also band-aid for "mtime gets set to atime". - // - // TODO drop this once https://github.com/hanwen/go-fuse/pull/131 is - // merged + if BrokenAtime { + if m == nil { + tlog.Warn.Printf("refusing to set the atime to prevent a crash in go-fuse") + return fuse.EINVAL + } + // Due to a bug in loopbackFile.Utimens, the "a" value will be used + // to set both mtime and atime. Because mtime is more important, we + // override "a". a = m } f.fdLock.RLock() -- cgit v1.2.3