Blame SOURCES/ypserv-2.5-nfsnobody2.patch

97edbe
diff -up ./scripts/ypMakefile.in.nfsnobody2 ./scripts/ypMakefile.in
97edbe
--- ./scripts/ypMakefile.in.nfsnobody2	2013-05-06 18:28:38.558327612 +0200
97edbe
+++ ./scripts/ypMakefile.in	2013-05-06 18:30:46.772434725 +0200
97edbe
@@ -40,6 +40,11 @@ YPPUSH_ARGS =
97edbe
 MINUID=500
97edbe
 MINGID=500
97edbe
 
97edbe
+# Don't export this uid/guid (nfsnobody).
97edbe
+# Set to 0 if you want to
97edbe
+NFSNOBODYUID=65534
97edbe
+NFSNOBODYGID=65534
97edbe
+
97edbe
 # Should we merge the passwd file with the shadow file ?
97edbe
 # MERGE_PASSWD=true|false
97edbe
 MERGE_PASSWD=true
97edbe
@@ -294,7 +299,7 @@ passwd.byname: $(PASSWD) $(SHADOW) $(YPD
97edbe
 	@echo "Updating $@..."
97edbe
 	@$(UMASK); \
97edbe
 	$(MERGER) -p $(PASSWD) $(SHADOW) | \
97edbe
-	   $(AWK) -F: '!/^[-+#]/ { if ($$1 != "" && $$3 >= $(MINUID) ) \
97edbe
+	   $(AWK) -F: '!/^[-+#]/ { if ($$1 != "" && $$3 >= $(MINUID) && $$3 != $(NFSNOBODYUID) ) \
97edbe
 	   print $$1"\t"$$0 }' | $(DBLOAD) -i $(PASSWD) \
97edbe
 		-o $(YPMAPDIR)/$@ - $@
97edbe
 	-@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
97edbe
@@ -303,7 +308,7 @@ passwd.byuid: $(PASSWD) $(SHADOW) $(YPDI
97edbe
 	@echo "Updating $@..."
97edbe
 	@$(UMASK); \
97edbe
 	$(MERGER) -p $(PASSWD) $(SHADOW) | \
97edbe
-	   $(AWK) -F: '!/^[-+#]/ { if ($$1 != "" && $$3 >= $(MINUID) ) \
97edbe
+	   $(AWK) -F: '!/^[-+#]/ { if ($$1 != "" && $$3 >= $(MINUID) && $$3 != $(NFSNOBODYUID) ) \
97edbe
 	   print $$3"\t"$$0 }' | $(DBLOAD) -i $(PASSWD) \
97edbe
 		 -o $(YPMAPDIR)/$@ - $@
97edbe
 	-@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
97edbe
@@ -317,7 +322,7 @@ else
97edbe
 passwd.byname: $(PASSWD) $(YPDIR)/Makefile
97edbe
 	@echo "Updating $@..."
97edbe
 	@$(UMASK); \
97edbe
-	$(AWK) -F: '!/^[-+#]/ { if ($$1 != "" && $$3 >= $(MINUID) ) \
97edbe
+	$(AWK) -F: '!/^[-+#]/ { if ($$1 != "" && $$3 >= $(MINUID) && $$3 != $(NFSNOBODYUID) ) \
97edbe
 	   print $$1"\t"$$0 }' $(PASSWD) | $(DBLOAD) -i $(PASSWD) \
97edbe
 		-o $(YPMAPDIR)/$@ - $@
97edbe
 	-@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
97edbe
@@ -325,7 +330,7 @@ passwd.byname: $(PASSWD) $(YPDIR)/Makefi
97edbe
 passwd.byuid: $(PASSWD) $(YPDIR)/Makefile
97edbe
 	@echo "Updating $@..."
97edbe
 	@$(UMASK); \
97edbe
-	$(AWK) -F: '!/^[-+#]/ { if ($$1 != "" && $$3 >= $(MINUID) ) \
97edbe
+	$(AWK) -F: '!/^[-+#]/ { if ($$1 != "" && $$3 >= $(MINUID) && $$3 != $(NFSNOBODYUID) ) \
97edbe
 	   print $$3"\t"$$0 }' $(PASSWD) | $(DBLOAD) -i $(PASSWD) \
97edbe
 		 -o $(YPMAPDIR)/$@ - $@
