diff options
author | Wolfram Schneider <wosch@FreeBSD.org> | 1996-09-17 19:34:56 +0000 |
---|---|---|
committer | Wolfram Schneider <wosch@FreeBSD.org> | 1996-09-17 19:34:56 +0000 |
commit | b2e5386c8bdcab49b312895115acc82a89fdaa51 (patch) | |
tree | 8d27cc2422718d4c407a4c75d77046ad71a17b01 /adduser | |
parent | 980d1d3590a81bcb215ee01a375accbd23d1d6f6 (diff) | |
download | pw-darwin-b2e5386c8bdcab49b312895115acc82a89fdaa51.tar.gz pw-darwin-b2e5386c8bdcab49b312895115acc82a89fdaa51.tar.zst pw-darwin-b2e5386c8bdcab49b312895115acc82a89fdaa51.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
Diffstat (limited to 'adduser')
-rw-r--r-- | adduser/adduser.perl | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/adduser/adduser.perl b/adduser/adduser.perl index 8e35578..d2e6050 100644 --- a/adduser/adduser.perl +++ b/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; } |