From 9178dcce3626d36e4e42be09295e7247ecabb25e Mon Sep 17 00:00:00 2001 From: dholland Date: Wed, 10 Aug 2022 03:35:38 +0000 Subject: [PATCH] PR bin/56963 Mark Davies: inetd not configured for rpc Instead of using negative flags to turn on positive flags, set -DRPC in the makefile. Corrects a problem where the SunRPC code in parse.c was accidentally left disabled. This is a prime example of why we don't like negative flags... --- usr.sbin/inetd/Makefile | 5 ++++- usr.sbin/inetd/inetd.c | 9 ++------- usr.sbin/inetd/parse.c | 10 +++++++--- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/usr.sbin/inetd/Makefile b/usr.sbin/inetd/Makefile index 60058de25844..6e2521a3519e 100644 --- a/usr.sbin/inetd/Makefile +++ b/usr.sbin/inetd/Makefile @@ -1,5 +1,5 @@ # from: @(#)Makefile 8.1 (Berkeley) 6/6/93 -# $NetBSD: Makefile,v 1.30 2021/10/12 19:08:04 christos Exp $ +# $NetBSD: Makefile,v 1.31 2022/08/10 03:35:38 dholland Exp $ .include @@ -15,6 +15,9 @@ WARNS= 6 # Enables debug printouts when in debug mode CPPFLAGS+=-DDEBUG_ENABLE +# Enables SunRPC support +CPPFLAGS+=-DRPC + CPPFLAGS+=-DLIBWRAP # Use LIBWRAP_INTERNAL for libwrap checking of inetd's `internal' services. #CPPFLAGS+=-DLIBWRAP_INTERNAL diff --git a/usr.sbin/inetd/inetd.c b/usr.sbin/inetd/inetd.c index b301b1eb90bc..834bb6299315 100644 --- a/usr.sbin/inetd/inetd.c +++ b/usr.sbin/inetd/inetd.c @@ -1,4 +1,4 @@ -/* $NetBSD: inetd.c,v 1.139 2021/10/17 04:14:49 ryo Exp $ */ +/* $NetBSD: inetd.c,v 1.140 2022/08/10 03:35:38 dholland Exp $ */ /*- * Copyright (c) 1998, 2003 The NetBSD Foundation, Inc. @@ -66,7 +66,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1991, 1993, 1994\ #if 0 static char sccsid[] = "@(#)inetd.c 8.4 (Berkeley) 4/13/94"; #else -__RCSID("$NetBSD: inetd.c,v 1.139 2021/10/17 04:14:49 ryo Exp $"); +__RCSID("$NetBSD: inetd.c,v 1.140 2022/08/10 03:35:38 dholland Exp $"); #endif #endif /* not lint */ @@ -193,11 +193,6 @@ __RCSID("$NetBSD: inetd.c,v 1.139 2021/10/17 04:14:49 ryo Exp $"); #include #include - -#ifndef NO_RPC -#define RPC -#endif - #include #ifdef RPC diff --git a/usr.sbin/inetd/parse.c b/usr.sbin/inetd/parse.c index 5ffa5ece2cfa..fb754f8e6fd6 100644 --- a/usr.sbin/inetd/parse.c +++ b/usr.sbin/inetd/parse.c @@ -1,4 +1,4 @@ -/* $NetBSD: parse.c,v 1.3 2022/05/22 11:27:37 andvar Exp $ */ +/* $NetBSD: parse.c,v 1.4 2022/08/10 03:35:38 dholland Exp $ */ /*- * Copyright (c) 1998, 2003 The NetBSD Foundation, Inc. @@ -64,7 +64,7 @@ #if 0 static char sccsid[] = "@(#)inetd.c 8.4 (Berkeley) 4/13/94"; #else -__RCSID("$NetBSD: parse.c,v 1.3 2022/05/22 11:27:37 andvar Exp $"); +__RCSID("$NetBSD: parse.c,v 1.4 2022/08/10 03:35:38 dholland Exp $"); #endif #endif /* not lint */ @@ -91,6 +91,10 @@ __RCSID("$NetBSD: parse.c,v 1.3 2022/05/22 11:27:37 andvar Exp $"); #include #include +#ifdef RPC +#include +#endif + #include "inetd.h" static void config(void); @@ -321,7 +325,7 @@ config(void) if (sep->se_fd != -1) register_rpc(sep); } else -#endif +#endif /* RPC */ { if (sep->se_fd >= 0) close_sep(sep);