From owner-svn-src-head@FreeBSD.ORG Thu Nov 15 16:40:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 24233AE4 for ; Thu, 15 Nov 2012 16:40:59 +0000 (UTC) (envelope-from postmaster@mailpod.hostingplatform.com) Received: from atl4mhob09.myregisteredsite.com (atl4mhob09.myregisteredsite.com [209.17.115.47]) by mx1.freebsd.org (Postfix) with ESMTP id C585C8FC12 for ; Thu, 15 Nov 2012 16:40:58 +0000 (UTC) Received: from mailpod1.hostingplatform.com (mailpod1.networksolutionsemail.com [206.188.198.65]) by atl4mhob09.myregisteredsite.com (8.14.4/8.14.4) with ESMTP id qAFGevrT026350 for ; Thu, 15 Nov 2012 11:40:57 -0500 Received: (qmail 14584 invoked by uid 0); 15 Nov 2012 15:59:34 -0000 Received: (qmail 31924 invoked by uid 0); 15 Nov 2012 15:08:15 -0000 Received: from unknown (HELO atl4mhib24.myregisteredsite.com) (209) by 0 with SMTP; 15 Nov 2012 15:08:15 -0000 Received: from mx2.freebsd.org (mx2.freebsd.org [69.147.83.53]) by atl4mhib24.myregisteredsite.com (8.14.4/8.14.4) with ESMTP id qAFF7W1k000554 for ; Thu, 15 Nov 2012 10:07:32 -0500 Received: from hub.freebsd.org (hub.FreeBSD.org [8.8.178.136]) by mx2.freebsd.org (Postfix) with ESMTP id F35473B72B1; Thu, 15 Nov 2012 15:07:09 +0000 (UTC) Received: from hub.FreeBSD.org (hub.FreeBSD.org [8.8.178.136]) by hub.freebsd.org (Postfix) with ESMTP id 437F7DD3; Thu, 15 Nov 2012 15:06:48 +0000 (UTC) (envelope-from owner-svn-src-all@freebsd.org) Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9BBB83CF; Thu, 15 Nov 2012 15:06:03 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 80F098FC14; Thu, 15 Nov 2012 15:06:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAFF633c003849; Thu, 15 Nov 2012 15:06:03 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAFF63v0003848; Thu, 15 Nov 2012 15:06:03 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211151506.qAFF63v0003848@svn.freebsd.org> From: Eitan Adler Date: Thu, 15 Nov 2012 15:06:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243076 - head/usr.sbin/chkgrp X-SVN-Group: head MIME-Version: 1.0 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: owner-svn-src-all@freebsd.org Sender: owner-svn-src-all@freebsd.org X-SpamScore: 0 X-MailHub-Apparently-To: mjm@michaelmeltzer.com X-MailHub-Forwarded: Yes X-BeenThere: svn-src-head@freebsd.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2012 16:40:59 -0000 Author: eadler Date: Thu Nov 15 15:06:03 2012 New Revision: 243076 URL: http://svnweb.freebsd.org/changeset/base/243076 Log: Check the range of the gid Approved by: cperciva MFC after: 1 week Modified: head/usr.sbin/chkgrp/chkgrp.c Modified: head/usr.sbin/chkgrp/chkgrp.c ============================================================================== --- head/usr.sbin/chkgrp/chkgrp.c Thu Nov 15 15:06:00 2012 (r243075) +++ head/usr.sbin/chkgrp/chkgrp.c Thu Nov 15 15:06:03 2012 (r243076) @@ -30,7 +30,10 @@ __FBSDID("$FreeBSD$"); #include +#include #include +#include +#include #include #include #include @@ -150,6 +153,18 @@ main(int argc, char *argv[]) warnx("%s: line %d: GID is not numeric", gfn, n); e++; } + + /* check the range of the group id */ + errno = 0; + unsigned long groupid = strtoul(f[2], NULL, 10); + if (errno != 0) { + warnx("%s: line %d: strtoul failed", gfn, n); + } + else if (groupid > GID_MAX) { + warnx("%s: line %d: group id is too large (> %ju)", + gfn, n, (uintmax_t)GID_MAX); + e++; + } #if 0 /* entry is correct, so print it */ _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"