Bug 7785 - atime limit
Summary: atime limit
Status: RESOLVED FIXED
Alias: None
Product: Samba 3.5
Classification: Unclassified
Component: File services (show other bugs)
Version: 3.5.3
Hardware: x64 Linux
: P3 normal
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-10 04:17 UTC by Gradimir
Modified: 2011-11-02 09:44 UTC (History)
1 user (show)

See Also:


Attachments
git am patch for 3.5.x. (1.68 KB, patch)
2010-11-23 13:18 UTC, Jeremy Allison
vl: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gradimir 2010-11-10 04:17:55 UTC
We are running an archiving protocol over CIFS and file's last access time is assigned a new meaning (it means file retention), so the values received on the server side should be allowed to go far into the future. But although we are running on x64, samba will impose limit of Jan 2038 (31bit, signed int). This is done in nt_time_to_unix_timespec:
if (d >= (int64_t)TIME_T_MAX) {
        ret.tv_sec = TIME_T_MAX; ...
and:
/*
 * we use the INT32_MAX here as on 64 bit systems,
 * gmtime() fails with INT64_MAX
 */
#ifndef TIME_T_MAX
#define TIME_T_MAX MIN(INT32_MAX,_TYPE_MAXIMUM(time_t))
#endif

From the log, when we tried to set atime 40 years ahead of now:

[2010/11/10 00:15:49.885710,  5] lib/util.c:627(show_msg)
  size=116
  smb_com=0x32
  smb_rcls=0
  smb_reh=0
  smb_err=0
  smb_flg=24
  smb_flg2=51207
  smb_tid=1
  smb_pid=3304
  smb_uid=100
  smb_mid=46080
  smt_wct=15
  smb_vwv[ 0]=    6 (0x6)
  smb_vwv[ 1]=   40 (0x28)
  smb_vwv[ 2]=    2 (0x2)
  smb_vwv[ 3]=    0 (0x0)
  smb_vwv[ 4]=    0 (0x0)
  smb_vwv[ 5]=    0 (0x0)
  smb_vwv[ 6]=    0 (0x0)
  smb_vwv[ 7]=    0 (0x0)
  smb_vwv[ 8]=    0 (0x0)
  smb_vwv[ 9]=    6 (0x6)
  smb_vwv[10]=   68 (0x44)
  smb_vwv[11]=   40 (0x28)
  smb_vwv[12]=   76 (0x4C)
  smb_vwv[13]=    1 (0x1)
  smb_vwv[14]=    8 (0x8)
  smb_bcc=51
[2010/11/10 00:15:49.885862, 10] ../lib/util/util.c:278(_dump_data)
  [0000] 00 00 00 2E 18 EC 03 00   00 00 00 00 00 00 00 00   ........ ........
  [0010] 00 00 00 00 94 74 DC 49   8F 03 02 00 00 00 00 00   .....t.I ........
  [0020] 00 00 00 00 00 00 00 00   00 00 00 00 00 00 00 00   ........ ........
  [0030] 00 00 00                                          ...
[2010/11/10 00:15:49.885932,  3] smbd/process.c:1294(switch_message)
  switch message SMBtrans2 (pid 30707) conn 0x555556026030
[2010/11/10 00:15:49.885950,  4] smbd/uid.c:257(change_to_user)
  change_to_user: Skipping user change - already user
[2010/11/10 00:15:49.885983,  3] smbd/trans2.c:7706(call_trans2setfilepathinfo)
  call_trans2setfilepathinfo(8) pn4/2010/11-09/A/128/A128C362F3D2A94F1F6E54DBCD3
B4931~DD~B8DBA113~00~1.DVSCC (fnum 6190) info_level=1004 totdata=40
[2010/11/10 00:15:49.886006,  3] smbd/trans2.c:7304(smbd_do_setfilepathinfo)
  smbd_do_setfilepathinfo: pn4/2010/11-09/A/128/A128C362F3D2A94F1F6E54DBCD3B4931
~DD~B8DBA113~00~1.DVSCC (fnum 6190) info_level=1004 totdata=40
[2010/11/10 00:15:49.886036,  6] smbd/trans2.c:5502(smb_set_file_dosmode)
  smb_set_file_dosmode: dosmode: 0x0
[2010/11/10 00:15:49.886057, 10] smbd/trans2.c:6287(smb_set_file_basic_info)
  smb_set_file_basic_info: file pn4/2010/11-09/A/128/A128C362F3D2A94F1F6E54DBCD3
B4931~DD~B8DBA113~00~1.DVSCC
[2010/11/10 00:15:49.886075,  5] smbd/trans2.c:5420(smb_set_file_time)
  smb_set_filetime: actime: Tue Jan 19 11:14:07 2038
Comment 1 Jeremy Allison 2010-11-23 13:18:02 UTC
Created attachment 6082 [details]
git am patch for 3.5.x.

Fix for 3.5.x.
Jeremy.
Comment 2 Volker Lendecke 2010-11-24 06:19:58 UTC
Comment on attachment 6082 [details]
git am patch for 3.5.x.

Looks good
Comment 3 Karolin Seeger 2010-11-24 11:02:31 UTC
Pushed to v3-5-test.
Closing out bug report.

Thanks!
Comment 4 Roel van Meer 2011-11-02 09:44:15 UTC
This patch had side effects: see bug 8561.