From 7c57ce41c18765d8f1d0e2783be5c4eed8577b6a Mon Sep 17 00:00:00 2001 From: Mike Swanson Date: Mon, 19 Aug 2019 11:11:04 -0700 Subject: [PATCH] =?UTF-8?q?[programs]=20don=E2=80=99t=20do=20chmod=20on=20?= =?UTF-8?q?destination=20file=20if=20reading=20from=20stdin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #1729 --- programs/fileio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/programs/fileio.c b/programs/fileio.c index 569a410c1a2..f16cbe38596 100644 --- a/programs/fileio.c +++ b/programs/fileio.c @@ -572,8 +572,8 @@ static FILE* FIO_openDstFile(FIO_prefs_t* const prefs, const char* srcFileName, { FILE* const f = fopen( dstFileName, "wb" ); if (f == NULL) { DISPLAYLEVEL(1, "zstd: %s: %s\n", dstFileName, strerror(errno)); - } else { - chmod(dstFileName, 00600); + } else if(srcFileName != NULL && strcmp (srcFileName, stdinmark)) { + chmod(dstFileName, 00600); } return f; }