1*7c478bd9Sstevel@tonic-gate# 2*7c478bd9Sstevel@tonic-gate# Copyright 2004 Sun Microsystems, Inc. All rights reserved. 3*7c478bd9Sstevel@tonic-gate# Use is subject to license terms. 4*7c478bd9Sstevel@tonic-gate# 5*7c478bd9Sstevel@tonic-gate# ident "%Z%%M% %I% %E% SMI" 6*7c478bd9Sstevel@tonic-gate# 7*7c478bd9Sstevel@tonic-gate 8*7c478bd9Sstevel@tonic-gateLIBRARY = libwrap.a 9*7c478bd9Sstevel@tonic-gateMAJOR = .1 10*7c478bd9Sstevel@tonic-gateMINOR = .0 11*7c478bd9Sstevel@tonic-gateVERS = $(MAJOR)$(MINOR) 12*7c478bd9Sstevel@tonic-gateOBJECTS = hosts_access.o options.o shell_cmd.o rfc931.o eval.o \ 13*7c478bd9Sstevel@tonic-gate hosts_ctl.o refuse.o percent_x.o clean_exit.o \ 14*7c478bd9Sstevel@tonic-gate fromhost.o fix_options.o socket.o tli.o workarounds.o \ 15*7c478bd9Sstevel@tonic-gate update.o misc.o diag.o percent_m.o 16*7c478bd9Sstevel@tonic-gate 17*7c478bd9Sstevel@tonic-gateinclude ../../Makefile.lib 18*7c478bd9Sstevel@tonic-gate 19*7c478bd9Sstevel@tonic-gateLIBS = $(DYNLIB) $(LINTLIB) 20*7c478bd9Sstevel@tonic-gateROOTLIBDIR = $(ROOTSFWLIB) 21*7c478bd9Sstevel@tonic-gateSONAME = $(LIBRARY:.a=.so)$(MAJOR) 22*7c478bd9Sstevel@tonic-gateROOTLINKS += $(ROOTLIBDIR)/$(LIBLINKS)$(MAJOR) 23*7c478bd9Sstevel@tonic-gateSRCDIR = .. 24*7c478bd9Sstevel@tonic-gate$(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) 25*7c478bd9Sstevel@tonic-gateDYNFLAGS += -M $(SRCDIR)/mapfile 26*7c478bd9Sstevel@tonic-gateLDLIBS += -lsocket -lnsl -lc 27*7c478bd9Sstevel@tonic-gate 28*7c478bd9Sstevel@tonic-gateCPPFLAGS += $(NETGROUP) $(TLI) $(ALWAYS_HOSTNAME) $(AUTH) \ 29*7c478bd9Sstevel@tonic-gate $(STYLE) $(TABLES) $(DOT) $(BUGS) \ 30*7c478bd9Sstevel@tonic-gate -DRFC931_TIMEOUT=$(RFC931_TIMEOUT) \ 31*7c478bd9Sstevel@tonic-gate -I$(SRCDIR) 32*7c478bd9Sstevel@tonic-gateCFLAGS += $(CCVERBOSE) -erroff=E_FUNC_EXPECTS_TO_RETURN_VALUE \ 33*7c478bd9Sstevel@tonic-gate -erroff=E_IMPLICIT_DECL_FUNC_RETURN_INT \ 34*7c478bd9Sstevel@tonic-gate -erroff=E_OLD_STYLE_DECL_HIDES_PROTO 35*7c478bd9Sstevel@tonic-gate 36*7c478bd9Sstevel@tonic-gateDISTFILES = clean_exit.c diag.c eval.c fix_options.c fromhost.c \ 37*7c478bd9Sstevel@tonic-gate hosts_access.c hosts_ctl.c misc.c mystdarg.h options.c \ 38*7c478bd9Sstevel@tonic-gate patchlevel.h percent_m.c percent_x.c refuse.c rfc931.c \ 39*7c478bd9Sstevel@tonic-gate setenv.c shell_cmd.c socket.c tcpd.h tli.c update.c \ 40*7c478bd9Sstevel@tonic-gate workarounds.c 41*7c478bd9Sstevel@tonic-gate 42*7c478bd9Sstevel@tonic-gateROOTSFWSRC = $(ROOTSFWSHSRC)/tcp_wrappers 43*7c478bd9Sstevel@tonic-gateROOTSFWSRCFILES = $(DISTFILES:%=$(ROOTSFWSRC)/%) 44*7c478bd9Sstevel@tonic-gate 45*7c478bd9Sstevel@tonic-gate.KEEP_STATE: 46*7c478bd9Sstevel@tonic-gate 47*7c478bd9Sstevel@tonic-gateall: $(LIBS) 48*7c478bd9Sstevel@tonic-gate 49*7c478bd9Sstevel@tonic-gatelint: lintcheck 50*7c478bd9Sstevel@tonic-gate 51*7c478bd9Sstevel@tonic-gate$(ROOTLIBS): $(ROOTLIBDIR) 52*7c478bd9Sstevel@tonic-gate 53*7c478bd9Sstevel@tonic-gate$(ROOTLIBDIR): $(ROOTSFW) 54*7c478bd9Sstevel@tonic-gate $(INS.dir) 55*7c478bd9Sstevel@tonic-gate 56*7c478bd9Sstevel@tonic-gate$(ROOTLIBDIR)/$(LIBLINKS)$(MAJOR): $(ROOTLIBDIR)/$(LIBLINKS)$(VERS) 57*7c478bd9Sstevel@tonic-gate $(INS.liblink) 58*7c478bd9Sstevel@tonic-gate 59*7c478bd9Sstevel@tonic-gate$(ROOTSFWSRCFILES) := FILEMODE = 0444 60*7c478bd9Sstevel@tonic-gate$(ROOTSFWSRCFILES): $(ROOTSFWSRC) 61*7c478bd9Sstevel@tonic-gate 62*7c478bd9Sstevel@tonic-gate$(ROOTSFWSRC): $(ROOTSFWSHSRC) 63*7c478bd9Sstevel@tonic-gate $(INS.dir) 64*7c478bd9Sstevel@tonic-gate 65*7c478bd9Sstevel@tonic-gate$(ROOTSFWSHSRC): $(ROOTSFW)/share 66*7c478bd9Sstevel@tonic-gate $(INS.dir) 67*7c478bd9Sstevel@tonic-gate 68*7c478bd9Sstevel@tonic-gate$(ROOTSFWSRC)/%: $(SRCDIR)/% 69*7c478bd9Sstevel@tonic-gate $(INS.file) 70*7c478bd9Sstevel@tonic-gate 71*7c478bd9Sstevel@tonic-gate$(ROOTSFW)/share: $(ROOTSFW) 72*7c478bd9Sstevel@tonic-gate $(INS.dir) 73*7c478bd9Sstevel@tonic-gate 74*7c478bd9Sstevel@tonic-gate$(ROOTSFW): 75*7c478bd9Sstevel@tonic-gate $(INS.dir) 76*7c478bd9Sstevel@tonic-gate 77*7c478bd9Sstevel@tonic-gateinclude ../../Makefile.targ 78*7c478bd9Sstevel@tonic-gate 79*7c478bd9Sstevel@tonic-gate 80*7c478bd9Sstevel@tonic-gate# The rest of this file contains definitions more-or-less directly from the 81*7c478bd9Sstevel@tonic-gate# original Makefile of the tcp_wrappers distribution. 82*7c478bd9Sstevel@tonic-gate 83*7c478bd9Sstevel@tonic-gate############################## 84*7c478bd9Sstevel@tonic-gate# System parameters appropriate for Solaris 9 85*7c478bd9Sstevel@tonic-gate 86*7c478bd9Sstevel@tonic-gateTLI = -DTLI 87*7c478bd9Sstevel@tonic-gateBUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DLIBC_CALLS_STRTOK 88*7c478bd9Sstevel@tonic-gateNETGROUP = -DNETGROUP 89*7c478bd9Sstevel@tonic-gate 90*7c478bd9Sstevel@tonic-gate############################## 91*7c478bd9Sstevel@tonic-gate# Start of the optional stuff. 92*7c478bd9Sstevel@tonic-gate 93*7c478bd9Sstevel@tonic-gate########################################### 94*7c478bd9Sstevel@tonic-gate# Optional: Turning on language extensions 95*7c478bd9Sstevel@tonic-gate# 96*7c478bd9Sstevel@tonic-gate# Instead of the default access control language that is documented in 97*7c478bd9Sstevel@tonic-gate# the hosts_access.5 document, the wrappers can be configured to 98*7c478bd9Sstevel@tonic-gate# implement an extensible language documented in the hosts_options.5 99*7c478bd9Sstevel@tonic-gate# document. This language is implemented by the "options.c" source 100*7c478bd9Sstevel@tonic-gate# module, which also gives hints on how to add your own extensions. 101*7c478bd9Sstevel@tonic-gate# Uncomment the next definition to turn on the language extensions 102*7c478bd9Sstevel@tonic-gate# (examples: allow, deny, banners, twist and spawn). 103*7c478bd9Sstevel@tonic-gate# 104*7c478bd9Sstevel@tonic-gateSTYLE = -DPROCESS_OPTIONS # Enable language extensions. 105*7c478bd9Sstevel@tonic-gate 106*7c478bd9Sstevel@tonic-gate########################### 107*7c478bd9Sstevel@tonic-gate# Optional: Reduce DNS load 108*7c478bd9Sstevel@tonic-gate# 109*7c478bd9Sstevel@tonic-gate# When looking up the address for a host.domain name, the typical DNS 110*7c478bd9Sstevel@tonic-gate# code will first append substrings of your own domain, so it tries 111*7c478bd9Sstevel@tonic-gate# host.domain.your.own.domain, then host.domain.own.domain, and then 112*7c478bd9Sstevel@tonic-gate# host.domain. The APPEND_DOT feature stops this waste of cycles. It is 113*7c478bd9Sstevel@tonic-gate# off by default because it causes problems on sites that don't use DNS 114*7c478bd9Sstevel@tonic-gate# and with Solaris < 2.4. APPEND_DOT will not work with hostnames taken 115*7c478bd9Sstevel@tonic-gate# from /etc/hosts or from NIS maps. It does work with DNS through NIS. 116*7c478bd9Sstevel@tonic-gate# 117*7c478bd9Sstevel@tonic-gate# DOT= -DAPPEND_DOT 118*7c478bd9Sstevel@tonic-gate 119*7c478bd9Sstevel@tonic-gate################################################## 120*7c478bd9Sstevel@tonic-gate# Optional: Always attempt remote username lookups 121*7c478bd9Sstevel@tonic-gate# 122*7c478bd9Sstevel@tonic-gate# By default, the wrappers look up the remote username only when the 123*7c478bd9Sstevel@tonic-gate# access control rules require them to do so. 124*7c478bd9Sstevel@tonic-gate# 125*7c478bd9Sstevel@tonic-gate# Username lookups require that the remote host runs a daemon that 126*7c478bd9Sstevel@tonic-gate# supports an RFC 931 like protocol. Remote user name lookups are not 127*7c478bd9Sstevel@tonic-gate# possible for UDP-based connections, and can cause noticeable delays 128*7c478bd9Sstevel@tonic-gate# with connections from non-UNIX PCs. On some systems, remote username 129*7c478bd9Sstevel@tonic-gate# lookups can trigger a kernel bug, causing loss of service. The README 130*7c478bd9Sstevel@tonic-gate# file describes how to find out if your UNIX kernel has that problem. 131*7c478bd9Sstevel@tonic-gate# 132*7c478bd9Sstevel@tonic-gate# Uncomment the following definition if the wrappers should always 133*7c478bd9Sstevel@tonic-gate# attempt to get the remote user name. If this is not enabled you can 134*7c478bd9Sstevel@tonic-gate# still do selective username lookups as documented in the hosts_access.5 135*7c478bd9Sstevel@tonic-gate# and hosts_options.5 manual pages (`nroff -man' format). 136*7c478bd9Sstevel@tonic-gate# 137*7c478bd9Sstevel@tonic-gate#AUTH = -DALWAYS_RFC931 138*7c478bd9Sstevel@tonic-gate# 139*7c478bd9Sstevel@tonic-gate# The default username lookup timeout is 10 seconds. This may not be long 140*7c478bd9Sstevel@tonic-gate# enough for slow hosts or networks, but is enough to irritate PC users. 141*7c478bd9Sstevel@tonic-gate 142*7c478bd9Sstevel@tonic-gateRFC931_TIMEOUT = 10 143*7c478bd9Sstevel@tonic-gate 144*7c478bd9Sstevel@tonic-gate######################################################## 145*7c478bd9Sstevel@tonic-gate# Optional: Changing the access control table pathnames 146*7c478bd9Sstevel@tonic-gate# 147*7c478bd9Sstevel@tonic-gate# The HOSTS_ALLOW and HOSTS_DENY macros define where the programs will 148*7c478bd9Sstevel@tonic-gate# look for access control information. Watch out for the quotes and 149*7c478bd9Sstevel@tonic-gate# backslashes when you make changes. 150*7c478bd9Sstevel@tonic-gate 151*7c478bd9Sstevel@tonic-gateTABLES = -DHOSTS_DENY=\"/etc/hosts.deny\" -DHOSTS_ALLOW=\"/etc/hosts.allow\" 152*7c478bd9Sstevel@tonic-gate 153*7c478bd9Sstevel@tonic-gate######################################## 154*7c478bd9Sstevel@tonic-gate# Optional: turning off hostname lookups 155*7c478bd9Sstevel@tonic-gate# 156*7c478bd9Sstevel@tonic-gate# By default, the software always attempts to look up the client 157*7c478bd9Sstevel@tonic-gate# hostname. With selective hostname lookups, the client hostname 158*7c478bd9Sstevel@tonic-gate# lookup is postponed until the name is required by an access control 159*7c478bd9Sstevel@tonic-gate# rule or by a %letter expansion. 160*7c478bd9Sstevel@tonic-gate# 161*7c478bd9Sstevel@tonic-gate# In order to perform selective hostname lookups, disable paranoid 162*7c478bd9Sstevel@tonic-gate# mode (see previous section) and comment out the following definition. 163*7c478bd9Sstevel@tonic-gate 164*7c478bd9Sstevel@tonic-gateALWAYS_HOSTNAME= -DALWAYS_HOSTNAME 165*7c478bd9Sstevel@tonic-gate 166*7c478bd9Sstevel@tonic-gate## End configuration options 167*7c478bd9Sstevel@tonic-gate############################ 168