aboutsummaryrefslogtreecommitdiff
path: root/logger.c
diff options
context:
space:
mode:
Diffstat (limited to 'logger.c')
-rw-r--r--logger.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/logger.c b/logger.c
index 665db75..9402695 100644
--- a/logger.c
+++ b/logger.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: logger.c,v 1.5 2014/08/06 12:56:58 reyk Exp $ */
+/* $OpenBSD: logger.c,v 1.7 2014/11/11 15:54:45 beck Exp $ */
/*
* Copyright (c) 2014 Reyk Floeter <reyk@openbsd.org>
@@ -164,8 +164,8 @@ logger_open_priv(struct imsg *imsg)
if ((size_t)snprintf(name, sizeof(name), "/%s", p) >= sizeof(name))
return (-1);
- if ((len = (size_t)snprintf(path, sizeof(path), "%s%s",
- env->sc_chroot, HTTPD_LOGROOT)) >= sizeof(path))
+ if ((len = strlcpy(path, env->sc_logdir, sizeof(path)))
+ >= sizeof(path))
return (-1);
p = path + len;
@@ -194,6 +194,9 @@ logger_open(struct server *srv, struct server_config *srv_conf, void *arg)
{
struct log_file *log, *logfile = NULL, *errfile = NULL;
+ if (srv_conf->flags & SRVFLAG_SYSLOG)
+ return(0);
+
/* disassociate */
srv_conf->logaccess = srv_conf->logerror = NULL;