Commit graph

14 commits

Author SHA1 Message Date
Gleb Smirnoff 1d9722de6f tcp_wrappers: recognize IPv6 addresses/prefixes
Intentionally or not, but the libwrap was written in such manner that
if your /etc/hosts.allow doesn't have any domain names, neither smart
keywords like LOCAL or KNOWN, then it will not try to resolve the
client address during the hosts check.  This was achieved with the
NOT_INADDR() check that matched IPv4 addresses/prefixes.  Extend this
to also skip resolve if client list token looks like IPv6.

Reviewed by:		philip, emaste
PR:			269456
Differential revision:	https://reviews.freebsd.org/D40070
2023-07-20 14:56:20 -07:00
Ed Maste 14f102eacc tcp_wrappers: Use ANSI (c89) function definitions
Although this code is in contrib/ there is no active upstream.

Reviewed by:	brooks
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36047
2023-03-21 10:09:34 -04:00
Piotr Pawel Stefaniak 9b6a8ee28d tcp_wrappers: remove duplicate errno declarations 2022-02-23 16:26:14 +01:00
Kyle Evans 4dbd8c72d3 tcp_wrappers: get rid of duplicate fgets declarations
This is declared in stdio.h, no need for this one.
2021-09-30 23:55:27 -05:00
Brooks Davis 068ad27de3 Use ANSI C function definitions and declerations.
Obtained from:	CheriBSD
MFC after:	1 week
Sponsored by:	DARPA, AFRL
2019-07-17 23:09:40 +00:00
Sean Bruno 707dd2b1d7 Queisce warning about undeclared function usage.
yp_get_default_domain is defined in workaround.c but is not declared
in any header file.  Tie the declaration to the same #define conditional
used when the function is called, NETGROUP
2013-10-30 22:45:35 +00:00
Sean Bruno 5375e4f833 Quiesce warning, which could be a bug IMO, by correctly defining the host_info
structure name
2013-10-30 22:43:40 +00:00
Sean Bruno 46bcf11d50 Quiesce warnings by updating headerfile includes 2013-10-30 21:18:14 +00:00
Maxim Sobolev d594463f1b Allow comment (#) to be placed anywhere in the line, not only at the
beginning, so it's consistent with other configuration files.

MFC after:	3 weeks
2010-01-08 10:54:15 +00:00
Hajimu UMEMOTO 4f10131848 NI_WITHSCOPEID cleanup. Neither RFC 2553 nor RFC 3493 defines
NI_WITHSCOPEID, and our getaddrinfo(3) does nothing special
for it, now.
2005-05-13 16:31:11 +00:00
Hajimu UMEMOTO b208ff84c1 Add IPv6 scoped address support.
It enables us to control link-local connections by interface like
this:

    ALL : [fe80::%ed0]/10 : allow
    ALL : [fe80::]/10 : deny
2000-07-14 17:15:34 +00:00
Yoshinobu Inoue 8053080cbc Missing tcp_wrapper IPv6 support seemed to be a bug, so commit it.
Now when tcp_wrapper is enabled by inetd -wW,
  several accesses which should be permitted are refused only for IPv6,
  if hostname is used to decide the host to be allowed.
  IPv6 users will be just upset.

  About security related concern.
    -All extensions are wrapped by #ifdef INET6, so people can completely
     disable the extension by recompile libwrap without INET6 option.
    -Access via IPv6 is not enabled by default.
     People need to enable IPv6 access by changing /etc/inetd.conf at first,
     by adding tcp6 and/or tcp46 entries.
    -The base of patches are from KAME package and are actually daily used
     for more than a year in several Japanese IPv6 environments.
    -Patches are reviewed by markm.

Approved by: jkh

Submitted by: Hajimu UMEMOTO <ume@mahoroba.org>
Reviewed by: markm
Obtained from: KAME project
2000-02-03 10:27:03 +00:00
Sheldon Hearn 99abb2876d Add the ``blacklist'' feature, which allows a path to a filename to
be used as a valid pattern in the access control language.

Patch obtained from ftp://ftp.porcupine.org/pub/security/ .

Requested by:	markm
1999-09-21 09:09:57 +00:00
Mark Murray 2aef693010 Clean import of TCP-wrappers by Wietse Venema.
Rest of build to follow.
1999-03-14 17:13:19 +00:00