diff options
author | Andrew Tridgell <tridge@samba.org> | 2006-04-06 01:56:04 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:00:19 -0500 |
commit | e54abee4e19538760119e8e63eb23f78fd88da4f (patch) | |
tree | 52652d0565a76ff1cfa263707c919586f29a5b92 /source4/ntvfs/posix/pvfs_setfileinfo.c | |
parent | fe071da009d910c3325f016ae9e4b349d726802f (diff) | |
download | samba-e54abee4e19538760119e8e63eb23f78fd88da4f.tar.gz samba-e54abee4e19538760119e8e63eb23f78fd88da4f.tar.bz2 samba-e54abee4e19538760119e8e63eb23f78fd88da4f.zip |
r14933: fix the handling of notify filters to be much closer to the behaviour
of w2k3. The behaviour is particularly tricky for rename.
(This used to be commit 4d3b8d95498a328ffc08ecb62d9531b6bfe4e2b5)
Diffstat (limited to 'source4/ntvfs/posix/pvfs_setfileinfo.c')
-rw-r--r-- | source4/ntvfs/posix/pvfs_setfileinfo.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/source4/ntvfs/posix/pvfs_setfileinfo.c b/source4/ntvfs/posix/pvfs_setfileinfo.c index 9f5153eb4b..b00624c0e9 100644 --- a/source4/ntvfs/posix/pvfs_setfileinfo.c +++ b/source4/ntvfs/posix/pvfs_setfileinfo.c @@ -147,7 +147,7 @@ static NTSTATUS pvfs_setfileinfo_rename(struct pvfs_state *pvfs, return status; } - status = pvfs_do_rename(pvfs, name->full_name, name2->full_name); + status = pvfs_do_rename(pvfs, name, name2->full_name); if (NT_STATUS_IS_OK(status)) { name->full_name = talloc_steal(name, name2->full_name); name->original_name = talloc_steal(name, name2->original_name); @@ -292,7 +292,6 @@ NTSTATUS pvfs_setfileinfo(struct ntvfs_module_context *ntvfs, case RAW_SFILEINFO_STANDARD: if (!null_time(info->setattre.in.create_time)) { unix_to_nt_time(&newstats.dos.create_time, info->setattre.in.create_time); - change_mask |= FILE_NOTIFY_CHANGE_CREATION; } if (!null_time(info->setattre.in.access_time)) { unix_to_nt_time(&newstats.dos.access_time, info->setattre.in.access_time); @@ -311,7 +310,6 @@ NTSTATUS pvfs_setfileinfo(struct ntvfs_module_context *ntvfs, case RAW_SFILEINFO_BASIC_INFORMATION: if (!null_nttime(info->basic_info.in.create_time)) { newstats.dos.create_time = info->basic_info.in.create_time; - change_mask |= FILE_NOTIFY_CHANGE_CREATION; } if (!null_nttime(info->basic_info.in.access_time)) { newstats.dos.access_time = info->basic_info.in.access_time; @@ -408,6 +406,9 @@ NTSTATUS pvfs_setfileinfo(struct ntvfs_module_context *ntvfs, /* possibly change the file timestamps */ ZERO_STRUCT(unix_times); + if (newstats.dos.create_time != h->name->dos.create_time) { + change_mask |= FILE_NOTIFY_CHANGE_CREATION; + } if (newstats.dos.access_time != h->name->dos.access_time) { unix_times.actime = nt_time_to_unix(newstats.dos.access_time); change_mask |= FILE_NOTIFY_CHANGE_LAST_ACCESS; @@ -494,7 +495,6 @@ NTSTATUS pvfs_setpathinfo(struct ntvfs_module_context *ntvfs, case RAW_SFILEINFO_STANDARD: if (!null_time(info->setattre.in.create_time)) { unix_to_nt_time(&newstats.dos.create_time, info->setattre.in.create_time); - change_mask |= FILE_NOTIFY_CHANGE_CREATION; } if (!null_time(info->setattre.in.access_time)) { unix_to_nt_time(&newstats.dos.access_time, info->setattre.in.access_time); @@ -513,7 +513,6 @@ NTSTATUS pvfs_setpathinfo(struct ntvfs_module_context *ntvfs, case RAW_SFILEINFO_BASIC_INFORMATION: if (!null_nttime(info->basic_info.in.create_time)) { newstats.dos.create_time = info->basic_info.in.create_time; - change_mask |= FILE_NOTIFY_CHANGE_CREATION; } if (!null_nttime(info->basic_info.in.access_time)) { newstats.dos.access_time = info->basic_info.in.access_time; @@ -585,11 +584,16 @@ NTSTATUS pvfs_setpathinfo(struct ntvfs_module_context *ntvfs, /* possibly change the file timestamps */ ZERO_STRUCT(unix_times); + if (newstats.dos.create_time != name->dos.create_time) { + change_mask |= FILE_NOTIFY_CHANGE_CREATION; + } if (newstats.dos.access_time != name->dos.access_time) { unix_times.actime = nt_time_to_unix(newstats.dos.access_time); + change_mask |= FILE_NOTIFY_CHANGE_LAST_ACCESS; } if (newstats.dos.write_time != name->dos.write_time) { unix_times.modtime = nt_time_to_unix(newstats.dos.write_time); + change_mask |= FILE_NOTIFY_CHANGE_LAST_WRITE; } if (unix_times.actime != 0 || unix_times.modtime != 0) { if (utime(name->full_name, &unix_times) == -1) { @@ -604,6 +608,7 @@ NTSTATUS pvfs_setpathinfo(struct ntvfs_module_context *ntvfs, if (chmod(name->full_name, mode) == -1) { return pvfs_map_errno(pvfs, errno); } + change_mask |= FILE_NOTIFY_CHANGE_ATTRIBUTES; } *name = newstats; |