From owner-svn-src-head@FreeBSD.ORG Wed Jul 22 22:13:43 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 175D3106568E; Wed, 22 Jul 2009 22:13:43 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DEB458FC12; Wed, 22 Jul 2009 22:13:42 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6MMDgYg053621; Wed, 22 Jul 2009 22:13:42 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6MMDgRl053619; Wed, 22 Jul 2009 22:13:42 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <200907222213.n6MMDgRl053619@svn.freebsd.org> From: Ken Smith Date: Wed, 22 Jul 2009 22:13:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195828 - head/usr.sbin/sysinstall X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list 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: Wed, 22 Jul 2009 22:13:43 -0000 Author: kensmith Date: Wed Jul 22 22:13:42 2009 New Revision: 195828 URL: http://svn.freebsd.org/changeset/base/195828 Log: It is believed the last of the base system that could have an issue with IDs larger than 16-bits has been updated so adjust sysinstall to allow IDs up to the current system-wide size of 32-bits. Approved by: re (kib) Modified: head/usr.sbin/sysinstall/user.c Modified: head/usr.sbin/sysinstall/user.c ============================================================================== --- head/usr.sbin/sysinstall/user.c Wed Jul 22 20:46:17 2009 (r195827) +++ head/usr.sbin/sysinstall/user.c Wed Jul 22 22:13:42 2009 (r195828) @@ -45,10 +45,10 @@ /* XXX should they be moved out to sysinstall.h? */ #define GNAME_FIELD_LEN 32 -#define GID_FIELD_LEN 10 +#define GID_FIELD_LEN 11 #define GMEMB_FIELD_LEN 64 -#define UID_FIELD_LEN 10 +#define UID_FIELD_LEN 11 #define UGROUP_FIELD_LEN GNAME_FIELD_LEN #define GECOS_FIELD_LEN 64 #define UMEMB_FIELD_LEN GMEMB_FIELD_LEN @@ -169,7 +169,7 @@ static int verifyGroupSettings(void) { char tmp[256], *cp; - long lgid; + unsigned long lgid; if (strlen(gname) == 0) { feepout("The group name field must not be empty!"); @@ -181,9 +181,9 @@ verifyGroupSettings(void) return 0; } if (strlen(gid) > 0) { - lgid = strtol(gid, &cp, 10); - if (lgid < 0 || lgid >= 65536 || (*cp != '\0' && !isspace(*cp))) { - feepout("The GID must be a number between 1 and 65535."); + lgid = strtoul(gid, &cp, 10); + if (lgid == 0 || lgid > GID_MAX || (*cp != '\0' && !isspace(*cp))) { + feepout("The GID must be a number between 1 and 4294967295."); return 0; } } @@ -406,7 +406,7 @@ static int verifyUserSettings(WINDOW *ds_win) { char tmp[256], *cp; - long luid; + unsigned long luid; WINDOW *save; int rv; @@ -420,9 +420,9 @@ verifyUserSettings(WINDOW *ds_win) return 0; } if (strlen(uid) > 0) { - luid = strtol(uid, &cp, 10); - if (luid < 0 || luid >= 65536 || (*cp != '\0' && !isspace(*cp))) { - feepout("The UID must be a number between 1 and 65535."); + luid = strtoul(uid, &cp, 10); + if (luid == 0 || luid > UID_MAX || (*cp != '\0' && !isspace(*cp))) { + feepout("The UID must be a number between 1 and 4294967295."); return 0; } }