From owner-freebsd-bugs@FreeBSD.ORG Wed Sep 28 06:50:04 2011 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14613106566C for ; Wed, 28 Sep 2011 06:50:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id E33F08FC1E for ; Wed, 28 Sep 2011 06:50:03 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p8S6o3jU044173 for ; Wed, 28 Sep 2011 06:50:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p8S6o34J044172; Wed, 28 Sep 2011 06:50:03 GMT (envelope-from gnats) Resent-Date: Wed, 28 Sep 2011 06:50:03 GMT Resent-Message-Id: <201109280650.p8S6o34J044172@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Stephane Lapie Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C34E1065670 for ; Wed, 28 Sep 2011 06:42:30 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id E6ED98FC13 for ; Wed, 28 Sep 2011 06:42:29 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p8S6gTiE015652 for ; Wed, 28 Sep 2011 06:42:29 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id p8S6gTnV015651; Wed, 28 Sep 2011 06:42:29 GMT (envelope-from nobody) Message-Id: <201109280642.p8S6gTnV015651@red.freebsd.org> Date: Wed, 28 Sep 2011 06:42:29 GMT From: Stephane Lapie To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: misc/161091: Max username length is 16 characters X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2011 06:50:04 -0000 >Number: 161091 >Category: misc >Synopsis: Max username length is 16 characters >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Wed Sep 28 06:50:03 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Stephane Lapie >Release: 8.2-RELEASE >Organization: Aozora Bank >Environment: FreeBSD fcc4svnapf01.aozora.lan 8.2-RELEASE #1: Mon Jun 13 12:33:03 JST 2011 stephanelapie@fcc4svnapf02.aozora.lan:/usr/obj/usr/src/sys/GENERIC amd64 >Description: The system only allows usernames to be 16 characters (definitions of UT_NAMESIZE in include/utmp.h, and MAXLOGNAME in sys/sys/param.h), which turns out to be a problem in our company, where we make up administrator usernames in the form of , which turns out quite often to require more than 16 characters. It would be nice if the system was built to support up to 32 characters, like many other OSes do. >How-To-Repeat: Creation of users via adduser will fail if the username is more than 16 characters. Obviously, directly editing password database files does not work either, the system won't acknowledge usernames beyond 16 characters. >Fix: I wrote a quick patch to apply to the whole source tree, that modifies : - /usr/src/include/utmp.h - /usr/src/sys/sys/param.h to bring up the login name max length to 32 characters (not including NUL) At my company, we are building our own releases and our own packages from the ports, to ensure consistency. The above patch has been tested since FreeBSD 8.0-RELEASE, and releases/packages generated relying on it have been ran in production for two years now, with no issues detected. Is there anything I missed, or any reasons for retaining the 16 character limitation? Patch attached with submission follows: --- ./include/utmp.h.old 2010-03-02 17:15:51.000000000 +0900 +++ ./include/utmp.h 2010-03-02 17:16:09.000000000 +0900 @@ -53,7 +53,7 @@ * UT_HOSTSIZE is also too small to hold most common hostnames or IPv6 * addresses. */ -#define UT_NAMESIZE 16 /* see MAXLOGNAME in */ +#define UT_NAMESIZE 32 /* see MAXLOGNAME in */ #define UT_LINESIZE 8 #define UT_HOSTSIZE 16 --- ./sys/sys/param.h.old 2010-03-02 17:17:18.000000000 +0900 +++ ./sys/sys/param.h 2010-03-02 17:17:36.000000000 +0900 @@ -75,7 +75,7 @@ #define MAXCOMLEN 19 /* max command name remembered */ #define MAXINTERP 32 /* max interpreter file name length */ -#define MAXLOGNAME 17 /* max login name length (incl. NUL) */ +#define MAXLOGNAME 33 /* max login name length (incl. NUL) */ #define MAXUPRC CHILD_MAX /* max simultaneous processes */ #define NCARGS ARG_MAX /* max bytes for an exec function */ #define NGROUPS (NGROUPS_MAX+1) /* max number groups */ >Release-Note: >Audit-Trail: >Unformatted: