summaryrefslogtreecommitdiff
path: root/usr/src/lib/libc
diff options
context:
space:
mode:
authorDavid Hanisch <titanic@dh-werder.de>2020-12-08 15:27:10 +0100
committerRobert Mustacchi <rm@fingolfin.org>2021-01-21 06:29:31 -0800
commit986778a303c760bb2204efc52ea9eba748546342 (patch)
tree5734468a7502d52821af30ace2ecdebc07ec8924 /usr/src/lib/libc
parent0b35c8bcd86de836ba2ab241e3b4ac7955c4148c (diff)
downloadillumos-joyent-986778a303c760bb2204efc52ea9eba748546342.tar.gz
13356 syslog(3c) should not open syslog_door without LOG_CONS
Reviewed by: Marcel Telka <marcel@telka.sk> Approved by: Robert Mustacchi <rm@fingolfin.org>
Diffstat (limited to 'usr/src/lib/libc')
-rw-r--r--usr/src/lib/libc/port/gen/syslog.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/usr/src/lib/libc/port/gen/syslog.c b/usr/src/lib/libc/port/gen/syslog.c
index 9c4e7b9443..99c2be2030 100644
--- a/usr/src/lib/libc/port/gen/syslog.c
+++ b/usr/src/lib/libc/port/gen/syslog.c
@@ -25,7 +25,7 @@
*/
/* Copyright (c) 1988 AT&T */
-/* All Rights Reserved */
+/* All Rights Reserved */
/*
* University Copyright- Copyright (c) 1982, 1986, 1988
@@ -86,10 +86,10 @@
#define PRIMASK(p) (1 << ((p) & LOG_PRIMASK))
#define PRIFAC(p) (((p) & LOG_FACMASK) >> 3)
-#define IMPORTANT LOG_ERR
+#define IMPORTANT LOG_ERR
#ifndef FALSE
-#define FALSE 0
+#define FALSE 0
#endif
#ifndef TRUE
@@ -190,6 +190,7 @@ vsyslog(int pri, const char *fmt, va_list ap)
uint32_t msgid;
char *msgid_start, *msgid_end;
int nowait;
+ int ret;
/*
* Maximum tag length is 256 (the pad in outline) minus the size of the
@@ -338,10 +339,11 @@ vsyslog(int pri, const char *fmt, va_list ap)
dat.buf = outline;
/* output the message to the local logger */
- if ((putmsg(LogFile, &ctl, &dat, 0) >= 0) && syslogd_ok())
- return;
+ ret = putmsg(LogFile, &ctl, &dat, 0);
if (!(LogStat & LOG_CONS))
return;
+ if ((ret >= 0) && syslogd_ok())
+ return;
/*
* Output the message to the console directly. To reduce visual