]> git.kaiwu.me - nginx.git/commit
Dav: changed ngx_copy_file() to preserve access and mtime.
authorMaxim Dounin <mdounin@mdounin.ru>
Tue, 31 Jul 2018 23:12:11 +0000 (02:12 +0300)
committerMaxim Dounin <mdounin@mdounin.ru>
Tue, 31 Jul 2018 23:12:11 +0000 (02:12 +0300)
commit9e0d1236f16ad51828b91ca2ded211c9a96cba72
tree3326f6d6d82f44685bcf12eb67ce63fbafa6357d
parent6bff9c9967dcac5fa03a0c1de6af0a1285c3d829
Dav: changed ngx_copy_file() to preserve access and mtime.

This fixes wrong permissions and file time after cross-device MOVE
in the DAV module (ticket #1577).  Broken in 8101d9101ed8 (0.8.9) when
cross-device copying was introduced in ngx_ext_rename_file().

With this change, ngx_copy_file() always calls ngx_set_file_time(),
either with the time provided, or with the time from the original file.
This is considered acceptable given that copying the file is costly anyway,
and optimizing cases when we do not need to preserve time will require
interface changes.
src/core/ngx_file.c