From 48ad297df13ce3734a432069812ae1479aa301c8 Mon Sep 17 00:00:00 2001 From: Bill Zissimopoulos Date: Tue, 14 Nov 2017 21:55:09 -0800 Subject: [PATCH] dll: fuse: setcrtime, setchgtime --- inc/fuse/fuse.h | 4 ++-- src/dll/fuse/fuse_intf.c | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/inc/fuse/fuse.h b/inc/fuse/fuse.h index c26e7893..25e390f7 100644 --- a/inc/fuse/fuse.h +++ b/inc/fuse/fuse.h @@ -109,8 +109,8 @@ struct fuse_operations /* _ */ int (*getxtimes)(const char *path, struct fuse_timespec *bkuptime, struct fuse_timespec *crtime); /* _ */ int (*setbkuptime)(const char *path, const struct fuse_timespec *tv); - /* _ */ int (*setchgtime)(const char *path, const struct fuse_timespec *tv); - /* _ */ int (*setcrtime)(const char *path, const struct fuse_timespec *tv); + /* S */ int (*setchgtime)(const char *path, const struct fuse_timespec *tv); + /* S */ int (*setcrtime)(const char *path, const struct fuse_timespec *tv); /* S */ int (*chflags)(const char *path, uint32_t flags); /* _ */ int (*setattr_x)(const char *path, struct fuse_setattr_x *attr); /* _ */ int (*fsetattr_x)(const char *path, struct fuse_setattr_x *attr, diff --git a/src/dll/fuse/fuse_intf.c b/src/dll/fuse/fuse_intf.c index 7e221d9e..bd3d2ec0 100644 --- a/src/dll/fuse/fuse_intf.c +++ b/src/dll/fuse/fuse_intf.c @@ -1316,6 +1316,24 @@ static NTSTATUS fsp_fuse_intf_SetBasicInfo(FSP_FILE_SYSTEM *FileSystem, return Result; } + if (0 != CreationTime && 0 != f->ops.setcrtime) + { + FspPosixFileTimeToUnixTime(CreationTime, (void *)&tv[0]); + err = f->ops.setcrtime(filedesc->PosixPath, &tv[0]); + Result = fsp_fuse_ntstatus_from_errno(f->env, err); + if (!NT_SUCCESS(Result)) + return Result; + } + + if (0 != ChangeTime && 0 != f->ops.setchgtime) + { + FspPosixFileTimeToUnixTime(ChangeTime, (void *)&tv[0]); + err = f->ops.setchgtime(filedesc->PosixPath, &tv[0]); + Result = fsp_fuse_ntstatus_from_errno(f->env, err); + if (!NT_SUCCESS(Result)) + return Result; + } + return fsp_fuse_intf_GetFileInfoEx(FileSystem, filedesc->PosixPath, &fi, &Uid, &Gid, &Mode, FileInfo); }