xref: /titanic_53/usr/src/lib/libwrap/Makefile.com (revision f998c95e3b7029fe5f7542e115f7474ddb8024d7)
17c478bd9Sstevel@tonic-gate#
2f808c858Sraf# CDDL HEADER START
3f808c858Sraf#
4f808c858Sraf# The contents of this file are subject to the terms of the
5f808c858Sraf# Common Development and Distribution License (the "License").
6f808c858Sraf# You may not use this file except in compliance with the License.
7f808c858Sraf#
8f808c858Sraf# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9f808c858Sraf# or http://www.opensolaris.org/os/licensing.
10f808c858Sraf# See the License for the specific language governing permissions
11f808c858Sraf# and limitations under the License.
12f808c858Sraf#
13f808c858Sraf# When distributing Covered Code, include this CDDL HEADER in each
14f808c858Sraf# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15f808c858Sraf# If applicable, add the following below this CDDL HEADER, with the
16f808c858Sraf# fields enclosed by brackets "[]" replaced with your own identifying
17f808c858Sraf# information: Portions Copyright [yyyy] [name of copyright owner]
18f808c858Sraf#
19f808c858Sraf# CDDL HEADER END
20f808c858Sraf#
21*f998c95eSceastha# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
227c478bd9Sstevel@tonic-gate# Use is subject to license terms.
237c478bd9Sstevel@tonic-gate#
247c478bd9Sstevel@tonic-gate# ident	"%Z%%M%	%I%	%E% SMI"
257c478bd9Sstevel@tonic-gate#
267c478bd9Sstevel@tonic-gate
277c478bd9Sstevel@tonic-gateLIBRARY =	libwrap.a
287c478bd9Sstevel@tonic-gateMAJOR =		.1
297c478bd9Sstevel@tonic-gateMINOR =		.0
307c478bd9Sstevel@tonic-gateVERS =		$(MAJOR)$(MINOR)
317c478bd9Sstevel@tonic-gateOBJECTS =	hosts_access.o options.o shell_cmd.o rfc931.o eval.o \
327c478bd9Sstevel@tonic-gate		hosts_ctl.o refuse.o percent_x.o clean_exit.o \
337c478bd9Sstevel@tonic-gate		fromhost.o fix_options.o socket.o tli.o workarounds.o \
347c478bd9Sstevel@tonic-gate		update.o misc.o diag.o percent_m.o
357c478bd9Sstevel@tonic-gate
367c478bd9Sstevel@tonic-gateinclude ../../Makefile.lib
377c478bd9Sstevel@tonic-gate
387c478bd9Sstevel@tonic-gateLIBS =		$(DYNLIB) $(LINTLIB)
397c478bd9Sstevel@tonic-gateSONAME =	$(LIBRARY:.a=.so)$(MAJOR)
407c478bd9Sstevel@tonic-gateROOTLINKS +=	$(ROOTLIBDIR)/$(LIBLINKS)$(MAJOR)
417c478bd9Sstevel@tonic-gate$(LINTLIB) :=	SRCS = $(SRCDIR)/$(LINTSRC)
42f808c858Sraf
43f808c858SrafMAPFILES =	../mapfile
44f808c858Sraf
457c478bd9Sstevel@tonic-gateLDLIBS +=	-lsocket -lnsl -lc
467c478bd9Sstevel@tonic-gate
477c478bd9Sstevel@tonic-gateCPPFLAGS +=	$(NETGROUP) $(TLI) $(ALWAYS_HOSTNAME) $(AUTH) \
487c478bd9Sstevel@tonic-gate		$(STYLE) $(TABLES) $(DOT) $(BUGS) \
497c478bd9Sstevel@tonic-gate		-DRFC931_TIMEOUT=$(RFC931_TIMEOUT) \
507c478bd9Sstevel@tonic-gate		-I$(SRCDIR)
517c478bd9Sstevel@tonic-gateCFLAGS +=	$(CCVERBOSE) -erroff=E_FUNC_EXPECTS_TO_RETURN_VALUE \
527c478bd9Sstevel@tonic-gate		-erroff=E_IMPLICIT_DECL_FUNC_RETURN_INT \
5372398d67Smditto		-erroff=E_OLD_STYLE_DECL_HIDES_PROTO \
5472398d67Smditto		-_gcc=-Wno-return-type
557c478bd9Sstevel@tonic-gate
567c478bd9Sstevel@tonic-gateDISTFILES =	clean_exit.c diag.c eval.c fix_options.c fromhost.c \
577c478bd9Sstevel@tonic-gate		hosts_access.c hosts_ctl.c misc.c mystdarg.h options.c \
587c478bd9Sstevel@tonic-gate		patchlevel.h percent_m.c percent_x.c refuse.c rfc931.c \
597c478bd9Sstevel@tonic-gate		setenv.c shell_cmd.c socket.c tcpd.h tli.c update.c \
607c478bd9Sstevel@tonic-gate		workarounds.c
617c478bd9Sstevel@tonic-gate
62*f998c95eSceasthaROOTSRC =	$(ROOT)/usr/share/src/tcp_wrappers
63*f998c95eSceastha$(ROOTSRC) :=   OWNER = root
64*f998c95eSceastha$(ROOTSRC) :=   GROUP = bin
65*f998c95eSceasthaROOTSRCFILES = $(DISTFILES:%=$(ROOTSRC)/%)
667c478bd9Sstevel@tonic-gate
677c478bd9Sstevel@tonic-gate.KEEP_STATE:
687c478bd9Sstevel@tonic-gate
697c478bd9Sstevel@tonic-gateall: $(LIBS)
707c478bd9Sstevel@tonic-gate
717c478bd9Sstevel@tonic-gatelint: lintcheck
727c478bd9Sstevel@tonic-gate
737c478bd9Sstevel@tonic-gate$(ROOTLIBDIR)/$(LIBLINKS)$(MAJOR): $(ROOTLIBDIR)/$(LIBLINKS)$(VERS)
747c478bd9Sstevel@tonic-gate	$(INS.liblink)
757c478bd9Sstevel@tonic-gate
76*f998c95eSceastha$(ROOTSRCFILES) := FILEMODE = 0444
77*f998c95eSceastha$(ROOTSRCFILES): $(ROOTSRC)
787c478bd9Sstevel@tonic-gate
79*f998c95eSceastha$(ROOTSRC):
807c478bd9Sstevel@tonic-gate	$(INS.dir)
817c478bd9Sstevel@tonic-gate
82*f998c95eSceastha$(ROOTSRC)/%: $(SRCDIR)/%
837c478bd9Sstevel@tonic-gate	$(INS.file)
847c478bd9Sstevel@tonic-gate
857c478bd9Sstevel@tonic-gateinclude ../../Makefile.targ
867c478bd9Sstevel@tonic-gate
877c478bd9Sstevel@tonic-gate
887c478bd9Sstevel@tonic-gate# The rest of this file contains definitions more-or-less directly from the
897c478bd9Sstevel@tonic-gate# original Makefile of the tcp_wrappers distribution.
907c478bd9Sstevel@tonic-gate
917c478bd9Sstevel@tonic-gate##############################
92*f998c95eSceastha# System parameters appropriate for Solaris 9 and later
937c478bd9Sstevel@tonic-gate
947c478bd9Sstevel@tonic-gateTLI		= -DTLI
957c478bd9Sstevel@tonic-gateBUGS		= -DGETPEERNAME_BUG -DBROKEN_FGETS -DLIBC_CALLS_STRTOK
967c478bd9Sstevel@tonic-gateNETGROUP	= -DNETGROUP
977c478bd9Sstevel@tonic-gate
987c478bd9Sstevel@tonic-gate##############################
997c478bd9Sstevel@tonic-gate# Start of the optional stuff.
1007c478bd9Sstevel@tonic-gate
1017c478bd9Sstevel@tonic-gate###########################################
1027c478bd9Sstevel@tonic-gate# Optional: Turning on language extensions
1037c478bd9Sstevel@tonic-gate#
1047c478bd9Sstevel@tonic-gate# Instead of the default access control language that is documented in
1057c478bd9Sstevel@tonic-gate# the hosts_access.5 document, the wrappers can be configured to
1067c478bd9Sstevel@tonic-gate# implement an extensible language documented in the hosts_options.5
1077c478bd9Sstevel@tonic-gate# document.  This language is implemented by the "options.c" source
1087c478bd9Sstevel@tonic-gate# module, which also gives hints on how to add your own extensions.
1097c478bd9Sstevel@tonic-gate# Uncomment the next definition to turn on the language extensions
1107c478bd9Sstevel@tonic-gate# (examples: allow, deny, banners, twist and spawn).
1117c478bd9Sstevel@tonic-gate#
1127c478bd9Sstevel@tonic-gateSTYLE	= -DPROCESS_OPTIONS	# Enable language extensions.
1137c478bd9Sstevel@tonic-gate
1147c478bd9Sstevel@tonic-gate###########################
1157c478bd9Sstevel@tonic-gate# Optional: Reduce DNS load
1167c478bd9Sstevel@tonic-gate#
1177c478bd9Sstevel@tonic-gate# When looking up the address for a host.domain name, the typical DNS
1187c478bd9Sstevel@tonic-gate# code will first append substrings of your own domain, so it tries
1197c478bd9Sstevel@tonic-gate# host.domain.your.own.domain, then host.domain.own.domain, and then
1207c478bd9Sstevel@tonic-gate# host.domain. The APPEND_DOT feature stops this waste of cycles. It is
1217c478bd9Sstevel@tonic-gate# off by default because it causes problems on sites that don't use DNS
1227c478bd9Sstevel@tonic-gate# and with Solaris < 2.4. APPEND_DOT will not work with hostnames taken
1237c478bd9Sstevel@tonic-gate# from /etc/hosts or from NIS maps. It does work with DNS through NIS.
1247c478bd9Sstevel@tonic-gate#
1257c478bd9Sstevel@tonic-gate# DOT= -DAPPEND_DOT
1267c478bd9Sstevel@tonic-gate
1277c478bd9Sstevel@tonic-gate##################################################
1287c478bd9Sstevel@tonic-gate# Optional: Always attempt remote username lookups
1297c478bd9Sstevel@tonic-gate#
1307c478bd9Sstevel@tonic-gate# By default, the wrappers look up the remote username only when the
1317c478bd9Sstevel@tonic-gate# access control rules require them to do so.
1327c478bd9Sstevel@tonic-gate#
1337c478bd9Sstevel@tonic-gate# Username lookups require that the remote host runs a daemon that
1347c478bd9Sstevel@tonic-gate# supports an RFC 931 like protocol.  Remote user name lookups are not
1357c478bd9Sstevel@tonic-gate# possible for UDP-based connections, and can cause noticeable delays
1367c478bd9Sstevel@tonic-gate# with connections from non-UNIX PCs.  On some systems, remote username
1377c478bd9Sstevel@tonic-gate# lookups can trigger a kernel bug, causing loss of service. The README
1387c478bd9Sstevel@tonic-gate# file describes how to find out if your UNIX kernel has that problem.
1397c478bd9Sstevel@tonic-gate#
1407c478bd9Sstevel@tonic-gate# Uncomment the following definition if the wrappers should always
1417c478bd9Sstevel@tonic-gate# attempt to get the remote user name. If this is not enabled you can
1427c478bd9Sstevel@tonic-gate# still do selective username lookups as documented in the hosts_access.5
1437c478bd9Sstevel@tonic-gate# and hosts_options.5 manual pages (`nroff -man' format).
1447c478bd9Sstevel@tonic-gate#
1457c478bd9Sstevel@tonic-gate#AUTH	= -DALWAYS_RFC931
1467c478bd9Sstevel@tonic-gate#
1477c478bd9Sstevel@tonic-gate# The default username lookup timeout is 10 seconds. This may not be long
1487c478bd9Sstevel@tonic-gate# enough for slow hosts or networks, but is enough to irritate PC users.
1497c478bd9Sstevel@tonic-gate
1507c478bd9Sstevel@tonic-gateRFC931_TIMEOUT = 10
1517c478bd9Sstevel@tonic-gate
1527c478bd9Sstevel@tonic-gate########################################################
1537c478bd9Sstevel@tonic-gate# Optional: Changing the access control table pathnames
1547c478bd9Sstevel@tonic-gate#
1557c478bd9Sstevel@tonic-gate# The HOSTS_ALLOW and HOSTS_DENY macros define where the programs will
1567c478bd9Sstevel@tonic-gate# look for access control information. Watch out for the quotes and
1577c478bd9Sstevel@tonic-gate# backslashes when you make changes.
1587c478bd9Sstevel@tonic-gate
1597c478bd9Sstevel@tonic-gateTABLES	= -DHOSTS_DENY=\"/etc/hosts.deny\" -DHOSTS_ALLOW=\"/etc/hosts.allow\"
1607c478bd9Sstevel@tonic-gate
1617c478bd9Sstevel@tonic-gate########################################
1627c478bd9Sstevel@tonic-gate# Optional: turning off hostname lookups
1637c478bd9Sstevel@tonic-gate#
1647c478bd9Sstevel@tonic-gate# By default, the software always attempts to look up the client
1657c478bd9Sstevel@tonic-gate# hostname.  With selective hostname lookups, the client hostname
1667c478bd9Sstevel@tonic-gate# lookup is postponed until the name is required by an access control
1677c478bd9Sstevel@tonic-gate# rule or by a %letter expansion.
1687c478bd9Sstevel@tonic-gate#
1697c478bd9Sstevel@tonic-gate# In order to perform selective hostname lookups, disable paranoid
1707c478bd9Sstevel@tonic-gate# mode (see previous section) and comment out the following definition.
1717c478bd9Sstevel@tonic-gate
1727c478bd9Sstevel@tonic-gateALWAYS_HOSTNAME= -DALWAYS_HOSTNAME
1737c478bd9Sstevel@tonic-gate
1747c478bd9Sstevel@tonic-gate## End configuration options
1757c478bd9Sstevel@tonic-gate############################
176