summaryrefslogtreecommitdiff
path: root/refuse.c
diff options
context:
space:
mode:
Diffstat (limited to 'refuse.c')
-rw-r--r--refuse.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/refuse.c b/refuse.c
new file mode 100644
index 0000000..ccf8030
--- /dev/null
+++ b/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 */
+}
+