miscd.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* Front end to the ULTRIX miscd service. The front end logs the remote host
* after renaming the real miscd daemon to the name defined with the
* REAL_MISCD macro.
*
* Connections and diagnostics are logged through syslog(3).
*
* The Ultrix miscd program implements (among others) the systat service, which
* pipes the output from who(1) to stdout. This information is potentially
* useful to systems crackers.
*
* Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
*/
#ifndef lint
#endif
/* System libraries. */
#include <stdio.h>
#include <syslog.h>
#ifndef MAXPATHNAMELEN
#define MAXPATHNAMELEN BUFSIZ
#endif
#ifndef STDIN_FILENO
#define STDIN_FILENO 0
#endif
/* Local stuff. */
#include "patchlevel.h"
#include "tcpd.h"
int argc;
char **argv;
{
struct request_info request;
char path[MAXPATHNAMELEN];
/* Attempt to prevent the creation of world-writable files. */
#ifdef DAEMON_UMASK
#endif
/*
* Open a channel to the syslog daemon. Older versions of openlog()
* require only two arguments.
*/
#ifdef LOG_MAIL
#else
#endif
/*
* Find out the endpoint addresses of this conversation. Host name
* lookups and double checks will be done on demand.
*/
/*
* Optionally look up and double check the remote host name. Sites
* concerned with security may choose to refuse connections from hosts
* that pretend to have someone elses host name.
*/
#ifdef PARANOID
#endif
/*
* The BSD rlogin and rsh daemons that came out after 4.3 BSD disallow
* socket options at the IP level. They do so for a good reason.
* Unfortunately, we cannot use this with SunOS 4.1.x because the
* getsockopt() system call can panic the system.
*/
#ifdef KILL_IP_OPTIONS
#endif
/*
* Check whether this host can access the service in argv[0]. The
* access-control code invokes optional shell commands as specified in
* the access-control tables.
*/
#ifdef HOSTS_ACCESS
if (!hosts_access(&request))
#endif
/* Report request and invoke the real daemon program. */
closelog();
/* NOTREACHED */
}