2016-03-19 15:14:35 +00:00
|
|
|
#include "first.h"
|
|
|
|
|
2005-02-20 14:27:00 +00:00
|
|
|
#include "base.h"
|
2017-06-20 03:00:45 +00:00
|
|
|
#include "fdevent.h"
|
2005-02-20 14:27:00 +00:00
|
|
|
#include "log.h"
|
|
|
|
#include "buffer.h"
|
2018-09-09 05:50:33 +00:00
|
|
|
#include "http_header.h"
|
2019-04-30 00:20:47 +00:00
|
|
|
#include "stat_cache.h"
|
2005-02-20 14:27:00 +00:00
|
|
|
|
|
|
|
#include "plugin.h"
|
|
|
|
|
|
|
|
#include "response.h"
|
|
|
|
|
|
|
|
#include "mod_ssi.h"
|
|
|
|
|
|
|
|
#include "sys-socket.h"
|
|
|
|
|
2009-10-11 14:31:42 +00:00
|
|
|
#include <sys/types.h>
|
2018-03-25 07:45:05 +00:00
|
|
|
#include <sys/stat.h>
|
2017-06-20 03:00:45 +00:00
|
|
|
#include <sys/wait.h>
|
2009-10-11 14:31:42 +00:00
|
|
|
|
|
|
|
#include <ctype.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <errno.h>
|
2016-04-18 03:37:40 +00:00
|
|
|
#include <fcntl.h>
|
2009-10-11 14:31:42 +00:00
|
|
|
#include <time.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
2005-02-20 14:27:00 +00:00
|
|
|
#ifdef HAVE_PWD_H
|
2009-10-11 14:31:42 +00:00
|
|
|
# include <pwd.h>
|
2005-02-20 14:27:00 +00:00
|
|
|
#endif
|
|
|
|
|
2005-10-18 10:38:11 +00:00
|
|
|
#ifdef HAVE_SYS_FILIO_H
|
2009-10-11 14:31:42 +00:00
|
|
|
# include <sys/filio.h>
|
2005-10-18 10:38:11 +00:00
|
|
|
#endif
|
|
|
|
|
2008-01-18 09:21:07 +00:00
|
|
|
#include "etag.h"
|
|
|
|
|
2019-11-25 06:54:08 +00:00
|
|
|
static handler_ctx * handler_ctx_init(plugin_data *p, log_error_st *errh) {
|
2016-12-06 05:25:56 +00:00
|
|
|
handler_ctx *hctx = calloc(1, sizeof(*hctx));
|
|
|
|
force_assert(hctx);
|
2019-11-25 06:54:08 +00:00
|
|
|
hctx->errh = errh;
|
2016-12-06 05:25:56 +00:00
|
|
|
hctx->timefmt = p->timefmt;
|
|
|
|
hctx->stat_fn = p->stat_fn;
|
|
|
|
hctx->ssi_vars = p->ssi_vars;
|
|
|
|
hctx->ssi_cgi_env = p->ssi_cgi_env;
|
|
|
|
memcpy(&hctx->conf, &p->conf, sizeof(plugin_config));
|
|
|
|
return hctx;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void handler_ctx_free(handler_ctx *hctx) {
|
|
|
|
free(hctx);
|
|
|
|
}
|
|
|
|
|
2008-01-18 09:21:07 +00:00
|
|
|
/* The newest modified time of included files for include statement */
|
|
|
|
static volatile time_t include_file_last_mtime = 0;
|
|
|
|
|
2005-02-20 14:27:00 +00:00
|
|
|
INIT_FUNC(mod_ssi_init) {
|
|
|
|
plugin_data *p;
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2005-02-20 14:27:00 +00:00
|
|
|
p = calloc(1, sizeof(*p));
|
2019-10-27 02:34:08 +00:00
|
|
|
force_assert(p);
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2005-02-20 14:27:00 +00:00
|
|
|
p->timefmt = buffer_init();
|
|
|
|
p->stat_fn = buffer_init();
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2019-11-22 05:57:48 +00:00
|
|
|
p->ssi_vars = array_init(8);
|
|
|
|
p->ssi_cgi_env = array_init(32);
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2005-02-20 14:27:00 +00:00
|
|
|
return p;
|
|
|
|
}
|
|
|
|
|
|
|
|
FREE_FUNC(mod_ssi_free) {
|
|
|
|
plugin_data *p = p_d;
|
|
|
|
array_free(p->ssi_vars);
|
|
|
|
array_free(p->ssi_cgi_env);
|
|
|
|
buffer_free(p->timefmt);
|
|
|
|
buffer_free(p->stat_fn);
|
|
|
|
}
|
|
|
|
|
2019-10-27 02:34:08 +00:00
|
|
|
static void mod_ssi_merge_config_cpv(plugin_config * const pconf, const config_plugin_value_t * const cpv) {
|
|
|
|
switch (cpv->k_id) { /* index into static config_plugin_keys_t cpk[] */
|
|
|
|
case 0: /* ssi.extension */
|
|
|
|
pconf->ssi_extension = cpv->v.a;
|
|
|
|
break;
|
|
|
|
case 1: /* ssi.content-type */
|
|
|
|
pconf->content_type = cpv->v.b;
|
|
|
|
break;
|
|
|
|
case 2: /* ssi.conditional-requests */
|
|
|
|
pconf->conditional_requests = cpv->v.u;
|
|
|
|
break;
|
|
|
|
case 3: /* ssi.exec */
|
|
|
|
pconf->ssi_exec = cpv->v.u;
|
|
|
|
break;
|
|
|
|
case 4: /* ssi.recursion-max */
|
|
|
|
pconf->ssi_recursion_max = cpv->v.shrt;
|
|
|
|
break;
|
|
|
|
default:/* should not happen */
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2019-10-27 02:34:08 +00:00
|
|
|
static void mod_ssi_merge_config(plugin_config * const pconf, const config_plugin_value_t *cpv) {
|
|
|
|
do {
|
|
|
|
mod_ssi_merge_config_cpv(pconf, cpv);
|
|
|
|
} while ((++cpv)->k_id != -1);
|
|
|
|
}
|
2017-03-05 20:39:45 +00:00
|
|
|
|
2019-10-27 02:34:08 +00:00
|
|
|
static void mod_ssi_patch_config(connection * const con, plugin_data * const p) {
|
|
|
|
memcpy(&p->conf, &p->defaults, sizeof(plugin_config));
|
|
|
|
for (int i = 1, used = p->nconfig; i < used; ++i) {
|
|
|
|
if (config_check_cond(con, (uint32_t)p->cvlist[i].k_id))
|
|
|
|
mod_ssi_merge_config(&p->conf, p->cvlist + p->cvlist[i].v.u2[0]);
|
|
|
|
}
|
|
|
|
}
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2019-10-27 02:34:08 +00:00
|
|
|
SETDEFAULTS_FUNC(mod_ssi_set_defaults) {
|
|
|
|
static const config_plugin_keys_t cpk[] = {
|
|
|
|
{ CONST_STR_LEN("ssi.extension"),
|
|
|
|
T_CONFIG_ARRAY,
|
|
|
|
T_CONFIG_SCOPE_CONNECTION }
|
|
|
|
,{ CONST_STR_LEN("ssi.content-type"),
|
|
|
|
T_CONFIG_STRING,
|
|
|
|
T_CONFIG_SCOPE_CONNECTION }
|
|
|
|
,{ CONST_STR_LEN("ssi.conditional-requests"),
|
|
|
|
T_CONFIG_BOOL,
|
|
|
|
T_CONFIG_SCOPE_CONNECTION }
|
|
|
|
,{ CONST_STR_LEN("ssi.exec"),
|
|
|
|
T_CONFIG_BOOL,
|
|
|
|
T_CONFIG_SCOPE_CONNECTION }
|
|
|
|
,{ CONST_STR_LEN("ssi.recursion-max"),
|
|
|
|
T_CONFIG_SHORT,
|
|
|
|
T_CONFIG_SCOPE_CONNECTION }
|
|
|
|
,{ NULL, 0,
|
|
|
|
T_CONFIG_UNSET,
|
|
|
|
T_CONFIG_SCOPE_UNSET }
|
|
|
|
};
|
|
|
|
|
|
|
|
plugin_data * const p = p_d;
|
|
|
|
if (!config_plugin_values_init(srv, p, cpk, "mod_ssi"))
|
|
|
|
return HANDLER_ERROR;
|
|
|
|
|
|
|
|
/* process and validate config directives
|
|
|
|
* (init i to 0 if global context; to 1 to skip empty global context) */
|
|
|
|
for (int i = !p->cvlist[0].v.u2[1]; i < p->nconfig; ++i) {
|
|
|
|
const config_plugin_value_t *cpv = p->cvlist + p->cvlist[i].v.u2[0];
|
|
|
|
for (; -1 != cpv->k_id; ++cpv) {
|
|
|
|
switch (cpv->k_id) {
|
|
|
|
case 0: /* ssi.extension */
|
|
|
|
if (!array_is_vlist(cpv->v.a)) {
|
|
|
|
log_error(srv->errh, __FILE__, __LINE__,
|
|
|
|
"unexpected value for %s; "
|
|
|
|
"expected list of \"ext\"", cpk[cpv->k_id].k);
|
|
|
|
return HANDLER_ERROR;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 1: /* ssi.content-type */
|
|
|
|
case 2: /* ssi.conditional-requests */
|
|
|
|
case 3: /* ssi.exec */
|
|
|
|
case 4: /* ssi.recursion-max */
|
|
|
|
break;
|
|
|
|
default:/* should not happen */
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
p->defaults.ssi_exec = 1;
|
|
|
|
|
|
|
|
/* initialize p->defaults from global config context */
|
|
|
|
if (p->nconfig > 0 && p->cvlist->v.u2[1]) {
|
|
|
|
const config_plugin_value_t *cpv = p->cvlist + p->cvlist->v.u2[0];
|
|
|
|
if (-1 != cpv->k_id)
|
|
|
|
mod_ssi_merge_config(&p->defaults, cpv);
|
|
|
|
}
|
|
|
|
|
|
|
|
return HANDLER_GO_ON;
|
2005-02-20 14:27:00 +00:00
|
|
|
}
|
|
|
|
|
2016-04-18 03:37:40 +00:00
|
|
|
|
consistent, shared code to create CGI env
consolidated from CGI, FastCGI, SCGI, SSI
Note: due to prior inconsistencies between the code in mod_cgi,
mod_fastcgi, mod_scgi, and mod_ssi, there are some minor behavior
changes.
CONTENT_LENGTH is now always set, even if 0
(though CONTENT_LENGTH is never set for FASTCGI_AUTHORIZER)
PATH_INFO is created only if present, not if empty.
(mod_fastcgi and mod_ssi previously set PATH_INFO="" (blank value))
PATH_TRANSLATED is now set if PATH_INFO is present
(previously missing from mod_cgi and mod_ssi)
mod_ssi now sets DOCUMENT_ROOT to con->physical.basedir, like others
(previously, mod_ssi set DOCUMENT_ROOT to con->physical.doc_root,
which matched con->physical.basedir unless mod_alias changed basedir)
mod_ssi now sets REQUEST_URI to con->request.orig_uri, like others
(previously, mod_ssi set REQUEST_URI to con->request.uri, which
matched con->request.orig_uri except after redirects, error docs)
2016-10-10 17:37:36 +00:00
|
|
|
static int ssi_env_add(void *venv, const char *key, size_t klen, const char *val, size_t vlen) {
|
2019-10-02 05:54:15 +00:00
|
|
|
array_set_key_value((array *)venv, key, klen, val, vlen);
|
2005-02-20 14:27:00 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2019-11-25 06:54:08 +00:00
|
|
|
static int build_ssi_cgi_vars(connection *con, handler_ctx *p) {
|
consistent, shared code to create CGI env
consolidated from CGI, FastCGI, SCGI, SSI
Note: due to prior inconsistencies between the code in mod_cgi,
mod_fastcgi, mod_scgi, and mod_ssi, there are some minor behavior
changes.
CONTENT_LENGTH is now always set, even if 0
(though CONTENT_LENGTH is never set for FASTCGI_AUTHORIZER)
PATH_INFO is created only if present, not if empty.
(mod_fastcgi and mod_ssi previously set PATH_INFO="" (blank value))
PATH_TRANSLATED is now set if PATH_INFO is present
(previously missing from mod_cgi and mod_ssi)
mod_ssi now sets DOCUMENT_ROOT to con->physical.basedir, like others
(previously, mod_ssi set DOCUMENT_ROOT to con->physical.doc_root,
which matched con->physical.basedir unless mod_alias changed basedir)
mod_ssi now sets REQUEST_URI to con->request.orig_uri, like others
(previously, mod_ssi set REQUEST_URI to con->request.uri, which
matched con->request.orig_uri except after redirects, error docs)
2016-10-10 17:37:36 +00:00
|
|
|
http_cgi_opts opts = { 0, 0, NULL, NULL };
|
|
|
|
/* temporarily remove Authorization from request headers
|
|
|
|
* so that Authorization does not end up in SSI environment */
|
2018-09-09 05:50:33 +00:00
|
|
|
buffer *vb_auth = http_header_request_get(con, HTTP_HEADER_AUTHORIZATION, CONST_STR_LEN("Authorization"));
|
|
|
|
buffer b_auth;
|
|
|
|
if (vb_auth) {
|
|
|
|
memcpy(&b_auth, vb_auth, sizeof(buffer));
|
|
|
|
memset(vb_auth, 0, sizeof(buffer));
|
2005-02-20 14:27:00 +00:00
|
|
|
}
|
|
|
|
|
2018-10-23 00:28:53 +00:00
|
|
|
array_reset_data_strings(p->ssi_cgi_env);
|
2016-03-26 11:14:21 +00:00
|
|
|
|
2019-11-25 06:54:08 +00:00
|
|
|
if (0 != http_cgi_headers(con, &opts, ssi_env_add, p->ssi_cgi_env)) {
|
consistent, shared code to create CGI env
consolidated from CGI, FastCGI, SCGI, SSI
Note: due to prior inconsistencies between the code in mod_cgi,
mod_fastcgi, mod_scgi, and mod_ssi, there are some minor behavior
changes.
CONTENT_LENGTH is now always set, even if 0
(though CONTENT_LENGTH is never set for FASTCGI_AUTHORIZER)
PATH_INFO is created only if present, not if empty.
(mod_fastcgi and mod_ssi previously set PATH_INFO="" (blank value))
PATH_TRANSLATED is now set if PATH_INFO is present
(previously missing from mod_cgi and mod_ssi)
mod_ssi now sets DOCUMENT_ROOT to con->physical.basedir, like others
(previously, mod_ssi set DOCUMENT_ROOT to con->physical.doc_root,
which matched con->physical.basedir unless mod_alias changed basedir)
mod_ssi now sets REQUEST_URI to con->request.orig_uri, like others
(previously, mod_ssi set REQUEST_URI to con->request.uri, which
matched con->request.orig_uri except after redirects, error docs)
2016-10-10 17:37:36 +00:00
|
|
|
con->http_status = 400;
|
|
|
|
return -1;
|
2016-03-26 11:14:21 +00:00
|
|
|
}
|
|
|
|
|
2018-09-09 05:50:33 +00:00
|
|
|
if (vb_auth) {
|
|
|
|
memcpy(vb_auth, &b_auth, sizeof(buffer));
|
2016-02-28 17:05:22 +00:00
|
|
|
}
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2005-02-20 14:27:00 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2019-11-25 06:54:08 +00:00
|
|
|
static int mod_ssi_process_file(connection *con, handler_ctx *p, struct stat *st);
|
2016-12-11 06:49:11 +00:00
|
|
|
|
2019-11-25 06:54:08 +00:00
|
|
|
static int process_ssi_stmt(connection *con, handler_ctx *p, const char **l, size_t n, struct stat *st) {
|
2016-04-18 03:37:40 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* <!--#element attribute=value attribute=value ... -->
|
|
|
|
*
|
|
|
|
* config DONE
|
|
|
|
* errmsg -- missing
|
|
|
|
* sizefmt DONE
|
|
|
|
* timefmt DONE
|
|
|
|
* echo DONE
|
|
|
|
* var DONE
|
|
|
|
* encoding -- missing
|
|
|
|
* exec DONE
|
|
|
|
* cgi -- never
|
|
|
|
* cmd DONE
|
|
|
|
* fsize DONE
|
|
|
|
* file DONE
|
|
|
|
* virtual DONE
|
|
|
|
* flastmod DONE
|
|
|
|
* file DONE
|
|
|
|
* virtual DONE
|
|
|
|
* include DONE
|
|
|
|
* file DONE
|
|
|
|
* virtual DONE
|
|
|
|
* printenv DONE
|
|
|
|
* set DONE
|
|
|
|
* var DONE
|
|
|
|
* value DONE
|
|
|
|
*
|
|
|
|
* if DONE
|
|
|
|
* elif DONE
|
|
|
|
* else DONE
|
|
|
|
* endif DONE
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* expressions
|
|
|
|
* AND, OR DONE
|
|
|
|
* comp DONE
|
|
|
|
* ${...} -- missing
|
|
|
|
* $... DONE
|
|
|
|
* '...' DONE
|
|
|
|
* ( ... ) DONE
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* ** all DONE **
|
|
|
|
* DATE_GMT
|
|
|
|
* The current date in Greenwich Mean Time.
|
|
|
|
* DATE_LOCAL
|
|
|
|
* The current date in the local time zone.
|
|
|
|
* DOCUMENT_NAME
|
|
|
|
* The filename (excluding directories) of the document requested by the user.
|
|
|
|
* DOCUMENT_URI
|
|
|
|
* The (%-decoded) URL path of the document requested by the user. Note that in the case of nested include files, this is not then URL for the current document.
|
|
|
|
* LAST_MODIFIED
|
|
|
|
* The last modification date of the document requested by the user.
|
|
|
|
* USER_NAME
|
|
|
|
* Contains the owner of the file which included it.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2005-02-20 14:27:00 +00:00
|
|
|
size_t i, ssicmd = 0;
|
|
|
|
char buf[255];
|
2019-11-25 06:54:08 +00:00
|
|
|
buffer *tb = NULL;
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2016-12-11 06:49:11 +00:00
|
|
|
static const struct {
|
2005-02-20 14:27:00 +00:00
|
|
|
const char *var;
|
2006-10-04 13:26:23 +00:00
|
|
|
enum { SSI_UNSET, SSI_ECHO, SSI_FSIZE, SSI_INCLUDE, SSI_FLASTMOD,
|
2005-02-20 14:27:00 +00:00
|
|
|
SSI_CONFIG, SSI_PRINTENV, SSI_SET, SSI_IF, SSI_ELIF,
|
2016-12-11 07:39:59 +00:00
|
|
|
SSI_ELSE, SSI_ENDIF, SSI_EXEC, SSI_COMMENT } type;
|
2005-02-20 14:27:00 +00:00
|
|
|
} ssicmds[] = {
|
|
|
|
{ "echo", SSI_ECHO },
|
|
|
|
{ "include", SSI_INCLUDE },
|
|
|
|
{ "flastmod", SSI_FLASTMOD },
|
|
|
|
{ "fsize", SSI_FSIZE },
|
|
|
|
{ "config", SSI_CONFIG },
|
|
|
|
{ "printenv", SSI_PRINTENV },
|
|
|
|
{ "set", SSI_SET },
|
|
|
|
{ "if", SSI_IF },
|
|
|
|
{ "elif", SSI_ELIF },
|
|
|
|
{ "endif", SSI_ENDIF },
|
|
|
|
{ "else", SSI_ELSE },
|
|
|
|
{ "exec", SSI_EXEC },
|
2016-12-11 07:39:59 +00:00
|
|
|
{ "comment", SSI_COMMENT },
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2005-02-20 14:27:00 +00:00
|
|
|
{ NULL, SSI_UNSET }
|
|
|
|
};
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2005-02-20 14:27:00 +00:00
|
|
|
for (i = 0; ssicmds[i].var; i++) {
|
|
|
|
if (0 == strcmp(l[1], ssicmds[i].var)) {
|
|
|
|
ssicmd = ssicmds[i].type;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2005-02-20 14:27:00 +00:00
|
|
|
switch(ssicmd) {
|
|
|
|
case SSI_ECHO: {
|
|
|
|
/* echo */
|
2009-07-21 20:35:27 +00:00
|
|
|
int var = 0;
|
|
|
|
/* int enc = 0; */
|
2005-02-20 14:27:00 +00:00
|
|
|
const char *var_val = NULL;
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2016-12-11 06:49:11 +00:00
|
|
|
static const struct {
|
2005-02-20 14:27:00 +00:00
|
|
|
const char *var;
|
2016-03-26 11:14:21 +00:00
|
|
|
enum {
|
|
|
|
SSI_ECHO_UNSET,
|
|
|
|
SSI_ECHO_DATE_GMT,
|
|
|
|
SSI_ECHO_DATE_LOCAL,
|
|
|
|
SSI_ECHO_DOCUMENT_NAME,
|
|
|
|
SSI_ECHO_DOCUMENT_URI,
|
|
|
|
SSI_ECHO_LAST_MODIFIED,
|
|
|
|
SSI_ECHO_USER_NAME,
|
|
|
|
SSI_ECHO_SCRIPT_URI,
|
|
|
|
SSI_ECHO_SCRIPT_URL,
|
|
|
|
} type;
|
2005-02-20 14:27:00 +00:00
|
|
|
} echovars[] = {
|
|
|
|
{ "DATE_GMT", SSI_ECHO_DATE_GMT },
|
|
|
|
{ "DATE_LOCAL", SSI_ECHO_DATE_LOCAL },
|
|
|
|
{ "DOCUMENT_NAME", SSI_ECHO_DOCUMENT_NAME },
|
|
|
|
{ "DOCUMENT_URI", SSI_ECHO_DOCUMENT_URI },
|
|
|
|
{ "LAST_MODIFIED", SSI_ECHO_LAST_MODIFIED },
|
|
|
|
{ "USER_NAME", SSI_ECHO_USER_NAME },
|
2016-03-26 11:14:21 +00:00
|
|
|
{ "SCRIPT_URI", SSI_ECHO_SCRIPT_URI },
|
|
|
|
{ "SCRIPT_URL", SSI_ECHO_SCRIPT_URL },
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2005-02-20 14:27:00 +00:00
|
|
|
{ NULL, SSI_ECHO_UNSET }
|
|
|
|
};
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2009-07-21 20:35:27 +00:00
|
|
|
/*
|
2016-12-11 06:49:11 +00:00
|
|
|
static const struct {
|
2005-02-20 14:27:00 +00:00
|
|
|
const char *var;
|
|
|
|
enum { SSI_ENC_UNSET, SSI_ENC_URL, SSI_ENC_NONE, SSI_ENC_ENTITY } type;
|
|
|
|
} encvars[] = {
|
|
|
|
{ "url", SSI_ENC_URL },
|
|
|
|
{ "none", SSI_ENC_NONE },
|
|
|
|
{ "entity", SSI_ENC_ENTITY },
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2005-02-20 14:27:00 +00:00
|
|
|
{ NULL, SSI_ENC_UNSET }
|
|
|
|
};
|
2009-07-21 20:35:27 +00:00
|
|
|
*/
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2005-02-20 14:27:00 +00:00
|
|
|
for (i = 2; i < n; i += 2) {
|
|
|
|
if (0 == strcmp(l[i], "var")) {
|
|
|
|
int j;
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2005-02-20 14:27:00 +00:00
|
|
|
var_val = l[i+1];
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2005-02-20 14:27:00 +00:00
|
|
|
for (j = 0; echovars[j].var; j++) {
|
|
|
|
if (0 == strcmp(l[i+1], echovars[j].var)) {
|
|
|
|
var = echovars[j].type;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (0 == strcmp(l[i], "encoding")) {
|
2009-07-21 20:35:27 +00:00
|
|
|
/*
|
2005-02-20 14:27:00 +00:00
|
|
|
int j;
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2005-02-20 14:27:00 +00:00
|
|
|
for (j = 0; encvars[j].var; j++) {
|
|
|
|
if (0 == strcmp(l[i+1], encvars[j].var)) {
|
|
|
|
enc = encvars[j].type;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2009-07-21 20:35:27 +00:00
|
|
|
*/
|
2005-02-20 14:27:00 +00:00
|
|
|
} else {
|
2019-11-25 06:54:08 +00:00
|
|
|
log_error(con->conf.errh, __FILE__, __LINE__,
|
|
|
|
"ssi: unknown attribute for %s %s", l[1], l[i]);
|
2005-02-20 14:27:00 +00:00
|
|
|
}
|
|
|
|
}
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2005-02-20 14:27:00 +00:00
|
|
|
if (p->if_is_false) break;
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2005-02-20 14:27:00 +00:00
|
|
|
if (!var_val) {
|
2019-11-25 06:54:08 +00:00
|
|
|
log_error(con->conf.errh, __FILE__, __LINE__,
|
|
|
|
"ssi: %s var is missing", l[1]);
|
2005-02-20 14:27:00 +00:00
|
|
|
break;
|
|
|
|
}
|
2005-08-08 08:22:06 +00:00
|
|
|
|
2005-02-20 14:27:00 +00:00
|
|
|
switch(var) {
|
|
|
|
case SSI_ECHO_USER_NAME: {
|
2019-11-25 06:54:08 +00:00
|
|
|
tb = con->srv->tmp_buf;
|
2005-02-20 14:27:00 +00:00
|
|
|
#ifdef HAVE_PWD_H
|
2019-11-25 06:54:08 +00:00
|
|
|
struct passwd *pw;
|
2016-04-18 03:37:40 +00:00
|
|
|
if (NULL == (pw = getpwuid(st->st_uid))) {
|
2019-11-25 06:54:08 +00:00
|
|
|
buffer_copy_int(tb, st->st_uid);
|
2005-02-20 14:27:00 +00:00
|
|
|
} else {
|
2019-11-25 06:54:08 +00:00
|
|
|
buffer_copy_string(tb, pw->pw_name);
|
2005-02-20 14:27:00 +00:00
|
|
|
}
|
|
|
|
#else
|
2019-11-25 06:54:08 +00:00
|
|
|
buffer_copy_int(tb, st->st_uid);
|
2005-02-20 14:27:00 +00:00
|
|
|
#endif
|
2019-11-25 06:54:08 +00:00
|
|
|
chunkqueue_append_mem(con->write_queue, CONST_BUF_LEN(tb));
|
2005-02-20 14:27:00 +00:00
|
|
|
break;
|
|
|
|
}
|
2016-03-26 11:14:21 +00:00
|
|
|
case SSI_ECHO_LAST_MODIFIED: {
|
2016-04-18 03:37:40 +00:00
|
|
|
time_t t = st->st_mtime;
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2005-02-20 14:27:00 +00:00
|
|
|
if (0 == strftime(buf, sizeof(buf), p->timefmt->ptr, localtime(&t))) {
|
2015-02-08 19:10:36 +00:00
|
|
|
chunkqueue_append_mem(con->write_queue, CONST_STR_LEN("(none)"));
|
2005-02-20 14:27:00 +00:00
|
|
|
} else {
|
2015-02-08 19:10:36 +00:00
|
|
|
chunkqueue_append_mem(con->write_queue, buf, strlen(buf));
|
2005-02-20 14:27:00 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case SSI_ECHO_DATE_LOCAL: {
|
|
|
|
time_t t = time(NULL);
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2005-02-20 14:27:00 +00:00
|
|
|
if (0 == strftime(buf, sizeof(buf), p->timefmt->ptr, localtime(&t))) {
|
2015-02-08 19:10:36 +00:00
|
|
|
chunkqueue_append_mem(con->write_queue, CONST_STR_LEN("(none)"));
|
2005-02-20 14:27:00 +00:00
|
|
|
} else {
|
2015-02-08 19:10:36 +00:00
|
|
|
chunkqueue_append_mem(con->write_queue, buf, strlen(buf));
|
2005-02-20 14:27:00 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case SSI_ECHO_DATE_GMT: {
|
|
|
|
time_t t = time(NULL);
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2005-02-20 14:27:00 +00:00
|
|
|
if (0 == strftime(buf, sizeof(buf), p->timefmt->ptr, gmtime(&t))) {
|
2015-02-08 19:10:36 +00:00
|
|
|
chunkqueue_append_mem(con->write_queue, CONST_STR_LEN("(none)"));
|
2005-02-20 14:27:00 +00:00
|
|
|
} else {
|
2015-02-08 19:10:36 +00:00
|
|
|
chunkqueue_append_mem(con->write_queue, buf, strlen(buf));
|
2005-02-20 14:27:00 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case SSI_ECHO_DOCUMENT_NAME: {
|
|
|
|
char *sl;
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2005-02-20 14:27:00 +00:00
|
|
|
if (NULL == (sl = strrchr(con->physical.path->ptr, '/'))) {
|
2015-02-08 19:10:36 +00:00
|
|
|
chunkqueue_append_mem(con->write_queue, CONST_BUF_LEN(con->physical.path));
|
2005-02-20 14:27:00 +00:00
|
|
|
} else {
|
2015-02-08 19:10:36 +00:00
|
|
|
chunkqueue_append_mem(con->write_queue, sl + 1, strlen(sl + 1));
|
2005-02-20 14:27:00 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case SSI_ECHO_DOCUMENT_URI: {
|
2015-02-08 19:10:36 +00:00
|
|
|
chunkqueue_append_mem(con->write_queue, CONST_BUF_LEN(con->uri.path));
|
2005-02-20 14:27:00 +00:00
|
|
|
break;
|
|
|
|
}
|
2016-03-26 11:14:21 +00:00
|
|
|
case SSI_ECHO_SCRIPT_URI: {
|
|
|
|
if (!buffer_string_is_empty(con->uri.scheme) && !buffer_string_is_empty(con->uri.authority)) {
|
|
|
|
chunkqueue_append_mem(con->write_queue, CONST_BUF_LEN(con->uri.scheme));
|
|
|
|
chunkqueue_append_mem(con->write_queue, CONST_STR_LEN("://"));
|
|
|
|
chunkqueue_append_mem(con->write_queue, CONST_BUF_LEN(con->uri.authority));
|
|
|
|
chunkqueue_append_mem(con->write_queue, CONST_BUF_LEN(con->request.uri));
|
|
|
|
if (!buffer_string_is_empty(con->uri.query)) {
|
|
|
|
chunkqueue_append_mem(con->write_queue, CONST_STR_LEN("?"));
|
|
|
|
chunkqueue_append_mem(con->write_queue, CONST_BUF_LEN(con->uri.query));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case SSI_ECHO_SCRIPT_URL: {
|
|
|
|
chunkqueue_append_mem(con->write_queue, CONST_BUF_LEN(con->request.uri));
|
|
|
|
if (!buffer_string_is_empty(con->uri.query)) {
|
|
|
|
chunkqueue_append_mem(con->write_queue, CONST_STR_LEN("?"));
|
|
|
|
chunkqueue_append_mem(con->write_queue, CONST_BUF_LEN(con->uri.query));
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2005-02-20 14:27:00 +00:00
|
|
|
default: {
|
2019-10-10 03:24:25 +00:00
|
|
|
const data_string *ds;
|
2016-01-03 14:48:07 +00:00
|
|
|
/* check if it is a cgi-var or a ssi-var */
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2019-10-10 03:24:25 +00:00
|
|
|
if (NULL != (ds = (const data_string *)array_get_element_klen(p->ssi_cgi_env, var_val, strlen(var_val))) ||
|
|
|
|
NULL != (ds = (const data_string *)array_get_element_klen(p->ssi_vars, var_val, strlen(var_val)))) {
|
2019-10-13 08:59:57 +00:00
|
|
|
chunkqueue_append_mem(con->write_queue, CONST_BUF_LEN(&ds->value));
|
2005-02-20 14:27:00 +00:00
|
|
|
} else {
|
2015-02-08 19:10:36 +00:00
|
|
|
chunkqueue_append_mem(con->write_queue, CONST_STR_LEN("(none)"));
|
2005-02-20 14:27:00 +00:00
|
|
|
}
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2005-02-20 14:27:00 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case SSI_INCLUDE:
|
|
|
|
case SSI_FLASTMOD:
|
|
|
|
case SSI_FSIZE: {
|
|
|
|
const char * file_path = NULL, *virt_path = NULL;
|
2016-04-18 03:37:40 +00:00
|
|
|
struct stat stb;
|
2005-02-20 14:27:00 +00:00
|
|
|
char *sl;
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2005-02-20 14:27:00 +00:00
|
|
|
for (i = 2; i < n; i += 2) {
|
|
|
|
if (0 == strcmp(l[i], "file")) {
|
|
|
|
file_path = l[i+1];
|
|
|
|
} else if (0 == strcmp(l[i], "virtual")) {
|
|
|
|
virt_path = l[i+1];
|
|
|
|
} else {
|
2019-11-25 06:54:08 +00:00
|
|
|
log_error(con->conf.errh, __FILE__, __LINE__,
|
|
|
|
"ssi: unknown attribute for %s %s", l[1], l[i]);
|
2005-02-20 14:27:00 +00:00
|
|
|
}
|
|
|
|
}
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2005-02-20 14:27:00 +00:00
|
|
|
if (!file_path && !virt_path) {
|
2019-11-25 06:54:08 +00:00
|
|
|
log_error(con->conf.errh, __FILE__, __LINE__,
|
|
|
|
"ssi: %s file or virtual is missing", l[1]);
|
2005-02-20 14:27:00 +00:00
|
|
|
break;
|
|
|
|
}
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2005-02-20 14:27:00 +00:00
|
|
|
if (file_path && virt_path) {
|
2019-11-25 06:54:08 +00:00
|
|
|
log_error(con->conf.errh, __FILE__, __LINE__,
|
|
|
|
"ssi: %s only one of file and virtual is allowed here", l[1]);
|
2005-02-20 14:27:00 +00:00
|
|
|
break;
|
|
|
|
}
|
2006-10-04 13:26:23 +00:00
|
|
|
|
|
|
|
|
2005-02-20 14:27:00 +00:00
|
|
|
if (p->if_is_false) break;
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2019-11-25 06:54:08 +00:00
|
|
|
tb = con->srv->tmp_buf;
|
|
|
|
|
2005-02-20 14:27:00 +00:00
|
|
|
if (file_path) {
|
|
|
|
/* current doc-root */
|
|
|
|
if (NULL == (sl = strrchr(con->physical.path->ptr, '/'))) {
|
2008-07-30 19:38:32 +00:00
|
|
|
buffer_copy_string_len(p->stat_fn, CONST_STR_LEN("/"));
|
2005-02-20 14:27:00 +00:00
|
|
|
} else {
|
|
|
|
buffer_copy_string_len(p->stat_fn, con->physical.path->ptr, sl - con->physical.path->ptr + 1);
|
|
|
|
}
|
2006-03-04 15:12:17 +00:00
|
|
|
|
2019-11-25 06:54:08 +00:00
|
|
|
buffer_copy_string(tb, file_path);
|
|
|
|
buffer_urldecode_path(tb);
|
|
|
|
if (!buffer_is_valid_UTF8(tb)) {
|
|
|
|
log_error(con->conf.errh, __FILE__, __LINE__,
|
|
|
|
"SSI invalid UTF-8 after url-decode: %s", tb->ptr);
|
2018-11-26 00:07:53 +00:00
|
|
|
break;
|
|
|
|
}
|
2019-11-25 06:54:08 +00:00
|
|
|
buffer_path_simplify(tb, tb);
|
|
|
|
buffer_append_string_buffer(p->stat_fn, tb);
|
2005-02-20 14:27:00 +00:00
|
|
|
} else {
|
|
|
|
/* virtual */
|
2016-05-12 16:12:53 +00:00
|
|
|
size_t remain;
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2005-02-20 14:27:00 +00:00
|
|
|
if (virt_path[0] == '/') {
|
2019-11-25 06:54:08 +00:00
|
|
|
buffer_copy_string(tb, virt_path);
|
2005-02-20 14:27:00 +00:00
|
|
|
} else {
|
|
|
|
/* there is always a / */
|
|
|
|
sl = strrchr(con->uri.path->ptr, '/');
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2019-11-25 06:54:08 +00:00
|
|
|
buffer_copy_string_len(tb, con->uri.path->ptr, sl - con->uri.path->ptr + 1);
|
|
|
|
buffer_append_string(tb, virt_path);
|
2005-02-20 14:27:00 +00:00
|
|
|
}
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2019-11-25 06:54:08 +00:00
|
|
|
buffer_urldecode_path(tb);
|
|
|
|
if (!buffer_is_valid_UTF8(tb)) {
|
|
|
|
log_error(con->conf.errh, __FILE__, __LINE__,
|
|
|
|
"SSI invalid UTF-8 after url-decode: %s", tb->ptr);
|
2018-11-26 00:07:53 +00:00
|
|
|
break;
|
|
|
|
}
|
2019-11-25 06:54:08 +00:00
|
|
|
buffer_path_simplify(tb, tb);
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2005-02-20 14:27:00 +00:00
|
|
|
/* we have an uri */
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2016-05-12 16:12:53 +00:00
|
|
|
/* Destination physical path (similar to code in mod_webdav.c)
|
|
|
|
* src con->physical.path might have been remapped with mod_alias, mod_userdir.
|
|
|
|
* (but neither modifies con->physical.rel_path)
|
|
|
|
* Find matching prefix to support relative paths to current physical path.
|
|
|
|
* Aliasing of paths underneath current con->physical.basedir might not work.
|
|
|
|
* Likewise, mod_rewrite URL rewriting might thwart this comparison.
|
|
|
|
* Use mod_redirect instead of mod_alias to remap paths *under* this basedir.
|
|
|
|
* Use mod_redirect instead of mod_rewrite on *any* parts of path to basedir.
|
|
|
|
* (Related, use mod_auth to protect this basedir, but avoid attempting to
|
|
|
|
* use mod_auth on paths underneath this basedir, as target path is not
|
|
|
|
* validated with mod_auth)
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* find matching URI prefix
|
|
|
|
* check if remaining con->physical.rel_path matches suffix
|
|
|
|
* of con->physical.basedir so that we can use it to
|
|
|
|
* remap Destination physical path */
|
|
|
|
{
|
|
|
|
const char *sep, *sep2;
|
|
|
|
sep = con->uri.path->ptr;
|
2019-11-25 06:54:08 +00:00
|
|
|
sep2 = tb->ptr;
|
2016-05-12 16:12:53 +00:00
|
|
|
for (i = 0; sep[i] && sep[i] == sep2[i]; ++i) ;
|
|
|
|
while (i != 0 && sep[--i] != '/') ; /* find matching directory path */
|
|
|
|
}
|
|
|
|
if (con->conf.force_lowercase_filenames) {
|
2019-11-25 06:54:08 +00:00
|
|
|
buffer_to_lower(tb);
|
2016-05-12 16:12:53 +00:00
|
|
|
}
|
|
|
|
remain = buffer_string_length(con->uri.path) - i;
|
|
|
|
if (!con->conf.force_lowercase_filenames
|
|
|
|
? buffer_is_equal_right_len(con->physical.path, con->physical.rel_path, remain)
|
|
|
|
:(buffer_string_length(con->physical.path) >= remain
|
2019-06-06 05:17:43 +00:00
|
|
|
&& buffer_eq_icase_ssn(con->physical.path->ptr+buffer_string_length(con->physical.path)-remain, con->physical.rel_path->ptr+i, remain))) {
|
2016-05-12 16:12:53 +00:00
|
|
|
buffer_copy_string_len(p->stat_fn, con->physical.path->ptr, buffer_string_length(con->physical.path)-remain);
|
2019-11-25 06:54:08 +00:00
|
|
|
buffer_append_string_len(p->stat_fn, tb->ptr+i, buffer_string_length(tb)-i);
|
2016-05-12 16:12:53 +00:00
|
|
|
} else {
|
|
|
|
/* unable to perform physical path remap here;
|
|
|
|
* assume doc_root/rel_path and no remapping */
|
|
|
|
buffer_copy_buffer(p->stat_fn, con->physical.doc_root);
|
2019-11-25 06:54:08 +00:00
|
|
|
buffer_append_string_buffer(p->stat_fn, tb);
|
2016-05-12 16:12:53 +00:00
|
|
|
}
|
2005-02-20 14:27:00 +00:00
|
|
|
}
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2019-04-30 00:20:47 +00:00
|
|
|
if (!con->conf.follow_symlink
|
2019-12-05 08:16:25 +00:00
|
|
|
&& 0 != stat_cache_path_contains_symlink(p->stat_fn, con->conf.errh)) {
|
2019-04-30 00:20:47 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
int fd = stat_cache_open_rdonly_fstat(p->stat_fn, &stb, con->conf.follow_symlink);
|
2019-11-23 17:19:15 +00:00
|
|
|
if (fd >= 0) {
|
2016-04-18 03:37:40 +00:00
|
|
|
time_t t = stb.st_mtime;
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2005-02-20 14:27:00 +00:00
|
|
|
switch (ssicmd) {
|
|
|
|
case SSI_FSIZE:
|
|
|
|
if (p->sizefmt) {
|
|
|
|
int j = 0;
|
|
|
|
const char *abr[] = { " B", " kB", " MB", " GB", " TB", NULL };
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2016-04-18 03:37:40 +00:00
|
|
|
off_t s = stb.st_size;
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2005-02-20 14:27:00 +00:00
|
|
|
for (j = 0; s > 1024 && abr[j+1]; s /= 1024, j++);
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2019-11-25 06:54:08 +00:00
|
|
|
buffer_copy_int(tb, s);
|
|
|
|
buffer_append_string(tb, abr[j]);
|
2005-02-20 14:27:00 +00:00
|
|
|
} else {
|
2019-11-25 06:54:08 +00:00
|
|
|
buffer_copy_int(tb, stb.st_size);
|
2005-02-20 14:27:00 +00:00
|
|
|
}
|
2019-11-25 06:54:08 +00:00
|
|
|
chunkqueue_append_mem(con->write_queue, CONST_BUF_LEN(tb));
|
2005-02-20 14:27:00 +00:00
|
|
|
break;
|
|
|
|
case SSI_FLASTMOD:
|
|
|
|
if (0 == strftime(buf, sizeof(buf), p->timefmt->ptr, localtime(&t))) {
|
2015-02-08 19:10:36 +00:00
|
|
|
chunkqueue_append_mem(con->write_queue, CONST_STR_LEN("(none)"));
|
2005-02-20 14:27:00 +00:00
|
|
|
} else {
|
2015-02-08 19:10:36 +00:00
|
|
|
chunkqueue_append_mem(con->write_queue, buf, strlen(buf));
|
2005-02-20 14:27:00 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SSI_INCLUDE:
|
2008-01-18 09:21:07 +00:00
|
|
|
/* Keep the newest mtime of included files */
|
2016-04-18 03:37:40 +00:00
|
|
|
if (stb.st_mtime > include_file_last_mtime)
|
|
|
|
include_file_last_mtime = stb.st_mtime;
|
2008-01-18 09:21:07 +00:00
|
|
|
|
2016-12-11 06:49:11 +00:00
|
|
|
if (file_path || 0 == p->conf.ssi_recursion_max) {
|
|
|
|
/* don't process if #include file="..." is used */
|
2019-04-30 00:20:47 +00:00
|
|
|
chunkqueue_append_file_fd(con->write_queue, p->stat_fn, fd, 0, stb.st_size);
|
|
|
|
fd = -1;
|
2016-12-11 06:49:11 +00:00
|
|
|
} else {
|
|
|
|
buffer *upsave, *ppsave, *prpsave;
|
|
|
|
|
|
|
|
/* only allow predefined recursion depth */
|
|
|
|
if (p->ssi_recursion_depth >= p->conf.ssi_recursion_max) {
|
|
|
|
chunkqueue_append_mem(con->write_queue, CONST_STR_LEN("(error: include directives recurse deeper than pre-defined ssi.recursion-max)"));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* prevents simple infinite loop */
|
|
|
|
if (buffer_is_equal(con->physical.path, p->stat_fn)) {
|
|
|
|
chunkqueue_append_mem(con->write_queue, CONST_STR_LEN("(error: include directives create an infinite loop)"));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* save and restore con->physical.path, con->physical.rel_path, and con->uri.path around include
|
|
|
|
*
|
2019-11-25 06:54:08 +00:00
|
|
|
* tb contains url-decoded, path-simplified, and lowercased (if con->conf.force_lowercase) uri path of target.
|
2016-12-11 06:49:11 +00:00
|
|
|
* con->uri.path and con->physical.rel_path are set to the same since we only operate on filenames here,
|
|
|
|
* not full re-run of all modules for subrequest */
|
|
|
|
upsave = con->uri.path;
|
|
|
|
ppsave = con |