#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for mod_chxj 0.9.0-1.
+# Generated by GNU Autoconf 2.61 for mod_chxj 0.9.1-1.
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
# Identity of this package.
PACKAGE_NAME='mod_chxj'
PACKAGE_TARNAME='mod_chxj'
-PACKAGE_VERSION='0.9.0-1'
-PACKAGE_STRING='mod_chxj 0.9.0-1'
+PACKAGE_VERSION='0.9.1-1'
+PACKAGE_STRING='mod_chxj 0.9.1-1'
PACKAGE_BUGREPORT=''
ac_unique_file="src/mod_chxj.c"
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures mod_chxj 0.9.0-1 to adapt to many kinds of systems.
+\`configure' configures mod_chxj 0.9.1-1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of mod_chxj 0.9.0-1:";;
+ short | recursive ) echo "Configuration of mod_chxj 0.9.1-1:";;
esac
cat <<\_ACEOF
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-mod_chxj configure 0.9.0-1
+mod_chxj configure 0.9.1-1
generated by GNU Autoconf 2.61
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by mod_chxj $as_me 0.9.0-1, which was
+It was created by mod_chxj $as_me 0.9.1-1, which was
generated by GNU Autoconf 2.61. Invocation command line was
$ $0 $@
# Define the identity of the package.
PACKAGE=mod_chxj
- VERSION=0.9.0-1
+ VERSION=0.9.1-1
cat >>confdefs.h <<_ACEOF
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by mod_chxj $as_me 0.9.0-1, which was
+This file was extended by mod_chxj $as_me 0.9.1-1, which was
generated by GNU Autoconf 2.61. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-mod_chxj config.status 0.9.0-1
+mod_chxj config.status 0.9.1-1
configured by $0, generated by GNU Autoconf 2.61,
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
static char* s_get_hostname_from_url(request_rec* r, char* value);
static char* s_cut_until_end_hostname(request_rec*, char* value);
+static int valid_domain(request_rec *r, const char *value);
+static int valid_path(request_rec *r, const char *value);
+static int valid_expire(request_rec *r, const char *value);
+static int valid_secure(request_rec *r, const char *value);
+static int check_valid_cookie_attribute(request_rec *r, const char *pair);
+
static char *
alloc_cookie_id(request_rec *r)
*val++ = 0;
apr_table_add(load_cookie_table, key, val);
}
- tmp_sem = strchr(pair, ';');
+ tmp_pair = apr_pstrdup(r->pool, pair);
+ tmp_sem = strchr(tmp_pair, ';');
if (tmp_sem)
*tmp_sem = '\0';
- if (strlen(header_cookie))
- header_cookie = apr_pstrcat(r->pool, header_cookie, ";", NULL);
-
- header_cookie = apr_pstrcat(r->pool, header_cookie, pair, NULL);
+ if (check_valid_cookie_attribute(r, pair)) {
+ if (strlen(header_cookie))
+ header_cookie = apr_pstrcat(r->pool, header_cookie, ";", NULL);
+
+ header_cookie = apr_pstrcat(r->pool, header_cookie, tmp_pair, NULL);
+ }
}
- if (strlen(header_cookie))
+ if (strlen(header_cookie)) {
+ DBG(r, "ADD COOKIE to REQUEST HEADER:[%s]", header_cookie);
apr_table_add(r->headers_in, "Cookie", header_cookie);
+ }
cookie->cookie_headers = (apr_array_header_t*)apr_table_elts(load_cookie_table);
return NULL;
}
+static int
+check_valid_cookie_attribute(request_rec *r, const char *value)
+{
+ char *pstat;
+ char *pair;
+ char *first_pair;
+ char *domain_pair;
+ char *path_pair;
+ char *expire_pair;
+ char *secure_pair;
+
+ DBG(r, "start check_valid_cookie_attribute() value:[%s]", value);
+
+ domain_pair = path_pair = expire_pair = secure_pair = NULL;
+
+ /* pass first pair */
+ first_pair = apr_strtok(value, ";", &pstat);
+
+ for (;;) {
+ pair = apr_strtok(NULL, ";", &pstat);
+ if (! pair) break;
+ pair = qs_trim_string(r, pair);
+ if (STRNCASEEQ('d','D',"domain", pair, sizeof("domain")-1)) {
+ domain_pair = apr_pstrdup(r->pool, pair);
+ }
+ else if (STRNCASEEQ('p','P',"path", pair, sizeof("path")-1)) {
+ path_pair = apr_pstrdup(r->pool, pair);
+ }
+ else if (STRNCASEEQ('e','E',"expire", pair, sizeof("expire")-1)) {
+ expire_pair = apr_pstrdup(r->pool, pair);
+ }
+ else if (STRNCASEEQ('s','S',"secure", pair, sizeof("secure")-1)) {
+ secure_pair = apr_pstrdup(r->pool, pair);
+ }
+ }
+
+ if (domain_pair) {
+ if (!valid_domain(r, domain_pair)) {
+ DBG(r, "invalid domain. domain_pair:[%s]", domain_pair);
+ return CHXJ_FALSE;
+ }
+ }
+ if (path_pair) {
+ if (!valid_path(r, path_pair)) {
+ DBG(r, "invalid path. path_pair:[%s]", path_pair);
+ return CHXJ_FALSE;
+ }
+ }
+ if (expire_pair) {
+ if (!valid_expire(r, expire_pair)) {
+ DBG(r, "invalid expire. expire_pair:[%s]", expire_pair);
+ return CHXJ_FALSE;
+ }
+ }
+ if (secure_pair) {
+ if (!valid_secure(r, secure_pair)) {
+ DBG(r, "invalid secure. secure_pair:[%s]", secure_pair);
+ return CHXJ_FALSE;
+ }
+ }
+ DBG(r, "end check_valid_cookie_attribute() value:[%s]", value);
+ return CHXJ_TRUE;
+}
+
+static int
+valid_domain(request_rec *r, const char *value)
+{
+ DBG(r, "start valid_domain() value:[%s]", value);
+ DBG(r, "end valid_domain() value:[%s]", value);
+ return CHXJ_TRUE;
+}
+
+static int
+valid_path(request_rec *r, const char *value)
+{
+ DBG(r, "start valid_path() value:[%s]", value);
+ DBG(r, "end valid_path() value:[%s]", value);
+ return CHXJ_TRUE;
+}
+
+static int
+valid_expire(request_rec *r, const char *value)
+{
+ DBG(r, "start valid_expire() value:[%s]", value);
+ DBG(r, "end valid_expire() value:[%s]", value);
+ return CHXJ_TRUE;
+}
+
+static int
+valid_secure(request_rec *r, const char *value)
+{
+ DBG(r, "start valid_secure() value:[%s]", value);
+ DBG(r, "end valid_secure() value:[%s]", value);
+ return CHXJ_TRUE;
+}
+
char*
chxj_add_cookie_parameter(request_rec* r, char* value, cookie_t* cookie)