mirror of
https://github.com/yrutschle/sslh.git
synced 2025-04-13 07:37:15 +03:00
syslog_facility 'none' disables syslog
This commit is contained in:
parent
9e2cc93973
commit
c5b0932bad
@ -18,6 +18,9 @@ vNEXT:
|
||||
Log to syslog even if in foreground (for people who
|
||||
use fail2ban)
|
||||
|
||||
Use syslog_facility: "none" to disable syslog
|
||||
output.
|
||||
|
||||
v1.20: 20NOV2018
|
||||
Added support for socks5 protocol (Eugene Protozanov)
|
||||
|
||||
|
16
common.c
16
common.c
@ -41,6 +41,9 @@ struct sslhcfg_item cfg;
|
||||
|
||||
struct addrinfo *addr_listen = NULL; /* what addresses do we listen to? */
|
||||
|
||||
|
||||
static int do_syslog = 1; /* Should we syslog? controled by syslog_facility = "none" */
|
||||
|
||||
#ifdef LIBWRAP
|
||||
#include <tcpd.h>
|
||||
int allow_severity =0, deny_severity = 0;
|
||||
@ -563,9 +566,11 @@ void log_message(int type, const char* msg, ...)
|
||||
vfprintf(stderr, msg, ap);
|
||||
va_end(ap);
|
||||
|
||||
va_start(ap, msg);
|
||||
vsyslog(type, msg, ap);
|
||||
va_end(ap);
|
||||
if (do_syslog) {
|
||||
va_start(ap, msg);
|
||||
vsyslog(type, msg, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -727,6 +732,11 @@ void setup_syslog(const char* bin_name) {
|
||||
char *name1, *name2;
|
||||
int res, fn;
|
||||
|
||||
if (!strcmp(cfg.syslog_facility, "none")) {
|
||||
do_syslog = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
name1 = strdup(bin_name);
|
||||
res = asprintf(&name2, "%s[%d]", basename(name1), getpid());
|
||||
CHECK_RES_DIE(res, "asprintf");
|
||||
|
@ -17,6 +17,7 @@ chroot: "/var/empty";
|
||||
# system are usually defined in /usr/include/*/sys/syslog.h
|
||||
# or equivalent)
|
||||
# Default is "auth"
|
||||
# "none" disables use of syslog
|
||||
syslog_facility: "auth";
|
||||
|
||||
# List of interfaces on which we should listen
|
||||
|
Loading…
x
Reference in New Issue
Block a user