summaryrefslogtreecommitdiff
path: root/source3/smbd/reply.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-11-05 04:21:55 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:05:19 -0500
commit6d5757395a0e54245543794d0d6d6d6a32cd857a (patch)
treecdf48f97df8be03543172690524ddf6332a389a2 /source3/smbd/reply.c
parent65ed4d3efda243f526131fd145c72647785f9906 (diff)
downloadsamba-6d5757395a0e54245543794d0d6d6d6a32cd857a.tar.gz
samba-6d5757395a0e54245543794d0d6d6d6a32cd857a.tar.bz2
samba-6d5757395a0e54245543794d0d6d6d6a32cd857a.zip
r11511: A classic "friday night check-in" :-). This moves much
of the Samba4 timezone handling code back into Samba3. Gets rid of "kludge-gmt" and removes the effectiveness of the parameter "time offset" (I can add this back in very easily if needed) - it's no longer being looked at. I'm hoping this will fix the problems people have been having with DST transitions. I'll start comprehensive testing tomorrow, but for now all modifications are done. Splits time get/set functions into srv_XXX and cli_XXX as they need to look at different timezone offsets. Get rid of much of the "efficiency" cruft that was added to Samba back in the day when the C library timezone handling functions were slow. Jeremy. (This used to be commit 414303bc0272f207046b471a0364fa296b67c1f8)
Diffstat (limited to 'source3/smbd/reply.c')
-rw-r--r--source3/smbd/reply.c38
1 files changed, 20 insertions, 18 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index f83b0ff746..81240fcb92 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -914,14 +914,16 @@ int reply_getatr(connection_struct *conn, char *inbuf,char *outbuf, int dum_size
outsize = set_message(outbuf,10,0,True);
SSVAL(outbuf,smb_vwv0,mode);
- if(lp_dos_filetime_resolution(SNUM(conn)) )
- put_dos_date3(outbuf,smb_vwv1,mtime & ~1);
- else
- put_dos_date3(outbuf,smb_vwv1,mtime);
+ if(lp_dos_filetime_resolution(SNUM(conn)) ) {
+ srv_put_dos_date3(outbuf,smb_vwv1,mtime & ~1);
+ } else {
+ srv_put_dos_date3(outbuf,smb_vwv1,mtime);
+ }
SIVAL(outbuf,smb_vwv3,(uint32)size);
- if (Protocol >= PROTOCOL_NT1)
+ if (Protocol >= PROTOCOL_NT1) {
SSVAL(outbuf,smb_flg2,SVAL(outbuf, smb_flg2) | FLAGS2_IS_LONG_NAME);
+ }
DEBUG( 3, ( "getatr name=%s mode=%d size=%d\n", fname, mode, (uint32)size ) );
@@ -963,7 +965,7 @@ int reply_setatr(connection_struct *conn, char *inbuf,char *outbuf, int dum_size
}
mode = SVAL(inbuf,smb_vwv0);
- mtime = make_unix_date3(inbuf+smb_vwv1);
+ mtime = srv_make_unix_date3(inbuf+smb_vwv1);
if (mode != FILE_ATTRIBUTE_NORMAL) {
if (VALID_STAT_OF_DIR(sbuf))
@@ -1393,9 +1395,9 @@ int reply_open(connection_struct *conn, char *inbuf,char *outbuf, int dum_size,
SSVAL(outbuf,smb_vwv0,fsp->fnum);
SSVAL(outbuf,smb_vwv1,fattr);
if(lp_dos_filetime_resolution(SNUM(conn)) ) {
- put_dos_date3(outbuf,smb_vwv2,mtime & ~1);
+ srv_put_dos_date3(outbuf,smb_vwv2,mtime & ~1);
} else {
- put_dos_date3(outbuf,smb_vwv2,mtime);
+ srv_put_dos_date3(outbuf,smb_vwv2,mtime);
}
SIVAL(outbuf,smb_vwv4,(uint32)size);
SSVAL(outbuf,smb_vwv6,deny_mode);
@@ -1563,9 +1565,9 @@ int reply_open_and_X(connection_struct *conn, char *inbuf,char *outbuf,int lengt
SSVAL(outbuf,smb_vwv2,fsp->fnum);
SSVAL(outbuf,smb_vwv3,fattr);
if(lp_dos_filetime_resolution(SNUM(conn)) ) {
- put_dos_date3(outbuf,smb_vwv4,mtime & ~1);
+ srv_put_dos_date3(outbuf,smb_vwv4,mtime & ~1);
} else {
- put_dos_date3(outbuf,smb_vwv4,mtime);
+ srv_put_dos_date3(outbuf,smb_vwv4,mtime);
}
SIVAL(outbuf,smb_vwv6,(uint32)size);
SSVAL(outbuf,smb_vwv8,GET_OPENX_MODE(deny_mode));
@@ -3272,7 +3274,7 @@ int reply_close(connection_struct *conn, char *inbuf,char *outbuf, int size,
* Take care of any time sent in the close.
*/
- mtime = make_unix_date3(inbuf+smb_vwv1);
+ mtime = srv_make_unix_date3(inbuf+smb_vwv1);
fsp_set_pending_modtime(fsp, mtime);
/*
@@ -3322,7 +3324,7 @@ int reply_writeclose(connection_struct *conn,
numtowrite = SVAL(inbuf,smb_vwv1);
startpos = IVAL_TO_SMB_OFF_T(inbuf,smb_vwv2);
- mtime = make_unix_date3(inbuf+smb_vwv4);
+ mtime = srv_make_unix_date3(inbuf+smb_vwv4);
data = smb_buf(inbuf) + 1;
if (numtowrite && is_locked(fsp,conn,(SMB_BIG_UINT)numtowrite,(SMB_BIG_UINT)startpos, WRITE_LOCK)) {
@@ -3639,7 +3641,7 @@ int reply_printqueue(connection_struct *conn,
for (i=first;i<first+num_to_get;i++) {
- put_dos_date2(p,0,queue[i].time);
+ srv_put_dos_date2(p,0,queue[i].time);
SCVAL(p,4,(queue[i].status==LPQ_PRINTING?2:3));
SSVAL(p,5, queue[i].job);
SIVAL(p,7,queue[i].size);
@@ -5444,8 +5446,8 @@ int reply_setattrE(connection_struct *conn, char *inbuf,char *outbuf, int size,
* time as UNIX can't set this.
*/
- unix_times.actime = make_unix_date2(inbuf+smb_vwv3);
- unix_times.modtime = make_unix_date2(inbuf+smb_vwv5);
+ unix_times.actime = srv_make_unix_date2(inbuf+smb_vwv3);
+ unix_times.modtime = srv_make_unix_date2(inbuf+smb_vwv5);
/*
* Patch from Ray Frush <frush@engr.colostate.edu>
@@ -5713,10 +5715,10 @@ int reply_getattrE(connection_struct *conn, char *inbuf,char *outbuf, int size,
* this.
*/
- put_dos_date2(outbuf,smb_vwv0,get_create_time(&sbuf,lp_fake_dir_create_times(SNUM(conn))));
- put_dos_date2(outbuf,smb_vwv2,sbuf.st_atime);
+ srv_put_dos_date2(outbuf,smb_vwv0,get_create_time(&sbuf,lp_fake_dir_create_times(SNUM(conn))));
+ srv_put_dos_date2(outbuf,smb_vwv2,sbuf.st_atime);
/* Should we check pending modtime here ? JRA */
- put_dos_date2(outbuf,smb_vwv4,sbuf.st_mtime);
+ srv_put_dos_date2(outbuf,smb_vwv4,sbuf.st_mtime);
if (mode & aDIR) {
SIVAL(outbuf,smb_vwv6,0);