summaryrefslogtreecommitdiff
path: root/src/output
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2018-12-28 14:16:02 +0100
committerMax Kellermann <max@musicpd.org>2018-12-28 14:16:02 +0100
commit22e6d95c4bbae15dd7f635eabe5fdde1ce06ba73 (patch)
tree30015237746efc3de22232ac012c2acf57ece4fb /src/output
parent1c7bd7d5c4ff7afaecf4a68978ae53e9d2094026 (diff)
remove libwrap support
libwrap is an obscure artefact from a past long ago, when source IP address meant something. And its API is "interesting"; it requires the application to expose two global variables `allow_severity` and `deny_severity`. This led to bug #437. I don't want to declare those variables; instead, I'd like to remove libwrap support. Closes #437
Diffstat (limited to 'src/output')
-rw-r--r--src/output/plugins/httpd/HttpdOutputPlugin.cxx30
-rw-r--r--src/output/plugins/meson.build2
2 files changed, 2 insertions, 30 deletions
diff --git a/src/output/plugins/httpd/HttpdOutputPlugin.cxx b/src/output/plugins/httpd/HttpdOutputPlugin.cxx
index 37062f7dd..1c6ad849d 100644
--- a/src/output/plugins/httpd/HttpdOutputPlugin.cxx
+++ b/src/output/plugins/httpd/HttpdOutputPlugin.cxx
@@ -40,11 +40,6 @@
#include <string.h>
#include <errno.h>
-#ifdef HAVE_LIBWRAP
-#include <sys/socket.h> /* needed for AF_LOCAL */
-#include <tcpd.h>
-#endif
-
const Domain httpd_output_domain("httpd_output");
inline
@@ -130,34 +125,11 @@ HttpdOutput::OnDeferredBroadcast() noexcept
void
HttpdOutput::OnAccept(UniqueSocketDescriptor fd,
- SocketAddress address, gcc_unused int uid) noexcept
+ SocketAddress, gcc_unused int uid) noexcept
{
/* the listener socket has become readable - a client has
connected */
-#ifdef HAVE_LIBWRAP
- if (address.GetFamily() != AF_LOCAL) {
- const auto hostaddr = ToString(address);
- // TODO: shall we obtain the program name from argv[0]?
- const char *progname = "mpd";
-
- struct request_info req;
- request_init(&req, RQ_FILE, fd.Get(), RQ_DAEMON, progname, 0);
-
- fromhost(&req);
-
- if (!hosts_access(&req)) {
- /* tcp wrappers says no */
- FormatWarning(httpd_output_domain,
- "libwrap refused connection (libwrap=%s) from %s",
- progname, hostaddr.c_str());
- return;
- }
- }
-#else
- (void)address;
-#endif /* HAVE_WRAP */
-
const std::lock_guard<Mutex> protect(mutex);
/* can we allow additional client */
diff --git a/src/output/plugins/meson.build b/src/output/plugins/meson.build
index 7b5ea8bb8..65883323b 100644
--- a/src/output/plugins/meson.build
+++ b/src/output/plugins/meson.build
@@ -38,7 +38,7 @@ if get_option('httpd')
'httpd/HttpdClient.cxx',
'httpd/HttpdOutputPlugin.cxx',
]
- output_plugins_deps += [ event_dep, net_dep, libwrap_dep ]
+ output_plugins_deps += [ event_dep, net_dep ]
need_encoder = true
endif