Return-Path: Delivered-To: apmail-httpd-test-cvs-archive@httpd.apache.org Received: (qmail 23432 invoked by uid 500); 22 Oct 2001 10:55:35 -0000 Mailing-List: contact test-cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: test-dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list test-cvs@httpd.apache.org Received: (qmail 23421 invoked from network); 22 Oct 2001 10:55:35 -0000 Date: 22 Oct 2001 10:48:12 -0000 Message-ID: <20011022104812.86379.qmail@icarus.apache.org> From: gbenson@apache.org To: httpd-test-cvs@apache.org Subject: cvs commit: httpd-test/perl-framework/c-modules/authany mod_authany.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N gbenson 01/10/22 03:48:12 Modified: perl-framework/c-modules/authany mod_authany.c Log: fixed for 1.x, and enabled Revision Changes Path 1.4 +13 -4 httpd-test/perl-framework/c-modules/authany/mod_authany.c Index: mod_authany.c =================================================================== RCS file: /home/cvs/httpd-test/perl-framework/c-modules/authany/mod_authany.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- mod_authany.c 2001/09/08 22:07:14 1.3 +++ mod_authany.c 2001/10/22 10:48:12 1.4 @@ -1,5 +1,3 @@ -#define HTTPD_TEST_REQUIRE_APACHE 2 - #if CONFIG_FOR_HTTPD_TEST Alias /authany @DocumentRoot@ @@ -52,6 +50,7 @@ { const char *sent_pw; int rc = ap_get_basic_auth_pw(r, &sent_pw); + char *user; if (rc != OK) { return rc; @@ -60,11 +59,21 @@ if (require_any_user(r) != OK) { return DECLINED; } + +#ifdef APACHE1 + user = r->connection->user; +#endif +#ifdef APACHE2 + user = r->user; +#endif - if (!(strtrue(r->user) && strtrue(sent_pw))) { + if (!(strtrue(user) && strtrue(sent_pw))) { ap_note_basic_auth_failure(r); +#ifdef APACHE1 + ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r, + "Both a username and password must be provided"); +#endif #ifdef APACHE2 - /* prototype is different in 1.x */ ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r, "Both a username and password must be provided"); #endif