From d1d9e7105b213544a23595dba7a4e2d5594a9a3b Mon Sep 17 00:00:00 2001 From: Jean-Pierre André Date: Sun, 23 Jun 2013 11:53:31 +0200 Subject: Fixed non-owner setting current time with write access --- kernel/fuse_kernel.h | 2 ++ kernel/fuse_vnops.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/kernel/fuse_kernel.h b/kernel/fuse_kernel.h index 56ea157..81d0e2c 100644 --- a/kernel/fuse_kernel.h +++ b/kernel/fuse_kernel.h @@ -113,6 +113,8 @@ struct fuse_file_lock { #define FATTR_ATIME (1 << 4) #define FATTR_MTIME (1 << 5) #define FATTR_FH (1 << 6) +#define FATTR_ATIME_NOW (1 << 7) +#define FATTR_MTIME_NOW (1 << 8) /** * Flags returned by the OPEN request diff --git a/kernel/fuse_vnops.c b/kernel/fuse_vnops.c index 5701d58..4c4d33b 100644 --- a/kernel/fuse_vnops.c +++ b/kernel/fuse_vnops.c @@ -1744,12 +1744,16 @@ fuse_setattr( fsai->FUSEATTR(atime) = vap->va_atime.tv_sec; fsai->FUSEATTR(atimensec) = vap->va_atime.tv_nsec; fsai->valid |= FATTR_ATIME; + if (!(flags & ATTR_UTIME)) + fsai->valid |= FATTR_ATIME_NOW; } if (mask & AT_MTIME) { fsai->FUSEATTR(mtime) = vap->va_mtime.tv_sec; fsai->FUSEATTR(mtimensec) = vap->va_mtime.tv_nsec; fsai->valid |= FATTR_MTIME; + if (!(flags & ATTR_UTIME)) + fsai->valid |= FATTR_MTIME_NOW; } if (mask & AT_SIZE) { -- cgit v1.2.3