From e10b9a1ef55b8106797a4bd34a3d811568a1f09d Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Sat, 15 Jun 2013 21:15:38 +0400 Subject: [PATCH] Don't make backup of znc.conf readable by everyone. It doesn't really matter, since the whole ~/.znc/ is not readable, but it's better to be safe. --- src/FileUtils.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/FileUtils.cpp b/src/FileUtils.cpp index a58a1e13..22795313 100644 --- a/src/FileUtils.cpp +++ b/src/FileUtils.cpp @@ -249,6 +249,10 @@ bool CFile::Copy(const CString& sOldFileName, const CString& sNewFileName, bool OldFile.Close(); NewFile.Close(); + struct stat st; + GetInfo(sOldFileName, st); + Chmod(sNewFileName, st.st_mode); + return true; }