diff options
author | Jakob Unterwurzacher | 2016-10-16 15:02:44 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2016-10-16 15:08:05 +0200 |
commit | 5144470e3d30499fa42af84927fa8adc27b51e68 (patch) | |
tree | 0c6cc71684687f40710e64b8c56a2162600ac59f /internal/fusefrontend | |
parent | a36e29f77efb81b52db686c9f8911ec14f8e5a71 (diff) |
fusefrontend: Utimens: ugly band-aid for nil pointer crash in go-fuse
Crash is described at https://github.com/rfjakob/gocryptfs/issues/48 .
Revert this once https://github.com/hanwen/go-fuse/pull/131 is merged.
Diffstat (limited to 'internal/fusefrontend')
-rw-r--r-- | internal/fusefrontend/file.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/internal/fusefrontend/file.go b/internal/fusefrontend/file.go index ab025d3..796aee8 100644 --- a/internal/fusefrontend/file.go +++ b/internal/fusefrontend/file.go @@ -386,7 +386,19 @@ func (f *file) GetAttr(a *fuse.Attr) fuse.Status { return fuse.OK } +// TODO drop this once https://github.com/hanwen/go-fuse/pull/131 is +// merged +const BrokenAtimeOmit = true + func (f *file) Utimens(a *time.Time, m *time.Time) fuse.Status { + if a == nil && BrokenAtimeOmit { + // Band-aid for a nil pointer crash, described in + // https://github.com/rfjakob/gocryptfs/issues/48 + // + // TODO drop this once https://github.com/hanwen/go-fuse/pull/131 is + // merged + a = m + } f.fdLock.RLock() defer f.fdLock.RUnlock() return f.loopbackFile.Utimens(a, m) |