inspircd

A modular C++ IRC daemon (ircd). https://www.inspircd.org/
Log | Files | Refs | README

commit 577cc512e4c2be2cfdff0f414f1c3081a414ac7f
parent d4a1ea70451abb333e71f9cff09b624db59531a0
Author: linuxdaemon <linuxdaemon@snoonet.org>
Date:   Thu, 24 Jan 2019 10:55:50 -0600

Don't allow invalid characters in UNIX listener paths.

Diffstat:
Msrc/socket.cpp | 8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)

diff --git a/src/socket.cpp b/src/socket.cpp @@ -107,6 +107,14 @@ int InspIRCd::BindPorts(FailedPortList& failed_ports) continue; } + // Check for characters which are problematic in the IRC message format. + if (path.find_first_of("\n\r\t!@: ") != std::string::npos) + { + this->Logs->Log("SOCKET", LOG_DEFAULT, "UNIX listener on %s at %s specified a path containing invalid characters!", + path.c_str(), tag->getTagLocation().c_str()); + continue; + } + // Create the bindspec manually (aptosa doesn't work with AF_UNIX yet). memset(&bindspec, 0, sizeof(bindspec)); bindspec.un.sun_family = AF_UNIX;