Skip to content
  • Alan Somers's avatar
    Revert "libc: Some enhancements to syslog(3)" · 943c4466
    Alan Somers authored
    This reverts commit 2886c93d.
    The original commit has two problems:
    
    * It sets SO_SNDBUF to be as large as MAXLINE.  But for unix domain
      sockets, the send buffer is bypassed.  Packets go directly to the
      peer's receive buffer, so setting and querying SO_SNDBUF is
      ineffective.  To ensure that the socket can accept messages of a
      certain size, it would be necessary to add a SO_PEERRCVBUF socket
      option that could query the connected peer's receive buffer size.
    
    * It sets MAXLINE to 8 kB, which is larger than the default sockbuf size
      of 4 kB.  That's ok for the builtin syslogd, which sets its recvbuf
      to 80 kB, but not ok for alternative sysloggers, like rsyslogd, which
      use the default size.
    
    As a consequence, writing messages of more than 4 kB with syslog() as a
    non-root user while running rsyslogd would cause the logging application
    to spin indefinitely within syslog().
    
    PR:		260126
    MFC:		2 weeks
    Sponsored by:	Axcient
    Reviewed by:	markj
    Differential Revision: https://reviews.freebsd.org/D33199
    943c4466