From zcarey@example.org Sun Aug 01 14:12:42 1999 Return-Path: <zcarey@example.org> Delivered-To: zcarey@example.org Received: (qmail 7138 invoked by uid 6000); 1 Aug 1999 14:12:40 -0000 Received: (qmail 7128 invoked by alias); 1 Aug 1999 14:12:38 -0000 Delivered-To: zcarey@example.org Received: (qmail 7113 invoked by uid 124); 1 Aug 1999 14:12:37 -0000 Date: 1 Aug 1999 14:12:37 -0000 Message-ID: <zcarey@example.org> From: zcarey@example.org To: zcarey@example.org Subject: cvs commit: apache-2.0/mpm/src/modules/standard mod_access.c mod_actions.c mod_alias.c mod_asis.c mod_auth.c mod_autoindex.c mod_dir.c mod_echo.c mod_env.c mod_imap.c mod_log_config.c mod_mime.c mod_negotiation.c mod_setenvif.c mod_userdir.c Sender: zcarey@example.org Precedence: bulk Reply-To: zcarey@example.org ben 99/08/01 07:12:37 Modified: mpm/src/include http_config.h mpm/src/main http_config.c http_core.c http_main.c mpm/src/modules/mpm/prefork prefork.c mpm/src/modules/standard mod_access.c mod_actions.c mod_alias.c mod_asis.c mod_auth.c mod_autoindex.c mod_dir.c mod_echo.c mod_env.c mod_imap.c mod_log_config.c mod_mime.c mod_negotiation.c mod_setenvif.c mod_userdir.c Log: Another hook. Revision Changes Path 1.13 +4 -4 apache-2.0/mpm/src/include/http_config.h Index: http_config.h =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/include/http_config.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- http_config.h 1999/07/27 21:16:36 1.12 +++ http_config.h 1999/08/01 14:12:29 1.13 @@ -211,7 +211,6 @@ * (see also mod_so). */ - void (*open_logs)(pool *pconf, pool *plog, pool *ptemp, server_rec *); void (*post_config)(pool *pconf, pool *plog, pool *ptemp, server_rec *); void (*child_init)(pool *pchild, server_rec *); @@ -333,7 +332,6 @@ void ap_show_directives(void); void ap_show_modules(void); server_rec *ap_read_config(pool *conf_pool, pool *temp_pool, const char *config_name); -void ap_open_logs_hook(pool *pconf, pool *plog, pool *ptemp, server_rec *s); void ap_post_config_hook(pool *pconf, pool *plog, pool *ptemp, server_rec *s); void ap_child_init_hook(pool *pchild, server_rec *s); @@ -371,11 +369,13 @@ CORE_EXPORT(void *) ap_set_config_vectors(cmd_parms *parms, void *config, module *mod); CORE_EXPORT(const char *) ap_handle_command(cmd_parms *parms, void *config, const char *l); +#endif + /* Hooks */ DECLARE_HOOK(int,header_parser,(request_rec *)) DECLARE_HOOK(void,pre_config,(pool *pconf,pool *plog,pool *ptemp)) - -#endif +DECLARE_HOOK(void,open_logs, + (pool *pconf, pool *plog, pool *ptemp, server_rec *s)) #ifdef __cplusplus } 1.17 +4 -9 apache-2.0/mpm/src/main/http_config.c Index: http_config.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_config.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- http_config.c 1999/07/31 09:31:20 1.16 +++ http_config.c 1999/08/01 14:12:30 1.17 @@ -84,11 +84,15 @@ HOOK_STRUCT( HOOK_LINK(header_parser) HOOK_LINK(pre_config) + HOOK_LINK(open_logs) ) IMPLEMENT_HOOK_RUN_ALL(int,header_parser,(request_rec *r),(r),OK,DECLINED) IMPLEMENT_HOOK_VOID(pre_config,(pool *pconf,pool *plog,pool *ptemp), (pconf,plog,ptemp)) +IMPLEMENT_HOOK_VOID(open_logs, + (pool *pconf, pool *plog, pool *ptemp, server_rec *s), + (pconf,plog,ptemp,s)) DEF_Explain @@ -1449,15 +1453,6 @@ (*m->post_config) (pconf, plog, ptemp, s); build_method_shortcuts(); init_handlers(pconf); -} - -void ap_open_logs_hook(pool *pconf, pool *plog, pool *ptemp, server_rec *s) -{ - module *m; - - for (m = top_module; m; m = m->next) - if (m->open_logs) - (*m->open_logs) (pconf, plog, ptemp, s); } void ap_child_init_hook(pool *pchild, server_rec *s) 1.14 +1 -1 apache-2.0/mpm/src/main/http_core.c Index: http_core.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_core.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- http_core.c 1999/07/27 21:16:39 1.13 +++ http_core.c 1999/08/01 14:12:30 1.14 @@ -2643,6 +2643,7 @@ HOOK_REALLY_LAST); ap_hook_http_method(core_method,NULL,NULL,HOOK_REALLY_LAST); ap_hook_default_port(core_port,NULL,NULL,HOOK_REALLY_LAST); + ap_hook_open_logs(core_open_logs,NULL,NULL,HOOK_MIDDLE); /* FIXME: I suspect we can eliminate the need for these - Ben */ ap_hook_type_checker(do_nothing,NULL,NULL,HOOK_REALLY_LAST); } @@ -2650,7 +2651,6 @@ API_VAR_EXPORT module core_module = { STANDARD20_MODULE_STUFF, NULL, /* post_config */ - core_open_logs, /* open_logs */ NULL, /* child_init */ create_core_dir_config, /* create per-directory config structure */ merge_core_dir_configs, /* merge per-directory config structures */ 1.7 +2 -2 apache-2.0/mpm/src/main/http_main.c Index: http_main.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_main.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- http_main.c 1999/07/27 21:16:39 1.6 +++ http_main.c 1999/08/01 14:12:30 1.7 @@ -327,7 +327,7 @@ } ap_clear_pool(plog); - ap_open_logs_hook(pconf, plog, ptemp, server_conf); + ap_run_open_logs(pconf, plog, ptemp, server_conf); ap_post_config_hook(pconf, plog, ptemp, server_conf); ap_clear_pool(ptemp); @@ -338,7 +338,7 @@ ap_run_pre_config(pconf, plog, ptemp); server_conf = ap_read_config(pconf, ptemp, confname); ap_clear_pool(plog); - ap_open_logs_hook(pconf, plog, ptemp, server_conf); + ap_run_open_logs(pconf, plog, ptemp, server_conf); ap_post_config_hook(pconf, plog, ptemp, server_conf); ap_destroy_pool(ptemp); 1.22 +0 -1 apache-2.0/mpm/src/modules/mpm/prefork/prefork.c Index: prefork.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/mpm/prefork/prefork.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- prefork.c 1999/07/27 21:16:43 1.21 +++ prefork.c 1999/08/01 14:12:31 1.22 @@ -3085,7 +3085,6 @@ module MODULE_VAR_EXPORT mpm_prefork_module = { STANDARD20_MODULE_STUFF, NULL, /* post_config */ - NULL, /* open_logs */ NULL, /* child_init */ NULL, /* create per-directory config structure */ NULL, /* merge per-directory config structures */ 1.11 +0 -1 apache-2.0/mpm/src/modules/standard/mod_access.c Index: mod_access.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_access.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- mod_access.c 1999/07/27 21:16:44 1.10 +++ mod_access.c 1999/08/01 14:12:32 1.11 @@ -390,7 +390,6 @@ { STANDARD20_MODULE_STUFF, NULL, /* post_config */ - NULL, /* open_logs */ NULL, /* initializer */ create_access_dir_config, /* dir config creater */ NULL, /* dir merger --- default is to override */ 1.10 +0 -1 apache-2.0/mpm/src/modules/standard/mod_actions.c Index: mod_actions.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_actions.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- mod_actions.c 1999/07/27 21:16:44 1.9 +++ mod_actions.c 1999/08/01 14:12:32 1.10 @@ -212,7 +212,6 @@ { STANDARD20_MODULE_STUFF, NULL, /* post_config */ - NULL, /* open_logs */ NULL, /* child initializer */ create_action_dir_config, /* dir config creater */ merge_action_dir_configs, /* dir merger --- default is to override */ 1.12 +0 -1 apache-2.0/mpm/src/modules/standard/mod_alias.c Index: mod_alias.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_alias.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- mod_alias.c 1999/07/27 21:16:45 1.11 +++ mod_alias.c 1999/08/01 14:12:32 1.12 @@ -407,7 +407,6 @@ { STANDARD20_MODULE_STUFF, NULL, /* post_config */ - NULL, /* open_logs */ NULL, /* initializer */ create_alias_dir_config, /* dir config creater */ merge_alias_dir_config, /* dir merger --- default is to override */ 1.11 +0 -1 apache-2.0/mpm/src/modules/standard/mod_asis.c Index: mod_asis.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_asis.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- mod_asis.c 1999/07/27 21:16:45 1.10 +++ mod_asis.c 1999/08/01 14:12:32 1.11 @@ -127,7 +127,6 @@ { STANDARD20_MODULE_STUFF, NULL, /* post_config */ - NULL, /* open_logs */ NULL, /* child initaliser */ NULL, /* create per-directory config structure */ NULL, /* merge per-directory config structures */ 1.11 +0 -1 apache-2.0/mpm/src/modules/standard/mod_auth.c Index: mod_auth.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_auth.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- mod_auth.c 1999/07/27 21:16:45 1.10 +++ mod_auth.c 1999/08/01 14:12:32 1.11 @@ -319,7 +319,6 @@ { STANDARD20_MODULE_STUFF, NULL, /* post_config */ - NULL, /* open_logs */ NULL, /* initializer */ create_auth_dir_config, /* dir config creater */ NULL, /* dir merger --- default is to override */ 1.11 +0 -1 apache-2.0/mpm/src/modules/standard/mod_autoindex.c Index: mod_autoindex.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_autoindex.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- mod_autoindex.c 1999/07/27 21:16:46 1.10 +++ mod_autoindex.c 1999/08/01 14:12:33 1.11 @@ -1651,7 +1651,6 @@ { STANDARD20_MODULE_STUFF, NULL, /* post_config */ - NULL, /* open_logs */ NULL, /* child initializer */ create_autoindex_config, /* dir config creater */ merge_autoindex_configs, /* dir merger --- default is to override */ 1.10 +0 -1 apache-2.0/mpm/src/modules/standard/mod_dir.c Index: mod_dir.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_dir.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- mod_dir.c 1999/07/27 21:16:46 1.9 +++ mod_dir.c 1999/08/01 14:12:33 1.10 @@ -225,7 +225,6 @@ module MODULE_VAR_EXPORT dir_module = { STANDARD20_MODULE_STUFF, NULL, /* post_config */ - NULL, /* open_logs */ NULL, /* child_init */ create_dir_config, /* create per-directory config structure */ merge_dir_configs, /* merge per-directory config structures */ 1.5 +0 -1 apache-2.0/mpm/src/modules/standard/mod_echo.c Index: mod_echo.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_echo.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- mod_echo.c 1999/07/27 21:16:46 1.4 +++ mod_echo.c 1999/08/01 14:12:33 1.5 @@ -64,7 +64,6 @@ API_VAR_EXPORT module echo_module = { STANDARD20_MODULE_STUFF, NULL, /* post_config */ - NULL, /* open_logs */ NULL, /* child_init */ NULL, /* create per-directory config structure */ NULL, /* merge per-directory config structures */ 1.12 +0 -1 apache-2.0/mpm/src/modules/standard/mod_env.c Index: mod_env.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_env.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- mod_env.c 1999/07/27 21:16:46 1.11 +++ mod_env.c 1999/08/01 14:12:33 1.12 @@ -257,7 +257,6 @@ { STANDARD20_MODULE_STUFF, NULL, /* post_config */ - NULL, /* open_logs */ NULL, /* child initializer */ create_env_dir_config, /* dir config creater */ merge_env_dir_configs, /* dir merger --- default is to override */ 1.11 +0 -1 apache-2.0/mpm/src/modules/standard/mod_imap.c Index: mod_imap.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_imap.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- mod_imap.c 1999/07/27 21:16:47 1.10 +++ mod_imap.c 1999/08/01 14:12:33 1.11 @@ -898,7 +898,6 @@ { STANDARD20_MODULE_STUFF, NULL, /* post_config */ - NULL, /* open_logs */ NULL, /* child initializer */ create_imap_dir_config, /* dir config creater */ merge_imap_dir_configs, /* dir merger --- default is to override */ 1.11 +1 -1 apache-2.0/mpm/src/modules/standard/mod_log_config.c Index: mod_log_config.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_log_config.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- mod_log_config.c 1999/07/27 21:16:47 1.10 +++ mod_log_config.c 1999/08/01 14:12:33 1.11 @@ -1107,6 +1107,7 @@ static void register_hooks() { + ap_hook_open_logs(init_config_log,NULL,NULL,HOOK_MIDDLE); ap_hook_log_transaction(multi_log_transaction,NULL,NULL,HOOK_MIDDLE); } @@ -1114,7 +1115,6 @@ { STANDARD20_MODULE_STUFF, NULL, /* post_config */ - init_config_log, /* open_logs */ NULL, /* child_init */ NULL, /* create per-dir config */ NULL, /* merge per-dir config */ 1.10 +0 -1 apache-2.0/mpm/src/modules/standard/mod_mime.c Index: mod_mime.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_mime.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- mod_mime.c 1999/07/27 21:16:47 1.9 +++ mod_mime.c 1999/08/01 14:12:33 1.10 @@ -387,7 +387,6 @@ module MODULE_VAR_EXPORT mime_module = { STANDARD20_MODULE_STUFF, mime_post_config, /* post_config */ - NULL, /* open_logs */ NULL, /* child_init */ create_mime_dir_config, /* create per-directory config structure */ merge_mime_dir_configs, /* merge per-directory config structures */ 1.11 +0 -1 apache-2.0/mpm/src/modules/standard/mod_negotiation.c Index: mod_negotiation.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_negotiation.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- mod_negotiation.c 1999/07/27 21:16:47 1.10 +++ mod_negotiation.c 1999/08/01 14:12:34 1.11 @@ -2734,7 +2734,6 @@ { STANDARD20_MODULE_STUFF, NULL, /* post_config */ - NULL, /* open_logs */ NULL, /* initializer */ create_neg_dir_config, /* dir config creator */ merge_neg_dir_configs, /* dir merger --- default is to override */ 1.12 +0 -1 apache-2.0/mpm/src/modules/standard/mod_setenvif.c Index: mod_setenvif.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_setenvif.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- mod_setenvif.c 1999/07/27 21:16:47 1.11 +++ mod_setenvif.c 1999/08/01 14:12:34 1.12 @@ -409,7 +409,6 @@ { STANDARD20_MODULE_STUFF, NULL, /* post_config */ - NULL, /* open_logs */ NULL, /* initializer */ NULL, /* dir config creater */ NULL, /* dir merger --- default is to override */ 1.12 +0 -1 apache-2.0/mpm/src/modules/standard/mod_userdir.c Index: mod_userdir.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_userdir.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- mod_userdir.c 1999/07/27 21:16:47 1.11 +++ mod_userdir.c 1999/08/01 14:12:34 1.12 @@ -337,7 +337,6 @@ module userdir_module = { STANDARD20_MODULE_STUFF, NULL, /* post_config */ - NULL, /* open_logs */ NULL, /* child initializer */ NULL, /* dir config creater */ NULL, /* dir merger --- default is to override */ From zcarey@example.org Sun Aug 01 14:26:29 1999 Return-Path: <zcarey@example.org> Delivered-To: zcarey@example.org Received: (qmail 11387 invoked by uid 6000); 1 Aug 1999 14:26:28 -0000 Received: (qmail 11381 invoked by alias); 1 Aug 1999 14:26:27 -0000 Delivered-To: zcarey@example.org Received: (qmail 11379 invoked by uid 207); 1 Aug 1999 14:26:26 -0000 Date: 1 Aug 1999 14:26:26 -0000 Message-ID: <zcarey@example.org> From: zcarey@example.org To: zcarey@example.org Subject: cvs commit: apache-1.3/src/support/SHA1 - New directory Sender: zcarey@example.org Precedence: bulk Reply-To: zcarey@example.org dirkx 99/08/01 07:26:26 apache-1.3/src/support/SHA1 - New directory From zcarey@example.org Sun Aug 01 14:43:37 1999 Return-Path: <zcarey@example.org> Delivered-To: zcarey@example.org Received: (qmail 16576 invoked by uid 6000); 1 Aug 1999 14:43:35 -0000 Received: (qmail 16568 invoked by alias); 1 Aug 1999 14:43:33 -0000 Delivered-To: zcarey@example.org Received: (qmail 16566 invoked by uid 124); 1 Aug 1999 14:43:33 -0000 Date: 1 Aug 1999 14:43:33 -0000 Message-ID: <zcarey@example.org> From: zcarey@example.org To: zcarey@example.org Subject: cvs commit: apache-2.0/mpm/src/modules/standard mod_access.c mod_actions.c mod_alias.c mod_asis.c mod_auth.c mod_autoindex.c mod_dir.c mod_echo.c mod_env.c mod_imap.c mod_log_config.c mod_mime.c mod_negotiation.c mod_setenvif.c mod_userdir.c Sender: zcarey@example.org Precedence: bulk Reply-To: zcarey@example.org ben 99/08/01 07:43:32 Modified: mpm/src/include http_config.h mpm/src/main http_config.c http_core.c mpm/src/modules/mpm/prefork prefork.c mpm/src/modules/standard mod_access.c mod_actions.c mod_alias.c mod_asis.c mod_auth.c mod_autoindex.c mod_dir.c mod_echo.c mod_env.c mod_imap.c mod_log_config.c mod_mime.c mod_negotiation.c mod_setenvif.c mod_userdir.c Log: Another hook. Revision Changes Path 1.14 +3 -2 apache-2.0/mpm/src/include/http_config.h Index: http_config.h =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/include/http_config.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- http_config.h 1999/08/01 14:12:29 1.13 +++ http_config.h 1999/08/01 14:43:22 1.14 @@ -211,7 +211,6 @@ * (see also mod_so). */ - void (*post_config)(pool *pconf, pool *plog, pool *ptemp, server_rec *); void (*child_init)(pool *pchild, server_rec *); void *(*create_dir_config) (pool *p, char *dir); @@ -374,8 +373,10 @@ /* Hooks */ DECLARE_HOOK(int,header_parser,(request_rec *)) DECLARE_HOOK(void,pre_config,(pool *pconf,pool *plog,pool *ptemp)) +DECLARE_HOOK(void,post_config, + (pool *pconf,pool *plog,pool *ptemp,server_rec *s)) DECLARE_HOOK(void,open_logs, - (pool *pconf, pool *plog, pool *ptemp, server_rec *s)) + (pool *pconf,pool *plog,pool *ptemp,server_rec *s)) #ifdef __cplusplus } 1.18 +5 -5 apache-2.0/mpm/src/main/http_config.c Index: http_config.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_config.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- http_config.c 1999/08/01 14:12:30 1.17 +++ http_config.c 1999/08/01 14:43:23 1.18 @@ -84,12 +84,16 @@ HOOK_STRUCT( HOOK_LINK(header_parser) HOOK_LINK(pre_config) + HOOK_LINK(post_config) HOOK_LINK(open_logs) ) IMPLEMENT_HOOK_RUN_ALL(int,header_parser,(request_rec *r),(r),OK,DECLINED) IMPLEMENT_HOOK_VOID(pre_config,(pool *pconf,pool *plog,pool *ptemp), (pconf,plog,ptemp)) +IMPLEMENT_HOOK_VOID(post_config, + (pool *pconf, pool *plog, pool *ptemp, server_rec *s), + (pconf,plog,ptemp,s)) IMPLEMENT_HOOK_VOID(open_logs, (pool *pconf, pool *plog, pool *ptemp, server_rec *s), (pconf,plog,ptemp,s)) @@ -1446,11 +1450,7 @@ void ap_post_config_hook(pool *pconf, pool *plog, pool *ptemp, server_rec *s) { - module *m; - - for (m = top_module; m; m = m->next) - if (m->post_config) - (*m->post_config) (pconf, plog, ptemp, s); + ap_run_post_config(pconf,plog,ptemp,s); build_method_shortcuts(); init_handlers(pconf); } 1.15 +0 -1 apache-2.0/mpm/src/main/http_core.c Index: http_core.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_core.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- http_core.c 1999/08/01 14:12:30 1.14 +++ http_core.c 1999/08/01 14:43:23 1.15 @@ -2650,7 +2650,6 @@ API_VAR_EXPORT module core_module = { STANDARD20_MODULE_STUFF, - NULL, /* post_config */ NULL, /* child_init */ create_core_dir_config, /* create per-directory config structure */ merge_core_dir_configs, /* merge per-directory config structures */ 1.23 +0 -1 apache-2.0/mpm/src/modules/mpm/prefork/prefork.c Index: prefork.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/mpm/prefork/prefork.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- prefork.c 1999/08/01 14:12:31 1.22 +++ prefork.c 1999/08/01 14:43:24 1.23 @@ -3084,7 +3084,6 @@ module MODULE_VAR_EXPORT mpm_prefork_module = { STANDARD20_MODULE_STUFF, - NULL, /* post_config */ NULL, /* child_init */ NULL, /* create per-directory config structure */ NULL, /* merge per-directory config structures */ 1.12 +0 -1 apache-2.0/mpm/src/modules/standard/mod_access.c Index: mod_access.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_access.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- mod_access.c 1999/08/01 14:12:32 1.11 +++ mod_access.c 1999/08/01 14:43:26 1.12 @@ -389,7 +389,6 @@ module MODULE_VAR_EXPORT access_module = { STANDARD20_MODULE_STUFF, - NULL, /* post_config */ NULL, /* initializer */ create_access_dir_config, /* dir config creater */ NULL, /* dir merger --- default is to override */ 1.11 +0 -1 apache-2.0/mpm/src/modules/standard/mod_actions.c Index: mod_actions.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_actions.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- mod_actions.c 1999/08/01 14:12:32 1.10 +++ mod_actions.c 1999/08/01 14:43:27 1.11 @@ -211,7 +211,6 @@ module action_module = { STANDARD20_MODULE_STUFF, - NULL, /* post_config */ NULL, /* child initializer */ create_action_dir_config, /* dir config creater */ merge_action_dir_configs, /* dir merger --- default is to override */ 1.13 +0 -1 apache-2.0/mpm/src/modules/standard/mod_alias.c Index: mod_alias.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_alias.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- mod_alias.c 1999/08/01 14:12:32 1.12 +++ mod_alias.c 1999/08/01 14:43:27 1.13 @@ -406,7 +406,6 @@ module MODULE_VAR_EXPORT alias_module = { STANDARD20_MODULE_STUFF, - NULL, /* post_config */ NULL, /* initializer */ create_alias_dir_config, /* dir config creater */ merge_alias_dir_config, /* dir merger --- default is to override */ 1.12 +0 -1 apache-2.0/mpm/src/modules/standard/mod_asis.c Index: mod_asis.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_asis.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- mod_asis.c 1999/08/01 14:12:32 1.11 +++ mod_asis.c 1999/08/01 14:43:28 1.12 @@ -126,7 +126,6 @@ module MODULE_VAR_EXPORT asis_module = { STANDARD20_MODULE_STUFF, - NULL, /* post_config */ NULL, /* child initaliser */ NULL, /* create per-directory config structure */ NULL, /* merge per-directory config structures */ 1.12 +0 -1 apache-2.0/mpm/src/modules/standard/mod_auth.c Index: mod_auth.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_auth.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- mod_auth.c 1999/08/01 14:12:32 1.11 +++ mod_auth.c 1999/08/01 14:43:28 1.12 @@ -318,7 +318,6 @@ module MODULE_VAR_EXPORT auth_module = { STANDARD20_MODULE_STUFF, - NULL, /* post_config */ NULL, /* initializer */ create_auth_dir_config, /* dir config creater */ NULL, /* dir merger --- default is to override */ 1.12 +0 -1 apache-2.0/mpm/src/modules/standard/mod_autoindex.c Index: mod_autoindex.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_autoindex.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- mod_autoindex.c 1999/08/01 14:12:33 1.11 +++ mod_autoindex.c 1999/08/01 14:43:28 1.12 @@ -1650,7 +1650,6 @@ module MODULE_VAR_EXPORT autoindex_module = { STANDARD20_MODULE_STUFF, - NULL, /* post_config */ NULL, /* child initializer */ create_autoindex_config, /* dir config creater */ merge_autoindex_configs, /* dir merger --- default is to override */ 1.11 +0 -1 apache-2.0/mpm/src/modules/standard/mod_dir.c Index: mod_dir.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_dir.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- mod_dir.c 1999/08/01 14:12:33 1.10 +++ mod_dir.c 1999/08/01 14:43:28 1.11 @@ -224,7 +224,6 @@ module MODULE_VAR_EXPORT dir_module = { STANDARD20_MODULE_STUFF, - NULL, /* post_config */ NULL, /* child_init */ create_dir_config, /* create per-directory config structure */ merge_dir_configs, /* merge per-directory config structures */ 1.6 +0 -1 apache-2.0/mpm/src/modules/standard/mod_echo.c Index: mod_echo.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_echo.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- mod_echo.c 1999/08/01 14:12:33 1.5 +++ mod_echo.c 1999/08/01 14:43:28 1.6 @@ -63,7 +63,6 @@ API_VAR_EXPORT module echo_module = { STANDARD20_MODULE_STUFF, - NULL, /* post_config */ NULL, /* child_init */ NULL, /* create per-directory config structure */ NULL, /* merge per-directory config structures */ 1.13 +0 -1 apache-2.0/mpm/src/modules/standard/mod_env.c Index: mod_env.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_env.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- mod_env.c 1999/08/01 14:12:33 1.12 +++ mod_env.c 1999/08/01 14:43:28 1.13 @@ -256,7 +256,6 @@ module MODULE_VAR_EXPORT env_module = { STANDARD20_MODULE_STUFF, - NULL, /* post_config */ NULL, /* child initializer */ create_env_dir_config, /* dir config creater */ merge_env_dir_configs, /* dir merger --- default is to override */ 1.12 +0 -1 apache-2.0/mpm/src/modules/standard/mod_imap.c Index: mod_imap.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_imap.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- mod_imap.c 1999/08/01 14:12:33 1.11 +++ mod_imap.c 1999/08/01 14:43:28 1.12 @@ -897,7 +897,6 @@ module MODULE_VAR_EXPORT imap_module = { STANDARD20_MODULE_STUFF, - NULL, /* post_config */ NULL, /* child initializer */ create_imap_dir_config, /* dir config creater */ merge_imap_dir_configs, /* dir merger --- default is to override */ 1.12 +0 -1 apache-2.0/mpm/src/modules/standard/mod_log_config.c Index: mod_log_config.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_log_config.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- mod_log_config.c 1999/08/01 14:12:33 1.11 +++ mod_log_config.c 1999/08/01 14:43:29 1.12 @@ -1114,7 +1114,6 @@ module MODULE_VAR_EXPORT config_log_module = { STANDARD20_MODULE_STUFF, - NULL, /* post_config */ NULL, /* child_init */ NULL, /* create per-dir config */ NULL, /* merge per-dir config */ 1.11 +1 -1 apache-2.0/mpm/src/modules/standard/mod_mime.c Index: mod_mime.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_mime.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- mod_mime.c 1999/08/01 14:12:33 1.10 +++ mod_mime.c 1999/08/01 14:43:29 1.11 @@ -382,11 +382,11 @@ static void register_hooks() { ap_hook_type_checker(find_ct,NULL,NULL,HOOK_MIDDLE); + ap_hook_post_config(mime_post_config,NULL,NULL,HOOK_MIDDLE); } module MODULE_VAR_EXPORT mime_module = { STANDARD20_MODULE_STUFF, - mime_post_config, /* post_config */ NULL, /* child_init */ create_mime_dir_config, /* create per-directory config structure */ merge_mime_dir_configs, /* merge per-directory config structures */ 1.12 +0 -1 apache-2.0/mpm/src/modules/standard/mod_negotiation.c Index: mod_negotiation.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_negotiation.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- mod_negotiation.c 1999/08/01 14:12:34 1.11 +++ mod_negotiation.c 1999/08/01 14:43:29 1.12 @@ -2733,7 +2733,6 @@ module MODULE_VAR_EXPORT negotiation_module = { STANDARD20_MODULE_STUFF, - NULL, /* post_config */ NULL, /* initializer */ create_neg_dir_config, /* dir config creator */ merge_neg_dir_configs, /* dir merger --- default is to override */ 1.13 +0 -1 apache-2.0/mpm/src/modules/standard/mod_setenvif.c Index: mod_setenvif.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_setenvif.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- mod_setenvif.c 1999/08/01 14:12:34 1.12 +++ mod_setenvif.c 1999/08/01 14:43:29 1.13 @@ -408,7 +408,6 @@ module MODULE_VAR_EXPORT setenvif_module = { STANDARD20_MODULE_STUFF, - NULL, /* post_config */ NULL, /* initializer */ NULL, /* dir config creater */ NULL, /* dir merger --- default is to override */ 1.13 +0 -1 apache-2.0/mpm/src/modules/standard/mod_userdir.c Index: mod_userdir.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_userdir.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- mod_userdir.c 1999/08/01 14:12:34 1.12 +++ mod_userdir.c 1999/08/01 14:43:29 1.13 @@ -336,7 +336,6 @@ module userdir_module = { STANDARD20_MODULE_STUFF, - NULL, /* post_config */ NULL, /* child initializer */ NULL, /* dir config creater */ NULL, /* dir merger --- default is to override */ From zcarey@example.org Sun Aug 01 15:20:56 1999 Return-Path: <zcarey@example.org> Delivered-To: zcarey@example.org Received: (qmail 26030 invoked by uid 6000); 1 Aug 1999 15:20:56 -0000 Received: (qmail 26023 invoked by alias); 1 Aug 1999 15:20:54 -0000 Delivered-To: zcarey@example.org Received: (qmail 26019 invoked by uid 124); 1 Aug 1999 15:20:54 -0000 Date: 1 Aug 1999 15:20:54 -0000 Message-ID: <zcarey@example.org> From: zcarey@example.org To: zcarey@example.org Subject: cvs commit: apache-2.0 emacs-style Sender: zcarey@example.org Precedence: bulk Reply-To: zcarey@example.org ben 99/08/01 08:20:53 Added: . emacs-style Log: Set up emacs for the Apache Style Guide. Revision Changes Path 1.1 apache-2.0/emacs-style Index: emacs-style =================================================================== (add-hook 'c-mode-hook (function (lambda () (c-set-offset 'inclass' ++) (c-set-offset 'defun-block-intro' ++) (c-set-offset 'statement-block-intro' ++) (c-set-offset 'substatement' ++) (c-set-offset 'brace-list-intro' ++) ))) (setq c++-mode-hook c-mode-hook) From zcarey@example.org Sun Aug 01 20:26:36 1999 Return-Path: <zcarey@example.org> Delivered-To: zcarey@example.org Received: (qmail 731 invoked by uid 6000); 1 Aug 1999 20:26:34 -0000 Received: (qmail 721 invoked by alias); 1 Aug 1999 20:26:32 -0000 Delivered-To: zcarey@example.org Received: (qmail 715 invoked by uid 124); 1 Aug 1999 20:26:31 -0000 Date: 1 Aug 1999 20:26:31 -0000 Message-ID: <zcarey@example.org> From: zcarey@example.org To: zcarey@example.org Subject: cvs commit: apache-2.0/mpm/src/ap ap_hooks.c Sender: zcarey@example.org Precedence: bulk Reply-To: zcarey@example.org ben 99/08/01 13:26:31 Modified: mpm/src/ap ap_hooks.c Log: Reformat according to style guide. Revision Changes Path 1.4 +54 -65 apache-2.0/mpm/src/ap/ap_hooks.c Index: ap_hooks.c =================================================================== RCS file: /export/home/cvs/apache-2.0/mpm/src/ap/ap_hooks.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- ap_hooks.c 1999/07/19 06:50:10 1.3 +++ ap_hooks.c 1999/08/01 20:26:31 1.4 @@ -8,53 +8,51 @@ /* NB: This must echo the LINK_##name structure */ typedef struct - { +{ void (*dummy)(void *); const char *szName; const char * const *aszPredecessors; const char * const *aszSuccessors; int nOrder; - } TSortData; +} TSortData; typedef struct tsort_ - { +{ void *pData; int nPredecessors; struct tsort_ **ppPredecessors; struct tsort_ *pNext; - } TSort; +} TSort; static int crude_order(const void *a_,const void *b_) - { +{ const TSortData *a=a_; const TSortData *b=b_; return a->nOrder-b->nOrder; - } +} static TSort *prepare(pool *p,TSortData *pItems,int nItems) - { +{ TSort *pData=ap_palloc(p,nItems*sizeof *pData); int n; - + qsort(pItems,nItems,sizeof *pItems,crude_order); - for(n=0 ; n < nItems ; ++n) - { + for(n=0 ; n < nItems ; ++n) { pData[n].nPredecessors=0; pData[n].ppPredecessors=ap_palloc(p,nItems*sizeof *pData[n].ppPredecessors); pData[n].pNext=NULL; pData[n].pData=&pItems[n]; - } + } - for(n=0 ; n < nItems ; ++n) - { + for(n=0 ; n < nItems ; ++n) { int i,k; for(i=0 ; pItems[n].aszPredecessors && pItems[n].aszPredecessors[i] ; ++i) for(k=0 ; k < nItems ; ++k) - if(!strcmp(pItems[k].szName,pItems[n].aszPredecessors[i])) - { + if(!strcmp(pItems[k].szName,pItems[n].aszPredecessors[i])) { int l; + for(l=0 ; l < pData[n].nPredecessors ; ++l) if(pData[n].ppPredecessors[l] == &pData[k]) goto got_it; @@ -62,12 +60,12 @@ ++pData[n].nPredecessors; got_it: break; - } + } for(i=0 ; pItems[n].aszSuccessors && pItems[n].aszSuccessors[i] ; ++i) for(k=0 ; k < nItems ; ++k) - if(!strcmp(pItems[k].szName,pItems[n].aszSuccessors[i])) - { + if(!strcmp(pItems[k].szName,pItems[n].aszSuccessors[i])) { int l; + for(l=0 ; l < pData[k].nPredecessors ; ++l) if(pData[k].ppPredecessors[l] == &pData[n]) goto got_it2; @@ -75,29 +73,27 @@ ++pData[k].nPredecessors; got_it2: break; - } - } + } + } return pData; - } +} static TSort *tsort(TSort *pData,int nItems) - { +{ int nTotal; TSort *pHead=NULL; TSort *pTail=NULL; - for(nTotal=0 ; nTotal < nItems ; ++nTotal) - { + for(nTotal=0 ; nTotal < nItems ; ++nTotal) { int n,i,k; - for(n=0 ; ; ++n) - { + for(n=0 ; ; ++n) { if(n == nItems) assert(0); /* // we have a loop... */ if(!pData[n].pNext && !pData[n].nPredecessors) break; - } + } if(pTail) pTail->pNext=&pData[n]; else @@ -106,18 +102,17 @@ pTail->pNext=pTail; /* // fudge it so it looks linked */ for(i=0 ; i < nItems ; ++i) for(k=0 ; pData[i].ppPredecessors[k] ; ++k) - if(pData[i].ppPredecessors[k] == &pData[n]) - { + if(pData[i].ppPredecessors[k] == &pData[n]) { --pData[i].nPredecessors; break; - } - } + } + } pTail->pNext=NULL; /* // unfudge the tail */ return pHead; - } +} static array_header *sort_hook(array_header *pHooks,const char *szName) - { +{ pool *p=ap_make_sub_pool(g_pHookPool); TSort *pSort; array_header *pNew; @@ -128,29 +123,28 @@ pNew=ap_make_array(g_pHookPool,pHooks->nelts,sizeof(TSortData)); if(g_bDebugHooks) printf("Sorting %s:",szName); - for(n=0 ; pSort ; pSort=pSort->pNext,++n) - { + for(n=0 ; pSort ; pSort=pSort->pNext,++n) { TSortData *pHook; assert(n < pHooks->nelts); pHook=ap_push_array(pNew); memcpy(pHook,pSort->pData,sizeof *pHook); if(g_bDebugHooks) printf(" %s",pHook->szName); - } + } if(g_bDebugHooks) fputc('\n',stdout); return pNew; - } +} static array_header *s_aHooksToSort; typedef struct - { +{ const char *szHookName; array_header **paHooks; - } HookSortEntry; +} HookSortEntry; void ap_hook_sort_register(const char *szHookName,array_header **paHooks) - { +{ HookSortEntry *pEntry; if(!s_aHooksToSort) @@ -158,68 +152,63 @@ pEntry=ap_push_array(s_aHooksToSort); pEntry->szHookName=szHookName; pEntry->paHooks=paHooks; - } +} void ap_sort_hooks() - { +{ int n; - for(n=0 ; n < s_aHooksToSort->nelts ; ++n) - { + for(n=0 ; n < s_aHooksToSort->nelts ; ++n) { HookSortEntry *pEntry=&((HookSortEntry *)s_aHooksToSort->elts)[n]; *pEntry->paHooks=sort_hook(*pEntry->paHooks,pEntry->szHookName); - } } +} void ap_show_hook(const char *szName,const char * const *aszPre, const char * const *aszSucc) - { +{ int nFirst; printf(" Hooked %s",szName); - if(aszPre) - { + if(aszPre) { fputs(" pre(",stdout); nFirst=1; - while(*aszPre) - { + while(*aszPre) { if(!nFirst) fputc(',',stdout); nFirst=0; fputs(*aszPre,stdout); ++aszPre; - } - fputc(')',stdout); } - if(aszSucc) - { + fputc(')',stdout); + } + if(aszSucc) { fputs(" succ(",stdout); nFirst=1; - while(*aszSucc) - { + while(*aszSucc) { if(!nFirst) fputc(',',stdout); nFirst=0; fputs(*aszSucc,stdout); ++aszSucc; - } - fputc(')',stdout); } - fputc('\n',stdout); + fputc(')',stdout); } + fputc('\n',stdout); +} #if 0 void main() - { +{ const char *aszAPre[]={"b","c",NULL}; const char *aszBPost[]={"a",NULL}; const char *aszCPost[]={"b",NULL}; TSortData t1[]= - { + { { "a",aszAPre,NULL }, - { "b",NULL,aszBPost }, - { "c",NULL,aszCPost } - }; + { "b",NULL,aszBPost }, + { "c",NULL,aszCPost } + }; TSort *pResult; pResult=prepare(t1,3); @@ -227,5 +216,5 @@ for( ; pResult ; pResult=pResult->pNext) printf("%s\n",pResult->pData->szName); - } +} #endif From zcarey@example.org Mon Aug 02 05:03:40 1999 Return-Path: <zcarey@example.org> Delivered-To: zcarey@example.org Received: (qmail 16464 invoked by uid 6000); 2 Aug 1999 05:03:40 -0000 Received: (qmail 16457 invoked by alias); 2 Aug 1999 05:03:38 -0000 Delivered-To: zcarey@example.org Received: (qmail 16454 invoked by uid 216); 2 Aug 1999 05:03:37 -0000 Date: 2 Aug 1999 05:03:37 -0000 Message-ID: <zcarey@example.org> From: zcarey@example.org To: zcarey@example.org Subject: cvs commit: apache-1.3/src/os/tpf os.c os.h Sender: zcarey@example.org Precedence: bulk Reply-To: zcarey@example.org manoj 99/08/01 22:03:37 Modified: htdocs/manual install-tpf.html src/os/tpf os.c os.h Log: Make the server compile cleanly on TPF. Submitted by: David McCreedy <zcarey@example.org> Revision Changes Path 1.7 +3 -0 apache-1.3/htdocs/manual/install-tpf.html Index: install-tpf.html =================================================================== RCS file: /home/cvs/apache-1.3/htdocs/manual/install-tpf.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -u -r1.6 -r1.7 --- install-tpf.html 1999/04/27 20:36:24 1.6 +++ install-tpf.html 1999/08/02 05:03:35 1.7 @@ -124,6 +124,9 @@ DO&nbsp;NOT modify the <TT>TPF=YES</TT> export variable. If this is changed, the "Configure" script will not recognize TPF. <BR><BR> +<LI>Remove the src/lib/expat-lite directory: + <TT><STRONG>rm -r lib/expat-lite</STRONG></TT> + <BR><BR> <LI>Run the "Configure" script: <TT><STRONG>Configure</STRONG></TT> <BR> 1.4 +7 -0 apache-1.3/src/os/tpf/os.c Index: os.c =================================================================== RCS file: /home/cvs/apache-1.3/src/os/tpf/os.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -u -r1.3 -r1.4 --- os.c 1999/04/27 20:36:38 1.3 +++ os.c 1999/08/02 05:03:36 1.4 @@ -161,6 +161,13 @@ return rv; } +/* the getpass function is not usable on TPF */ +char *getpass(const char* prompt) +{ + errno = EIO; + return((char *)NULL); +} + #ifndef __PIPE_ int pipe(int fildes[2]) { 1.8 +1 -0 apache-1.3/src/os/tpf/os.h Index: os.h =================================================================== RCS file: /home/cvs/apache-1.3/src/os/tpf/os.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -u -r1.7 -r1.8 --- os.h 1999/05/02 14:01:02 1.7 +++ os.h 1999/08/02 05:03:36 1.8 @@ -95,6 +95,7 @@ struct server_rec; pid_t os_fork(struct server_rec *s, int slot); int os_check_server(char *server); +char *getpass(const char *prompt); extern char *ap_server_argv0; extern int scoreboard_fd; #include <signal.h> From zcarey@example.org Mon Aug 02 10:13:55 1999 Return-Path: <zcarey@example.org> Delivered-To: zcarey@example.org Received: (qmail 1188 invoked by uid 6000); 2 Aug 1999 10:13:54 -0000 Received: (qmail 1182 invoked by alias); 2 Aug 1999 10:13:52 -0000 Delivered-To: zcarey@example.org Received: (qmail 1178 invoked by uid 207); 2 Aug 1999 10:13:51 -0000 Date: 2 Aug 1999 10:13:51 -0000 Message-ID: <zcarey@example.org> From: zcarey@example.org To: zcarey@example.org Subject: cvs commit: apache-1.3/src/support/SHA1 README.sha1 convert-sha1.pl htpasswd-sha1.pl ldif-sha1.example Sender: zcarey@example.org Precedence: bulk Reply-To: zcarey@example.org dirkx 99/08/02 03:13:51 Modified: htdocs/manual new_features_1_3.html htdocs/manual/new_features_1_3.html src/CHANGES src/ap/Makefile.tmpl src/ap/ap_md5c.c src/include/ap_md5.h src/modules/standard/mod_auth.c src/modules/standard/mod_auth_db.c src/modules/standard/mod_auth_dbm.c src/support/README src/support/htpasswd.1 src/support/htpasswd.c src CHANGES htdocs/manual/new_features_1_3.html src/CHANGES src/ap/Makefile.tmpl src/ap/ap_md5c.c src/include/ap_md5.h src/modules/standard/mod_auth.c src/modules/standard/mod_auth_db.c src/modules/standard/mod_auth_dbm.c src/support/README src/support/htpasswd.1 src/support/htpasswd.c src/ap Makefile.tmpl ap_md5c.c htdocs/manual/new_features_1_3.html src/CHANGES src/ap/Makefile.tmpl src/ap/ap_md5c.c src/include/ap_md5.h src/modules/standard/mod_auth.c src/modules/standard/mod_auth_db.c src/modules/standard/mod_auth_dbm.c src/support/README src/support/htpasswd.1 src/support/htpasswd.c src/include ap_md5.h htdocs/manual/new_features_1_3.html src/CHANGES src/ap/Makefile.tmpl src/ap/ap_md5c.c src/include/ap_md5.h src/modules/standard/mod_auth.c src/modules/standard/mod_auth_db.c src/modules/standard/mod_auth_dbm.c src/support/README src/support/htpasswd.1 src/support/htpasswd.c src/modules/standard mod_auth.c mod_auth_db.c mod_auth_dbm.c htdocs/manual/new_features_1_3.html src/CHANGES src/ap/Makefile.tmpl src/ap/ap_md5c.c src/include/ap_md5.h src/modules/standard/mod_auth.c src/modules/standard/mod_auth_db.c src/modules/standard/mod_auth_dbm.c src/support/README src/support/htpasswd.1 src/support/htpasswd.c src/support README htpasswd.1 htpasswd.c htdocs/manual/new_features_1_3.html src/CHANGES src/ap/Makefile.tmpl src/ap/ap_md5c.c src/include/ap_md5.h src/modules/standard/mod_auth.c src/modules/standard/mod_auth_db.c src/modules/standard/mod_auth_dbm.c src/support/README src/support/htpasswd.1 src/support/htpasswd.c src/support/SHA1 htdocs/manual/new_features_1_3.html src/CHANGES src/ap/Makefile.tmpl src/ap/ap_md5c.c src/include/ap_md5.h src/modules/standard/mod_auth.c src/modules/standard/mod_auth_db.c src/modules/standard/mod_auth_dbm.c src/support/README src/support/htpasswd.1 src/support/htpasswd.c Added: htdocs/manual src/ap/ap_checkpass.c src/include/ap_checkpass.h src/ap/ap_sha1.c src/include/ap_sha1.h src/support/SHA1/README.sha1 src/support/SHA1/convert-sha1.pl src/support/SHA1/htpasswd-sha1.pl src/support/SHA1/ldif-sha1.example src src/ap/ap_checkpass.c src/include/ap_checkpass.h src/ap/ap_sha1.c src/include/ap_sha1.h src/support/SHA1/README.sha1 src/support/SHA1/convert-sha1.pl src/support/SHA1/htpasswd-sha1.pl src/support/SHA1/ldif-sha1.example src/ap ap_checkpass.c ap_sha1.c src/ap/ap_checkpass.c src/include/ap_checkpass.h src/ap/ap_sha1.c src/include/ap_sha1.h src/support/SHA1/README.sha1 src/support/SHA1/convert-sha1.pl src/support/SHA1/htpasswd-sha1.pl src/support/SHA1/ldif-sha1.example src/include ap_checkpass.h ap_sha1.h src/ap/ap_checkpass.c src/include/ap_checkpass.h src/ap/ap_sha1.c src/include/ap_sha1.h src/support/SHA1/README.sha1 src/support/SHA1/convert-sha1.pl src/support/SHA1/htpasswd-sha1.pl src/support/SHA1/ldif-sha1.example src/modules/standard src/ap/ap_checkpass.c src/include/ap_checkpass.h src/ap/ap_sha1.c src/include/ap_sha1.h src/support/SHA1/README.sha1 src/support/SHA1/convert-sha1.pl src/support/SHA1/htpasswd-sha1.pl src/support/SHA1/ldif-sha1.example src/support src/ap/ap_checkpass.c src/include/ap_checkpass.h src/ap/ap_sha1.c src/include/ap_sha1.h src/support/SHA1/README.sha1 src/support/SHA1/convert-sha1.pl src/support/SHA1/htpasswd-sha1.pl src/support/SHA1/ldif-sha1.example src/support/SHA1 README.sha1 convert-sha1.pl htpasswd-sha1.pl ldif-sha1.example src/ap/ap_checkpass.c src/include/ap_checkpass.h src/ap/ap_sha1.c src/include/ap_sha1.h src/support/SHA1/README.sha1 src/support/SHA1/convert-sha1.pl src/support/SHA1/htpasswd-sha1.pl src/support/SHA1/ldif-sha1.example Log: In order to fold in support for SHA / LDAP Directory Interchange Format style passwords (which make integration or migration between apache and netscape intstallations easier) the following has been done: 1. move ap_validate_passwd() out into its own function, and change includes from ap_md5.h into ap_checkpasswd.h in the various auth sections. 2. collate some to64 encodings into a single ap_to64 3. Add a ap_sha1.c along the lines of ap_md5.c 4. Add some flags to htpasswd, and make some man page chnages Added some blurp in the html docs. 5. add a directory SHA1 in support with some usefull examples for peoply trying to integrate or migrate from/to netscape servers. Obtained from Clinton Wong <zcarey@example.org> and reworked into something sepearate from ap_mda5c.c But it could benefit from further abstraction; same goed for the various base64, uunecode and mime-style base64 encoders we have floating around. Also, we could deal with string lenghts and verify lengths better. Revision Changes Path 1.80 +9 -0 apache-1.3/htdocs/manual/new_features_1_3.html Index: new_features_1_3.html =================================================================== RCS file: /x3/home/cvs/apache-1.3/htdocs/manual/new_features_1_3.html,v retrieving revision 1.79 retrieving revision 1.80 diff -u -r1.79 -r1.80 --- new_features_1_3.html 1999/03/23 14:30:40 1.79 +++ new_features_1_3.html 1999/08/02 10:13:40 1.80 @@ -675,6 +675,15 @@ </DL> +<DT><STRONG>Support for Netscape style SHA1 encrypted passwords</STRONG><BR> +<DD>To facilitate migration or integration of BasicAuth password + schemes where the password is encrypted using SHA1 (as opposed + to apache's build in MD5 and/or the OS specific crypt(3) function + ) passwords prefixed with with <CODE>{SHA1}</CODE> are taken + as Base64 encoded SHA1 passwords. More information and + some utilities to convert Netscape ldap/ldif entries can be + found in support/SHA1. + <!--#include virtual="footer.html" --> </BODY> </HTML> 1.1407 +9 -0 apache-1.3/src/CHANGES Index: CHANGES =================================================================== RCS file: /x3/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.1406 retrieving revision 1.1407 diff -u -r1.1406 -r1.1407 --- CHANGES 1999/07/31 03:30:16 1.1406 +++ CHANGES 1999/08/02 10:13:42 1.1407 @@ -1,5 +1,14 @@ Changes with Apache 1.3.8 + *) Added SHA1 password encryption support to easy migration from + Netscape servers. See support/SHA1 for more information; based + on the code contributed by Clinton Wong <zcarey@example.org>. + Caused the separation of ap_md5.c into md5, sha1 and a general + ap_checkpass.c with just a validate_passwd routine. Added a + couple of flags to support/htpasswd. Some reuse of the to64() + function; hence renamed to ap_to64(). + [dirkx] + *) Change for EBCDIC platforms (TPF and BS2000) to correctly deal with ASCII/EBCDIC conversions in "ident" query. [David McCreedy <zcarey@example.org>] 1.33 +1 -1 apache-1.3/src/ap/Makefile.tmpl Index: Makefile.tmpl =================================================================== RCS file: /x3/home/cvs/apache-1.3/src/ap/Makefile.tmpl,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- Makefile.tmpl 1999/05/31 17:09:30 1.32 +++ Makefile.tmpl 1999/08/02 10:13:44 1.33 @@ -6,7 +6,7 @@ LIB=libap.a OBJS=ap_cpystrn.o ap_execve.o ap_fnmatch.o ap_getpass.o ap_md5c.o ap_signal.o \ - ap_slack.o ap_snprintf.o + ap_slack.o ap_snprintf.o ap_sha1.o ap_checkpass.o .c.o: $(CC) -c $(INCLUDES) $(CFLAGS) $< 1.28 +8 -46 apache-1.3/src/ap/ap_md5c.c Index: ap_md5c.c =================================================================== RCS file: /x3/home/cvs/apache-1.3/src/ap/ap_md5c.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- ap_md5c.c 1999/04/27 20:36:28 1.27 +++ ap_md5c.c 1999/08/02 10:13:44 1.28 @@ -415,15 +415,14 @@ * Define the Magic String prefix that identifies a password as being * hashed using our algorithm. */ -static const char *apr1_id = "$apr1$"; +const char *apr1_id = "$apr1$"; /* * The following MD5 password encryption code was largely borrowed from * the FreeBSD 3.0 /usr/src/lib/libcrypt/crypt.c file, which is * licenced as stated at the top of this file. */ - -static void to64(char *s, unsigned long v, int n) +API_EXPORT(void) ap_to64(char *s, unsigned long v, int n) { static unsigned char itoa64[] = /* 0 ... 63 => ASCII - 64 */ "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; @@ -572,12 +571,12 @@ p = passwd + strlen(passwd); - l = (final[ 0]<<16) | (final[ 6]<<8) | final[12]; to64(p, l, 4); p += 4; - l = (final[ 1]<<16) | (final[ 7]<<8) | final[13]; to64(p, l, 4); p += 4; - l = (final[ 2]<<16) | (final[ 8]<<8) | final[14]; to64(p, l, 4); p += 4; - l = (final[ 3]<<16) | (final[ 9]<<8) | final[15]; to64(p, l, 4); p += 4; - l = (final[ 4]<<16) | (final[10]<<8) | final[ 5]; to64(p, l, 4); p += 4; - l = final[11] ; to64(p, l, 2); p += 2; + l = (final[ 0]<<16) | (final[ 6]<<8) | final[12]; ap_to64(p, l, 4); p += 4; + l = (final[ 1]<<16) | (final[ 7]<<8) | final[13]; ap_to64(p, l, 4); p += 4; + l = (final[ 2]<<16) | (final[ 8]<<8) | final[14]; ap_to64(p, l, 4); p += 4; + l = (final[ 3]<<16) | (final[ 9]<<8) | final[15]; ap_to64(p, l, 4); p += 4; + l = (final[ 4]<<16) | (final[10]<<8) | final[ 5]; ap_to64(p, l, 4); p += 4; + l = final[11] ; ap_to64(p, l, 2); p += 2; *p = '\0'; /* @@ -586,41 +585,4 @@ memset(final, 0, sizeof(final)); ap_cpystrn(result, passwd, nbytes - 1); -} - -/* - * Validate a plaintext password against a smashed one. Use either - * crypt() (if available) or ap_MD5Encode(), depending upon the format - * of the smashed input password. Return NULL if they match, or - * an explanatory text string if they don't. - */ - -API_EXPORT(char *) ap_validate_password(const char *passwd, const char *hash) -{ - char sample[120]; - char *crypt_pw; - - if (!strncmp(hash, apr1_id, strlen(apr1_id))) { - /* - * The hash was created using our custom algorithm. - */ - ap_MD5Encode((const unsigned char *)passwd, - (const unsigned char *)hash, sample, sizeof(sample)); - } - else { - /* - * It's not our algorithm, so feed it to crypt() if possible. - */ -#if defined(WIN32) || defined(TPF) - /* - * On Windows, the only alternative to our MD5 algorithm is plain - * text. - */ - ap_cpystrn(sample, passwd, sizeof(sample) - 1); -#else - crypt_pw = crypt(passwd, hash); - ap_cpystrn(sample, crypt_pw, sizeof(sample) - 1); -#endif - } - return (strcmp(sample, hash) == 0) ? NULL : "password mismatch"; } 1.1 apache-1.3/src/ap/ap_checkpass.c Index: ap_checkpass.c =================================================================== /* ==================================================================== * Copyright (c) 1996-1999 The Apache Group. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. All advertising materials mentioning features or use of this * software must display the following acknowledgment: * "This product includes software developed by the Apache Group * for use in the Apache HTTP server project (http://www.apache.org/)." * * 4. The names "Apache Server" and "Apache Group" must not be used to * endorse or promote products derived from this software without * prior written permission. For written permission, please contact * zcarey@example.org. * * 5. Products derived from this software may not be called "Apache" * nor may "Apache" appear in their names without prior written * permission of the Apache Group. * * 6. Redistributions of any form whatsoever must retain the following * acknowledgment: * "This product includes software developed by the Apache Group * for use in the Apache HTTP server project (http://www.apache.org/)." * * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE GROUP OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Group and was originally based * on public domain software written at the National Center for * Supercomputing Applications, University of Illinois, Urbana-Champaign. * For more information on the Apache Group and the Apache HTTP server * project, please see <http://www.apache.org/>. * * Simple password verify, which 'know's about various password * types, such as the simple base64 encoded crypt()s, MD5 $ marked * FreeBSD style and netscape SHA1's. */ #include <string.h> #include "ap_config.h" #include "ap_md5.h" #include "ap_sha1.h" #include "ap.h" #ifdef CHARSET_EBCDIC #include "ebcdic.h" #endif /*CHARSET_EBCDIC*/ #if HAVE_CRYPT_H #include <crypt.h> #endif /* * Validate a plaintext password against a smashed one. Use either * crypt() (if available), ap_MD5Encode() or ap_SHA1Encode depending * upon the format of the smashed input password. * * Return NULL if they match, or an explanatory text string if they don't. */ API_EXPORT(char *) ap_validate_password(const char *passwd, const char *hash) { char sample[120]; char *crypt_pw; /* FreeBSD style MD5 string */ if (!strncmp(hash, apr1_id, strlen(apr1_id))) { ap_MD5Encode((const unsigned char *)passwd, (const unsigned char *)hash, sample, sizeof(sample)); } /* Netscape / SHA1 ldap style strng */ else if (!strncmp(hash, sha1_id, strlen(sha1_id))) { ap_sha1_base64(passwd, strlen(passwd), sample); } else { /* * It's not our algorithm, so feed it to crypt() if possible. */ #if defined(WIN32) || defined(TPF) /* * On Windows, the only alternative to our MD5 algorithm is plain * text. */ ap_cpystrn(sample, passwd, sizeof(sample) - 1); #else crypt_pw = crypt(passwd, hash); ap_cpystrn(sample, crypt_pw, sizeof(sample) - 1); #endif } return (strcmp(sample, hash) == 0) ? NULL : "password mismatch"; } 1.1 apache-1.3/src/ap/ap_sha1.c Index: ap_sha1.c =================================================================== /* ==================================================================== * Copyright (c) 1996-1999 The Apache Group. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. All advertising materials mentioning features or use of this * software must display the following acknowledgment: * "This product includes software developed by the Apache Group * for use in the Apache HTTP server project (http://www.apache.org/)." * * 4. The names "Apache Server" and "Apache Group" must not be used to * endorse or promote products derived from this software without * prior written permission. For written permission, please contact * zcarey@example.org. * * 5. Products derived from this software may not be called "Apache" * nor may "Apache" appear in their names without prior written * permission of the Apache Group. * * 6. Redistributions of any form whatsoever must retain the following * acknowledgment: * "This product includes software developed by the Apache Group * for use in the Apache HTTP server project (http://www.apache.org/)." * * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE GROUP OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Group and was originally based * on public domain software written at the National Center for * Supercomputing Applications, University of Illinois, Urbana-Champaign. * For more information on the Apache Group and the Apache HTTP server * project, please see <http://www.apache.org/>. * * The only exported function: * * ap_sha1_base64(char *clear, int len, char *out); * * provides a means to SHA1 crypt/encode a plaintext password in * a way which makes password files compatible with those commonly * used in netscape web and ldap installations. It was put together * by Clinton Wong <zcarey@example.org>, who also notes that: * * Note: SHA1 support is useful for migration purposes, but is less * secure than Apache's password format, since Apache's (MD5) * password format uses a random eight character salt to generate * one of many possible hashes for the same password. Netscape * uses plain SHA1 without a salt, so the same password * will always generate the same hash, making it easier * to break since the search space is smaller. * * See also the documentation in support/SHA1 as to hints on how to * migrate an existing netscape installation and other supplied utitlites. * * This software also makes use of the following components: * * NIST Secure Hash Algorithm * heavily modified by Uwe Hollerbach zcarey@example.org edu * from Peter C. Gutmann's implementation as found in * Applied Cryptography by Bruce Schneier * This code is hereby placed in the public domain * * MIME Base 64 encoding based on src/metamail/codes.c in metamail, * available at: ftp://thumper.bellcore.com/pub/nsb/ * * Metamail's copyright is: * Copyright (c) 1991 Bell Communications Research, Inc. (Bellcore) * Permission to use, copy, modify, and distribute this material * for any purpose and without fee is hereby granted, provided * that the above copyright notice and this permission notice * appear in all copies, and that the name of Bellcore not be * used in advertising or publicity pertaining to this * material without the specific, prior written permission * of an authorized representative of Bellcore. BELLCORE * MAKES NO REPRESENTATIONS ABOUT THE ACCURACY OR SUITABILITY * OF THIS MATERIAL FOR ANY PURPOSE. IT IS PROVIDED "AS IS", * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. */ #include <string.h> #include "ap_config.h" #include "ap_sha1.h" #include "ap.h" #ifdef CHARSET_EBCDIC #include "ebcdic.h" #endif /*CHARSET_EBCDIC*/ /* a bit faster & bigger, if defined */ #define UNROLL_LOOPS /* NIST's proposed modification to SHA, 7/11/94 */ #define USE_MODIFIED_SHA /* SHA f()-functions */ #define f1(x,y,z) ((x & y) | (~x & z)) #define f2(x,y,z) (x ^ y ^ z) #define f3(x,y,z) ((x & y) | (x & z) | (y & z)) #define f4(x,y,z) (x ^ y ^ z) /* SHA constants */ #define CONST1 0x5a827999L #define CONST2 0x6ed9eba1L #define CONST3 0x8f1bbcdcL #define CONST4 0xca62c1d6L /* 32-bit rotate */ #define ROT32(x,n) ((x << n) | (x >> (32 - n))) #define FUNC(n,i) \ temp = ROT32(A,5) + f##n(B,C,D) + E + W[i] + CONST##n; \ E = D; D = C; C = ROT32(B,30); B = A; A = temp typedef unsigned char BYTE; /* an 8-bit quantity */ typedef unsigned long LONG; /* a 32-bit quantity */ #define SHA_BLOCKSIZE 64 #define SHA_DIGESTSIZE 20 typedef struct { LONG digest[5]; /* message digest */ LONG count_lo, count_hi; /* 64-bit bit count */ LONG data[16]; /* SHA data buffer */ int local; /* unprocessed amount in data */ } SHA_INFO; void sha_init(SHA_INFO *); void sha_update(SHA_INFO *, BYTE *, int); void sha_final(SHA_INFO *); void sha_raw_swap(SHA_INFO *); void output64chunk(unsigned char, unsigned char, unsigned char, int, unsigned char **); void encode_mime64(unsigned char *, unsigned char *, int); void sha1_base64(char *, int, char *); /* do SHA transformation */ static void sha_transform(SHA_INFO *sha_info) { int i; LONG temp, A, B, C, D, E, W[80]; for (i = 0; i < 16; ++i) { W[i] = sha_info->data[i]; } for (i = 16; i < 80; ++i) { W[i] = W[i-3] ^ W[i-8] ^ W[i-14] ^ W[i-16]; #ifdef USE_MODIFIED_SHA W[i] = ROT32(W[i], 1); #endif /* USE_MODIFIED_SHA */ } A = sha_info->digest[0]; B = sha_info->digest[1]; C = sha_info->digest[2]; D = sha_info->digest[3]; E = sha_info->digest[4]; #ifdef UNROLL_LOOPS FUNC(1, 0); FUNC(1, 1); FUNC(1, 2); FUNC(1, 3); FUNC(1, 4); FUNC(1, 5); FUNC(1, 6); FUNC(1, 7); FUNC(1, 8); FUNC(1, 9); FUNC(1,10); FUNC(1,11); FUNC(1,12); FUNC(1,13); FUNC(1,14); FUNC(1,15); FUNC(1,16); FUNC(1,17); FUNC(1,18); FUNC(1,19); FUNC(2,20); FUNC(2,21); FUNC(2,22); FUNC(2,23); FUNC(2,24); FUNC(2,25); FUNC(2,26); FUNC(2,27); FUNC(2,28); FUNC(2,29); FUNC(2,30); FUNC(2,31); FUNC(2,32); FUNC(2,33); FUNC(2,34); FUNC(2,35); FUNC(2,36); FUNC(2,37); FUNC(2,38); FUNC(2,39); FUNC(3,40); FUNC(3,41); FUNC(3,42); FUNC(3,43); FUNC(3,44); FUNC(3,45); FUNC(3,46); FUNC(3,47); FUNC(3,48); FUNC(3,49); FUNC(3,50); FUNC(3,51); FUNC(3,52); FUNC(3,53); FUNC(3,54); FUNC(3,55); FUNC(3,56); FUNC(3,57); FUNC(3,58); FUNC(3,59); FUNC(4,60); FUNC(4,61); FUNC(4,62); FUNC(4,63); FUNC(4,64); FUNC(4,65); FUNC(4,66); FUNC(4,67); FUNC(4,68); FUNC(4,69); FUNC(4,70); FUNC(4,71); FUNC(4,72); FUNC(4,73); FUNC(4,74); FUNC(4,75); FUNC(4,76); FUNC(4,77); FUNC(4,78); FUNC(4,79); #else /* !UNROLL_LOOPS */ for (i = 0; i < 20; ++i) { FUNC(1,i); } for (i = 20; i < 40; ++i) { FUNC(2,i); } for (i = 40; i < 60; ++i) { FUNC(3,i); } for (i = 60; i < 80; ++i) { FUNC(4,i); } #endif /* !UNROLL_LOOPS */ sha_info->digest[0] += A; sha_info->digest[1] += B; sha_info->digest[2] += C; sha_info->digest[3] += D; sha_info->digest[4] += E; } union endianTest { long Long; char Char[sizeof(long)]; }; char isLittleEndian() { static union endianTest u; u.Long = 1; return(u.Char[0]==1); } /* change endianness of data */ /* count is the number of bytes to do an endian flip */ static void maybe_byte_reverse(LONG *buffer, int count) { int i; BYTE ct[4], *cp; if (isLittleEndian()) { /* do the swap only if it is little endian */ count /= sizeof(LONG); cp = (BYTE *) buffer; for (i = 0; i < count; ++i) { ct[0] = cp[0]; ct[1] = cp[1]; ct[2] = cp[2]; ct[3] = cp[3]; cp[0] = ct[3]; cp[1] = ct[2]; cp[2] = ct[1]; cp[3] = ct[0]; cp += sizeof(LONG); } } } /* initialize the SHA digest */ void sha_init(SHA_INFO *sha_info) { sha_info->digest[0] = 0x67452301L; sha_info->digest[1] = 0xefcdab89L; sha_info->digest[2] = 0x98badcfeL; sha_info->digest[3] = 0x10325476L; sha_info->digest[4] = 0xc3d2e1f0L; sha_info->count_lo = 0L; sha_info->count_hi = 0L; sha_info->local = 0; } /* update the SHA digest */ void sha_update(SHA_INFO *sha_info, BYTE *buffer, int count) { int i; if ((sha_info->count_lo + ((LONG) count << 3)) < sha_info->count_lo) { ++sha_info->count_hi; } sha_info->count_lo += (LONG) count << 3; sha_info->count_hi += (LONG) count >> 29; if (sha_info->local) { i = SHA_BLOCKSIZE - sha_info->local; if (i > count) { i = count; } memcpy(((BYTE *) sha_info->data) + sha_info->local, buffer, i); count -= i; buffer += i; sha_info->local += i; if (sha_info->local == SHA_BLOCKSIZE) { maybe_byte_reverse(sha_info->data, SHA_BLOCKSIZE); sha_transform(sha_info); } else { return; } } while (count >= SHA_BLOCKSIZE) { memcpy(sha_info->data, buffer, SHA_BLOCKSIZE); buffer += SHA_BLOCKSIZE; count -= SHA_BLOCKSIZE; maybe_byte_reverse(sha_info->data, SHA_BLOCKSIZE); sha_transform(sha_info); } memcpy(sha_info->data, buffer, count); sha_info->local = count; } /* finish computing the SHA digest */ void sha_final(SHA_INFO *sha_info) { int count; LONG lo_bit_count, hi_bit_count; lo_bit_count = sha_info->count_lo; hi_bit_count = sha_info->count_hi; count = (int) ((lo_bit_count >> 3) & 0x3f); ((BYTE *) sha_info->data)[count++] = 0x80; if (count > SHA_BLOCKSIZE - 8) { memset(((BYTE *) sha_info->data) + count, 0, SHA_BLOCKSIZE - count); maybe_byte_reverse(sha_info->data, SHA_BLOCKSIZE); sha_transform(sha_info); memset((BYTE *) sha_info->data, 0, SHA_BLOCKSIZE - 8); } else { memset(((BYTE *) sha_info->data) + count, 0, SHA_BLOCKSIZE - 8 - count); } maybe_byte_reverse(sha_info->data, SHA_BLOCKSIZE); sha_info->data[14] = hi_bit_count; sha_info->data[15] = lo_bit_count; sha_transform(sha_info); } /* internally implemented as an array of longs, need to swap if you're going to access the memory in the raw, instead of looping through with arrays of longs. */ void sha_raw_swap(SHA_INFO *sha_info) { int i; for (i=0; i<5; ++i) maybe_byte_reverse((LONG *) &sha_info->digest[i], 4); } static char basis_64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; void output64chunk(unsigned char c1, unsigned char c2, unsigned char c3, int pads, unsigned char **outfile) { *(*outfile)++ = basis_64[c1>>2]; *(*outfile)++ = basis_64[((c1 & 0x3)<< 4) | ((c2 & 0xF0) >> 4)]; if (pads == 2) { *(*outfile)++ = '='; *(*outfile)++ = '='; } else if (pads) { *(*outfile)++ = basis_64[((c2 & 0xF) << 2) | ((c3 & 0xC0) >>6)]; *(*outfile)++ = '='; } else { *(*outfile)++ = basis_64[((c2 & 0xF) << 2) | ((c3 & 0xC0) >>6)]; *(*outfile)++ = basis_64[c3 & 0x3F]; } } void encode_mime64(unsigned char *in, unsigned char *out, int length) { int diff, ct=0; while ( (diff= length - ct) ) { if ( diff >= 3 ) { diff = 3; output64chunk(in[ct], in[ct+1], in[ct+2], 0, &out); } else if ( diff == 2 ) { output64chunk(in[ct], in[ct+1], 0, 1, &out); } else if ( diff == 1 ) { output64chunk(in[ct], 0, 0, 2, &out); } ct += diff; } *out++ = 0; } /* {SHA} is the prefix used for base64 encoded sha1 in * ldap data interchange format. */ const char *sha1_id = "{SHA}"; API_EXPORT(void) ap_sha1_base64(char *clear, int len, char *out) { SHA_INFO context; if (!strncmp(clear,sha1_id,strlen(sha1_id))) clear+=strlen(sha1_id); sha_init(&context); sha_update(&context, clear, len); sha_final(&context); sha_raw_swap(&context); /* private marker. */ strcpy(out,sha1_id); /* SHA1 hash is always 20 chars */ encode_mime64((char *)context.digest, out+strlen(sha1_id), 20); /* output of MIME Base 64 encoded SHA1 is always 28 characters + strlen(sha1_id) */ } 1.6 +3 -0 apache-1.3/src/include/ap_md5.h Index: ap_md5.h =================================================================== RCS file: /x3/home/cvs/apache-1.3/src/include/ap_md5.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- ap_md5.h 1999/04/08 20:56:39 1.5 +++ ap_md5.h 1999/08/02 10:13:45 1.6 @@ -104,6 +104,8 @@ unsigned char buffer[64]; /* input buffer */ } AP_MD5_CTX; +const char *apr1_id; /* MD5 passwd marker string */ + API_EXPORT(void) ap_MD5Init(AP_MD5_CTX *context); API_EXPORT(void) ap_MD5Update(AP_MD5_CTX *context, const unsigned char *input, unsigned int inputLen); @@ -111,6 +113,7 @@ API_EXPORT(void) ap_MD5Encode(const unsigned char *password, const unsigned char *salt, char *result, size_t nbytes); +API_EXPORT(void) ap_to64(char *s, unsigned long v, int n); API_EXPORT(char *) ap_validate_password(const char *passwd, const char *hash); #ifdef __cplusplus 1.1 apache-1.3/src/include/ap_checkpass.h Index: ap_checkpass.h =================================================================== /* ==================================================================== * Copyright (c) 1996-1999 The Apache Group. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary
{'source': 'Apache Software Foundation Public Mail Archives'}