Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Dec 2009 10:30:54 +0000 (UTC)
From:      Ed Schouten <ed@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r200982 - head/libexec/atrun
Message-ID:  <200912251030.nBPAUsQo058864@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <syslog.h>
 #include <time.h>
 #include <unistd.h>
-#include <utmp.h>
 #ifdef __FreeBSD__
 #include <paths.h>
 #else
@@ -63,12 +62,6 @@ static const char rcsid[] =
 #include <security/openpam.h>
 #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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200912251030.nBPAUsQo058864>