From df8e5814640b2ba4a6190a89655ea64502b0da7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Pierre=20Andr=C3=A9?= Date: Mon, 19 Apr 2010 11:10:54 +0200 Subject: [PATCH] fixed the condition for executing utime() and utimensat() --- src/lowntfs-3g.c | 4 ++-- src/ntfs-3g.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lowntfs-3g.c b/src/lowntfs-3g.c index e64e67f0..d248902e 100644 --- a/src/lowntfs-3g.c +++ b/src/lowntfs-3g.c @@ -1589,10 +1589,10 @@ static int ntfs_fuse_utimens(struct SECURITY_CONTEXT *scx, fuse_ino_t ino, /* no check or update if both UTIME_OMIT */ if (to_set & (FUSE_SET_ATTR_ATIME + FUSE_SET_ATTR_MTIME)) { #if !KERNELPERMS | (POSIXACLS & !KERNELACLS) - if (ntfs_allowed_access(scx, ni, S_IWRITE) + if (ntfs_allowed_as_owner(scx, ni) || ((to_set & FUSE_SET_ATTR_ATIME_NOW) && (to_set & FUSE_SET_ATTR_MTIME_NOW) - && ntfs_allowed_as_owner(scx, ni))) { + && ntfs_allowed_access(scx, ni, S_IWRITE))) { #endif ntfs_time_update_flags mask = NTFS_UPDATE_CTIME; diff --git a/src/ntfs-3g.c b/src/ntfs-3g.c index a4d1afe2..84ac8513 100644 --- a/src/ntfs-3g.c +++ b/src/ntfs-3g.c @@ -2248,10 +2248,10 @@ static int ntfs_fuse_utimens(const char *path, const struct timespec tv[2]) /* no check or update if both UTIME_OMIT */ if ((tv[0].tv_nsec != UTIME_OMIT) || (tv[1].tv_nsec != UTIME_OMIT)) { #if !KERNELPERMS | (POSIXACLS & !KERNELACLS) - if (ntfs_allowed_access(&security, ni, S_IWRITE) + if (ntfs_allowed_as_owner(&security, ni) || ((tv[0].tv_nsec == UTIME_NOW) && (tv[0].tv_nsec == UTIME_NOW) - && ntfs_allowed_as_owner(&security, ni))) { + && ntfs_allowed_access(&security, ni, S_IWRITE))) { #endif ntfs_time_update_flags mask = NTFS_UPDATE_CTIME;