summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/reply.c17
-rw-r--r--source3/smbd/trans2.c26
2 files changed, 21 insertions, 22 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 93bb679289..38380180f9 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -779,7 +779,10 @@ int reply_getatr(char *inbuf,char *outbuf)
outsize = set_message(outbuf,10,0,True);
SSVAL(outbuf,smb_vwv0,mode);
- put_dos_date3(outbuf,smb_vwv1,mtime);
+ if(lp_dos_filetime_resolution(SNUM(cnum)) )
+ put_dos_date3(outbuf,smb_vwv1,mtime & ~1);
+ else
+ put_dos_date3(outbuf,smb_vwv1,mtime);
SIVAL(outbuf,smb_vwv3,size);
if (Protocol >= PROTOCOL_NT1) {
@@ -1231,7 +1234,10 @@ int reply_open(char *inbuf,char *outbuf)
outsize = set_message(outbuf,7,0,True);
SSVAL(outbuf,smb_vwv0,fnum);
SSVAL(outbuf,smb_vwv1,fmode);
- put_dos_date3(outbuf,smb_vwv2,mtime);
+ if(lp_dos_filetime_resolution(SNUM(cnum)) )
+ put_dos_date3(outbuf,smb_vwv2,mtime & ~1);
+ else
+ put_dos_date3(outbuf,smb_vwv2,mtime);
SIVAL(outbuf,smb_vwv4,size);
SSVAL(outbuf,smb_vwv6,rmode);
@@ -1357,7 +1363,10 @@ int reply_open_and_X(char *inbuf,char *outbuf,int length,int bufsize)
set_message(outbuf,15,0,True);
SSVAL(outbuf,smb_vwv2,fnum);
SSVAL(outbuf,smb_vwv3,fmode);
- put_dos_date3(outbuf,smb_vwv4,mtime);
+ if(lp_dos_filetime_resolution(SNUM(cnum)) )
+ put_dos_date3(outbuf,smb_vwv4,mtime & ~1);
+ else
+ put_dos_date3(outbuf,smb_vwv4,mtime);
SIVAL(outbuf,smb_vwv6,size);
SSVAL(outbuf,smb_vwv8,rmode);
SSVAL(outbuf,smb_vwv11,smb_action);
@@ -3917,7 +3926,7 @@ int reply_getattrE(char *inbuf,char *outbuf)
date to be last modify date as UNIX doesn't save
this */
put_dos_date2(outbuf,smb_vwv0,get_create_time(&sbuf));
- put_dos_date2(outbuf,smb_vwv2,get_access_time(&sbuf));
+ put_dos_date2(outbuf,smb_vwv2,sbuf.st_atime);
put_dos_date2(outbuf,smb_vwv4,sbuf.st_mtime);
if (mode & aDIR)
{
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 2b5d5785fa..6eda891e32 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -376,7 +376,7 @@ static int get_lanman2_dir_entry(int cnum,char *path_mask,int dirtype,int info_l
size = sbuf.st_size;
mdate = sbuf.st_mtime;
- adate = get_access_time(&sbuf);
+ adate = sbuf.st_atime;
cdate = get_create_time(&sbuf);
if(mode & aDIR)
size = 0;
@@ -1139,18 +1139,9 @@ static int call_trans2qfilepathinfo(char *inbuf, char *outbuf, int length,
case SMB_INFO_STANDARD:
case SMB_INFO_QUERY_EA_SIZE:
data_size = (info_level==1?22:26);
- if( lp_win95_bug_compatibility())
- {
- put_dos_date(pdata,l1_fdateCreation,get_create_time(&sbuf));
- put_dos_date(pdata,l1_fdateLastAccess,get_access_time(&sbuf));
- put_dos_date(pdata,l1_fdateLastWrite,sbuf.st_mtime); /* write time */
- }
- else
- {
- put_dos_date2(pdata,l1_fdateCreation,get_create_time(&sbuf));
- put_dos_date2(pdata,l1_fdateLastAccess,get_access_time(&sbuf));
- put_dos_date2(pdata,l1_fdateLastWrite,sbuf.st_mtime); /* write time */
- }
+ put_dos_date2(pdata,l1_fdateCreation,get_create_time(&sbuf));
+ put_dos_date2(pdata,l1_fdateLastAccess,sbuf.st_atime);
+ put_dos_date2(pdata,l1_fdateLastWrite,sbuf.st_mtime); /* write time */
SIVAL(pdata,l1_cbFile,size);
SIVAL(pdata,l1_cbFileAlloc,ROUNDUP(size,1024));
SSVAL(pdata,l1_attrFile,mode);
@@ -1160,7 +1151,7 @@ static int call_trans2qfilepathinfo(char *inbuf, char *outbuf, int length,
case SMB_INFO_QUERY_EAS_FROM_LIST:
data_size = 24;
put_dos_date2(pdata,0,get_create_time(&sbuf));
- put_dos_date2(pdata,4,get_access_time(&sbuf));
+ put_dos_date2(pdata,4,sbuf.st_atime);
put_dos_date2(pdata,8,sbuf.st_mtime);
SIVAL(pdata,12,size);
SIVAL(pdata,16,ROUNDUP(size,1024));
@@ -1178,7 +1169,7 @@ static int call_trans2qfilepathinfo(char *inbuf, char *outbuf, int length,
case SMB_QUERY_FILE_BASIC_INFO:
data_size = 36; /* w95 returns 40 bytes not 36 - why ?. */
put_long_date(pdata,get_create_time(&sbuf));
- put_long_date(pdata+8,get_access_time(&sbuf));
+ put_long_date(pdata+8,sbuf.st_atime);
put_long_date(pdata+16,sbuf.st_mtime); /* write time */
put_long_date(pdata+24,sbuf.st_mtime); /* change time */
SIVAL(pdata,32,mode);
@@ -1187,9 +1178,8 @@ static int call_trans2qfilepathinfo(char *inbuf, char *outbuf, int length,
{
time_t create_time = get_create_time(&sbuf);
DEBUG(5,("create: %s ", ctime(&create_time)));
- create_time = get_access_time(&sbuf);
- DEBUG(5,("access: %s ", ctime(&create_time)));
}
+ DEBUG(5,("access: %s ", ctime(&sbuf.st_atime)));
DEBUG(5,("write: %s ", ctime(&sbuf.st_mtime)));
DEBUG(5,("change: %s ", ctime(&sbuf.st_mtime)));
DEBUG(5,("mode: %x\n", mode));
@@ -1243,7 +1233,7 @@ static int call_trans2qfilepathinfo(char *inbuf, char *outbuf, int length,
case SMB_QUERY_FILE_ALL_INFO:
put_long_date(pdata,get_create_time(&sbuf));
- put_long_date(pdata+8,get_access_time(&sbuf));
+ put_long_date(pdata+8,sbuf.st_atime);
put_long_date(pdata+16,sbuf.st_mtime); /* write time */
put_long_date(pdata+24,sbuf.st_mtime); /* change time */
SIVAL(pdata,32,mode);