|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T r
Length: 1368 (0x558)
Types: TextFile
Names: »refuse.c«
└─⟦4f9d7c866⟧ Bits:30007245 EUUGD6: Sikkerheds distributionen
└─⟦62b59102f⟧ »./log_tcp/3.1.tar.Z«
└─⟦1de3ed35f⟧
└─⟦this⟧ »log_tcp/refuse.c«
#if defined(PARANOID) || defined(HOSTS_ACCESS)
/*
* refuse - do the necessary cleanup if we refuse service to some host. This
* code is never invoked when access control and protection against bad host
* names are disabled.
*
* Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
*/
#ifndef lint
static char sccsid[] = "@(#) refuse.c 1.1 91/10/02 23:01:53";
#endif
/* System libraries. */
#include <sys/types.h>
#include <sys/param.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <stdio.h>
#include <syslog.h>
extern void exit();
/* Local stuff. */
#include "log_tcp.h"
/* refuse - refuse request from bad host */
void refuse(f)
struct from_host *f;
{
char buf[BUFSIZ];
struct sockaddr sa;
int size = sizeof(sa);
syslog(LOG_WARNING, "refused connect from %s", f->source);
/*
* In the case of non-connection-oriented services we must discard the
* packet sent by the client. Otherwise, a fresh daemon will be started
* each time the present one exits. Some systems insist on a non-zero
* source address argument in the recvfrom() call below.
*/
if (f->sock_type == FROM_UNCONNECTED)
(void) recvfrom(0, buf, sizeof(buf), 0, &sa, &size);
/* Terminate with zero exit status to keep the inetd happy. */
exit(0);
}
#endif