1eaaa3
diff -up ypserv-2.32/scripts/ypMakefile.in.nfsnobody ypserv-2.32/scripts/ypMakefile.in
1eaaa3
--- ypserv-2.32/scripts/ypMakefile.in.nfsnobody	2013-11-18 09:19:58.092797179 +0100
1eaaa3
+++ ypserv-2.32/scripts/ypMakefile.in	2013-11-18 09:20:39.885790669 +0100
1eaaa3
@@ -40,6 +40,11 @@ YPPUSH_ARGS =
1eaaa3
 MINUID=$(shell TMP=`egrep '^UID_MIN\s+[0-9]+' /etc/login.defs|sed -e 's/^UID_MIN//'` ; [ -n "$$TMP" ] && echo "$$TMP" || echo 1000)
1eaaa3
 MINGID=$(shell TMP=`egrep '^GID_MIN\s+[0-9]+' /etc/login.defs|sed -e 's/^GID_MIN//'` ; [ -n "$$TMP" ] && echo "$$TMP" || echo 1000)
1eaaa3
 
1eaaa3
+# Don't export this uid/guid (nfsnobody).
1eaaa3
+# Set to 0 if you want to
1eaaa3
+NFSNOBODYUID=65534
1eaaa3
+NFSNOBODYGID=65534
1eaaa3
+
1eaaa3
 # Should we merge the passwd file with the shadow file ?
1eaaa3
 # MERGE_PASSWD=true|false
1eaaa3
 MERGE_PASSWD=true
1eaaa3
@@ -294,7 +299,7 @@ passwd.byname: $(PASSWD) $(SHADOW) $(YPD
1eaaa3
 	@echo "Updating $@..."
1eaaa3
 	@$(UMASK); \
1eaaa3
 	$(MERGER) -p $(PASSWD) $(SHADOW) | \
1eaaa3
-	   $(AWK) -F: '!/^[-+#]/ { if ($$1 != "" && $$3 >= $(MINUID) ) \
1eaaa3
+	   $(AWK) -F: '!/^[-+#]/ { if ($$1 != "" && $$3 >= $(MINUID) && $$3 != $(NFSNOBODYUID) ) \
1eaaa3
 	   print $$1"\t"$$0 }' | $(DBLOAD) -i $(PASSWD) \
1eaaa3
 		-o $(YPMAPDIR)/$@ - $@
1eaaa3
 	-@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
1eaaa3
@@ -303,7 +308,7 @@ passwd.byuid: $(PASSWD) $(SHADOW) $(YPDI
1eaaa3
 	@echo "Updating $@..."
1eaaa3
 	@$(UMASK); \
1eaaa3
 	$(MERGER) -p $(PASSWD) $(SHADOW) | \
1eaaa3
-	   $(AWK) -F: '!/^[-+#]/ { if ($$1 != "" && $$3 >= $(MINUID) ) \
1eaaa3
+	   $(AWK) -F: '!/^[-+#]/ { if ($$1 != "" && $$3 >= $(MINUID) && $$3 != $(NFSNOBODYUID) ) \
1eaaa3
 	   print $$3"\t"$$0 }' | $(DBLOAD) -i $(PASSWD) \
1eaaa3
 		 -o $(YPMAPDIR)/$@ - $@
1eaaa3
 	-@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
1eaaa3
@@ -317,7 +322,7 @@ else
1eaaa3
 passwd.byname: $(PASSWD) $(YPDIR)/Makefile
1eaaa3
 	@echo "Updating $@..."
1eaaa3
 	@$(UMASK); \
1eaaa3
-	$(AWK) -F: '!/^[-+#]/ { if ($$1 != "" && $$3 >= $(MINUID) ) \
1eaaa3
+	$(AWK) -F: '!/^[-+#]/ { if ($$1 != "" && $$3 >= $(MINUID) && $$3 != $(NFSNOBODYUID) ) \
1eaaa3
 	   print $$1"\t"$$0 }' $(PASSWD) | $(DBLOAD) -i $(PASSWD) \
1eaaa3
 		-o $(YPMAPDIR)/$@ - $@
1eaaa3
 	-@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
1eaaa3
@@ -325,7 +330,7 @@ passwd.byname: $(PASSWD) $(YPDIR)/Makefi
1eaaa3
 passwd.byuid: $(PASSWD) $(YPDIR)/Makefile
1eaaa3
 	@echo "Updating $@..."
1eaaa3
 	@$(UMASK); \
