17c478bd9Sstevel@tonic-gate# 2*72398d67Smditto# Copyright 2005 Sun Microsystems, Inc. All rights reserved. 37c478bd9Sstevel@tonic-gate# Use is subject to license terms. 47c478bd9Sstevel@tonic-gate# 57c478bd9Sstevel@tonic-gate# ident "%Z%%M% %I% %E% SMI" 67c478bd9Sstevel@tonic-gate# 77c478bd9Sstevel@tonic-gate 87c478bd9Sstevel@tonic-gateLIBRARY = libwrap.a 97c478bd9Sstevel@tonic-gateMAJOR = .1 107c478bd9Sstevel@tonic-gateMINOR = .0 117c478bd9Sstevel@tonic-gateVERS = $(MAJOR)$(MINOR) 127c478bd9Sstevel@tonic-gateOBJECTS = hosts_access.o options.o shell_cmd.o rfc931.o eval.o \ 137c478bd9Sstevel@tonic-gate hosts_ctl.o refuse.o percent_x.o clean_exit.o \ 147c478bd9Sstevel@tonic-gate fromhost.o fix_options.o socket.o tli.o workarounds.o \ 157c478bd9Sstevel@tonic-gate update.o misc.o diag.o percent_m.o 167c478bd9Sstevel@tonic-gate 177c478bd9Sstevel@tonic-gateinclude ../../Makefile.lib 187c478bd9Sstevel@tonic-gate 197c478bd9Sstevel@tonic-gateLIBS = $(DYNLIB) $(LINTLIB) 207c478bd9Sstevel@tonic-gateROOTLIBDIR = $(ROOTSFWLIB) 217c478bd9Sstevel@tonic-gateSONAME = $(LIBRARY:.a=.so)$(MAJOR) 227c478bd9Sstevel@tonic-gateROOTLINKS += $(ROOTLIBDIR)/$(LIBLINKS)$(MAJOR) 237c478bd9Sstevel@tonic-gateSRCDIR = .. 247c478bd9Sstevel@tonic-gate$(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) 257c478bd9Sstevel@tonic-gateDYNFLAGS += -M $(SRCDIR)/mapfile 267c478bd9Sstevel@tonic-gateLDLIBS += -lsocket -lnsl -lc 277c478bd9Sstevel@tonic-gate 287c478bd9Sstevel@tonic-gateCPPFLAGS += $(NETGROUP) $(TLI) $(ALWAYS_HOSTNAME) $(AUTH) \ 297c478bd9Sstevel@tonic-gate $(STYLE) $(TABLES) $(DOT) $(BUGS) \ 307c478bd9Sstevel@tonic-gate -DRFC931_TIMEOUT=$(RFC931_TIMEOUT) \ 317c478bd9Sstevel@tonic-gate -I$(SRCDIR) 327c478bd9Sstevel@tonic-gateCFLAGS += $(CCVERBOSE) -erroff=E_FUNC_EXPECTS_TO_RETURN_VALUE \ 337c478bd9Sstevel@tonic-gate -erroff=E_IMPLICIT_DECL_FUNC_RETURN_INT \ 34*72398d67Smditto -erroff=E_OLD_STYLE_DECL_HIDES_PROTO \ 35*72398d67Smditto -_gcc=-Wno-return-type 367c478bd9Sstevel@tonic-gate 377c478bd9Sstevel@tonic-gateDISTFILES = clean_exit.c diag.c eval.c fix_options.c fromhost.c \ 387c478bd9Sstevel@tonic-gate hosts_access.c hosts_ctl.c misc.c mystdarg.h options.c \ 397c478bd9Sstevel@tonic-gate patchlevel.h percent_m.c percent_x.c refuse.c rfc931.c \ 407c478bd9Sstevel@tonic-gate setenv.c shell_cmd.c socket.c tcpd.h tli.c update.c \ 417c478bd9Sstevel@tonic-gate workarounds.c 427c478bd9Sstevel@tonic-gate 437c478bd9Sstevel@tonic-gateROOTSFWSRC = $(ROOTSFWSHSRC)/tcp_wrappers 447c478bd9Sstevel@tonic-gateROOTSFWSRCFILES = $(DISTFILES:%=$(ROOTSFWSRC)/%) 457c478bd9Sstevel@tonic-gate 467c478bd9Sstevel@tonic-gate.KEEP_STATE: 477c478bd9Sstevel@tonic-gate 487c478bd9Sstevel@tonic-gateall: $(LIBS) 497c478bd9Sstevel@tonic-gate 507c478bd9Sstevel@tonic-gatelint: lintcheck 517c478bd9Sstevel@tonic-gate 527c478bd9Sstevel@tonic-gate$(ROOTLIBS): $(ROOTLIBDIR) 537c478bd9Sstevel@tonic-gate 547c478bd9Sstevel@tonic-gate$(ROOTLIBDIR): $(ROOTSFW) 557c478bd9Sstevel@tonic-gate $(INS.dir) 567c478bd9Sstevel@tonic-gate 577c478bd9Sstevel@tonic-gate$(ROOTLIBDIR)/$(LIBLINKS)$(MAJOR): $(ROOTLIBDIR)/$(LIBLINKS)$(VERS) 587c478bd9Sstevel@tonic-gate $(INS.liblink) 597c478bd9Sstevel@tonic-gate 607c478bd9Sstevel@tonic-gate$(ROOTSFWSRCFILES) := FILEMODE = 0444 617c478bd9Sstevel@tonic-gate$(ROOTSFWSRCFILES): $(ROOTSFWSRC) 627c478bd9Sstevel@tonic-gate 637c478bd9Sstevel@tonic-gate$(ROOTSFWSRC): $(ROOTSFWSHSRC) 647c478bd9Sstevel@tonic-gate $(INS.dir) 657c478bd9Sstevel@tonic-gate 667c478bd9Sstevel@tonic-gate$(ROOTSFWSHSRC): $(ROOTSFW)/share 677c478bd9Sstevel@tonic-gate $(INS.dir) 687c478bd9Sstevel@tonic-gate 697c478bd9Sstevel@tonic-gate$(ROOTSFWSRC)/%: $(SRCDIR)/% 707c478bd9Sstevel@tonic-gate $(INS.file) 717c478bd9Sstevel@tonic-gate 727c478bd9Sstevel@tonic-gate$(ROOTSFW)/share: $(ROOTSFW) 737c478bd9Sstevel@tonic-gate $(INS.dir) 747c478bd9Sstevel@tonic-gate 757c478bd9Sstevel@tonic-gate$(ROOTSFW): 767c478bd9Sstevel@tonic-gate $(INS.dir) 777c478bd9Sstevel@tonic-gate 787c478bd9Sstevel@tonic-gateinclude ../../Makefile.targ 797c478bd9Sstevel@tonic-gate 807c478bd9Sstevel@tonic-gate 817c478bd9Sstevel@tonic-gate# The rest of this file contains definitions more-or-less directly from the 827c478bd9Sstevel@tonic-gate# original Makefile of the tcp_wrappers distribution. 837c478bd9Sstevel@tonic-gate 847c478bd9Sstevel@tonic-gate############################## 857c478bd9Sstevel@tonic-gate# System parameters appropriate for Solaris 9 867c478bd9Sstevel@tonic-gate 877c478bd9Sstevel@tonic-gateTLI = -DTLI 887c478bd9Sstevel@tonic-gateBUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DLIBC_CALLS_STRTOK 897c478bd9Sstevel@tonic-gateNETGROUP = -DNETGROUP 907c478bd9Sstevel@tonic-gate 917c478bd9Sstevel@tonic-gate############################## 927c478bd9Sstevel@tonic-gate# Start of the optional stuff. 937c478bd9Sstevel@tonic-gate 947c478bd9Sstevel@tonic-gate########################################### 957c478bd9Sstevel@tonic-gate# Optional: Turning on language extensions 967c478bd9Sstevel@tonic-gate# 977c478bd9Sstevel@tonic-gate# Instead of the default access control language that is documented in 987c478bd9Sstevel@tonic-gate# the hosts_access.5 document, the wrappers can be configured to 997c478bd9Sstevel@tonic-gate# implement an extensible language documented in the hosts_options.5 1007c478bd9Sstevel@tonic-gate# document. This language is implemented by the "options.c" source 1017c478bd9Sstevel@tonic-gate# module, which also gives hints on how to add your own extensions. 1027c478bd9Sstevel@tonic-gate# Uncomment the next definition to turn on the language extensions 1037c478bd9Sstevel@tonic-gate# (examples: allow, deny, banners, twist and spawn). 1047c478bd9Sstevel@tonic-gate# 1057c478bd9Sstevel@tonic-gateSTYLE = -DPROCESS_OPTIONS # Enable language extensions. 1067c478bd9Sstevel@tonic-gate 1077c478bd9Sstevel@tonic-gate########################### 1087c478bd9Sstevel@tonic-gate# Optional: Reduce DNS load 1097c478bd9Sstevel@tonic-gate# 1107c478bd9Sstevel@tonic-gate# When looking up the address for a host.domain name, the typical DNS 1117c478bd9Sstevel@tonic-gate# code will first append substrings of your own domain, so it tries 1127c478bd9Sstevel@tonic-gate# host.domain.your.own.domain, then host.domain.own.domain, and then 1137c478bd9Sstevel@tonic-gate# host.domain. The APPEND_DOT feature stops this waste of cycles. It is 1147c478bd9Sstevel@tonic-gate# off by default because it causes problems on sites that don't use DNS 1157c478bd9Sstevel@tonic-gate# and with Solaris < 2.4. APPEND_DOT will not work with hostnames taken 1167c478bd9Sstevel@tonic-gate# from /etc/hosts or from NIS maps. It does work with DNS through NIS. 1177c478bd9Sstevel@tonic-gate# 1187c478bd9Sstevel@tonic-gate# DOT= -DAPPEND_DOT 1197c478bd9Sstevel@tonic-gate 1207c478bd9Sstevel@tonic-gate################################################## 1217c478bd9Sstevel@tonic-gate# Optional: Always attempt remote username lookups 1227c478bd9Sstevel@tonic-gate# 1237c478bd9Sstevel@tonic-gate# By default, the wrappers look up the remote username only when the 1247c478bd9Sstevel@tonic-gate# access control rules require them to do so. 1257c478bd9Sstevel@tonic-gate# 1267c478bd9Sstevel@tonic-gate# Username lookups require that the remote host runs a daemon that 1277c478bd9Sstevel@tonic-gate# supports an RFC 931 like protocol. Remote user name lookups are not 1287c478bd9Sstevel@tonic-gate# possible for UDP-based connections, and can cause noticeable delays 1297c478bd9Sstevel@tonic-gate# with connections from non-UNIX PCs. On some systems, remote username 1307c478bd9Sstevel@tonic-gate# lookups can trigger a kernel bug, causing loss of service. The README 1317c478bd9Sstevel@tonic-gate# file describes how to find out if your UNIX kernel has that problem. 1327c478bd9Sstevel@tonic-gate# 1337c478bd9Sstevel@tonic-gate# Uncomment the following definition if the wrappers should always 1347c478bd9Sstevel@tonic-gate# attempt to get the remote user name. If this is not enabled you can 1357c478bd9Sstevel@tonic-gate# still do selective username lookups as documented in the hosts_access.5 1367c478bd9Sstevel@tonic-gate# and hosts_options.5 manual pages (`nroff -man' format). 1377c478bd9Sstevel@tonic-gate# 1387c478bd9Sstevel@tonic-gate#AUTH = -DALWAYS_RFC931 1397c478bd9Sstevel@tonic-gate# 1407c478bd9Sstevel@tonic-gate# The default username lookup timeout is 10 seconds. This may not be long 1417c478bd9Sstevel@tonic-gate# enough for slow hosts or networks, but is enough to irritate PC users. 1427c478bd9Sstevel@tonic-gate 1437c478bd9Sstevel@tonic-gateRFC931_TIMEOUT = 10 1447c478bd9Sstevel@tonic-gate 1457c478bd9Sstevel@tonic-gate######################################################## 1467c478bd9Sstevel@tonic-gate# Optional: Changing the access control table pathnames 1477c478bd9Sstevel@tonic-gate# 1487c478bd9Sstevel@tonic-gate# The HOSTS_ALLOW and HOSTS_DENY macros define where the programs will 1497c478bd9Sstevel@tonic-gate# look for access control information. Watch out for the quotes and 1507c478bd9Sstevel@tonic-gate# backslashes when you make changes. 1517c478bd9Sstevel@tonic-gate 1527c478bd9Sstevel@tonic-gateTABLES = -DHOSTS_DENY=\"/etc/hosts.deny\" -DHOSTS_ALLOW=\"/etc/hosts.allow\" 1537c478bd9Sstevel@tonic-gate 1547c478bd9Sstevel@tonic-gate######################################## 1557c478bd9Sstevel@tonic-gate# Optional: turning off hostname lookups 1567c478bd9Sstevel@tonic-gate# 1577c478bd9Sstevel@tonic-gate# By default, the software always attempts to look up the client 1587c478bd9Sstevel@tonic-gate# hostname. With selective hostname lookups, the client hostname 1597c478bd9Sstevel@tonic-gate# lookup is postponed until the name is required by an access control 1607c478bd9Sstevel@tonic-gate# rule or by a %letter expansion. 1617c478bd9Sstevel@tonic-gate# 1627c478bd9Sstevel@tonic-gate# In order to perform selective hostname lookups, disable paranoid 1637c478bd9Sstevel@tonic-gate# mode (see previous section) and comment out the following definition. 1647c478bd9Sstevel@tonic-gate 1657c478bd9Sstevel@tonic-gateALWAYS_HOSTNAME= -DALWAYS_HOSTNAME 1667c478bd9Sstevel@tonic-gate 1677c478bd9Sstevel@tonic-gate## End configuration options 1687c478bd9Sstevel@tonic-gate############################ 169