summaryrefslogtreecommitdiff
path: root/usr.sbin/ypserv/ypinit
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/ypserv/ypinit')
-rw-r--r--usr.sbin/ypserv/ypinit/Makefile.yp24
-rw-r--r--usr.sbin/ypserv/ypinit/Makefile.yp.810
2 files changed, 15 insertions, 19 deletions
diff --git a/usr.sbin/ypserv/ypinit/Makefile.yp b/usr.sbin/ypserv/ypinit/Makefile.yp
index a46786c20f1..5215ccb045b 100644
--- a/usr.sbin/ypserv/ypinit/Makefile.yp
+++ b/usr.sbin/ypserv/ypinit/Makefile.yp
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.yp,v 1.16 2010/01/20 23:20:28 schwarze Exp $
+# $OpenBSD: Makefile.yp,v 1.17 2015/11/29 15:20:46 rpe Exp $
# ----------------------------------------------------------------------
# User-configurable settings; see Makefile.yp(8) for details.
@@ -46,8 +46,6 @@ REVNETGROUP=/usr/sbin/revnetgroup
RM=/bin/rm
SED=/usr/bin/sed
SENDMAIL=/usr/sbin/sendmail
-STDETHERS=/usr/sbin/stdethers
-STDHOSTS=/usr/sbin/stdhosts
TOUCH=/usr/bin/touch
YPPUSH=/usr/sbin/yppush
@@ -133,11 +131,13 @@ group.time: $(DIR)/group
hosts.time: $(DIR)/hosts
-@if [ -f $(DIR)/hosts ]; then \
- $(STDHOSTS) $(>) | $(SED) -e s/#.*$$// | \
- $(AWK) '{for (i = 2; i <= NF; i++) print $$i, $$0 }' | \
+ $(SED) -E -e 's/[[:blank:]]*#.*$$//' -e '/^$$/d' $(>) | \
+ $(AWK) 'BEGIN { OFS="\t" } \
+ { if (length() > 1024) next; for (i=2; i <= NF; i++) print $$i,$$0 }' | \
$(MAKEDBM) $(USEDNS) - hosts.byname; \
- $(STDHOSTS) $(>) | \
- $(AWK) 'BEGIN { OFS="\t"; } { print $$1, $$0 }' | \
+ $(SED) -E -e 's/[[:blank:]]*#.*$$//' -e '/^$$/d' $(>) | \
+ $(AWK) 'BEGIN { OFS="\t" } \
+ { if (length() > 1024) next; print $$1,$$0 }' | \
$(MAKEDBM) $(USEDNS) - hosts.byaddr; \
$(TOUCH) $(@); \
$(ECHO) "updated hosts"; \
@@ -154,11 +154,13 @@ hosts.time: $(DIR)/hosts
ethers.time: $(DIR)/ethers
-@if [ -f $(DIR)/ethers ]; then \
- $(STDETHERS) $(>) | $(SED) -e s/#.*$$// | \
- $(AWK) 'BEGIN { FS="\t"; OFS="\t"; } { print $$1, $$0 }' | \
+ $(SED) -E -e 's/[[:blank:]]*#.*$$//' -e '/^$$/d' $(>) | \
+ $(SED) -E -n '/^([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}[[:blank:]]/p' | \
+ $(AWK) 'BEGIN { OFS="\t" } { if (length() > 1024) next; print $$1,$$0 }' | \
$(MAKEDBM) - ethers.byaddr; \
- $(STDETHERS) $(>) | \
- $(AWK) 'BEGIN { FS="\t"; OFS="\t"; } { print $$2, $$0 }' | \
+ $(SED) -E -e 's/[[:blank:]]*#.*$$//' -e '/^$$/d' $(>) | \
+ $(SED) -E -n '/^([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}[[:blank:]]/p' | \
+ $(AWK) 'BEGIN { OFS="\t" } { if (length() > 1024) next; print $$2,$$0 }' | \
$(MAKEDBM) - ethers.byname; \
$(TOUCH) $(@); \
$(ECHO) "updated ethers"; \
diff --git a/usr.sbin/ypserv/ypinit/Makefile.yp.8 b/usr.sbin/ypserv/ypinit/Makefile.yp.8
index f0695ec91e5..a3d640206c9 100644
--- a/usr.sbin/ypserv/ypinit/Makefile.yp.8
+++ b/usr.sbin/ypserv/ypinit/Makefile.yp.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: Makefile.yp.8,v 1.6 2010/01/20 23:20:28 schwarze Exp $
+.\" $OpenBSD: Makefile.yp.8,v 1.7 2015/11/29 15:20:46 rpe Exp $
.\"
.\" Copyright (c) 2008 Ingo Schwarze <schwarze@usta.de>
.\"
@@ -14,7 +14,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: January 20 2010 $
+.Dd $Mdocdate: November 29 2015 $
.Dt MAKEFILE.YP 8
.Os
.Sh NAME
@@ -187,9 +187,6 @@ maps from
.Xr hosts 5
for use by
.Xr gethostbyname 3 .
-Requires the
-.Xr stdhosts 8
-utility.
.Pp
To get
.Xr ypserv 8
@@ -206,9 +203,6 @@ maps from
.Xr ethers 5
for use by
.Xr ethers 3 .
-Requires the
-.Xr stdethers 8
-utility.
.It Ic networks
Generates the
.Pa networks.byname