diff -ur sysvinit-2.78/src/init.c sysvinit-2.78.new/src/init.c --- sysvinit-2.78/src/init.c Fri Feb 11 12:17:02 2000 +++ sysvinit-2.78.new/src/init.c Mon Sep 2 10:57:26 2002 @@ -429,7 +429,7 @@ buf[0] = 0; va_start(ap, fmt); - len = vsprintf(buf, fmt, ap); + len = vsnprintf(buf, sizeof(buf), fmt, ap); va_end(ap); memset(argv0, 0, maxproclen + 1); @@ -777,8 +777,8 @@ */ int spawn(CHILD *ch, int *res) { - char *args[16]; /* Argv array */ - char buf[136]; /* Line buffer */ + char *args[MAXINITARGS]; /* Argv array */ + char buf[MAXINITENTRY+10]; /* Line buffer */ int f, st; /* Scratch variables */ char *ptr; /* Ditto */ time_t t; /* System time */ @@ -844,7 +844,7 @@ } args[6] = proc; args[7] = NULL; - } else if (any(proc, "~`!$^&*()=|\\{}[];\"'<>?")) { + } else if (any(proc, "|")) { /* See if we need to fire off a shell for this command */ /* Give command line to shell */ args[1] = SHELL; @@ -857,7 +857,7 @@ /* Split up command line arguments */ strncpy(buf, proc, sizeof(buf) - 1); ptr = buf; - for(f = 1; f < 15; f++) { + for(f = 1; f < (MAXINITARGS-1); f++) { /* Skip white space */ while(*ptr == ' ' || *ptr == '\t') ptr++; args[f] = ptr; @@ -1080,7 +1080,7 @@ void read_inittab(void) { FILE *fp; /* The INITTAB file */ - char buf[256]; /* Line buffer */ + char buf[MAXINITENTRY]; /* Line buffer */ char err[64]; /* Error message. */ char *id, *rlevel, *action, *process; /* Fields of a line */ @@ -1160,7 +1160,7 @@ (int)sizeof(utproto.ut_id)); if (rlevel && strlen(rlevel) > 11) strcpy(err, "rlevel field too long (max 11 characters)"); - if (process && strlen(process) > 127) + if (process && strlen(process) > (MAXINITENTRY-1)) strcpy(err, "process field too long"); if (action && strlen(action) > 32) strcpy(err, "action field too long"); diff -ur sysvinit-2.78/src/init.h sysvinit-2.78.new/src/init.h --- sysvinit-2.78/src/init.h Thu Jun 3 21:22:59 1999 +++ sysvinit-2.78.new/src/init.h Thu Aug 29 15:41:44 2002 @@ -52,6 +52,9 @@ #define POWERFAILNOW 14 #define KBREQUEST 15 +#define MAXINITENTRY 1024 +#define MAXINITARGS 64 + /* Information about a process in the in-core inittab */ typedef struct _child_ { int flags; /* Status of this entry */ @@ -62,7 +65,7 @@ char id[8]; /* Inittab id (must be unique) */ char rlevel[12]; /* run levels */ int action; /* what to do (see list below) */ - char process[128]; /* The command line */ + char process[MAXINITENTRY]; /* The command line */ struct _child_ *new; /* New entry (after inittab re-read) */ struct _child_ *next; /* For the linked list */ } CHILD; Only in sysvinit-2.78.new/src: pidof