]> git.ipfire.org Git - thirdparty/zstd.git/commit
[programs] set chmod 600 after opening destination file
authorMike Swanson <mikeonthecomputer@gmail.com>
Sun, 9 Jun 2019 04:54:02 +0000 (21:54 -0700)
committerMike Swanson <mikeonthecomputer@gmail.com>
Sun, 9 Jun 2019 04:54:02 +0000 (21:54 -0700)
commit3968160a916a759c3d3418da533e1b4f8b795343
treec21e173109e20013d6c1b76973f8b0a73ed556ba
parentd06c15cc8957862b26665b68e86c20cc5ab2ca6a
[programs] set chmod 600 after opening destination file

This resolves a race condition where zstd or unzstd may expose read
permissions beyond the original file allowed.  Mode 600 is used
temporarily during the compression and decompression write stage
and the new file inherits the original file’s mode at the end.

Fixes #1630
programs/fileio.c