[ftp] Fix wrong access time in Ftp::ftpCopyGet()
ClosedPublic

Authored by wbauer on Jun 21 2019, 9:40 AM.

Details

Summary

sPartInfo refers to the .part file which might not exist in the first place, resulting in a wrong/invalid access time.
To avoid this, take the access time from the actual destination file instead.

CCBUG: 374420

Test Plan

Run kioclient5 copy "ftp://upload.kde.org/README" /tmp/file and check the times with stat.

Before:
$ kioclient5 copy "ftp://upload.kde.org/README" /tmp/file
$ LANG=C stat /tmp/file

File: /tmp/file
Size: 594             Blocks: 8          IO Block: 4096   regular file

Device: 39h/57d Inode: 91811 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ wolfi) Gid: ( 100/ users)
Access: 1970-01-01 00:00:00.000000000 +0100
Modify: 2013-04-27 00:00:00.000000000 +0200
Change: 2019-06-21 11:09:38.980032795 +0200
Birth: -

(note the "Access" time)

With this patch:
$ kioclient5 copy "ftp://upload.kde.org/README" /tmp/file
$ LANG=C stat /tmp/file

File: /tmp/file
Size: 594             Blocks: 8          IO Block: 4096   regular file

Device: 39h/57d Inode: 91947 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ wolfi) Gid: ( 100/ users)
Access: 2019-06-21 11:28:49.000000000 +0200
Modify: 2013-04-27 00:00:00.000000000 +0200
Change: 2019-06-21 11:28:49.529808792 +0200
Birth: -

Diff Detail

Repository
R241 KIO
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
wbauer created this revision.Jun 21 2019, 9:40 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald TranscriptJun 21 2019, 9:40 AM
wbauer requested review of this revision.Jun 21 2019, 9:40 AM
wbauer added a subscriber: dfaure.Jul 3 2019, 7:34 PM
dfaure accepted this revision.Jul 3 2019, 8:03 PM
This revision is now accepted and ready to land.Jul 3 2019, 8:03 PM
This revision was automatically updated to reflect the committed changes.