summaryrefslogtreecommitdiffstats
path: root/contrib/tcp_wrappers/refuse.c
diff options
context:
space:
mode:
authormarkm <markm@FreeBSD.org>1999-03-14 17:13:19 +0000
committermarkm <markm@FreeBSD.org>1999-03-14 17:13:19 +0000
commit06c148304a969b7ab848c2ae00bc474c2f6b87b6 (patch)
tree5c4b2dfe1ca36eeb731956db3380eef1053a2d03 /contrib/tcp_wrappers/refuse.c
downloadFreeBSD-src-06c148304a969b7ab848c2ae00bc474c2f6b87b6.zip
FreeBSD-src-06c148304a969b7ab848c2ae00bc474c2f6b87b6.tar.gz
Clean import of TCP-wrappers by Wietse Venema.
Rest of build to follow.
Diffstat (limited to 'contrib/tcp_wrappers/refuse.c')
-rw-r--r--contrib/tcp_wrappers/refuse.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/contrib/tcp_wrappers/refuse.c b/contrib/tcp_wrappers/refuse.c
new file mode 100644
index 0000000..ccf8030
--- /dev/null
+++ b/contrib/tcp_wrappers/refuse.c
@@ -0,0 +1,32 @@
+ /*
+ * refuse() reports a refused connection, and takes the consequences: in
+ * case of a datagram-oriented service, the unread datagram is taken from
+ * the input queue (or inetd would see the same datagram again and again);
+ * the program is terminated.
+ *
+ * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
+ */
+
+#ifndef lint
+static char sccsid[] = "@(#) refuse.c 1.5 94/12/28 17:42:39";
+#endif
+
+/* System libraries. */
+
+#include <stdio.h>
+#include <syslog.h>
+
+/* Local stuff. */
+
+#include "tcpd.h"
+
+/* refuse - refuse request */
+
+void refuse(request)
+struct request_info *request;
+{
+ syslog(deny_severity, "refused connect from %s", eval_client(request));
+ clean_exit(request);
+ /* NOTREACHED */
+}
+
OpenPOWER on IntegriCloud