diff options
author | Roland Reichwein <mail@reichwein.it> | 2020-04-06 19:19:23 +0200 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2020-04-06 19:19:23 +0200 |
commit | 0ff6671cec0bc8db106f094400425ada5d4faf7a (patch) | |
tree | d8e03e9da57cea28b4d090524b10d64f00b0e0e3 /config.cpp | |
parent | 917d4574153fa57ea43e7410006f58aa5b1bbb0b (diff) |
Don't use privileged ports as user
Diffstat (limited to 'config.cpp')
-rw-r--r-- | config.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -87,7 +87,10 @@ void Config::readConfigfile(std::string filename) } else throw std::runtime_error("Unknown element: "s + x.first); } - m_sockets.push_back(socket_struct); + if (geteuid() != 0 && stoi(socket_struct.port) < 1024) + std::cout << "Warning: Skipping privileged port " << socket_struct.port << std::endl; + else + m_sockets.push_back(socket_struct); } } } |