From 361d49e6a4463bd86aba76a67c2b1dc0348f711a Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 21 Dec 1998 12:39:47 +0000 Subject: Update. * nss/db-Makefile (shadow.db): Create file with correct protections. Based on a patch by Joel Klecker . --- nss/db-Makefile | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'nss') 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))... " -- cgit v1.2.3