[Pkg-samba-maint] Bug#458071: Wrong file timestamps on smbfs mounted share when timezone +13

Alex Jenner alexx at orcon.net.nz
Fri Dec 28 12:47:31 UTC 2007


Package: smbfs
Version: 3.0.24-6etch9

When file is created on smbfs mounted share, the file has the wrong
timestamp if timezone +13. e.g. Pacific/Auckland during daylight saving.

To reproduce problem...

Install samba, smbfs and smbclient packages, etc.

Run tzconfig and make timezone: Pacific/Auckland
Set date to summer in New Zealand
  - i.e. some date in December 2007 or Jan/Feb/Mar 2008.

# date; date -u
Fri Dec 28 13:02:36 NZDT 2007
Fri Dec 28 00:02:36 UTC 2007

Edit smb.conf to allow guest login and export the share:

  - In the [global] section...

    guest ok = yes
    guest account = nobody

  - At the end of smb.conf add the following share definition...

  [smbrw]
     comment = Samba server Read-Write share for testing
     writable = yes
     path = /var/tmp/smbrw
     create mask = 0775
     directory mask = 0775

Create SMB export and mount directories:

# mkdir /var/tmp/smbrw
# mkdir /var/tmp/smbrw/tmp
# chmod 777 /var/tmp/smbrw/tmp
# mkdir /var/tmp/mnt_smbrw

Restart samba and mount share for testing:

# /etc/init.d/samba restart
# mount -t smbfs //<hostname>/smbrw /var/tmp/mnt_smbrw -o guest

Change to smbfs mounted directory and test...

# cd /var/tmp/mnt_smbrw/tmp
# date; date -u; touch xxx; ls -a --full-time
Fri Dec 28 13:08:59 NZDT 2007
Fri Dec 28 00:08:59 UTC 2007
total 4
drwxr-xr-x 1 root root    0 2007-12-28 13:08:59.000000000 +1300 .
drwxr-xr-x 1 root root 4096 2007-12-28 13:08:47.079353110 +1300 ..
-rwxr-xr-x 1 root root    0 2007-12-28 00:22:00.000000000 +1300 xxx

  - Note time difference between date command and file timestamp.
  - The file timestamp error is approx 12 h 47 m.

Additional testing...

Stop NTP, umount share and change Timezone

# umount //<hostname>/smbrw
# /etc/init.d/ntp stop
# tzconfig

 - Choose a different timezone e.g. Australia/Sydney

# date; date -u
Fri Dec 28 11:23:22 EST 2007
Fri Dec 28 00:23:22 UTC 2007

Mount share again and repeat test.

# mount -t smbfs //<hostname>/smbrw /var/tmp/mnt_smbrw -o guest
# cd /var/tmp/mnt_smbrw/tmp
# date; date -u; touch xxx; ls -a --full-time
Fri Dec 28 11:29:54 EST 2007
Fri Dec 28 00:29:54 UTC 2007
total 4
drwxr-xr-x 1 root root    0 2007-12-28 11:29:54.000000000 +1100 .
drwxr-xr-x 1 root root 4096 2007-12-28 11:25:26.765938870 +1100 ..
-rwxr-xr-x 1 root root    0 2007-12-28 11:29:54.000000000 +1100 xxx

  - Note: Timestamp of file shows same time as date command.

Umount share, return timezone to Pacific/Auckland and change date.

# cd; umount //<hostname>/smbrw
# tzconfig
# date -u 06060253
Wed Jun  6 14:53:00 UTC 2007

Mount share again and repeat test.

# mount -t smbfs //<hostname>/smbrw /var/tmp/mnt_smbrw -o guest
# cd /var/tmp/mnt_smbrw/tmp
# date; date -u; touch xxx; ls -a --full-time
Wed Jun  6 14:58:09 NZST 2007
Wed Jun  6 02:58:09 UTC 2007
total 4
drwxr-xr-x 1 root root    0 2007-06-06 14:58:09.000000000 +1200 .
drwxr-xr-x 1 root root 4096 2007-06-06 14:56:13.030548470 +1200 ..
-rwxr-xr-x 1 root root    0 2007-06-06 14:58:08.000000000 +1200 xxx

 - Notes:

 - Timestamp of file correct for timezone Pacific/Auckland
   during the winter months only (Timezone +12:00 = NZST).

 - Problem appears when timezone is +13:00 (e.g. NZDT).
 - Problem is not seen if smbclient used to transfer file instead
   of mounting the samba share using mount.smbfs.

 - Kernel version: 2.6.18+6etch2
 - cpu: Pentium II (Deschutes) / 400 MHz / 512 KB cache.

---







More information about the Pkg-samba-maint mailing list