1eaaa3
-	$(AWK) -F: '!/^[-+#]/ { if ($$1 != "" && $$3 >= $(MINUID) ) \
1eaaa3
+	$(AWK) -F: '!/^[-+#]/ { if ($$1 != "" && $$3 >= $(MINUID) && $$3 != $(NFSNOBODYUID) ) \
1eaaa3
 	   print $$3"\t"$$0 }' $(PASSWD) | $(DBLOAD) -i $(PASSWD) \
1eaaa3
 		 -o $(YPMAPDIR)/$@ - $@
1eaaa3
 	-@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
1eaaa3
@@ -334,7 +339,7 @@ shadow.byname: $(SHADOW) $(YPDIR)/Makefi
1eaaa3
 	@echo "Updating $@..."
1eaaa3
 	@$(UMASK); \
1eaaa3
 	$(AWK) -F: '{ if (FILENAME ~ /shadow$$/) { \
1eaaa3
-		if (UID[$$1] >= $(MINUID) ) print $$1"\t"$$0; \
1eaaa3
+		if (UID[$$1] >= $(MINUID) && UID[$$1] != $(NFSNOBODYUID)) print $$1"\t"$$0; \
1eaaa3
 			} else UID[$$1] = $$3; }' $(PASSWD) $(SHADOW) \
1eaaa3
 		| $(DBLOAD) -s -i $(SHADOW) -o $(YPMAPDIR)/$@ - $@
1eaaa3
 	-@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
1eaaa3
@@ -353,7 +358,7 @@ group.byname: $(GROUP) $(GSHADOW) $(YPDI
1eaaa3
 	@echo "Updating $@..."
1eaaa3
 	@$(UMASK); \
1eaaa3
 	$(MERGER) -g $(GROUP) $(GSHADOW) | \
1eaaa3
-	$(AWK) -F: '!/^[-+#]/ { if ($$1 != "" && $$3 >= $(MINGID) ) \
1eaaa3
+	$(AWK) -F: '!/^[-+#]/ { if ($$1 != "" && $$3 >= $(MINGID) && $$3 != $(NFSNOBODYGID) ) \
1eaaa3
 	print $$1"\t"$$0 }' | $(DBLOAD) -i $(GROUP) -o $(YPMAPDIR)/$@ - $@
1eaaa3
 	-@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
1eaaa3
 
1eaaa3
@@ -361,7 +366,7 @@ group.bygid: $(GROUP) $(GSHADOW) $(YPDIR
1eaaa3
 	@echo "Updating $@..."
1eaaa3
 	@$(UMASK); \
1eaaa3
 	$(MERGER) -g $(GROUP) $(GSHADOW) | \
1eaaa3
-	$(AWK) -F: '!/^[-+#]/ { if ($$1 != "" && $$3 >= $(MINGID) ) \
1eaaa3
+	$(AWK) -F: '!/^[-+#]/ { if ($$1 != "" && $$3 >= $(MINGID) && $$3 != $(NFSNOBODYGID) ) \
1eaaa3
 	print $$3"\t"$$0 }' | $(DBLOAD) -i $(GROUP) -o $(YPMAPDIR)/$@ - $@
1eaaa3
 	-@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
1eaaa3
 
1eaaa3
@@ -370,7 +375,7 @@ else
1eaaa3
 group.byname: $(GROUP) $(YPDIR)/Makefile
1eaaa3
 	@echo "Updating $@..."
1eaaa3
 	@$(UMASK); \
1eaaa3
-	$(AWK) -F: '!/^[-+#]/ { if ($$1 != "" && $$3 >= $(MINGID) ) \
1eaaa3
+	$(AWK) -F: '!/^[-+#]/ { if ($$1 != "" && $$3 >= $(MINGID) && $$3 != $(NFSNOBODYGID) ) \
1eaaa3
 					print $$1"\t"$$0 }' $(GROUP) \
1eaaa3
 		| $(DBLOAD) -i $(GROUP) -o $(YPMAPDIR)/$@ - $@
1eaaa3
 	-@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
1eaaa3
@@ -378,7 +383,7 @@ group.byname: $(GROUP) $(YPDIR)/Makefile
1eaaa3
 group.bygid: $(GROUP) $(YPDIR)/Makefile
1eaaa3
 	@echo "Updating $@..."
1eaaa3
 	@$(UMASK); \
1eaaa3
-	$(AWK) -F: '!/^[-+#]/ { if ($$1 != "" && $$3 >= $(MINGID) ) \
1eaaa3
+	$(AWK) -F: '!/^[-+#]/ { if ($$1 != "" && $$3 >= $(MINGID) && $$3 != $(NFSNOBODYGID) ) \
1eaaa3
 					print $$3"\t"$$0 }' $(GROUP) \
1eaaa3
 		| $(DBLOAD) -i $(GROUP) -o $(YPMAPDIR)/$@ - $@
1eaaa3
 	-@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@