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