003 File Manager
Current Path:
/usr/src/contrib/tcp_wrappers
usr
/
src
/
contrib
/
tcp_wrappers
/
📁
..
📄
BLURB
(1.7 KB)
📄
Banners.Makefile
(2.17 KB)
📄
CHANGES
(18.75 KB)
📄
DISCLAIMER
(1.21 KB)
📄
Makefile
(32.68 KB)
📄
README
(47.08 KB)
📄
README.IRIX
(2.57 KB)
📄
README.NIS
(6.52 KB)
📄
clean_exit.c
(1.07 KB)
📄
diag.c
(1.44 KB)
📄
environ.c
(4.75 KB)
📄
eval.c
(3.59 KB)
📄
fakelog.c
(1012 B)
📄
fix_options.c
(3.7 KB)
📄
fromhost.c
(1.37 KB)
📄
hosts_access.3
(3.52 KB)
📄
hosts_access.5
(15.97 KB)
📄
hosts_access.c
(14.13 KB)
📄
hosts_ctl.c
(1.08 KB)
📄
hosts_options.5
(6.5 KB)
📄
inetcf.c
(8.03 KB)
📄
inetcf.h
(516 B)
📄
misc.c
(1.9 KB)
📄
miscd.c
(3.07 KB)
📄
mystdarg.h
(571 B)
📄
myvsyslog.c
(766 B)
📄
ncr.c
(2.52 KB)
📄
options.c
(13.85 KB)
📄
patchlevel.h
(88 B)
📄
percent_m.c
(797 B)
📄
percent_x.c
(2.37 KB)
📄
printf.ck
(39 B)
📄
ptx.c
(2.65 KB)
📄
refuse.c
(911 B)
📄
rfc931.c
(5.95 KB)
📄
safe_finger.c
(4.98 KB)
📄
scaffold.c
(6.38 KB)
📄
scaffold.h
(370 B)
📄
setenv.c
(931 B)
📄
shell_cmd.c
(2.13 KB)
📄
socket.c
(12.06 KB)
📄
strcasecmp.c
(3.78 KB)
📄
tcpd.8
(6.86 KB)
📄
tcpd.c
(3.49 KB)
📄
tcpd.h
(8.18 KB)
📄
tcpdchk.8
(2.51 KB)
📄
tcpdchk.c
(12.84 KB)
📄
tcpdmatch.8
(3.18 KB)
📄
tcpdmatch.c
(10.69 KB)
📄
tli-sequent.c
(4.85 KB)
📄
tli-sequent.h
(411 B)
📄
tli.c
(10.34 KB)
📄
try-from.c
(2.01 KB)
📄
update.c
(3.05 KB)
📄
vfprintf.c
(3.12 KB)
📄
workarounds.c
(7.57 KB)
Editing: tcpd.c
/* * General front end for stream and datagram IP services. This program logs * the remote host name and then invokes the real daemon. For example, * install as /usr/etc/{tftpd,fingerd,telnetd,ftpd,rlogind,rshd,rexecd}, * after saving the real daemons in the directory specified with the * REAL_DAEMON_DIR macro. This arrangement requires that the network daemons * are started by inetd or something similar. Connections and diagnostics * are logged through syslog(3). * * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands. * * $FreeBSD$ */ #ifndef lint static char sccsid[] = "@(#) tcpd.c 1.10 96/02/11 17:01:32"; #endif /* System libraries. */ #include <sys/types.h> #include <sys/param.h> #include <sys/stat.h> #include <sys/socket.h> #include <netinet/in.h> #include <stdio.h> #include <syslog.h> #include <string.h> #include <unistd.h> #ifndef MAXPATHNAMELEN #define MAXPATHNAMELEN BUFSIZ #endif #ifndef STDIN_FILENO #define STDIN_FILENO 0 #endif /* Local stuff. */ #include "patchlevel.h" #include "tcpd.h" int allow_severity = SEVERITY; /* run-time adjustable */ int deny_severity = LOG_WARNING; /* ditto */ main(argc, argv) int argc; char **argv; { struct request_info request; char path[MAXPATHNAMELEN]; /* Attempt to prevent the creation of world-writable files. */ #ifdef DAEMON_UMASK umask(DAEMON_UMASK); #endif /* * If argv[0] is an absolute path name, ignore REAL_DAEMON_DIR, and strip * argv[0] to its basename. */ if (argv[0][0] == '/') { strlcpy(path, argv[0], sizeof(path)); argv[0] = strrchr(argv[0], '/') + 1; } else { snprintf(path, sizeof(path), "%s/%s", REAL_DAEMON_DIR, argv[0]); } /* * Open a channel to the syslog daemon. Older versions of openlog() * require only two arguments. */ #ifdef LOG_MAIL (void) openlog(argv[0], LOG_PID, FACILITY); #else (void) openlog(argv[0], LOG_PID); #endif /* * Find out the endpoint addresses of this conversation. Host name * lookups and double checks will be done on demand. */ request_init(&request, RQ_DAEMON, argv[0], RQ_FILE, STDIN_FILENO, 0); fromhost(&request); /* * 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 if (STR_EQ(eval_hostname(request.client), paranoid)) refuse(&request); #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 fix_options(&request); #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)) refuse(&request); #endif /* Report request and invoke the real daemon program. */ #ifdef INET6 syslog(allow_severity, "connect from %s (%s)", eval_client(&request), eval_hostaddr(request.client)); #else syslog(allow_severity, "connect from %s", eval_client(&request)); #endif closelog(); (void) execv(path, argv); syslog(LOG_ERR, "error: cannot execute %s: %m", path); clean_exit(&request); /* NOTREACHED */ }
Upload File
Create Folder