about summary refs log tree commit diff
path: root/nss/db-Makefile
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@gmail.com>2011-06-15 21:00:21 -0400
committerUlrich Drepper <drepper@gmail.com>2011-06-15 21:06:19 -0400
commit9f2da732e7b03825027462dd1c46f8b4d18fc1f5 (patch)
treed7158fab8d3f0ee030e7efa8b681bcbeb1ca7b0e /nss/db-Makefile
parent82e9a1f7df488c62a214ee63847b2c884dcba565 (diff)
downloadglibc-9f2da732e7b03825027462dd1c46f8b4d18fc1f5.tar.gz
glibc-9f2da732e7b03825027462dd1c46f8b4d18fc1f5.tar.xz
glibc-9f2da732e7b03825027462dd1c46f8b4d18fc1f5.zip
Add initgroups lookups to nss_db
Diffstat (limited to 'nss/db-Makefile')
-rw-r--r--nss/db-Makefile14
1 files changed, 13 insertions, 1 deletions
diff --git a/nss/db-Makefile b/nss/db-Makefile
index 649e09ced6..13259c188c 100644
--- a/nss/db-Makefile
+++ b/nss/db-Makefile
@@ -47,7 +47,19 @@ $(VAR_DB)/group.db: /etc/group
 		 /^[ \t]*$$/ { next } \
 		 /^[ \t]*#/ { next } \
 		 /^[^#]/ { printf ".%s ", $$1; print; \
-			   printf "=%s ", $$3; print }' $^ | \
+			   printf "=%s ", $$3; print; \
+			   if ($$4 != "") { \
+			     split($$4, grmems, ","); \
+			     for (memidx in grmems) { \
+			       mem=grmems[memidx]; \
+			       if (members[mem] == "") \
+				 members[mem]=$$3; \
+			       else \
+				 members[mem]=members[mem] "," $$3; \
+			     } \
+			     delete grmems; } } \
+		 END { for (mem in members) \
+			 printf ":%s $s %s\n", mem, mem, members[mem]; }' $^ | \
 	$(MAKEDB) -o $@ -
 	@echo "done."