summaryrefslogtreecommitdiff
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
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.
-rw-r--r--source3/include/smb.h1
-rw-r--r--source3/smbd/trans2.c34
2 files changed, 9 insertions, 26 deletions
diff --git a/source3/include/smb.h b/source3/include/smb.h
index 11927443bd..819d3a8c4f 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -1895,6 +1895,7 @@ struct smb_extended_info {
struct smb_file_time {
struct timespec mtime;
struct timespec atime;
+ struct timespec ctime;
struct timespec create_time;
};
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);
}
/****************************************************************************