Merge pull request #371 from viric/pem_mode

makepem: create pem only rw for the user, on non-win32
This commit is contained in:
Alexey Sokolov
2013-06-13 13:34:06 -07:00
+9
View File
@@ -263,7 +263,16 @@ bool CZNC::WritePemFile() {
CString sPemFile = GetPemLocation();
CUtils::PrintAction("Writing Pem file [" + sPemFile + "]");
#ifndef _WIN32
int fd = creat(sPemFile.c_str(), 0600);
if (fd == -1) {
CUtils::PrintStatus(false, "Unable to open");
return false;
}
FILE *f = fdopen(fd, "w");
#else
FILE *f = fopen(sPemFile.c_str(), "w");
#endif
if (!f) {
CUtils::PrintStatus(false, "Unable to open");