diff options
Diffstat (limited to 'usr/src/cmd/cron')
-rw-r--r-- | usr/src/cmd/cron/Makefile | 5 | ||||
-rw-r--r-- | usr/src/cmd/cron/cron.c | 2 | ||||
-rw-r--r-- | usr/src/cmd/cron/cron.h | 10 | ||||
-rw-r--r-- | usr/src/cmd/cron/funcs.c | 4 |
4 files changed, 15 insertions, 6 deletions
diff --git a/usr/src/cmd/cron/Makefile b/usr/src/cmd/cron/Makefile index ce64d5a69b..c9ffeadffe 100644 --- a/usr/src/cmd/cron/Makefile +++ b/usr/src/cmd/cron/Makefile @@ -33,6 +33,11 @@ ROOTMANIFESTDIR = $(ROOTSVCSYSTEM) ROOTMETHOD = $(ROOTLIBSVCMETHOD)/svc-cron CPPFLAGS += -D_FILE_OFFSET_BITS=64 -I $(SRC)/common/util +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-value ROOTVAR = $(ROOT)/var diff --git a/usr/src/cmd/cron/cron.c b/usr/src/cmd/cron/cron.c index 5dd41f63e7..347b03287a 100644 --- a/usr/src/cmd/cron/cron.c +++ b/usr/src/cmd/cron/cron.c @@ -3111,7 +3111,7 @@ logit(int cc, struct runinfo *rp, int rc) if (cc == BCHAR) (void) printf("%c CMD: %s\n", cc, next_event->cmd); (void) strftime(timebuf, sizeof (timebuf), FORMAT, localtime(&t)); - (void) printf("%c %.8s %u %c %s", + (void) printf("%c %s %u %c %s", cc, (rp->rusr)->name, rp->pid, QUE(rp->que), timebuf); if ((ret = TSTAT(rc)) != 0) (void) printf(" ts=%d", ret); diff --git a/usr/src/cmd/cron/cron.h b/usr/src/cmd/cron/cron.h index ae8d2142de..93e21e7b41 100644 --- a/usr/src/cmd/cron/cron.h +++ b/usr/src/cmd/cron/cron.h @@ -26,6 +26,8 @@ #ifndef _CRON_H #define _CRON_H +#include <unistd.h> + /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ @@ -53,8 +55,11 @@ extern "C" { #define RCODE(x) (((x)>>8)&0377) #define TSTAT(x) ((x)&0377) -#define FLEN 15 -#define LLEN 9 +/* This constant must be at least sysconf(_SC_LOGIN_NAME_MAX) in size */ +#define UNAMESIZE 32 /* max chars in a user name */ + +#define FLEN UNAMESIZE +#define LLEN UNAMESIZE /* * structure used for passing messages from the at and crontab commands to cron @@ -88,7 +93,6 @@ struct message { #define ENV_HOME "HOME=" #define CTLINESIZE 1000 /* max chars in a crontab line */ -#define UNAMESIZE 20 /* max chars in a user name */ extern int allowed(char *, char *, char *); extern int days_in_mon(int, int); diff --git a/usr/src/cmd/cron/funcs.c b/usr/src/cmd/cron/funcs.c index aa479fcbde..f907d439cb 100644 --- a/usr/src/cmd/cron/funcs.c +++ b/usr/src/cmd/cron/funcs.c @@ -172,8 +172,8 @@ cron_sendmsg(char action, char *login, char *fname, char etype) } pmsg->etype = etype; pmsg->action = action; - (void) strncpy(pmsg->fname, fname, FLEN); - (void) strncpy(pmsg->logname, login, LLEN); + (void) strlcpy(pmsg->fname, fname, FLEN); + (void) strlcpy(pmsg->logname, login, LLEN); if ((i = write(msgfd, pmsg, sizeof (struct message))) < 0) (void) fprintf(stderr, gettext("error in message send\n")); else if (i != sizeof (struct message)) |