diff options
Diffstat (limited to 'source3/smbd/nttrans.c')
-rw-r--r-- | source3/smbd/nttrans.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index d58bb106af..f2b6ba7a80 100644 --- a/source3/smbd/nttrans.c +++ b/source3/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; |