diff --git a/Client.cpp b/Client.cpp index 8720ea21..8271a6e5 100644 --- a/Client.cpp +++ b/Client.cpp @@ -848,6 +848,11 @@ void CClient::UserCommand(const CString& sLine) { return; } + if ((!m_pUser->IsAdmin() && sFile.Left(1) == "~") || sFile.Left(1) == "/" || sFile.find("..") != CString::npos) { + PutStatus("Illegal path."); + return; + } + if (m_pUser) { m_pUser->SendFile(sToNick, sFile); } @@ -859,7 +864,7 @@ void CClient::UserCommand(const CString& sLine) { return; } - if (sFile.find("..") != CString::npos) { + if ((!m_pUser->IsAdmin() && sFile.Left(1) == "~") || sFile.Left(1) == "/" || sFile.find("..") != CString::npos) { PutStatus("Illegal path."); return; }