about summary refs log tree commit diff
path: root/nss/db-Makefile
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-12-21 12:39:47 +0000
committerUlrich Drepper <drepper@redhat.com>1998-12-21 12:39:47 +0000
commit361d49e6a4463bd86aba76a67c2b1dc0348f711a (patch)
treee951bd9f2702b970dd86bfcb4652990c0c1a4458 /nss/db-Makefile
parentd17a729b483109285ac4913c3fe4f2c620b87fc6 (diff)
downloadglibc-361d49e6a4463bd86aba76a67c2b1dc0348f711a.tar.gz
glibc-361d49e6a4463bd86aba76a67c2b1dc0348f711a.tar.xz
glibc-361d49e6a4463bd86aba76a67c2b1dc0348f711a.zip
Update.
	* nss/db-Makefile (shadow.db): Create file with correct protections.
	Based on a patch by Joel Klecker <espy@debian.org>.
Diffstat (limited to 'nss/db-Makefile')
-rw-r--r--nss/db-Makefile13
1 files changed, 12 insertions, 1 deletions
diff --git a/nss/db-Makefile b/nss/db-Makefile
index a0dad0fd6a..f281d4d0e0 100644
--- a/nss/db-Makefile
+++ b/nss/db-Makefile
@@ -111,8 +111,19 @@ $(VAR_DB)/shadow.db: /etc/shadow
 		 /^[ \t]*#/ { next } \
 		 { printf "0%u ", cnt++; print } \
 		 /^[^#]/ { printf ".%s ", $$1; print }' $^ | \
-	$(MAKEDB) -o $@ -
+	(umask 077 && $(MAKEDB) -o $@ -)
 	@echo "done."
+	@if chgrp shadow $@ 2>/dev/null; then \
+	  chmod g+r $@; \
+	else \
+	  chown 0; chgrp 0; chmod 600; \
+	  echo; \
+	  echo "Warning: The shadow password database $@"; \
+	  echo "has been set to be readable only by root.  You may want"; \
+	  echo "to make it readable by the \`shadow' group depending"; \
+	  echo "on your configuration."; \
+	  echo; \
+	fi
 
 $(VAR_DB)/netgroup.db: /etc/netgroup
 	@echo -n "$(patsubst %.db,%,$(@F))... "