-/* $OpenBSD: httpd.h,v 1.8 2014/07/24 08:11:27 reyk Exp $ */
+/* $OpenBSD: httpd.h,v 1.9 2014/07/25 12:42:05 reyk Exp $ */
/*
* Copyright (c) 2006 - 2014 Reyk Floeter <reyk@openbsd.org>
u_int32_t id;
u_int32_t flags;
char name[MAXHOSTNAMELEN];
+ char docroot[MAXPATHLEN];
in_port_t port;
struct sockaddr_storage ss;
struct timeval timeout;
-/* $OpenBSD: parse.y,v 1.3 2014/07/23 22:02:02 reyk Exp $ */
+/* $OpenBSD: parse.y,v 1.4 2014/07/25 12:42:05 reyk Exp $ */
/*
* Copyright (c) 2007 - 2014 Reyk Floeter <reyk@openbsd.org>
}
free($2);
+ strlcpy(s->srv_conf.docroot, HTTPD_DOCROOT,
+ sizeof(s->srv_conf.docroot));
s->srv_conf.id = ++last_server_id;
s->srv_conf.timeout.tv_sec = SERVER_TIMEOUT;
-/* $OpenBSD: server_file.c,v 1.10 2014/07/23 22:20:37 reyk Exp $ */
+/* $OpenBSD: server_file.c,v 1.11 2014/07/25 12:42:05 reyk Exp $ */
/*
* Copyright (c) 2006 - 2014 Reyk Floeter <reyk@openbsd.org>
char path[MAXPATHLEN];
struct stat st;
- if (canonicalize_path(HTTPD_DOCROOT,
+ if (canonicalize_path(srv->srv_conf.docroot,
desc->http_path, path, sizeof(path)) == NULL) {
/* Do not echo the uncanonicalized path */
server_abort_http(clt, 500, "invalid request path");