xref: /illumos-gate/usr/src/lib/libwrap/refuse.c (revision 9164a50bf932130cbb5097a16f6986873ce0e6e5)
1 /*
2  * Copyright 2001 Sun Microsystems, Inc.  All rights reserved.
3  * Use is subject to license terms.
4  */
5 
6  /*
7   * refuse() reports a refused connection, and takes the consequences: in
8   * case of a datagram-oriented service, the unread datagram is taken from
9   * the input queue (or inetd would see the same datagram again and again);
10   * the program is terminated.
11   *
12   * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
13   */
14 
15 #ifndef lint
16 static char sccsid[] = "@(#) refuse.c 1.5 94/12/28 17:42:39";
17 #endif
18 
19 /* System libraries. */
20 
21 #include <stdio.h>
22 #include <syslog.h>
23 
24 /* Local stuff. */
25 
26 #include "tcpd.h"
27 
28 /* refuse - refuse request */
29 
30 void    refuse(request)
31 struct request_info *request;
32 {
33     syslog(deny_severity, "refused connect from %s", eval_client(request));
34     clean_exit(request);
35     /* NOTREACHED */
36 }
37 
38