Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F105746176
D27205.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D27205.diff
View Options
diff --git a/lib/libc/gen/syslog.c b/lib/libc/gen/syslog.c
--- a/lib/libc/gen/syslog.c
+++ b/lib/libc/gen/syslog.c
@@ -57,6 +57,9 @@
#include "libc_private.h"
+/* Maximum number of characters of syslog message */
+#define MAXLINE 8192
+
static int LogFile = -1; /* fd for log */
static int status; /* connection status */
static int opened; /* have done openlog() */
@@ -141,7 +144,7 @@
char ch, *p;
long tz_offset;
int cnt, fd, saved_errno;
- char hostname[MAXHOSTNAMELEN], *stdp, tbuf[2048], fmt_cpy[1024],
+ char hostname[MAXHOSTNAMELEN], *stdp, tbuf[MAXLINE], fmt_cpy[MAXLINE],
errstr[64], tz_sign;
FILE *fp, *fmt_fp;
struct bufcookie tbuf_cookie;
@@ -396,9 +399,19 @@
struct sockaddr_un SyslogAddr; /* AF_UNIX address of local logger */
if (LogFile == -1) {
+ socklen_t len;
+
if ((LogFile = _socket(AF_UNIX, SOCK_DGRAM | SOCK_CLOEXEC,
0)) == -1)
return;
+ if (_getsockopt(LogFile, SOL_SOCKET, SO_SNDBUF, &len,
+ &(socklen_t){sizeof(len)}) == 0) {
+ if (len < MAXLINE) {
+ len = MAXLINE;
+ (void)_setsockopt(LogFile, SOL_SOCKET, SO_SNDBUF,
+ &len, sizeof(len));
+ }
+ }
}
if (LogFile != -1 && status == NOCONN) {
SyslogAddr.sun_len = sizeof(SyslogAddr);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 21, 1:39 AM (17 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15537015
Default Alt Text
D27205.diff (1 KB)
Attached To
Mode
D27205: libc: Some enhancements to syslog(3)
Attached
Detach File
Event Timeline
Log In to Comment