FreeBSD Bugzilla – Attachment 151651 Details for
Bug 196742
new feature for syslogd - obey mesg flag
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
context diff for 10.0-R /usr/src/usr.sbin/syslogd/syslogd.c
patch.txt (text/plain), 1.71 KB, created by
Jef Poskanzer
on 2015-01-15 01:10:30 UTC
(
hide
)
Description:
context diff for 10.0-R /usr/src/usr.sbin/syslogd/syslogd.c
Filename:
MIME Type:
Creator:
Jef Poskanzer
Created:
2015-01-15 01:10:30 UTC
Size:
1.71 KB
patch
obsolete
>*** syslogd.c.orig Thu Jan 16 12:43:42 2014 >--- syslogd.c Thu Jun 19 13:58:08 2014 >*************** >*** 330,335 **** >--- 330,336 ---- > static int p_open(const char *, pid_t *); > static void readklog(void); > static void reapchild(int); >+ static const char *ttymsg_check(struct iovec *, int, char *, int); > static void usage(void); > static int validate(struct sockaddr *, const char *); > static void unmapped(struct sockaddr *); >*************** >*** 1373,1379 **** > if (!f->f_un.f_uname[i][0]) > break; > if (!strcmp(f->f_un.f_uname[i], ut->ut_user)) { >! if ((p = ttymsg(iov, iovlen, ut->ut_line, > TTYMSGTIME)) != NULL) { > errno = 0; /* already in msg */ > logerror(p); >--- 1374,1380 ---- > if (!f->f_un.f_uname[i][0]) > break; > if (!strcmp(f->f_un.f_uname[i], ut->ut_user)) { >! if ((p = ttymsg_check(iov, iovlen, ut->ut_line, > TTYMSGTIME)) != NULL) { > errno = 0; /* already in msg */ > logerror(p); >*************** >*** 1386,1391 **** >--- 1387,1418 ---- > reenter = 0; > } > >+ /* >+ * Wrapper routine for ttymsg() that checks the terminal for messages enabled. >+ */ >+ static const char * >+ ttymsg_check(iov, iovcnt, line, tmout) >+ struct iovec *iov; >+ int iovcnt; >+ char *line; >+ int tmout; >+ { >+ static char device[1024] = _PATH_DEV; >+ static char errbuf[1024]; >+ struct stat sb; >+ >+ (void) strcpy(device + sizeof(_PATH_DEV) - 1, line); >+ if (stat(device, &sb) < 0) { >+ (void) snprintf(errbuf, sizeof(errbuf), >+ "%s: %s", device, strerror(errno)); >+ return (errbuf); >+ } >+ if ((sb.st_mode & S_IWGRP) == 0) >+ /* Messages disabled. */ >+ return (NULL); >+ return ttymsg(iov, iovcnt, line, tmout); >+ } >+ > static void > reapchild(int signo __unused) > {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 196742
: 151651