Module Name:    src
Committed By:   spz
Date:           Wed Nov  6 19:30:20 UTC 2013

Modified Files:
        src/etc: security

Log Message:
having more than one line with the same group name and gid is not only
allowed, it's even recommended for groups with lots of members, so
do not warn about duplicate group name lines if the gid is the same


To generate a diff of this commit:
cvs rdiff -u -r1.113 -r1.114 src/etc/security

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/etc/security
diff -u src/etc/security:1.113 src/etc/security:1.114
--- src/etc/security:1.113	Sun Sep  8 08:19:40 2013
+++ src/etc/security	Wed Nov  6 19:30:20 2013
@@ -1,6 +1,6 @@
 #!/bin/sh -
 #
-#	$NetBSD: security,v 1.113 2013/09/08 08:19:40 prlw1 Exp $
+#	$NetBSD: security,v 1.114 2013/11/06 19:30:20 spz Exp $
 #	from: @(#)security	8.1 (Berkeley) 6/9/93
 #
 
@@ -337,9 +337,16 @@ if checkyesno check_group; then
 	fi
 
 	awk -F: '{ print $1 }' $GRP | sort | uniq -d > $OUTPUT
-	if [ -s $OUTPUT ] ; then
+	dupgroups=""
+	for group in $(cat $OUTPUT) ; do
+		gcount=$(awk -F: "/$group/ { print \$1,\$3 }" $GRP | sort -u | wc -l)
+		if [ $gcount -gt 1 ]; then
+			dupgroups="$dupgroups $group"
+		fi
+	done
+	if [ ! -z $dupgroups ] ; then
 		printf "\n$GRP has duplicate group names.\n"
-		column $OUTPUT
+		printf "$dupgroups\n"
 	fi
 fi
 

Reply via email to