Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/etc having more than one line with the same group name and g...



details:   https://anonhg.NetBSD.org/src/rev/4df754e869d7
branches:  trunk
changeset: 791140:4df754e869d7
user:      spz <spz%NetBSD.org@localhost>
date:      Wed Nov 06 19:30:20 2013 +0000

description:
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

diffstat:

 etc/security |  13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diffs (30 lines):

diff -r f55f15053a7d -r 4df754e869d7 etc/security
--- a/etc/security      Wed Nov 06 18:37:57 2013 +0000
+++ b/etc/security      Wed Nov 06 19:30:20 2013 +0000
@@ -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 @@
        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
 



Home | Main Index | Thread Index | Old Index