From 1cae2ac905cc3e4b6e4c92ec4d64c582cfad8fea Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 27 Aug 2008 15:06:14 -0700 Subject: Add st_birthtime and friends for accurate create times on systems that support it (*BSD and MacOSX). Should have done this ages ago, sorry. Jeremy. (This used to be commit 4c3a9558906f213948c3bdc081be73f8fed148cb) --- source3/smbd/reply.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source3/smbd/reply.c') diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 06aa835cb0..ff38ac88cf 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -7126,6 +7126,7 @@ void reply_getattrE(struct smb_request *req) SMB_STRUCT_STAT sbuf; int mode; files_struct *fsp; + struct timespec create_ts; START_PROFILE(SMBgetattrE); @@ -7160,9 +7161,9 @@ void reply_getattrE(struct smb_request *req) reply_outbuf(req, 11, 0); - srv_put_dos_date2((char *)req->outbuf, smb_vwv0, - get_create_time(&sbuf, - lp_fake_dir_create_times(SNUM(conn)))); + create_ts = get_create_timespec(&sbuf, + lp_fake_dir_create_times(SNUM(conn))); + srv_put_dos_date2((char *)req->outbuf, smb_vwv0, create_ts.tv_sec); srv_put_dos_date2((char *)req->outbuf, smb_vwv2, sbuf.st_atime); /* Should we check pending modtime here ? JRA */ srv_put_dos_date2((char *)req->outbuf, smb_vwv4, sbuf.st_mtime); -- cgit From edd16eaa90df96f58ba1c224ca9316ccc0e2210d Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 1 Sep 2008 18:42:44 +0200 Subject: Slightly simplify logic: remove an else branch (This used to be commit 56ecec50130aa948a431427285aed4b28a5647e8) --- source3/smbd/reply.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'source3/smbd/reply.c') diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index ff38ac88cf..16f8a5b177 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -3264,25 +3264,22 @@ normal_read: } TALLOC_FREE(req->outbuf); return; - } else { - reply_outbuf(req, 12, smb_maxcnt); + } - nread = read_file(fsp, smb_buf(req->outbuf), startpos, - smb_maxcnt); - if (nread < 0) { - reply_unixerror(req, ERRDOS, ERRnoaccess); - return; - } + reply_outbuf(req, 12, smb_maxcnt); - setup_readX_header((char *)req->outbuf, nread); + nread = read_file(fsp, smb_buf(req->outbuf), startpos, smb_maxcnt); + if (nread < 0) { + reply_unixerror(req, ERRDOS, ERRnoaccess); + return; + } - DEBUG( 3, ( "send_file_readX fnum=%d max=%d nread=%d\n", - fsp->fnum, (int)smb_maxcnt, (int)nread ) ); + setup_readX_header((char *)req->outbuf, nread); - chain_reply(req); + DEBUG( 3, ( "send_file_readX fnum=%d max=%d nread=%d\n", + fsp->fnum, (int)smb_maxcnt, (int)nread ) ); - return; - } + chain_reply(req); } /**************************************************************************** -- cgit