mirror of
https://github.com/znc/znc.git
synced 2026-08-07 01:13:25 +02:00
Merge pull request #371 from viric/pem_mode
makepem: create pem only rw for the user, on non-win32
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user