-
- /*
- * Might as well fork instead of using nonblocking I/O
- * and doing notty().
- */
- if (fork() == 0) {
- (void) signal(SIGTERM, SIG_DFL);
- (void) alarm(0);
- (void) signal(SIGALRM, endtty);
- (void) signal(SIGTTOU, SIG_IGN);
- (void) sigsetmask(0);
- (void) sprintf(greetings,
- "\r\n\7Message from syslogd@%s at %.24s ...\r\n",
- iov[2].iov_base, ctime(&now));
- len = strlen(greetings);
-
- /* scan the user login file */
- while (fread((char *) &ut, sizeof ut, 1, uf) == 1) {
- /* is this slot used? */
- if (ut.ut_name[0] == '\0')
- continue;
-
- /* should we send the message to this user? */
- if (f->f_type == F_USERS) {
- for (i = 0; i < MAXUNAMES; i++) {
- if (!f->f_un.f_uname[i][0]) {
- i = MAXUNAMES;
- break;
- }
- if (strncmp(f->f_un.f_uname[i],
- ut.ut_name, UNAMESZ) == 0)
- break;
- }
- if (i >= MAXUNAMES)
- continue;
- }
-
- /* compute the device name */
- p = "/dev/12345678";
- strncpy(&p[5], ut.ut_line, UNAMESZ);
-
- if (f->f_type == F_WALL) {
- iov[0].iov_base = greetings;
- iov[0].iov_len = len;
- iov[1].iov_len = 0;
+ /* NOSTRICT */
+ while (fread((char *)&ut, sizeof(ut), 1, uf) == 1) {
+ if (ut.ut_name[0] == '\0')
+ continue;
+ strncpy(line, ut.ut_line, sizeof(ut.ut_line));
+ line[sizeof(ut.ut_line)] = '\0';
+ if (f->f_type == F_WALL) {
+ if ((p = ttymsg(iov, 6, line, 60*5)) != NULL) {
+ errno = 0; /* already in msg */
+ logerror(p);