either files or the fastcgi socket (and there's no need to use a union yet).
-/* $OpenBSD: config.c,v 1.8 2014/07/31 09:34:57 reyk Exp $ */
+/* $OpenBSD: config.c,v 1.9 2014/07/31 13:28:15 reyk Exp $ */
/*
* Copyright (c) 2011 - 2014 Reyk Floeter <reyk@openbsd.org>
if ((srv_conf->flags & f) == 0)
srv_conf->flags |= srv->srv_conf.flags & f;
- f = SRVFLAG_DOCROOT;
+ f = SRVFLAG_PATH;
if ((srv_conf->flags & f) == 0) {
- (void)strlcpy(srv_conf->docroot,
- srv->srv_conf.docroot,
- sizeof(srv_conf->docroot));
+ (void)strlcpy(srv_conf->path,
+ srv->srv_conf.path,
+ sizeof(srv_conf->path));
}
f = SRVFLAG_FCGI|SRVFLAG_NO_FCGI;
-/* $OpenBSD: httpd.h,v 1.21 2014/07/31 09:34:57 reyk Exp $ */
+/* $OpenBSD: httpd.h,v 1.22 2014/07/31 13:28:15 reyk Exp $ */
/*
* Copyright (c) 2006 - 2014 Reyk Floeter <reyk@openbsd.org>
#define SRVFLAG_NO_INDEX 0x02
#define SRVFLAG_AUTO_INDEX 0x04
#define SRVFLAG_NO_AUTO_INDEX 0x08
-#define SRVFLAG_DOCROOT 0x10
+#define SRVFLAG_PATH 0x10
#define SRVFLAG_LOCATION 0x20
#define SRVFLAG_FCGI 0x40
#define SRVFLAG_NO_FCGI 0x80
#define SRVFLAG_BITS \
"\10\01INDEX\02NO_INDEX\03AUTO_INDEX\04NO_AUTO_INDEX" \
- "\05LOCATION\06FCGI\07NO_FCGI"
+ "\05PATH\06LOCATION\07FCGI\10NO_FCGI"
#define TCPFLAG_NODELAY 0x01
#define TCPFLAG_NNODELAY 0x02
struct server_config {
u_int32_t id;
char name[MAXHOSTNAMELEN];
- char docroot[MAXPATHLEN];
- char index[NAME_MAX];
char location[NAME_MAX];
+ char index[NAME_MAX];
+ char path[MAXPATHLEN];
in_port_t port;
struct sockaddr_storage ss;
-/* $OpenBSD: parse.y,v 1.11 2014/07/31 09:34:57 reyk Exp $ */
+/* $OpenBSD: parse.y,v 1.12 2014/07/31 13:28:15 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));
+ strlcpy(s->srv_conf.path, HTTPD_DOCROOT,
+ sizeof(s->srv_conf.path));
strlcpy(s->srv_conf.index, HTTPD_INDEX,
sizeof(s->srv_conf.index));
s->srv_conf.id = ++last_server_id;
host_free(&al);
}
| ROOT STRING {
- if (strlcpy(srv->srv_conf.docroot, $2,
- sizeof(srv->srv_conf.docroot)) >=
- sizeof(srv->srv_conf.docroot)) {
+ if (strlcpy(srv->srv_conf.path, $2,
+ sizeof(srv->srv_conf.path)) >=
+ sizeof(srv->srv_conf.path)) {
yyerror("document root too long");
free($2);
YYERROR;
}
free($2);
- srv->srv_conf.flags |= SRVFLAG_DOCROOT;
+ srv->srv_conf.flags |= SRVFLAG_PATH;
}
| DIRECTORY dirflags
| DIRECTORY '{' dirflags_l '}'
-/* $OpenBSD: server_file.c,v 1.19 2014/07/30 07:09:38 reyk Exp $ */
+/* $OpenBSD: server_file.c,v 1.20 2014/07/31 13:28:15 reyk Exp $ */
/*
* Copyright (c) 2006 - 2014 Reyk Floeter <reyk@openbsd.org>
/* Request path is already canonicalized */
if ((size_t)snprintf(path, sizeof(path), "%s%s",
- srv_conf->docroot, desc->http_path) >= sizeof(path)) {
+ srv_conf->path, desc->http_path) >= sizeof(path)) {
/* Do not echo the uncanonicalized path */
server_abort_http(clt, 500, desc->http_path);
return (-1);
/* Request path is already canonicalized */
if ((size_t)snprintf(path, sizeof(path), "%s%s",
- srv_conf->docroot, desc->http_path) >= sizeof(path))
+ srv_conf->path, desc->http_path) >= sizeof(path))
goto fail;
/* Now open the file, should be readable or we have another problem */