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