E17: fix race condition when copying a file

during the copy, the file can be accessed by users.
See http://cwe.mitre.org/data/definitions/689.html
So we apply the access rights after the creation of
the dest file.

Patch by Maxime Villard


SVN revision: 74284
This commit is contained in:
Vincent Torri 2012-07-21 18:20:19 +00:00
parent 6b430e4489
commit 72c6b4e4a3
1 changed files with 1 additions and 0 deletions

View File

@ -1250,6 +1250,7 @@ _e_fm_op_open_files(E_Fm_Op_Task *task)
data->to = fopen(task->dst.name, "wb");
if (!data->to)
_E_FM_OP_ERROR_SEND_WORK(task, E_FM_OP_ERROR, "Cannot open file '%s' for writing: %s.", task->dst.name);
_e_fm_op_copy_stat_info(task);
}
return 0;