b0f15a
MINUID and MINGID should match the values UID_MIN and GID_MIN in
b0f15a
/etc/login.defs to be consistent and to not distribute uids and gids
b0f15a
used by the linux system.
b0f15a
b0f15a
However, we can't simply change values to 1000 since on upgraded systems
b0f15a
that keep using UIDs 501+ and haven't changed /var/yp/Makefile, the Makefile
b0f15a
would actually be updated and UIDs lower than 1000 won't be included in maps.
b0f15a
b0f15a
Thus, we will read MINUID and MINGID values from /etc/login.defs
b0f15a
b0f15a
RHBZ#1004090
b0f15a
b0f15a
diff -up ypserv-2.31/scripts/ypMakefile.in.minuid ypserv-2.31/scripts/ypMakefile.in
b0f15a
--- ypserv-2.31/scripts/ypMakefile.in.minuid	2013-09-04 13:29:12.294945130 +0200
b0f15a
+++ ypserv-2.31/scripts/ypMakefile.in	2013-09-04 13:31:07.308820321 +0200
b0f15a
@@ -37,8 +37,10 @@ YPPUSH_ARGS =
b0f15a
 # the passwd file. If no entry is found, this shadow entry is
b0f15a
 # ignored.
b0f15a
 # MINGID is the lowest gid that will be included in the group maps.
b0f15a
-MINUID=500
b0f15a
-MINGID=500
b0f15a
+# You can either set values directly (e.g. MINUID=1000) or pick up
b0f15a
+# current values from /etc/login.defs
b0f15a
+MINUID=$(shell TMP=`egrep '^UID_MIN\s+[0-9]+' /etc/login.defs|sed -e 's/^UID_MIN//'` ; [ -n "$$TMP" ] && echo "$$TMP" || echo 1000)
b0f15a
+MINGID=$(shell TMP=`egrep '^GID_MIN\s+[0-9]+' /etc/login.defs|sed -e 's/^GID_MIN//'` ; [ -n "$$TMP" ] && echo "$$TMP" || echo 1000)
b0f15a
 
b0f15a
 # Don't export this uid/guid (nfsnobody).
b0f15a
 # Set to 0 if you want to