xref: /titanic_53/usr/src/lib/libwrap/Makefile.com (revision e1b84cb03d8fd1ef230a385429f6b768687ff944)
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#
2124fe0b3bSjmcp# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
227c478bd9Sstevel@tonic-gate# Use is subject to license terms.
237c478bd9Sstevel@tonic-gate#
24ead9bb4bSYuri Pankov# Copyright 2011 Nexenta Systems, Inc. All rights reserved.
25ead9bb4bSYuri Pankov#
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 \
34*e1b84cb0SYuri Pankov		update.o misc.o diag.o percent_m.o libvars.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-gate.KEEP_STATE:
577c478bd9Sstevel@tonic-gate
587c478bd9Sstevel@tonic-gateall: $(LIBS)
597c478bd9Sstevel@tonic-gate
607c478bd9Sstevel@tonic-gatelint: lintcheck
617c478bd9Sstevel@tonic-gate
627c478bd9Sstevel@tonic-gate$(ROOTLIBDIR)/$(LIBLINKS)$(MAJOR): $(ROOTLIBDIR)/$(LIBLINKS)$(VERS)
637c478bd9Sstevel@tonic-gate	$(INS.liblink)
647c478bd9Sstevel@tonic-gate
657c478bd9Sstevel@tonic-gateinclude ../../Makefile.targ
667c478bd9Sstevel@tonic-gate
677c478bd9Sstevel@tonic-gate
687c478bd9Sstevel@tonic-gate# The rest of this file contains definitions more-or-less directly from the
697c478bd9Sstevel@tonic-gate# original Makefile of the tcp_wrappers distribution.
707c478bd9Sstevel@tonic-gate
717c478bd9Sstevel@tonic-gate##############################
72f998c95eSceastha# System parameters appropriate for Solaris 9 and later
737c478bd9Sstevel@tonic-gate
747c478bd9Sstevel@tonic-gateTLI		= -DTLI
757c478bd9Sstevel@tonic-gateBUGS		= -DGETPEERNAME_BUG -DBROKEN_FGETS -DLIBC_CALLS_STRTOK
767c478bd9Sstevel@tonic-gateNETGROUP	= -DNETGROUP
777c478bd9Sstevel@tonic-gate
787c478bd9Sstevel@tonic-gate##############################
797c478bd9Sstevel@tonic-gate# Start of the optional stuff.
807c478bd9Sstevel@tonic-gate
817c478bd9Sstevel@tonic-gate###########################################
827c478bd9Sstevel@tonic-gate# Optional: Turning on language extensions
837c478bd9Sstevel@tonic-gate#
847c478bd9Sstevel@tonic-gate# Instead of the default access control language that is documented in
857c478bd9Sstevel@tonic-gate# the hosts_access.5 document, the wrappers can be configured to
867c478bd9Sstevel@tonic-gate# implement an extensible language documented in the hosts_options.5
877c478bd9Sstevel@tonic-gate# document.  This language is implemented by the "options.c" source
887c478bd9Sstevel@tonic-gate# module, which also gives hints on how to add your own extensions.
897c478bd9Sstevel@tonic-gate# Uncomment the next definition to turn on the language extensions
907c478bd9Sstevel@tonic-gate# (examples: allow, deny, banners, twist and spawn).
917c478bd9Sstevel@tonic-gate#
927c478bd9Sstevel@tonic-gateSTYLE	= -DPROCESS_OPTIONS	# Enable language extensions.
937c478bd9Sstevel@tonic-gate
947c478bd9Sstevel@tonic-gate###########################
957c478bd9Sstevel@tonic-gate# Optional: Reduce DNS load
967c478bd9Sstevel@tonic-gate#
977c478bd9Sstevel@tonic-gate# When looking up the address for a host.domain name, the typical DNS
987c478bd9Sstevel@tonic-gate# code will first append substrings of your own domain, so it tries
997c478bd9Sstevel@tonic-gate# host.domain.your.own.domain, then host.domain.own.domain, and then
1007c478bd9Sstevel@tonic-gate# host.domain. The APPEND_DOT feature stops this waste of cycles. It is
1017c478bd9Sstevel@tonic-gate# off by default because it causes problems on sites that don't use DNS
1027c478bd9Sstevel@tonic-gate# and with Solaris < 2.4. APPEND_DOT will not work with hostnames taken
1037c478bd9Sstevel@tonic-gate# from /etc/hosts or from NIS maps. It does work with DNS through NIS.
1047c478bd9Sstevel@tonic-gate#
1057c478bd9Sstevel@tonic-gate# DOT= -DAPPEND_DOT
1067c478bd9Sstevel@tonic-gate
1077c478bd9Sstevel@tonic-gate##################################################
1087c478bd9Sstevel@tonic-gate# Optional: Always attempt remote username lookups
1097c478bd9Sstevel@tonic-gate#
1107c478bd9Sstevel@tonic-gate# By default, the wrappers look up the remote username only when the
1117c478bd9Sstevel@tonic-gate# access control rules require them to do so.
1127c478bd9Sstevel@tonic-gate#
1137c478bd9Sstevel@tonic-gate# Username lookups require that the remote host runs a daemon that
1147c478bd9Sstevel@tonic-gate# supports an RFC 931 like protocol.  Remote user name lookups are not
1157c478bd9Sstevel@tonic-gate# possible for UDP-based connections, and can cause noticeable delays
1167c478bd9Sstevel@tonic-gate# with connections from non-UNIX PCs.  On some systems, remote username
1177c478bd9Sstevel@tonic-gate# lookups can trigger a kernel bug, causing loss of service. The README
1187c478bd9Sstevel@tonic-gate# file describes how to find out if your UNIX kernel has that problem.
1197c478bd9Sstevel@tonic-gate#
1207c478bd9Sstevel@tonic-gate# Uncomment the following definition if the wrappers should always
1217c478bd9Sstevel@tonic-gate# attempt to get the remote user name. If this is not enabled you can
1227c478bd9Sstevel@tonic-gate# still do selective username lookups as documented in the hosts_access.5
1237c478bd9Sstevel@tonic-gate# and hosts_options.5 manual pages (`nroff -man' format).
1247c478bd9Sstevel@tonic-gate#
1257c478bd9Sstevel@tonic-gate#AUTH	= -DALWAYS_RFC931
1267c478bd9Sstevel@tonic-gate#
1277c478bd9Sstevel@tonic-gate# The default username lookup timeout is 10 seconds. This may not be long
1287c478bd9Sstevel@tonic-gate# enough for slow hosts or networks, but is enough to irritate PC users.
1297c478bd9Sstevel@tonic-gate
1307c478bd9Sstevel@tonic-gateRFC931_TIMEOUT = 10
1317c478bd9Sstevel@tonic-gate
1327c478bd9Sstevel@tonic-gate########################################################
1337c478bd9Sstevel@tonic-gate# Optional: Changing the access control table pathnames
1347c478bd9Sstevel@tonic-gate#
1357c478bd9Sstevel@tonic-gate# The HOSTS_ALLOW and HOSTS_DENY macros define where the programs will
1367c478bd9Sstevel@tonic-gate# look for access control information. Watch out for the quotes and
1377c478bd9Sstevel@tonic-gate# backslashes when you make changes.
1387c478bd9Sstevel@tonic-gate
1397c478bd9Sstevel@tonic-gateTABLES	= -DHOSTS_DENY=\"/etc/hosts.deny\" -DHOSTS_ALLOW=\"/etc/hosts.allow\"
1407c478bd9Sstevel@tonic-gate
1417c478bd9Sstevel@tonic-gate########################################
1427c478bd9Sstevel@tonic-gate# Optional: turning off hostname lookups
1437c478bd9Sstevel@tonic-gate#
1447c478bd9Sstevel@tonic-gate# By default, the software always attempts to look up the client
1457c478bd9Sstevel@tonic-gate# hostname.  With selective hostname lookups, the client hostname
1467c478bd9Sstevel@tonic-gate# lookup is postponed until the name is required by an access control
1477c478bd9Sstevel@tonic-gate# rule or by a %letter expansion.
1487c478bd9Sstevel@tonic-gate#
1497c478bd9Sstevel@tonic-gate# In order to perform selective hostname lookups, disable paranoid
1507c478bd9Sstevel@tonic-gate# mode (see previous section) and comment out the following definition.
1517c478bd9Sstevel@tonic-gate
1527c478bd9Sstevel@tonic-gateALWAYS_HOSTNAME= -DALWAYS_HOSTNAME
1537c478bd9Sstevel@tonic-gate
1547c478bd9Sstevel@tonic-gate## End configuration options
1557c478bd9Sstevel@tonic-gate############################
156