97edbe
 	-@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
97edbe
@@ -334,7 +339,7 @@ shadow.byname: $(SHADOW) $(YPDIR)/Makefi
97edbe
 	@echo "Updating $@..."
97edbe
 	@$(UMASK); \
97edbe
 	$(AWK) -F: '{ if (FILENAME ~ /shadow$$/) { \
97edbe
-		if (UID[$$1] >= $(MINUID) ) print $$1"\t"$$0; \
97edbe
+		if (UID[$$1] >= $(MINUID) && UID[$$1] != $(NFSNOBODYUID)) print $$1"\t"$$0; \
97edbe
 			} else UID[$$1] = $$3; }' $(PASSWD) $(SHADOW) \
97edbe
 		| $(DBLOAD) -s -i $(SHADOW) -o $(YPMAPDIR)/$@ - $@
97edbe
 	-@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
97edbe
@@ -353,7 +358,7 @@ group.byname: $(GROUP) $(GSHADOW) $(YPDI
97edbe
 	@echo "Updating $@..."
97edbe
 	@$(UMASK); \
97edbe
 	$(MERGER) -g $(GROUP) $(GSHADOW) | \
97edbe
-	$(AWK) -F: '!/^[-+#]/ { if ($$1 != "" && $$3 >= $(MINGID) ) \
97edbe
+	$(AWK) -F: '!/^[-+#]/ { if ($$1 != "" && $$3 >= $(MINGID) && $$3 != $(NFSNOBODYGID) ) \
97edbe
 	print $$1"\t"$$0 }' | $(DBLOAD) -i $(GROUP) -o $(YPMAPDIR)/$@ - $@
97edbe
 	-@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
97edbe
 
97edbe
@@ -361,7 +366,7 @@ group.bygid: $(GROUP) $(GSHADOW) $(YPDIR
97edbe
 	@echo "Updating $@..."
97edbe
 	@$(UMASK); \
97edbe
 	$(MERGER) -g $(GROUP) $(GSHADOW) | \
97edbe
-	$(AWK) -F: '!/^[-+#]/ { if ($$1 != "" && $$3 >= $(MINGID) ) \
97edbe
+	$(AWK) -F: '!/^[-+#]/ { if ($$1 != "" && $$3 >= $(MINGID) && $$3 != $(NFSNOBODYGID) ) \
97edbe
 	print $$3"\t"$$0 }' | $(DBLOAD) -i $(GROUP) -o $(YPMAPDIR)/$@ - $@
97edbe
 	-@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
97edbe
 
97edbe
@@ -370,7 +375,7 @@ else
97edbe
 group.byname: $(GROUP) $(YPDIR)/Makefile
97edbe
 	@echo "Updating $@..."
97edbe
 	@$(UMASK); \
97edbe
-	$(AWK) -F: '!/^[-+#]/ { if ($$1 != "" && $$3 >= $(MINGID) ) \
97edbe
+	$(AWK) -F: '!/^[-+#]/ { if ($$1 != "" && $$3 >= $(MINGID) && $$3 != $(NFSNOBODYGID) ) \
97edbe
 					print $$1"\t"$$0 }' $(GROUP) \
97edbe
 		| $(DBLOAD) -i $(GROUP) -o $(YPMAPDIR)/$@ - $@
97edbe
 	-@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
97edbe
@@ -378,7 +383,7 @@ group.byname: $(GROUP) $(YPDIR)/Makefile
97edbe
 group.bygid: $(GROUP) $(YPDIR)/Makefile
97edbe
 	@echo "Updating $@..."
97edbe
 	@$(UMASK); \
97edbe
-	$(AWK) -F: '!/^[-+#]/ { if ($$1 != "" && $$3 >= $(MINGID) ) \
97edbe
+	$(AWK) -F: '!/^[-+#]/ { if ($$1 != "" && $$3 >= $(MINGID) && $$3 != $(NFSNOBODYGID) ) \
97edbe
 					print $$3"\t"$$0 }' $(GROUP) \
97edbe
 		| $(DBLOAD) -i $(GROUP) -o $(YPMAPDIR)/$@ - $@
97edbe
 	-@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@