summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlinuxdaemon <linuxdaemon@snoonet.org>2019-01-24 10:55:50 -0600
committerPeter Powell <petpow@saberuk.com>2019-02-06 10:45:58 +0000
commit577cc512e4c2be2cfdff0f414f1c3081a414ac7f (patch)
treecb33432e19cd25c17315baf06b6df6486bc72e90
parentd4a1ea70451abb333e71f9cff09b624db59531a0 (diff)
Don't allow invalid characters in UNIX listener paths.
-rw-r--r--src/socket.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/socket.cpp b/src/socket.cpp
index b33664f84..580d3ba49 100644
--- 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;