diff options
author | ngie <ngie@FreeBSD.org> | 2017-02-04 15:49:50 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2017-02-04 15:49:50 +0000 |
commit | 5f7f855015b0d6e4e3b8884a42299050e79eb889 (patch) | |
tree | f1a7e8f4a4f8eabb2015ceb843d5fa900dd6ca4c | |
parent | d3fc042af1518f7707e62e3e71b088119b19e20d (diff) | |
download | FreeBSD-src-5f7f855015b0d6e4e3b8884a42299050e79eb889.zip FreeBSD-src-5f7f855015b0d6e4e3b8884a42299050e79eb889.tar.gz |
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
-rw-r--r-- | usr.sbin/inetd/Makefile | 7 | ||||
-rw-r--r-- | usr.sbin/inetd/inetd.c | 8 |
2 files changed, 14 insertions, 1 deletions
diff --git a/usr.sbin/inetd/Makefile b/usr.sbin/inetd/Makefile index 6174592..da39008 100644 --- a/usr.sbin/inetd/Makefile +++ b/usr.sbin/inetd/Makefile @@ -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) diff --git a/usr.sbin/inetd/inetd.c b/usr.sbin/inetd/inetd.c index 9f91385..569154a 100644 --- a/usr.sbin/inetd/inetd.c +++ b/usr.sbin/inetd/inetd.c @@ -138,7 +138,9 @@ __FBSDID("$FreeBSD$"); #include <string.h> #include <sysexits.h> #include <syslog.h> +#ifdef LIBWRAP #include <tcpd.h> +#endif #include <unistd.h> #include "inetd.h" @@ -297,6 +299,7 @@ getvalue(const char *arg, int *value, const char *whine) 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 { |