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 \ 34e1b84cb0SYuri 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) 41*9584cebbSAlexander PyhalovROOTLINKS64 += $(ROOTLIBDIR64)/$(LIBLINKS)$(MAJOR) 427c478bd9Sstevel@tonic-gate$(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) 43f808c858Sraf 44*9584cebbSAlexander PyhalovMAPFILES = ../mapfile-vers 45f808c858Sraf 467c478bd9Sstevel@tonic-gateLDLIBS += -lsocket -lnsl -lc 477c478bd9Sstevel@tonic-gate 487c478bd9Sstevel@tonic-gateCPPFLAGS += $(NETGROUP) $(TLI) $(ALWAYS_HOSTNAME) $(AUTH) \ 497c478bd9Sstevel@tonic-gate $(STYLE) $(TABLES) $(DOT) $(BUGS) \ 507c478bd9Sstevel@tonic-gate -DRFC931_TIMEOUT=$(RFC931_TIMEOUT) \ 517c478bd9Sstevel@tonic-gate -I$(SRCDIR) 527014882cSRichard LoweCFLAGS += $(CCVERBOSE) 537014882cSRichard Lowe 547014882cSRichard LoweCERRWARN += -erroff=E_FUNC_EXPECTS_TO_RETURN_VALUE 557014882cSRichard LoweCERRWARN += -erroff=E_IMPLICIT_DECL_FUNC_RETURN_INT 567014882cSRichard LoweCERRWARN += -erroff=E_OLD_STYLE_DECL_HIDES_PROTO 577014882cSRichard Lowe 587014882cSRichard LoweCERRWARN += -_gcc=-Wno-return-type 597014882cSRichard LoweCERRWARN += -_gcc=-Wno-parentheses 607014882cSRichard LoweCERRWARN += -_gcc=-Wno-unused-variable 617014882cSRichard LoweCERRWARN += -_gcc=-Wno-uninitialized 627c478bd9Sstevel@tonic-gate 637c478bd9Sstevel@tonic-gate.KEEP_STATE: 647c478bd9Sstevel@tonic-gate 657c478bd9Sstevel@tonic-gateall: $(LIBS) 667c478bd9Sstevel@tonic-gate 677c478bd9Sstevel@tonic-gatelint: lintcheck 687c478bd9Sstevel@tonic-gate 697c478bd9Sstevel@tonic-gate$(ROOTLIBDIR)/$(LIBLINKS)$(MAJOR): $(ROOTLIBDIR)/$(LIBLINKS)$(VERS) 707c478bd9Sstevel@tonic-gate $(INS.liblink) 717c478bd9Sstevel@tonic-gate 72*9584cebbSAlexander Pyhalov$(ROOTLIBDIR64)/$(LIBLINKS)$(MAJOR): $(ROOTLIBDIR64)/$(LIBLINKS)$(VERS) 73*9584cebbSAlexander Pyhalov $(INS.liblink64) 74*9584cebbSAlexander Pyhalov 757c478bd9Sstevel@tonic-gateinclude ../../Makefile.targ 767c478bd9Sstevel@tonic-gate 777c478bd9Sstevel@tonic-gate 787c478bd9Sstevel@tonic-gate# The rest of this file contains definitions more-or-less directly from the 797c478bd9Sstevel@tonic-gate# original Makefile of the tcp_wrappers distribution. 807c478bd9Sstevel@tonic-gate 817c478bd9Sstevel@tonic-gate############################## 82f998c95eSceastha# System parameters appropriate for Solaris 9 and later 837c478bd9Sstevel@tonic-gate 847c478bd9Sstevel@tonic-gateTLI = -DTLI 857c478bd9Sstevel@tonic-gateBUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DLIBC_CALLS_STRTOK 867c478bd9Sstevel@tonic-gateNETGROUP = -DNETGROUP 877c478bd9Sstevel@tonic-gate 887c478bd9Sstevel@tonic-gate############################## 897c478bd9Sstevel@tonic-gate# Start of the optional stuff. 907c478bd9Sstevel@tonic-gate 917c478bd9Sstevel@tonic-gate########################################### 927c478bd9Sstevel@tonic-gate# Optional: Turning on language extensions 937c478bd9Sstevel@tonic-gate# 947c478bd9Sstevel@tonic-gate# Instead of the default access control language that is documented in 957c478bd9Sstevel@tonic-gate# the hosts_access.5 document, the wrappers can be configured to 967c478bd9Sstevel@tonic-gate# implement an extensible language documented in the hosts_options.5 977c478bd9Sstevel@tonic-gate# document. This language is implemented by the "options.c" source 987c478bd9Sstevel@tonic-gate# module, which also gives hints on how to add your own extensions. 997c478bd9Sstevel@tonic-gate# Uncomment the next definition to turn on the language extensions 1007c478bd9Sstevel@tonic-gate# (examples: allow, deny, banners, twist and spawn). 1017c478bd9Sstevel@tonic-gate# 1027c478bd9Sstevel@tonic-gateSTYLE = -DPROCESS_OPTIONS # Enable language extensions. 1037c478bd9Sstevel@tonic-gate 1047c478bd9Sstevel@tonic-gate########################### 1057c478bd9Sstevel@tonic-gate# Optional: Reduce DNS load 1067c478bd9Sstevel@tonic-gate# 1077c478bd9Sstevel@tonic-gate# When looking up the address for a host.domain name, the typical DNS 1087c478bd9Sstevel@tonic-gate# code will first append substrings of your own domain, so it tries 1097c478bd9Sstevel@tonic-gate# host.domain.your.own.domain, then host.domain.own.domain, and then 1107c478bd9Sstevel@tonic-gate# host.domain. The APPEND_DOT feature stops this waste of cycles. It is 1117c478bd9Sstevel@tonic-gate# off by default because it causes problems on sites that don't use DNS 1127c478bd9Sstevel@tonic-gate# and with Solaris < 2.4. APPEND_DOT will not work with hostnames taken 1137c478bd9Sstevel@tonic-gate# from /etc/hosts or from NIS maps. It does work with DNS through NIS. 1147c478bd9Sstevel@tonic-gate# 1157c478bd9Sstevel@tonic-gate# DOT= -DAPPEND_DOT 1167c478bd9Sstevel@tonic-gate 1177c478bd9Sstevel@tonic-gate################################################## 1187c478bd9Sstevel@tonic-gate# Optional: Always attempt remote username lookups 1197c478bd9Sstevel@tonic-gate# 1207c478bd9Sstevel@tonic-gate# By default, the wrappers look up the remote username only when the 1217c478bd9Sstevel@tonic-gate# access control rules require them to do so. 1227c478bd9Sstevel@tonic-gate# 1237c478bd9Sstevel@tonic-gate# Username lookups require that the remote host runs a daemon that 1247c478bd9Sstevel@tonic-gate# supports an RFC 931 like protocol. Remote user name lookups are not 1257c478bd9Sstevel@tonic-gate# possible for UDP-based connections, and can cause noticeable delays 1267c478bd9Sstevel@tonic-gate# with connections from non-UNIX PCs. On some systems, remote username 1277c478bd9Sstevel@tonic-gate# lookups can trigger a kernel bug, causing loss of service. The README 1287c478bd9Sstevel@tonic-gate# file describes how to find out if your UNIX kernel has that problem. 1297c478bd9Sstevel@tonic-gate# 1307c478bd9Sstevel@tonic-gate# Uncomment the following definition if the wrappers should always 1317c478bd9Sstevel@tonic-gate# attempt to get the remote user name. If this is not enabled you can 1327c478bd9Sstevel@tonic-gate# still do selective username lookups as documented in the hosts_access.5 1337c478bd9Sstevel@tonic-gate# and hosts_options.5 manual pages (`nroff -man' format). 1347c478bd9Sstevel@tonic-gate# 1357c478bd9Sstevel@tonic-gate#AUTH = -DALWAYS_RFC931 1367c478bd9Sstevel@tonic-gate# 1377c478bd9Sstevel@tonic-gate# The default username lookup timeout is 10 seconds. This may not be long 1387c478bd9Sstevel@tonic-gate# enough for slow hosts or networks, but is enough to irritate PC users. 1397c478bd9Sstevel@tonic-gate 1407c478bd9Sstevel@tonic-gateRFC931_TIMEOUT = 10 1417c478bd9Sstevel@tonic-gate 1427c478bd9Sstevel@tonic-gate######################################################## 1437c478bd9Sstevel@tonic-gate# Optional: Changing the access control table pathnames 1447c478bd9Sstevel@tonic-gate# 1457c478bd9Sstevel@tonic-gate# The HOSTS_ALLOW and HOSTS_DENY macros define where the programs will 1467c478bd9Sstevel@tonic-gate# look for access control information. Watch out for the quotes and 1477c478bd9Sstevel@tonic-gate# backslashes when you make changes. 1487c478bd9Sstevel@tonic-gate 1497c478bd9Sstevel@tonic-gateTABLES = -DHOSTS_DENY=\"/etc/hosts.deny\" -DHOSTS_ALLOW=\"/etc/hosts.allow\" 1507c478bd9Sstevel@tonic-gate 1517c478bd9Sstevel@tonic-gate######################################## 1527c478bd9Sstevel@tonic-gate# Optional: turning off hostname lookups 1537c478bd9Sstevel@tonic-gate# 1547c478bd9Sstevel@tonic-gate# By default, the software always attempts to look up the client 1557c478bd9Sstevel@tonic-gate# hostname. With selective hostname lookups, the client hostname 1567c478bd9Sstevel@tonic-gate# lookup is postponed until the name is required by an access control 1577c478bd9Sstevel@tonic-gate# rule or by a %letter expansion. 1587c478bd9Sstevel@tonic-gate# 1597c478bd9Sstevel@tonic-gate# In order to perform selective hostname lookups, disable paranoid 1607c478bd9Sstevel@tonic-gate# mode (see previous section) and comment out the following definition. 1617c478bd9Sstevel@tonic-gate 1627c478bd9Sstevel@tonic-gateALWAYS_HOSTNAME= -DALWAYS_HOSTNAME 1637c478bd9Sstevel@tonic-gate 1647c478bd9Sstevel@tonic-gate## End configuration options 1657c478bd9Sstevel@tonic-gate############################ 166