mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
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.
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user