Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/ypserv/ypinit Commit the patches in Wolfgang Stuken...
details: https://anonhg.NetBSD.org/src/rev/ec0f79bc63df
branches: trunk
changeset: 788776:ec0f79bc63df
user: hauke <hauke%NetBSD.org@localhost>
date: Fri Jul 19 11:44:51 2013 +0000
description:
Commit the patches in Wolfgang Stukenbrock's PR bin/41896.
(1) Do not serve UIDs below MINUID in master.passwd.* maps,
just like in passwd.* maps.
(2) Since stdethers(8) and stdhosts(8) strip comments, we do
not have to do it here, much less inconsistently.
diffstat:
usr.sbin/ypserv/ypinit/Makefile.yp | 18 ++++++++++--------
1 files changed, 10 insertions(+), 8 deletions(-)
diffs (55 lines):
diff -r 986ef5ac499c -r ec0f79bc63df usr.sbin/ypserv/ypinit/Makefile.yp
--- a/usr.sbin/ypserv/ypinit/Makefile.yp Fri Jul 19 11:43:18 2013 +0000
+++ b/usr.sbin/ypserv/ypinit/Makefile.yp Fri Jul 19 11:44:51 2013 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.yp,v 1.21 2006/10/07 16:54:38 elad Exp $
+# $NetBSD: Makefile.yp,v 1.22 2013/07/19 11:44:51 hauke Exp $
#
# This is the YP Makefile, used to create and push YP maps.
#
@@ -112,12 +112,14 @@
${MAKEDBM} - passwd.byuid; \
fi; \
${CAT} ${.ALLSRC} | \
- ${AWK} 'BEGIN { FS=":"; OFS="\t"; } /^[a-zA-Z0-9_]/ \
- { print $$1, $$0 }' - | ${SORT} | \
+ ${AWK} -v minuid=${MINUID} \
+ 'BEGIN { FS=":"; OFS="\t"; } /^[a-zA-Z0-9_]/ \
+ { if (minuid <= $$3) print $$1, $$0 }' - | ${SORT} | \
${MAKEDBM_S} - master.passwd.byname; \
${CAT} ${.ALLSRC} | \
- ${AWK} 'BEGIN { FS=":"; OFS="\t"; } /^[a-zA-Z0-9_]/ \
- { print $$3, $$0 }' - | ${SORT} | \
+ ${AWK} -v minuid=${MINUID} \
+ 'BEGIN { FS=":"; OFS="\t"; } /^[a-zA-Z0-9_]/ \
+ { if (minuid <= $$3) print $$3, $$0 }' - | ${SORT} | \
${MAKEDBM_S} - master.passwd.byuid; \
${TOUCH} ${.TARGET}; \
${ECHO} "updated passwd"; \
@@ -198,7 +200,7 @@
ethers.time: ${DIR}/ethers
-@if [ -f ${.ALLSRC} ]; then \
- ${STDETHERS} ${.ALLSRC} | ${SED} -e s/#.*$$// | \
+ ${STDETHERS} ${.ALLSRC} | \
${AWK} 'BEGIN { FS="\t"; OFS="\t"; } { print $$1, $$0 }' | \
${SORT} | ${MAKEDBM} - ethers.byaddr; \
${STDETHERS} ${.ALLSRC} | \
@@ -257,7 +259,7 @@
#
hosts.time: ${DIR}/hosts
-@if [ -f ${.ALLSRC} ]; then \
- ${STDHOSTS} ${.ALLSRC} | ${SED} -e s/#.*$$// | \
+ ${STDHOSTS} ${.ALLSRC} | \
${AWK} '{for (i = 2; i <= NF; i++) print $$i, $$0 }' | \
${SORT} | ${MAKEDBM} - hosts.byname; \
${STDHOSTS} ${.ALLSRC} | \
@@ -279,7 +281,7 @@
ipnodes.time: ${DIR}/hosts
-@if [ -f ${.ALLSRC} ]; then \
- ${STDHOSTS} -n ${.ALLSRC} | ${SED} -e s/#.*$$// | \
+ ${STDHOSTS} -n ${.ALLSRC} | \
${AWK} '{for (i = 2; i <= NF; i++) print $$i, $$0 }' | \
${SORT} | ${MAKEDBM} - ipnodes.byname; \
${STDHOSTS} -n ${.ALLSRC} | \
Home |
Main Index |
Thread Index |
Old Index