ypserv/ypserv-2.5-nfsnobody2.patch

97 lines
4.1 KiB
Diff
Raw Normal View History

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