1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-08 04:58:40 +03:00

pvfs_close: correctly handle the write time updates passed by close()

metze
(This used to be commit 7f033ce4fb6fc897f8159926d5a6d2e45dd447b6)
This commit is contained in:
Stefan Metzmacher 2008-05-08 22:16:55 +02:00
parent 60759b64a7
commit 6e52c4feb8
2 changed files with 7 additions and 4 deletions

View File

@ -1591,7 +1591,6 @@ NTSTATUS pvfs_close(struct ntvfs_module_context *ntvfs,
{
struct pvfs_state *pvfs = ntvfs->private_data;
struct pvfs_file *f;
struct utimbuf unix_times;
if (io->generic.level == RAW_CLOSE_SPLCLOSE) {
return NT_STATUS_DOS(ERRSRV, ERRerror);
@ -1607,9 +1606,9 @@ NTSTATUS pvfs_close(struct ntvfs_module_context *ntvfs,
}
if (!null_time(io->generic.in.write_time)) {
unix_times.actime = 0;
unix_times.modtime = io->close.in.write_time;
utime(f->handle->name->full_name, &unix_times);
f->handle->write_time.update_forced = false;
f->handle->write_time.update_on_close = true;
unix_to_nt_time(&f->handle->write_time.close_time, io->generic.in.write_time);
}
if (io->generic.in.flags & SMB2_CLOSE_FLAGS_FULL_INFORMATION) {

View File

@ -712,6 +712,10 @@ NTSTATUS pvfs_resolve_name_handle(struct pvfs_state *pvfs,
status = pvfs_resolve_name_fd(pvfs, h->fd, h->name, 0);
NT_STATUS_NOT_OK_RETURN(status);
if (!null_nttime(h->write_time.close_time)) {
h->name->dos.write_time = h->write_time.close_time;
}
return NT_STATUS_OK;
}