no_quote.patch This patch make `AuthName` don't need quotes. Last Modify:04/04/2000 Copyright (c) 2000 hagy All rights reserved. ================================================================================ diff -r -c ../../apache_1.3.9/src/include/ap_compat.h ./include/ap_compat.h *** ../../apache_1.3.9/src/include/ap_compat.h Wed May 26 00:23:56 1999 --- ./include/ap_compat.h Wed Apr 5 00:26:47 2000 *************** *** 415,420 **** --- 415,421 ---- #define util_uri_init ap_util_uri_init #define uudecode ap_uudecode #define vbprintf ap_vbprintf + #define getword_conf_no_quote ap_getword_conf_no_quote /* * Macros for routines whose arguments have changed over time. diff -r -c ../../apache_1.3.9/src/include/http_config.h ./include/http_config.h *** ../../apache_1.3.9/src/include/http_config.h Fri May 7 09:16:10 1999 --- ./include/http_config.h Wed Apr 5 00:22:19 2000 *************** *** 89,95 **** TAKE3, /* three arguments only */ TAKE23, /* two or three arguments */ TAKE123, /* one, two or three arguments */ ! TAKE13 /* one or three arguments */ }; typedef struct command_struct { --- 89,96 ---- TAKE3, /* three arguments only */ TAKE23, /* two or three arguments */ TAKE123, /* one, two or three arguments */ ! TAKE13, /* one or three arguments */ ! NO_QUOTE_ARGS /* some arguments, e.g. AuthName */ }; typedef struct command_struct { diff -r -c ../../apache_1.3.9/src/include/httpd.h ./include/httpd.h *** ../../apache_1.3.9/src/include/httpd.h Tue Aug 17 02:57:53 1999 --- ./include/httpd.h Wed Apr 5 00:29:03 2000 *************** *** 959,964 **** --- 959,965 ---- API_EXPORT(char *) ap_getword_nulls_nc(pool *p, char **line, char stop); API_EXPORT(char *) ap_getword_conf(pool *p, const char **line); API_EXPORT(char *) ap_getword_conf_nc(pool *p, char **line); + API_EXPORT(char *) ap_getword_conf_no_quote(pool *p, const char **line); API_EXPORT(const char *) ap_size_list_item(const char **field, int *len); API_EXPORT(char *) ap_get_list_item(pool *p, const char **field); diff -r -c ../../apache_1.3.9/src/main/http_config.c ./main/http_config.c *** ../../apache_1.3.9/src/main/http_config.c Sat Aug 7 01:21:33 1999 --- ./main/http_config.c Wed Apr 5 01:22:45 2000 *************** *** 796,801 **** --- 796,812 ---- return ((const char *(*)(cmd_parms *, void *)) (cmd->func)) (parms, mconfig); + case NO_QUOTE_ARGS: + w = ap_getword_conf_no_quote(parms->pool, &args); + /* w = ap_escape_quotes(parms->pool, &args); */ + + if (*w == '\0' || *args != 0) + return ap_pstrcat(parms->pool, cmd->name, " takes some arguments", + cmd->errmsg ? ", " : NULL, cmd->errmsg, NULL); + + return ((const char *(*)(cmd_parms *, void *, const char *)) + (cmd->func)) (parms, mconfig, w); + case TAKE1: w = ap_getword_conf(parms->pool, &args); diff -r -c ../../apache_1.3.9/src/main/http_core.c ./main/http_core.c *** ../../apache_1.3.9/src/main/http_core.c Mon Aug 9 16:29:29 1999 --- ./main/http_core.c Wed Apr 5 00:18:26 2000 *************** *** 2761,2767 **** { "AuthType", ap_set_string_slot, (void*)XtOffsetOf(core_dir_config, ap_auth_type), OR_AUTHCFG, TAKE1, "An HTTP authorization type (e.g., \"Basic\")" }, ! { "AuthName", set_authname, NULL, OR_AUTHCFG, TAKE1, "The authentication realm (e.g. \"Members Only\")" }, { "Require", require, NULL, OR_AUTHCFG, RAW_ARGS, "Selects which authenticated users or groups may access a protected space" }, --- 2761,2768 ---- { "AuthType", ap_set_string_slot, (void*)XtOffsetOf(core_dir_config, ap_auth_type), OR_AUTHCFG, TAKE1, "An HTTP authorization type (e.g., \"Basic\")" }, ! /* { "AuthName", set_authname, NULL, OR_AUTHCFG, TAKE1, */ ! { "AuthName", set_authname, NULL, OR_AUTHCFG, NO_QUOTE_ARGS, "The authentication realm (e.g. \"Members Only\")" }, { "Require", require, NULL, OR_AUTHCFG, RAW_ARGS, "Selects which authenticated users or groups may access a protected space" }, diff -r -c ../../apache_1.3.9/src/main/util.c ./main/util.c *** ../../apache_1.3.9/src/main/util.c Sat Aug 14 17:35:50 1999 --- ./main/util.c Wed Apr 5 01:23:44 2000 *************** *** 751,756 **** --- 751,798 ---- return res; } + API_EXPORT(char *) ap_getword_conf_no_quote(pool *p, const char **line) + { + const char *str = *line, *strend; + char *res; + char quote; + + while (*str && ap_isspace(*str)) + ++str; + + if (!*str) { + *line = str; + return ""; + } + + if ((quote = *str) == '"' || quote == '\'') { + strend = str + 1; + while (*strend && *strend != quote) { + if (*strend == '\\' && strend[1] && strend[1] == quote) + strend += 2; + else + ++strend; + } + res = substring_conf(p, str + 1, strend - str - 1, quote); + + if (*strend == quote) + ++strend; + } + else { + strend = str; + /* while (*strend && !ap_isspace(*strend)) */ + while (*strend) + ++strend; + + res = substring_conf(p, str, strend - str, 0); + } + + while (*strend && ap_isspace(*strend)) + ++strend; + *line = strend; + return res; + } + API_EXPORT(int) ap_cfg_closefile(configfile_t *cfp) { #ifdef DEBUG