Unleashed v1.4
[unleashed.git] / usr / src / cmd / tcpd / Makefile
blobc31266c0782f2e0d9b8a001c6c849cf095294e9e
2 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
3 # Use is subject to license terms.
5 # Copyright 2011 Nexenta Systems, Inc. All rights reserved.
7 # Copyright (c) 2018, Joyent, Inc.
9 PROG= safe_finger tcpd tcpdchk tcpdmatch try-from
11 include ../Makefile.cmd
13 CPPFLAGS += $(ACCESS) $(PARANOID) $(NETGROUP) $(TLI) \
14 $(UMASK) $(STYLE) $(TABLES) $(KILL_OPT) $(BUGS) \
15 -DRFC931_TIMEOUT=$(RFC931_TIMEOUT) \
16 -DFACILITY=$(FACILITY) -DSEVERITY=$(SEVERITY) \
17 -DREAL_DAEMON_DIR=\"$(REAL_DAEMON_DIR)\" \
18 -I../../lib/libwrap
19 tcpd tcpdmatch try-from := \
20 LDLIBS += -lwrap
21 tcpdchk := LDLIBS += -lwrap
23 CERRWARN += -Wno-unused-variable
24 CERRWARN += -Wno-parentheses
25 CERRWARN += -Wno-uninitialized
26 CERRWARN += -Wno-implicit-function-declaration
27 CERRWARN += -Wno-return-type
28 CERRWARN += -Wno-clobbered
30 # not linted
31 SMATCH=off
33 MAPFILE.INT.D= mapfile-intf-tcpdchk
34 MAPFILE.INT.M= mapfile-intf-tcpdmatch
35 MAPFILE.INT.F= mapfile-intf-tryfrom
37 tcpdchk := LDFLAGS +=$(MAPFILE.INT.D:%=-Wl,-M%)
38 tcpdmatch := LDFLAGS +=$(MAPFILE.INT.M:%=-Wl,-M%)
39 try-from := LDFLAGS +=$(MAPFILE.INT.F:%=-Wl,-M%)
41 .KEEP_STATE:
43 all: $(PROG)
45 install: all $(ROOTUSRSBINPROG)
47 clean:
48 $(RM) *.o
51 TCPDMATCH_OBJ= tcpdmatch.o fakelog.o inetcf.o scaffold.o
53 tcpdmatch: $(TCPDMATCH_OBJ) $(LIB) $(MAPFILE.INTF.M)
54 $(LINK.c) -o $@ $(TCPDMATCH_OBJ) $(LDLIBS)
55 $(POST_PROCESS)
57 try-from: try-from.o fakelog.o $(LIB) $(MAPFILE.INTF.F)
58 $(LINK.c) -o $@ try-from.o fakelog.o $(LDLIBS)
59 $(POST_PROCESS)
61 TCPDCHK_OBJ= tcpdchk.o fakelog.o inetcf.o scaffold.o
63 tcpdchk: $(TCPDCHK_OBJ) $(LIB) $(MAPFILE.INTF.C)
64 $(LINK.c) -o $@ $(TCPDCHK_OBJ) $(LDLIBS)
65 $(POST_PROCESS)
67 include ../Makefile.targ
69 # The rest of this file contains definitions more-or-less directly from the
70 # original Makefile of the tcp_wrappers distribution.
72 ##############################
73 # System parameters appropriate for Solaris 9
75 REAL_DAEMON_DIR = /usr/sbin
76 TLI = -DTLI
77 NETGROUP = -DNETGROUP
79 ##############################
80 # Start of the optional stuff.
82 ###########################################
83 # Optional: Turning on language extensions
85 # Instead of the default access control language that is documented in
86 # the hosts_access.5 document, the wrappers can be configured to
87 # implement an extensible language documented in the hosts_options.5
88 # document. This language is implemented by the "options.c" source
89 # module, which also gives hints on how to add your own extensions.
90 # Uncomment the next definition to turn on the language extensions
91 # (examples: allow, deny, banners, twist and spawn).
93 STYLE = -DPROCESS_OPTIONS # Enable language extensions.
95 ################################################################
96 # Optional: Changing the default disposition of logfile records
98 # By default, logfile entries are written to the same file as used for
99 # sendmail transaction logs. See your /etc/syslog.conf file for actual
100 # path names of logfiles. The tutorial section in the README file
101 # gives a brief introduction to the syslog daemon.
103 # Change the FACILITY definition below if you disagree with the default
104 # disposition. Some syslog versions (including Ultrix 4.x) do not provide
105 # this flexibility.
107 # If nothing shows up on your system, it may be that the syslog records
108 # are sent to a dedicated loghost. It may also be that no syslog daemon
109 # is running at all. The README file gives pointers to surrogate syslog
110 # implementations for systems that have no syslog library routines or
111 # no syslog daemons. When changing the syslog.conf file, remember that
112 # there must be TABs between fields.
114 # The LOG_XXX names below are taken from the /usr/include/syslog.h file.
116 FACILITY= LOG_MAIL # LOG_MAIL is what most sendmail daemons use
118 # The syslog priority at which successful connections are logged.
120 SEVERITY= LOG_INFO # LOG_INFO is normally not logged to the console
122 ######################################################
123 # Optional: Changing the default file protection mask
125 # On many systems, network daemons and other system processes are started
126 # with a zero umask value, so that world-writable files may be produced.
127 # It is a good idea to edit your /etc/rc* files so that they begin with
128 # an explicit umask setting. On our site we use `umask 022' because it
129 # does not break anything yet gives adequate protection against tampering.
131 # The following macro specifies the default umask for processes run under
132 # control of the daemon wrappers. Comment it out only if you are certain
133 # that inetd and its children are started with a safe umask value.
135 UMASK = -DDAEMON_UMASK=022
137 #######################################
138 # Optional: Turning off access control
140 # By default, host access control is enabled. To disable host access
141 # control, comment out the following definition. Host access control
142 # can also be turned off at runtime by providing no or empty access
143 # control tables.
145 ACCESS = -DHOSTS_ACCESS
147 ####################################################
148 # Optional: dealing with host name/address conflicts
150 # By default, the software tries to protect against hosts that claim to
151 # have someone elses host name. This is relevant for network services
152 # whose authentication depends on host names, such as rsh and rlogin.
154 # With paranoid mode on, connections will be rejected when the host name
155 # does not match the host address. Connections will also be rejected when
156 # the host name is available but cannot be verified.
158 # Comment out the following definition if you want more control over such
159 # requests. When paranoid mode is off and a host name double check fails,
160 # the client can be matched with the PARANOID access control pattern.
162 # Paranoid mode implies hostname lookup. In order to disable hostname
163 # lookups altogether, see the next section.
165 PARANOID= -DPARANOID
167 # The default username lookup timeout is 10 seconds. This may not be long
168 # enough for slow hosts or networks, but is enough to irritate PC users.
170 RFC931_TIMEOUT = 10
172 ########################################################
173 # Optional: Changing the access control table pathnames
175 # The HOSTS_ALLOW and HOSTS_DENY macros define where the programs will
176 # look for access control information. Watch out for the quotes and
177 # backslashes when you make changes.
179 TABLES = -DHOSTS_DENY=\"/etc/hosts.deny\" -DHOSTS_ALLOW=\"/etc/hosts.allow\"
181 #############################################
182 # Optional: Turning on host ADDRESS checking
184 # Optionally, the software tries to protect against hosts that pretend to
185 # have someone elses host address. This is relevant for network services
186 # whose authentication depends on host names, such as rsh and rlogin,
187 # because the network address is used to look up the remote host name.
189 # The protection is to refuse TCP connections with IP source routing
190 # options.
192 # This feature cannot be used with SunOS 4.x because of a kernel bug in
193 # the implementation of the getsockopt() system call. Kernel panics have
194 # been observed for SunOS 4.1.[1-3]. Symptoms are "BAD TRAP" and "Data
195 # fault" while executing the tcp_ctloutput() kernel function.
197 # Reportedly, Sun patch 100804-03 or 101790 fixes this for SunOS 4.1.x.
199 # Uncomment the following macro definition if your getsockopt() is OK.
201 # -DKILL_IP_OPTIONS is not needed on modern UNIX systems that can stop
202 # source-routed traffic in the kernel. Examples: 4.4BSD derivatives,
203 # Solaris 2.x, and Linux. See your system documentation for details.
205 # KILL_OPT= -DKILL_IP_OPTIONS
207 ## End configuration options
208 ############################