From owner-svn-src-all@freebsd.org Sat Feb 4 15:49:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E08C7CD0641; Sat, 4 Feb 2017 15:49:51 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92E47DFD; Sat, 4 Feb 2017 15:49:51 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v14Fno3Q049012; Sat, 4 Feb 2017 15:49:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v14FnopW049010; Sat, 4 Feb 2017 15:49:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702041549.v14FnopW049010@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 4 Feb 2017 15:49:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r313203 - stable/11/usr.sbin/inetd X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2017 15:49:52 -0000 Author: ngie Date: Sat Feb 4 15:49:50 2017 New Revision: 313203 URL: https://svnweb.freebsd.org/changeset/base/313203 Log: MFC r312105,r312162: r312105: Conditionalize libwrap support into inetd based on MK_TCP_WRAPPERS This will allow inetd to stand by itself without libwrap. Relnotes: yes r312162: Fix up r312105 - Only #include tcpd.h when LIBWRAP is true to avoid header include errors - Only define whichaf when LIBWRAP is true to avoid -Wunused warning and to avoid issues with structs being defined that should only be defined when tcpd.h is included. Pointyhat to: ngie Modified: stable/11/usr.sbin/inetd/Makefile stable/11/usr.sbin/inetd/inetd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/inetd/Makefile ============================================================================== --- stable/11/usr.sbin/inetd/Makefile Sat Feb 4 15:48:53 2017 (r313202) +++ stable/11/usr.sbin/inetd/Makefile Sat Feb 4 15:49:50 2017 (r313203) @@ -16,7 +16,12 @@ CFLAGS+= -DLOGIN_CAP CFLAGS+= -DINET6 .endif -LIBADD= util wrap +LIBADD= util + +.if ${MK_TCP_WRAPPERS} != "no" +CFLAGS+= -DLIBWRAP +LIBADD+= wrap +.endif # XXX for src/release/picobsd .if !defined(RELEASE_CRUNCH) Modified: stable/11/usr.sbin/inetd/inetd.c ============================================================================== --- stable/11/usr.sbin/inetd/inetd.c Sat Feb 4 15:48:53 2017 (r313202) +++ stable/11/usr.sbin/inetd/inetd.c Sat Feb 4 15:49:50 2017 (r313203) @@ -138,7 +138,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef LIBWRAP #include +#endif #include #include "inetd.h" @@ -297,6 +299,7 @@ getvalue(const char *arg, int *value, co return 0; /* success */ } +#ifdef LIBWRAP static sa_family_t whichaf(struct request_info *req) { @@ -310,6 +313,7 @@ whichaf(struct request_info *req) return AF_INET; return sa->sa_family; } +#endif int main(int argc, char **argv) @@ -324,9 +328,11 @@ main(int argc, char **argv) #ifdef LOGIN_CAP login_cap_t *lc = NULL; #endif +#ifdef LIBWRAP struct request_info req; int denied; char *service = NULL; +#endif struct sockaddr_storage peer; int i; struct addrinfo hints, *res; @@ -736,6 +742,7 @@ main(int argc, char **argv) _exit(0); } } +#ifdef LIBWRAP if (ISWRAP(sep)) { inetd_setproctitle("wrapping", ctrl); service = sep->se_server_name ? @@ -764,6 +771,7 @@ main(int argc, char **argv) (whichaf(&req) == AF_INET6) ? "6" : ""); } } +#endif if (sep->se_bi) { (*sep->se_bi->bi_fn)(ctrl, sep); } else {