From owner-svn-src-head@FreeBSD.ORG Fri Dec 25 10:30:54 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 CBF69106568D; Fri, 25 Dec 2009 10:30:54 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BBF0E8FC13; Fri, 25 Dec 2009 10:30:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBPAUsMx058866; Fri, 25 Dec 2009 10:30:54 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBPAUsQo058864; Fri, 25 Dec 2009 10:30:54 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912251030.nBPAUsQo058864@svn.freebsd.org> From: Ed Schouten Date: Fri, 25 Dec 2009 10:30:54 +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: r200982 - head/libexec/atrun 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: Fri, 25 Dec 2009 10:30:54 -0000 Author: ed Date: Fri Dec 25 10:30:54 2009 New Revision: 200982 URL: http://svn.freebsd.org/changeset/base/200982 Log: Don't use UT_NAMESIZE here to determine the maximum username length. Modified: head/libexec/atrun/atrun.c Modified: head/libexec/atrun/atrun.c ============================================================================== --- head/libexec/atrun/atrun.c Fri Dec 25 10:01:35 2009 (r200981) +++ head/libexec/atrun/atrun.c Fri Dec 25 10:30:54 2009 (r200982) @@ -49,7 +49,6 @@ static const char rcsid[] = #include #include #include -#include #ifdef __FreeBSD__ #include #else @@ -63,12 +62,6 @@ static const char rcsid[] = #include #endif -#if (MAXLOGNAME-1) > UT_NAMESIZE -#define LOGNAMESIZE UT_NAMESIZE -#else -#define LOGNAMESIZE (MAXLOGNAME-1) -#endif - /* Local headers */ #include "gloadavg.h" @@ -130,7 +123,7 @@ run_file(const char *filename, uid_t uid pid_t pid; int fd_out, fd_in; int queue; - char mailbuf[LOGNAMESIZE + 1], fmt[49]; + char mailbuf[MAXLOGNAME], fmt[49]; char *mailname = NULL; FILE *stream; int send_mail = 0; @@ -231,7 +224,7 @@ run_file(const char *filename, uid_t uid snprintf(fmt, sizeof(fmt), "#!/bin/sh\n# atrun uid=%%ld gid=%%ld\n# mail %%%ds %%d", - LOGNAMESIZE); + MAXLOGNAME - 1); if (fscanf(stream, fmt, &nuid, &ngid, mailbuf, &send_mail) != 4) perrx("File %s is in wrong format - aborting", filename);