Index: login.c =================================================================== RCS file: /home/ncvs/src/usr.bin/login/login.c,v retrieving revision 1.63 diff -u -r1.63 login.c --- login.c 2001/05/22 06:20:27 1.63 +++ login.c 2001/06/19 18:48:02 @@ -125,6 +125,7 @@ static int auth_traditional __P((void)); extern void login __P((struct utmp *)); static void usage __P((void)); +static void welcome __P((char *)); #define TTYGRPNAME "tty" /* name of group to own ttys */ #define DEFAULT_BACKOFF 3 @@ -669,9 +670,9 @@ (void)printf("\n"); cw = login_getcapstr(lc, "welcome", NULL, NULL); - if (cw == NULL || access(cw, F_OK) != 0) + if (cw == NULL) cw = _PATH_MOTDFILE; - motd(cw); + welcome(cw); cw = getenv("MAIL"); /* $MAIL may have been set by class */ if (cw != NULL) { @@ -938,6 +939,24 @@ int signo; { motdinterrupt = 1; +} + +static void +welcome(w) + char *w; +{ + char *p; + + p = strtok(w, ","); + if (p == NULL) + return; + do { + if (*p == '|') + system(++p); + else + if (access(p, F_OK) == 0) + motd(p); + } while ((p = strtok(NULL, ",")) != NULL); } void