summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-07-30 13:16:40 -0700
committerJeremy Allison <jra@samba.org>2009-07-30 13:16:40 -0700
commit84bfd7395c48783fd6fca19effa12561217f65ec (patch)
treed0a56a6b53ec4c535ec0c39e6557bab73d3fd917 /source3/smbd
parente411ec6a8af13ff9213b27212a4bed2db651585d (diff)
downloadsamba-84bfd7395c48783fd6fca19effa12561217f65ec.tar.gz
samba-84bfd7395c48783fd6fca19effa12561217f65ec.tar.bz2
samba-84bfd7395c48783fd6fca19effa12561217f65ec.zip
Remove the extraneous logic in smb_set_info_standard - we
do the time twiddling logic at the smb_set_file_time level. Jeremy.
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/trans2.c34
1 files changed, 8 insertions, 26 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 76b6b3bbe1..93bd9107ac 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -6055,12 +6055,9 @@ static NTSTATUS smb_set_file_basic_info(connection_struct *conn,
const struct smb_filename *smb_fname)
{
/* Patch to do this correctly from Paul Eggert <eggert@twinsun.com>. */
- struct timespec write_time;
- struct timespec changed_time;
struct smb_file_time ft;
uint32 dosmode = 0;
NTSTATUS status = NT_STATUS_OK;
- bool setting_write_time = true;
ZERO_STRUCT(ft);
@@ -6075,38 +6072,23 @@ static NTSTATUS smb_set_file_basic_info(connection_struct *conn,
return status;
}
- /* access time */
- ft.atime = interpret_long_date(pdata+8);
-
- write_time = interpret_long_date(pdata+16);
- changed_time = interpret_long_date(pdata+24);
-
- /* mtime */
- ft.mtime = timespec_min(&write_time, &changed_time);
-
/* create time */
ft.create_time = interpret_long_date(pdata);
- if ((timespec_compare(&write_time, &ft.mtime) == 1) &&
- !null_timespec(write_time)) {
- ft.mtime = write_time;
- }
+ /* access time */
+ ft.atime = interpret_long_date(pdata+8);
- /* Prefer a defined time to an undefined one. */
- if (null_timespec(ft.mtime)) {
- if (null_timespec(write_time)) {
- ft.mtime = changed_time;
- setting_write_time = false;
- } else {
- ft.mtime = write_time;
- }
- }
+ /* write time. */
+ ft.mtime = interpret_long_date(pdata+16);
+
+ /* change time. */
+ ft.ctime = interpret_long_date(pdata+24);
DEBUG(10, ("smb_set_file_basic_info: file %s\n",
smb_fname_str_dbg(smb_fname)));
return smb_set_file_time(conn, fsp, smb_fname, &ft,
- setting_write_time);
+ true);
}
/****************************************************************************