aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/adduser/adduser.perl
diff options
context:
space:
mode:
authorWolfram Schneider <wosch@FreeBSD.org>1996-09-17 19:34:56 +0000
committerWolfram Schneider <wosch@FreeBSD.org>1996-09-17 19:34:56 +0000
commitd45496e5c449239e283b6dd100ddad5764824a3f (patch)
treed0dc1f6ab3e00519be38a1cc6ce1427c945f4d42 /usr.sbin/adduser/adduser.perl
parentcb07d7668c5de4b38b5daf9cb861e9138ad42187 (diff)
downloadsrc-d45496e5c449239e283b6dd100ddad5764824a3f.tar.gz
src-d45496e5c449239e283b6dd100ddad5764824a3f.zip
warn if reach group line limit (>200 users, >1024 bytes per line)
close PR#1595 suggested by: Seppo Kallio <kallio@beeblebrox.cc.jyu.fi
Notes
Notes: svn path=/head/; revision=18332
Diffstat (limited to 'usr.sbin/adduser/adduser.perl')
-rw-r--r--usr.sbin/adduser/adduser.perl11
1 files changed, 10 insertions, 1 deletions
diff --git a/usr.sbin/adduser/adduser.perl b/usr.sbin/adduser/adduser.perl
index 8e35578dbb0c..d2e6050b0010 100644
--- a/usr.sbin/adduser/adduser.perl
+++ b/usr.sbin/adduser/adduser.perl
@@ -24,7 +24,7 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-# $Id: adduser.perl,v 1.17 1996/09/11 08:36:54 jkh Exp $
+# $Id: adduser.perl,v 1.18 1996/09/14 23:22:23 wosch Exp $
# read variables
@@ -394,6 +394,15 @@ sub add_group {
$groupmembers{$gid} .= "," if $groupmembers{$gid};
$groupmembers{$gid} .= "$name";
+ local(@l) = split(',', $groupmembers{$gid});
+ # group(5): A group cannot have more than 200 members.
+ # The maximum line length of /etc/group is 1024 characters.
+ # Longer lines will be skiped.
+ if ($#l >= 200 ||
+ length($groupmembers{$gid}) > 1024 - 50) { # 50 is for group name
+ warn "WARNING, maybe group line ``$gid{$gid}'' is to long or to\n" .
+ "much users in group, see group(5)\a\n";
+ }
return $name;
}