Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Implement permission inheritance in log module

Quick-and-dirty matching of permissions when new log directories are
created. Currently gets tripped up by the umask with some perms.
  • Loading branch information...
commit 3e1a2d9ea72dd3dbf9562094db4d322c4fc92303 1 parent cec2fa6
@dgw dgw authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 modules/log.cpp
4 modules/log.cpp
@@ -97,7 +97,9 @@ void CLogMod::PutLog(const CString& sLine, const CString& sWindow /*= "Status"*/
CFile LogFile(sPath);
CString sLogDir = LogFile.GetDir();
- if (!CFile::Exists(sLogDir)) CDir::MakeDir(sLogDir);
+ struct stat ModDirInfo;
+ CFile::GetInfo(GetSavePath(), ModDirInfo);
+ if (!CFile::Exists(sLogDir)) CDir::MakeDir(sLogDir, ModDirInfo.st_mode);
if (LogFile.Open(O_WRONLY | O_APPEND | O_CREAT))
LogFile.Write(CUtils::FormatTime(curtime, "[%H:%M:%S] ", m_pUser->GetTimezone()) + (m_bSanitize ? sLine.StripControls_n() : sLine) + "\n");

0 comments on commit 3e1a2d9

Please sign in to comment.
Something went wrong with that request. Please try again.