summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Pierre André <jpandre@users.sourceforge.net>2013-06-23 11:53:31 +0200
committerJean-Pierre André <jpandre@users.sourceforge.net>2013-06-23 11:53:31 +0200
commitd1d9e7105b213544a23595dba7a4e2d5594a9a3b (patch)
tree4c7dbd2e634ec5f94c44889d24b73e21d8a72c38
parent312096b26299a2d186173c2e9b69684203f81022 (diff)
downloadillumos-fusefs-d1d9e7105b213544a23595dba7a4e2d5594a9a3b.tar.gz
Fixed non-owner setting current time with write access
-rw-r--r--kernel/fuse_kernel.h2
-rw-r--r--kernel/fuse_vnops.c4
2 files changed, 6 insertions, 0 deletions
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) {