Hello. I hacked the mod_nss code so it compiles with latest apache-2.2.0. I attached the patch plus one autofoo patch. Cheers. -- Regards // Oden Eriksson Mandriva: http://www.mandriva.com NUX: http://li.nux.se
diff -Naur mod_nss-1.0/mod_nss.c mod_nss-1.0.oden/mod_nss.c --- mod_nss-1.0/mod_nss.c 2005-10-03 16:59:26.000000000 +0200 +++ mod_nss-1.0.oden/mod_nss.c 2005-12-20 09:15:10.000000000 +0100 @@ -362,7 +362,7 @@ return APR_SUCCESS; } -static const char *nss_hook_http_method(const request_rec *r) +static const char *nss_hook_http_scheme(const request_rec *r) { SSLSrvConfigRec *sc = mySrvConfig(r->server); @@ -394,7 +394,7 @@ ap_hook_pre_connection(nss_hook_pre_connection,NULL,NULL, APR_HOOK_MIDDLE); ap_hook_post_config (nss_init_Module, NULL,NULL, APR_HOOK_MIDDLE); - ap_hook_http_method (nss_hook_http_method, NULL,NULL, APR_HOOK_MIDDLE); + ap_hook_http_scheme (nss_hook_http_scheme, NULL,NULL, APR_HOOK_MIDDLE); ap_hook_default_port (nss_hook_default_port, NULL,NULL, APR_HOOK_MIDDLE); ap_hook_pre_config (nss_hook_pre_config, NULL,NULL, APR_HOOK_MIDDLE); ap_hook_child_init (nss_init_Child, NULL,NULL, APR_HOOK_MIDDLE); diff -Naur mod_nss-1.0/nss_engine_pphrase.c mod_nss-1.0.oden/nss_engine_pphrase.c --- mod_nss-1.0/nss_engine_pphrase.c 2005-08-04 18:18:49.000000000 +0200 +++ mod_nss-1.0.oden/nss_engine_pphrase.c 2005-12-20 09:02:22.000000000 +0100 @@ -125,7 +125,7 @@ snprintf(buf, 1024, "STOR\t%s\t%s", PK11_GetTokenName(slot), passwd); rv = apr_file_write_full(parg->mc->proc.in, buf, strlen(buf), NULL); - if (!APR_STATUS_IS_SUCCESS(rv)) { + if (rv != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL, "Unable to write to pin store for slot: %s APR err: %d", PK11_GetTokenName(slot), rv); nss_die(); @@ -139,9 +139,9 @@ memset(buf, 0, sizeof(buf)); rv = apr_file_read(parg->mc->proc.out, buf, &nBytes); - if (APR_STATUS_IS_SUCCESS(rv)) + if (rv = APR_SUCCESS) res = atoi(buf); - if (!APR_STATUS_IS_SUCCESS(rv) || + if (rv != APR_SUCCESS || (res != PIN_SUCCESS && res != PIN_INCORRECTPW)) { ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL, "Unable to read from pin store for slot: %s APR err: %d", PK11_GetTokenName(slot), rv); @@ -245,7 +245,7 @@ snprintf(buf, 1024, "RETR\t%s", token_name); rv = apr_file_write_full(parg->mc->proc.in, buf, strlen(buf), NULL); - if (!APR_STATUS_IS_SUCCESS(rv)) { + if (rv != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL, "Unable to write to pin store for slot: %s APR err: %d", PK11_GetTokenName(slot), rv); nss_die(); @@ -256,7 +256,7 @@ */ memset(buf, 0, sizeof(buf)); rv = apr_file_read(parg->mc->proc.out, buf, &nBytes); - if (!APR_STATUS_IS_SUCCESS(rv)) { + if (rv != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL, "Unable to read from pin store for slot: %s APR err: %d", PK11_GetTokenName(slot), rv); nss_die(); diff -Naur mod_nss-1.0/nss_engine_vars.c mod_nss-1.0.oden/nss_engine_vars.c --- mod_nss-1.0/nss_engine_vars.c 2005-05-31 16:32:42.000000000 +0200 +++ mod_nss-1.0.oden/nss_engine_vars.c 2005-12-20 09:16:30.000000000 +0100 @@ -100,7 +100,7 @@ else if (strcEQ(var, "REQUEST_METHOD")) result = (char *)(r->method); else if (strcEQ(var, "REQUEST_SCHEME")) - result = (char *)ap_http_method(r); + result = (char *)ap_http_scheme(r); else if (strcEQ(var, "REQUEST_URI")) result = r->uri; else if (strcEQ(var, "SCRIPT_FILENAME") || diff -Naur mod_nss-1.0/nss_expr_eval.c mod_nss-1.0.oden/nss_expr_eval.c --- mod_nss-1.0/nss_expr_eval.c 2005-05-31 16:32:42.000000000 +0200 +++ mod_nss-1.0.oden/nss_expr_eval.c 2005-12-20 08:49:07.000000000 +0100 @@ -113,24 +113,24 @@ nss_expr *e1; nss_expr *e2; char *word; - regex_t *regex; + ap_regex_t *regex; e1 = (nss_expr *)node->node_arg1; e2 = (nss_expr *)node->node_arg2; word = nss_expr_eval_word(r, e1); - regex = (regex_t *)(e2->node_arg1); + regex = (ap_regex_t *)(e2->node_arg1); return (ap_regexec(regex, word, 0, NULL, 0) == 0); } case op_NRE: { nss_expr *e1; nss_expr *e2; char *word; - regex_t *regex; + ap_regex_t *regex; e1 = (nss_expr *)node->node_arg1; e2 = (nss_expr *)node->node_arg2; word = nss_expr_eval_word(r, e1); - regex = (regex_t *)(e2->node_arg1); + regex = (ap_regex_t *)(e2->node_arg1); return !(ap_regexec(regex, word, 0, NULL, 0) == 0); } default: { diff -Naur mod_nss-1.0/nss_expr_parse.c mod_nss-1.0.oden/nss_expr_parse.c --- mod_nss-1.0/nss_expr_parse.c 2005-05-31 16:32:42.000000000 +0200 +++ mod_nss-1.0.oden/nss_expr_parse.c 2005-12-20 08:52:59.000000000 +0100 @@ -818,9 +818,9 @@ case 24: #line 102 "nss_expr_parse.y" { - regex_t *regex; + ap_regex_t *regex; if ((regex = ap_pregcomp(nss_expr_info.pool, nss_expr_yyvsp[0].cpVal, - REG_EXTENDED|REG_NOSUB)) == NULL) { + AP_REG_EXTENDED|AP_REG_NOSUB)) == NULL) { nss_expr_error = "Failed to compile regular expression"; YYERROR; } @@ -830,9 +830,9 @@ case 25: #line 111 "nss_expr_parse.y" { - regex_t *regex; + ap_regex_t *regex; if ((regex = ap_pregcomp(nss_expr_info.pool, nss_expr_yyvsp[0].cpVal, - REG_EXTENDED|REG_NOSUB|REG_ICASE)) == NULL) { + AP_REG_EXTENDED|AP_REG_NOSUB|AP_REG_ICASE)) == NULL) { nss_expr_error = "Failed to compile regular expression"; YYERROR; } diff -Naur mod_nss-1.0/nss_expr_parse.y mod_nss-1.0.oden/nss_expr_parse.y --- mod_nss-1.0/nss_expr_parse.y 2005-05-31 16:32:42.000000000 +0200 +++ mod_nss-1.0.oden/nss_expr_parse.y 2005-12-20 08:53:14.000000000 +0100 @@ -100,18 +100,18 @@ ; regex : T_REGEX { - regex_t *regex; + ap_regex_t *regex; if ((regex = ap_pregcomp(nss_expr_info.pool, $1, - REG_EXTENDED|REG_NOSUB)) == NULL) { + AP_REG_EXTENDED|AP_REG_NOSUB)) == NULL) { nss_expr_error = "Failed to compile regular expression"; YYERROR; } $$ = nss_expr_make(op_Regex, regex, NULL); } | T_REGEX_I { - regex_t *regex; + ap_regex_t *regex; if ((regex = ap_pregcomp(nss_expr_info.pool, $1, - REG_EXTENDED|REG_NOSUB|REG_ICASE)) == NULL) { + AP_REG_EXTENDED|AP_REG_NOSUB|AP_REG_ICASE)) == NULL) { nss_expr_error = "Failed to compile regular expression"; YYERROR; }
--- Makefile.am 2005-10-03 16:59:26.000000000 +0200 +++ Makefile.am.oden 2005-12-01 20:28:08.000000000 +0100 @@ -7,6 +7,7 @@ ## Define the source file for the module libmodnss_la_SOURCES = mod_nss.c nss_engine_config.c nss_engine_init.c nss_engine_io.c nss_engine_kernel.c nss_engine_log.c nss_engine_pphrase.c nss_engine_vars.c nss_expr.c nss_expr_eval.c nss_expr_parse.y nss_expr_scan.l nss_util.c nss_engine_rand.c +libmodnss_la_LDFLAGS = -module -avoid-version ## Set the includes and libraries needed INCLUDES = -I@apache_inc@ @nspr_inc@ @nss_inc@ @apr_inc@