diff options
author | Jeremy Allison <jra@samba.org> | 2001-07-04 01:01:02 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2001-07-04 01:01:02 +0000 |
commit | 8f57233c0f871763bc3657d754c894dbd29ae501 (patch) | |
tree | dde192485bc2aa770c43d72f80289a31bb04ea87 /source/smbd/nttrans.c | |
parent | 5cf7bc582bc2dc4fa7be43d87c81e94f6dd00573 (diff) | |
download | samba-8f57233c0f871763bc3657d754c894dbd29ae501.tar.gz samba-8f57233c0f871763bc3657d754c894dbd29ae501.tar.xz samba-8f57233c0f871763bc3657d754c894dbd29ae501.zip |
Ensure we correctly round down to 2 second boundary if dos filetime
set for a share.
Jeremy.
Diffstat (limited to 'source/smbd/nttrans.c')
-rw-r--r-- | source/smbd/nttrans.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/source/smbd/nttrans.c b/source/smbd/nttrans.c index d58bb106af8..f2b6ba7a803 100644 --- a/source/smbd/nttrans.c +++ b/source/smbd/nttrans.c @@ -635,6 +635,7 @@ int reply_ntcreate_and_X(connection_struct *conn, files_struct *fsp=NULL; char *p = NULL; BOOL stat_open_only = False; + time_t c_time; START_PROFILE(SMBntcreateX); /* If it's an IPC, use the pipe handler. */ @@ -913,7 +914,16 @@ int reply_ntcreate_and_X(connection_struct *conn, p += 4; /* Create time. */ - put_long_date(p,get_create_time(&sbuf,lp_fake_dir_create_times(SNUM(conn)))); + c_time = get_create_time(&sbuf,lp_fake_dir_create_times(SNUM(conn))); + + if (lp_dos_filetime_resolution(SNUM(conn))) { + c_time &= ~1; + sbuf.st_atime &= ~1; + sbuf.st_mtime &= ~1; + sbuf.st_mtime &= ~1; + } + + put_long_date(p,c_time); p += 8; put_long_date(p,sbuf.st_atime); /* access time */ p += 8; @@ -1115,6 +1125,7 @@ static int call_nt_transact_create(connection_struct *conn, int smb_attr; int error_class; uint32 error_code; + time_t c_time; DEBUG(5,("call_nt_transact_create\n")); @@ -1385,7 +1396,16 @@ static int call_nt_transact_create(connection_struct *conn, p += 8; /* Create time. */ - put_long_date(p,get_create_time(&sbuf,lp_fake_dir_create_times(SNUM(conn)))); + c_time = get_create_time(&sbuf,lp_fake_dir_create_times(SNUM(conn))); + + if (lp_dos_filetime_resolution(SNUM(conn))) { + c_time &= ~1; + sbuf.st_atime &= ~1; + sbuf.st_mtime &= ~1; + sbuf.st_mtime &= ~1; + } + + put_long_date(p,c_time); p += 8; put_long_date(p,sbuf.st_atime); /* access time */ p += 8; |