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