aboutsummaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorEd Schouten <ed@FreeBSD.org>2009-12-25 10:30:54 +0000
committerEd Schouten <ed@FreeBSD.org>2009-12-25 10:30:54 +0000
commitf195f6269e1843c05bac4079a12c2fef908743fa (patch)
tree4d9ec32cff188bbd73537493b909408e477f0b49 /libexec
parent893d013cf6748f7e6206adc958c5e56280ac7e4f (diff)
Notes
Diffstat (limited to 'libexec')
-rw-r--r--libexec/atrun/atrun.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/libexec/atrun/atrun.c b/libexec/atrun/atrun.c
index a7cef873eeef5..e4fc625fe3eef 100644
--- a/libexec/atrun/atrun.c
+++ b/libexec/atrun/atrun.c
@@ -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, gid_t gid)
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, gid_t gid)
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);