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: eval.c
/* * Routines for controlled evaluation of host names, user names, and so on. * They are, in fact, wrappers around the functions that are specific for * the sockets or TLI programming interfaces. The request_info and host_info * structures are used for result cacheing. * * These routines allows us to postpone expensive operations until their * results are really needed. Examples are hostname lookups and double * checks, or username lookups. Information that cannot be retrieved is * given the value "unknown" ("paranoid" in case of hostname problems). * * When ALWAYS_HOSTNAME is off, hostname lookup is done only when required by * tcpd paranoid mode, by access control patterns, or by %letter expansions. * * When ALWAYS_RFC931 mode is off, user lookup is done only when required by * access control patterns or %letter expansions. * * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands. */ #ifndef lint static char sccsid[] = "@(#) eval.c 1.3 95/01/30 19:51:45"; #endif /* System libraries. */ #include <stdio.h> #include <string.h> /* Local stuff. */ #include "tcpd.h" /* * When a string has the value STRING_UNKNOWN, it means: don't bother, I * tried to look up the data but it was unavailable for some reason. When a * host name has the value STRING_PARANOID it means there was a name/address * conflict. */ char unknown[] = STRING_UNKNOWN; char paranoid[] = STRING_PARANOID; /* eval_user - look up user name */ char *eval_user(request) struct request_info *request; { if (request->user[0] == 0) { strcpy(request->user, unknown); if (request->sink == 0 && request->client->sin && request->server->sin) rfc931(request->client->sin, request->server->sin, request->user); } return (request->user); } /* eval_hostaddr - look up printable address */ char *eval_hostaddr(host) struct host_info *host; { if (host->addr[0] == 0) { strcpy(host->addr, unknown); if (host->request->hostaddr != 0) host->request->hostaddr(host); } return (host->addr); } /* eval_hostname - look up host name */ char *eval_hostname(host) struct host_info *host; { if (host->name[0] == 0) { strcpy(host->name, unknown); if (host->request->hostname != 0) host->request->hostname(host); } return (host->name); } /* eval_hostinfo - return string with host name (preferred) or address */ char *eval_hostinfo(host) struct host_info *host; { char *hostname; #ifndef ALWAYS_HOSTNAME /* no implicit host lookups */ if (host->name[0] == 0) return (eval_hostaddr(host)); #endif hostname = eval_hostname(host); if (HOSTNAME_KNOWN(hostname)) { return (host->name); } else { return (eval_hostaddr(host)); } } /* eval_client - return string with as much about the client as we know */ char *eval_client(request) struct request_info *request; { static char both[2 * STRING_LENGTH]; char *hostinfo = eval_hostinfo(request->client); #ifndef ALWAYS_RFC931 /* no implicit user lookups */ if (request->user[0] == 0) return (hostinfo); #endif if (STR_NE(eval_user(request), unknown)) { sprintf(both, "%s@%s", request->user, hostinfo); return (both); } else { return (hostinfo); } } /* eval_server - return string with as much about the server as we know */ char *eval_server(request) struct request_info *request; { static char both[2 * STRING_LENGTH]; char *host = eval_hostinfo(request->server); char *daemon = eval_daemon(request); if (STR_NE(host, unknown)) { sprintf(both, "%s@%s", daemon, host); return (both); } else { return (daemon); } }
Upload File
Create Folder