Re: svn commit: r367455 - head/usr.sbin/syslogd

2020-11-07 Thread Cy Schubert
In message <202011071718.0a7hijdy003...@repo.freebsd.org>, Bryan Drewery 
writes
:
> Author: bdrewery
> Date: Sat Nov  7 17:18:44 2020
> New Revision: 367455
> URL: https://svnweb.freebsd.org/changeset/base/367455
>
> Log:
>   syslogd: Stop trying to send remote messages through special sockets
>   
>   Specifically this was causing the /dev/klog fd and the signal pipe
>   handling fd to get a sendmsg(2) called on them and always returned
>   [ENOTSOCK].
>   
>   r310350 combined these sockets into the main socket list and properly
>   skipped AF_UNSPEC at the sendmsg(2) call but later in r344739 it was
>   broken such that these special sockets were no longer excluded since
>   the AF_UNSPEC check specifically excluded these special sockets. Only
>   these special sockets have sl_sa = NULL. The sl_family checks should
>   be redundant now but are left in case of future changes so the intent
>   is clearer.
>   
>   MFC after:  2 weeks
>
> Modified:
>   head/usr.sbin/syslogd/syslogd.c
>
> Modified: head/usr.sbin/syslogd/syslogd.c
> =
> =
> --- head/usr.sbin/syslogd/syslogd.c   Sat Nov  7 16:58:38 2020(r36745
> 4)
> +++ head/usr.sbin/syslogd/syslogd.c   Sat Nov  7 17:18:44 2020(r36745
> 5)
> @@ -1871,9 +1871,9 @@ fprintlog_write(struct filed *f, struct iovlist *il, i
>   STAILQ_FOREACH(sl, , next) {
>   if (sl->sl_socket < 0)
>   continue;
> - if (sl->sl_sa != NULL &&
> - (sl->sl_family == AF_LOCAL ||
> -  sl->sl_family == AF_UNSPEC))
> + if (sl->sl_sa == NULL ||
> + sl->sl_family == AF_UNSPEC ||
> + sl->sl_family == AF_LOCAL) {

The extraneous left brace broke the build.

>   continue;
>   lsent = sendmsg(sl->sl_socket, , 0);
>   if (lsent == (ssize_t)il->totalsize)
>


-- 
Cheers,
Cy Schubert 
FreeBSD UNIX: Web:  https://FreeBSD.org
NTP:   Web:  https://nwtime.org

The need of the many outweighs the greed of the few.



___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367455 - head/usr.sbin/syslogd

2020-11-07 Thread Bryan Drewery
Author: bdrewery
Date: Sat Nov  7 17:18:44 2020
New Revision: 367455
URL: https://svnweb.freebsd.org/changeset/base/367455

Log:
  syslogd: Stop trying to send remote messages through special sockets
  
  Specifically this was causing the /dev/klog fd and the signal pipe
  handling fd to get a sendmsg(2) called on them and always returned
  [ENOTSOCK].
  
  r310350 combined these sockets into the main socket list and properly
  skipped AF_UNSPEC at the sendmsg(2) call but later in r344739 it was
  broken such that these special sockets were no longer excluded since
  the AF_UNSPEC check specifically excluded these special sockets. Only
  these special sockets have sl_sa = NULL. The sl_family checks should
  be redundant now but are left in case of future changes so the intent
  is clearer.
  
  MFC after:2 weeks

Modified:
  head/usr.sbin/syslogd/syslogd.c

Modified: head/usr.sbin/syslogd/syslogd.c
==
--- head/usr.sbin/syslogd/syslogd.c Sat Nov  7 16:58:38 2020
(r367454)
+++ head/usr.sbin/syslogd/syslogd.c Sat Nov  7 17:18:44 2020
(r367455)
@@ -1871,9 +1871,9 @@ fprintlog_write(struct filed *f, struct iovlist *il, i
STAILQ_FOREACH(sl, , next) {
if (sl->sl_socket < 0)
continue;
-   if (sl->sl_sa != NULL &&
-   (sl->sl_family == AF_LOCAL ||
-sl->sl_family == AF_UNSPEC))
+   if (sl->sl_sa == NULL ||
+   sl->sl_family == AF_UNSPEC ||
+   sl->sl_family == AF_LOCAL) {
continue;
lsent = sendmsg(sl->sl_socket, , 0);
if (lsent == (ssize_t)il->totalsize)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"