From: <ps...@us...> - 2009-01-02 17:48:27
|
Revision: 1318 http://znc.svn.sourceforge.net/znc/?rev=1318&view=rev Author: psychon Date: 2009-01-02 17:48:20 +0000 (Fri, 02 Jan 2009) Log Message: ----------- access() is evil and we never want a controlling TTY Modified Paths: -------------- trunk/FileUtils.cpp trunk/FileUtils.h Modified: trunk/FileUtils.cpp =================================================================== --- trunk/FileUtils.cpp 2009-01-01 12:22:21 UTC (rev 1317) +++ trunk/FileUtils.cpp 2009-01-02 17:48:20 UTC (rev 1318) @@ -65,8 +65,6 @@ bool CFile::IsLnk(bool bUseLstat) const { return CFile::IsLnk(m_sLongName, bUseLstat); } bool CFile::IsSock(bool bUseLstat) const { return CFile::IsSock(m_sLongName, bUseLstat); } -bool CFile::access(int mode) { return (::access(m_sLongName.c_str(), mode) == 0); } - // for gettin file types, using fstat instead bool CFile::FType(const CString sFileName, EFileTypes eType, bool bUseLstat) { struct stat st; @@ -261,7 +259,8 @@ return false; } - m_iFD = open(m_sLongName.c_str(), iFlags, iMode); + // We never want to get a controlling TTY through this -> O_NOCTTY + m_iFD = open(m_sLongName.c_str(), iFlags | O_NOCTTY, iMode); if (m_iFD < 0) return false; Modified: trunk/FileUtils.h =================================================================== --- trunk/FileUtils.h 2009-01-01 12:22:21 UTC (rev 1317) +++ trunk/FileUtils.h 2009-01-02 17:48:20 UTC (rev 1318) @@ -60,8 +60,6 @@ bool IsLnk(bool bUseLstat = true) const; bool IsSock(bool bUseLstat = false) const; - bool access(int mode); - // for gettin file types, using fstat instead static bool FType(const CString sFileName, EFileTypes eType, bool bUseLstat = false); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |