From 31abc47c7ce4357e2d6be7e90343cdc13991bb8d Mon Sep 17 00:00:00 2001 From: jpandre Date: Sat, 16 Jan 2010 09:35:24 +0000 Subject: [PATCH] Secured against use of external fuse not patched for UTIME_NOW --- include/fuse-lite/fuse.h | 2 -- src/ntfs-3g.c | 9 +++++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/include/fuse-lite/fuse.h b/include/fuse-lite/fuse.h index 473caed3..16c4ea9c 100644 --- a/include/fuse-lite/fuse.h +++ b/include/fuse-lite/fuse.h @@ -68,8 +68,6 @@ typedef int (*fuse_fill_dir_t) (void *buf, const char *name, * Previously, paths were limited to a length of PATH_MAX. */ -#define HAS_UTIME_OMIT_OK 1 - struct fuse_operations { /** Get file attributes. * diff --git a/src/ntfs-3g.c b/src/ntfs-3g.c index ebbbac88..0bb89075 100644 --- a/src/ntfs-3g.c +++ b/src/ntfs-3g.c @@ -3459,8 +3459,13 @@ static void ntfs_fuse_destroy2(void *unused __attribute__((unused))) } static struct fuse_operations ntfs_3g_ops = { -#if defined(HAVE_UTIMENSAT) && defined(HAS_UTIME_OMIT_OK) - .flag_utime_omit_ok = 1, /* accept UTIME_NOW and UTIME_OMIT in utimens */ +#if defined(HAVE_UTIMENSAT) && (defined(FUSE_INTERNAL) || (FUSE_VERSION > 28)) + /* + * Accept UTIME_NOW and UTIME_OMIT in utimens, when + * using internal fuse or a fuse version since 2.9 + * (this field is not present in older versions) + */ + .flag_utime_omit_ok = 1, #endif .getattr = ntfs_fuse_getattr, .readlink = ntfs_fuse_readlink,