diff options
-rw-r--r-- | source4/lib/time.c | 9 | ||||
-rw-r--r-- | source4/ntvfs/posix/pvfs_setfileinfo.c | 16 | ||||
-rw-r--r-- | source4/ntvfs/posix/pvfs_xattr.c | 8 |
3 files changed, 21 insertions, 12 deletions
diff --git a/source4/lib/time.c b/source4/lib/time.c index 67397e953a..7b371f58dd 100644 --- a/source4/lib/time.c +++ b/source4/lib/time.c @@ -112,6 +112,15 @@ BOOL null_time(time_t t) t == (time_t)-1; } + +/**************************************************************************** +check if it's a null NTTIME +****************************************************************************/ +BOOL null_nttime(NTTIME t) +{ + return t == 0 || t == (NTTIME)-1; +} + /******************************************************************* create a 16 bit dos packed date ********************************************************************/ diff --git a/source4/ntvfs/posix/pvfs_setfileinfo.c b/source4/ntvfs/posix/pvfs_setfileinfo.c index 9bc51d1ef4..31a60fac18 100644 --- a/source4/ntvfs/posix/pvfs_setfileinfo.c +++ b/source4/ntvfs/posix/pvfs_setfileinfo.c @@ -301,18 +301,18 @@ NTSTATUS pvfs_setfileinfo(struct ntvfs_module_context *ntvfs, case RAW_SFILEINFO_BASIC_INFO: case RAW_SFILEINFO_BASIC_INFORMATION: - if (info->basic_info.in.create_time) { + if (!null_nttime(info->basic_info.in.create_time)) { newstats.dos.create_time = info->basic_info.in.create_time; } - if (info->basic_info.in.access_time) { + if (!null_nttime(info->basic_info.in.access_time)) { newstats.dos.access_time = info->basic_info.in.access_time; } - if (info->basic_info.in.write_time) { + if (!null_nttime(info->basic_info.in.write_time)) { newstats.dos.write_time = info->basic_info.in.write_time; newstats.dos.flags |= XATTR_ATTRIB_FLAG_STICKY_WRITE_TIME; h->sticky_write_time = True; } - if (info->basic_info.in.change_time) { + if (!null_nttime(info->basic_info.in.change_time)) { newstats.dos.change_time = info->basic_info.in.change_time; } if (info->basic_info.in.attrib != 0) { @@ -490,16 +490,16 @@ NTSTATUS pvfs_setpathinfo(struct ntvfs_module_context *ntvfs, case RAW_SFILEINFO_BASIC_INFO: case RAW_SFILEINFO_BASIC_INFORMATION: - if (info->basic_info.in.create_time) { + if (!null_nttime(info->basic_info.in.create_time)) { newstats.dos.create_time = info->basic_info.in.create_time; } - if (info->basic_info.in.access_time) { + if (!null_nttime(info->basic_info.in.access_time)) { newstats.dos.access_time = info->basic_info.in.access_time; } - if (info->basic_info.in.write_time) { + if (!null_nttime(info->basic_info.in.write_time)) { newstats.dos.write_time = info->basic_info.in.write_time; } - if (info->basic_info.in.change_time) { + if (!null_nttime(info->basic_info.in.change_time)) { newstats.dos.change_time = info->basic_info.in.change_time; } if (info->basic_info.in.attrib != 0) { diff --git a/source4/ntvfs/posix/pvfs_xattr.c b/source4/ntvfs/posix/pvfs_xattr.c index c930fcbd68..c2af2e10bd 100644 --- a/source4/ntvfs/posix/pvfs_xattr.c +++ b/source4/ntvfs/posix/pvfs_xattr.c @@ -190,10 +190,10 @@ NTSTATUS pvfs_dosattrib_load(struct pvfs_state *pvfs, struct pvfs_filename *name name->dos.alloc_size = pvfs_round_alloc_size(pvfs, info1->alloc_size); } - if (info1->create_time != 0) { + if (!null_nttime(info1->create_time)) { name->dos.create_time = info1->create_time; } - if (info1->change_time != 0) { + if (!null_nttime(info1->change_time)) { name->dos.change_time = info1->change_time; } name->dos.flags = 0; @@ -207,10 +207,10 @@ NTSTATUS pvfs_dosattrib_load(struct pvfs_state *pvfs, struct pvfs_filename *name name->dos.alloc_size = pvfs_round_alloc_size(pvfs, info2->alloc_size); } - if (info2->create_time != 0) { + if (!null_nttime(info2->create_time)) { name->dos.create_time = info2->create_time; } - if (info2->change_time != 0) { + if (!null_nttime(info2->change_time)) { name->dos.change_time = info2->change_time; } name->dos.flags = info2->flags; |