summaryrefslogtreecommitdiff
path: root/usr.sbin/httpd/server_file.c
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2014-08-03 11:16:11 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2014-08-03 11:16:11 +0000
commit54c558ccca89ea59015d982b678bcd0d0c797c82 (patch)
treef3aec754f679ac55c544b84d1d104dc8713210fc /usr.sbin/httpd/server_file.c
parent70ca76f5c9ac1628526d2ccd16d737158d340ef2 (diff)
Split fastcgi socket path and document root option and add the
SCRIPT_FILENAME CGI param with a prepended root. This fixes php-fpm that expects SCRIPT_FILENAME and also works with slowcgi if you configure the root correctly. For example, if SCRIPT_NAME and REQUEST_URI are /php/index.php, root is /htdocs, SCRIPT_FILENAME will be /htdocs/php/index.php. As tested and discussed with florian@
Diffstat (limited to 'usr.sbin/httpd/server_file.c')
-rw-r--r--usr.sbin/httpd/server_file.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/httpd/server_file.c b/usr.sbin/httpd/server_file.c
index 5985681acdd..4a906612dd6 100644
--- a/usr.sbin/httpd/server_file.c
+++ b/usr.sbin/httpd/server_file.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server_file.c,v 1.24 2014/08/02 09:54:13 reyk Exp $ */
+/* $OpenBSD: server_file.c,v 1.25 2014/08/03 11:16:10 reyk Exp $ */
/*
* Copyright (c) 2006 - 2014 Reyk Floeter <reyk@openbsd.org>
@@ -148,7 +148,7 @@ server_file(struct httpd *env, struct client *clt)
/* Request path is already canonicalized */
if ((size_t)snprintf(path, sizeof(path), "%s%s",
- srv_conf->path, desc->http_path) >= sizeof(path)) {
+ srv_conf->root, desc->http_path) >= sizeof(path)) {
/* Do not echo the uncanonicalized path */
server_abort_http(clt, 500, desc->http_path);
return (-1);
@@ -226,7 +226,7 @@ server_file_index(struct httpd *env, struct client *clt)
/* Request path is already canonicalized */
if ((size_t)snprintf(path, sizeof(path), "%s%s",
- srv_conf->path, desc->http_path) >= sizeof(path))
+ srv_conf->root, desc->http_path) >= sizeof(path))
goto fail;
/* Now open the file, should be readable or we have another problem */