NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/41896: yp-makefile ignores MINUSER setting for master.passwd file



>Number:         41896
>Category:       bin
>Synopsis:       yp-makefile ignores MINUSER setting for master.passwd file
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Aug 16 10:10:00 +0000 2009
>Originator:     Wolfgang Stukenbrock
>Release:        NetBSD 4.0
>Organization:
Dr. Nagler & Company GmbH
        
>Environment:
        
        
System: NetBSD s012 4.0 NetBSD 4.0 (NSW-S012) #9: Fri Mar 13 12:31:52 CET 2009 
wgstuken@s012:/usr/src/sys/arch/amd64/compile/NSW-S012 amd64
Architecture: x86_64
Machine: amd64
>Description:
        The yp-makefile (/var/yp/Makefile.yp) has support to insert only user 
and group id's above a given value into the yp-maps.
        The required compare operateion is missing for the two master.passwd 
map files.
        It makes no sence to exclude theese ID's from the "normal" yp-map, but 
include it into the "root"-access only map.
        This can only end up with surprised users and inkonsisten system 
behaviour.

        The following fix will fix three other minor things too.
        The programs stdethers and stdhosts will output no comments lines at 
all. So it is useles to filter them out in a separate statement.
        The yp-makefile (/var/yp/Makefile.yp) has support to insert only user 
and group id's above a given value into the yp-maps.
        The required compare operateion is missing for the two master.passwd 
map files.
        It makes no sence to exclude theese ID's from the "normal" yp-map, but 
include it into the "root"-access only map.
        This can only end up with surprised users and inkonsisten system 
behaviour.

        The following fix will fix three other minor things too.
        The programs stdethers and stdhosts will output no comments lines at 
all. So it is useles to filter them out in a separate statement.
        It is even more senseless to to it for the .byaddr map and not for the 
.byname map or the other way round.
>How-To-Repeat:
        Setup a MINUID value and genere the password maps. The id's that should 
be excluded are still in the master.passwd maps.
>Fix:
        The following patch will fix the problem.
        Even in master.passwd.xx maps all uid's less MINUID gets excluded.
        The useless sed statemens for comment-filtereing are removed too.

--- Makefile.yp 2009/08/16 10:28:08     1.1
+++ Makefile.yp 2009/08/16 10:52:13
@@ -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} | \

>Unformatted:
        
        


Home | Main Index | Thread Index | Old Index