mod-auth-commit Mailing List for mod_auth (Page 4)
Brought to you by:
firechipmunk,
honx
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(36) |
Dec
(8) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(7) |
Feb
(51) |
Mar
(22) |
Apr
|
May
(6) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <fir...@us...> - 2004-02-08 02:30:34
|
Update of /cvsroot/mod-auth/mod_authn_dbi/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv610/include Added Files: .cvsignore Log Message: added lots of cvsignore action --- NEW FILE: .cvsignore --- mod_authn_dbi_config.h stamp-h1 |
From: <fir...@us...> - 2004-02-08 02:30:34
|
Update of /cvsroot/mod-auth/mod_authn_dbi/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv610/src Added Files: .cvsignore Log Message: added lots of cvsignore action --- NEW FILE: .cvsignore --- .deps .libs Makefile Makefile.in *.la *.lo |
From: <fir...@us...> - 2004-02-08 02:26:50
|
Update of /cvsroot/mod-auth/mod_authn_dbi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32287 Modified Files: autogen.sh Log Message: removed un-needed line Index: autogen.sh =================================================================== RCS file: /cvsroot/mod-auth/mod_authn_dbi/autogen.sh,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** autogen.sh 8 Feb 2004 02:18:28 -0000 1.4 --- autogen.sh 8 Feb 2004 02:23:53 -0000 1.5 *************** *** 6,10 **** aclocal autoheader ! automake --add-missing echo --- 6,10 ---- aclocal autoheader ! automake --add-missing --copy echo |
From: <fir...@us...> - 2004-02-08 02:21:32
|
Update of /cvsroot/mod-auth/mod_authn_dbi/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31128/src Modified Files: mod_authn_dbi.c Log Message: Moved to Apache License 2.0 Started killing un-needed auto* files Index: mod_authn_dbi.c =================================================================== RCS file: /cvsroot/mod-auth/mod_authn_dbi/src/mod_authn_dbi.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** mod_authn_dbi.c 1 Jan 2004 16:34:19 -0000 1.9 --- mod_authn_dbi.c 8 Feb 2004 02:18:28 -0000 1.10 *************** *** 1,58 **** /* ==================================================================== ! * The Apache Software License, Version 1.1 ! * ! * Copyright (c) 2000-2003 The Apache Software Foundation. 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. The end-user documentation included with the redistribution, ! * if any, must include the following acknowledgment: ! * "This product includes software developed by the ! * Apache Software Foundation (http://www.apache.org/)." ! * Alternately, this acknowledgment may appear in the software itself, ! * if and wherever such third-party acknowledgments normally appear. ! * ! * 4. The names "Apache" and "Apache Software Foundation" must ! * not be used to endorse or promote products derived from this ! * software without prior written permission. For written ! * permission, please contact ap...@ap.... * ! * 5. Products derived from this software may not be called "Apache", ! * nor may "Apache" appear in their name, without prior written ! * permission of the Apache Software Foundation. * ! * THIS SOFTWARE IS PROVIDED ``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 SOFTWARE FOUNDATION 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 Software Foundation. For more ! * information on the Apache Software Foundation, please see ! * <http://www.apache.org/>. * - * Portions of this software are based upon public domain software - * originally written at the National Center for Supercomputing Applications, - * University of Illinois, Urbana-Champaign. */ --- 1,17 ---- /* ==================================================================== ! * Copyright 2003-2004 Paul Querna and Axel Grossklaus * ! * Licensed under the Apache License, Version 2.0 (the "License"); ! * you may not use this file except in compliance with the License. ! * You may obtain a copy of the License at * ! * http://www.apache.org/licenses/LICENSE-2.0 * ! * Unless required by applicable law or agreed to in writing, software ! * distributed under the License is distributed on an "AS IS" BASIS, ! * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ! * See the License for the specific language governing permissions and ! * limitations under the License. * */ *************** *** 65,72 **** * based on mod_authn_mysql * - * redchip cvs: $Id$ */ #include "../include/mod_authn_dbi_config.h" #define MOD_AUTHN_DBI_VERSION VERSION --- 24,32 ---- * based on mod_authn_mysql * */ + #include "../include/mod_authn_dbi_config.h" + #define AUTHN_DBI_CVS_ID "$Id$" #define MOD_AUTHN_DBI_VERSION VERSION |
Update of /cvsroot/mod-auth/mod_authn_dbi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31128 Modified Files: COPYING ChangeLog autogen.sh Added Files: udcl.sh Removed Files: NEWS install-sh ltmain.sh missing mkinstalldirs Log Message: Moved to Apache License 2.0 Started killing un-needed auto* files --- NEW FILE: udcl.sh --- #!/bin/sh # define $EDITOR and EDITOR_FLAGS in your environment to customize this CL="ChangeLog" DSTR=`date +%d.%m.%Y` DSTR2=`date +%H:%M\ \(%Z\)` TF="ferite-changelog-entry-"$USER if test -z $EDITOR; then EDITOR="nano" EDITOR_FLAGS="+" fi export UNAME=$USER; if test $USER="chip"; then export UNAME="firechipmunk" fi echo "--------------------------------------------------------------------------------------------------------" > $TF echo "$DSTR $DSTR2, $UNAME" >> $TF echo >> $TF echo >> $TF $EDITOR $EDITOR_FLAGS $TF echo "" >> $TF cat $CL >> $TF rm $CL if test -f $TF"~"; then rm $TF"~" fi mv $TF $CL Index: COPYING =================================================================== RCS file: /cvsroot/mod-auth/mod_authn_dbi/COPYING,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** COPYING 25 Oct 2003 04:15:52 -0000 1.2 --- COPYING 8 Feb 2004 02:18:28 -0000 1.3 *************** *** 1,55 **** ! The Apache Software License, Version 1.1 ! Copyright (c) 2000 The Apache Software Foundation. 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. The end-user documentation included with the redistribution, ! if any, must include the following acknowledgment: ! "This product includes software developed by the ! Apache Software Foundation (http://www.apache.org/)." ! Alternately, this acknowledgment may appear in the software itself, ! if and wherever such third-party acknowledgments normally appear. ! 4. The names "Apache" and "Apache Software Foundation" must ! not be used to endorse or promote products derived from this ! software without prior written permission. For written ! permission, please contact ap...@ap.... ! 5. Products derived from this software may not be called "Apache", ! nor may "Apache" appear in their name, without prior written ! permission of the Apache Software Foundation. ! THIS SOFTWARE IS PROVIDED ``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 SOFTWARE FOUNDATION 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 Software Foundation. For more ! information on the Apache Software Foundation, please see ! <http://www.apache.org/>. - Portions of this software are based upon public domain software - originally written at the National Center for Supercomputing Applications, - University of Illinois, Urbana-Champaign. --- 1,202 ---- ! Apache License ! Version 2.0, January 2004 ! http://www.apache.org/licenses/ ! TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION ! 1. Definitions. ! "License" shall mean the terms and conditions for use, reproduction, ! and distribution as defined by Sections 1 through 9 of this document. ! "Licensor" shall mean the copyright owner or entity authorized by ! the copyright owner that is granting the License. ! "Legal Entity" shall mean the union of the acting entity and all ! other entities that control, are controlled by, or are under common ! control with that entity. For the purposes of this definition, ! "control" means (i) the power, direct or indirect, to cause the ! direction or management of such entity, whether by contract or ! otherwise, or (ii) ownership of fifty percent (50%) or more of the ! outstanding shares, or (iii) beneficial ownership of such entity. ! "You" (or "Your") shall mean an individual or Legal Entity ! exercising permissions granted by this License. ! "Source" form shall mean the preferred form for making modifications, ! including but not limited to software source code, documentation ! source, and configuration files. ! "Object" form shall mean any form resulting from mechanical ! transformation or translation of a Source form, including but ! not limited to compiled object code, generated documentation, ! and conversions to other media types. ! "Work" shall mean the work of authorship, whether in Source or ! Object form, made available under the License, as indicated by a ! copyright notice that is included in or attached to the work ! (an example is provided in the Appendix below). ! ! "Derivative Works" shall mean any work, whether in Source or Object ! form, that is based on (or derived from) the Work and for which the ! editorial revisions, annotations, elaborations, or other modifications ! represent, as a whole, an original work of authorship. For the purposes ! of this License, Derivative Works shall not include works that remain ! separable from, or merely link (or bind by name) to the interfaces of, ! the Work and Derivative Works thereof. ! ! "Contribution" shall mean any work of authorship, including ! the original version of the Work and any modifications or additions ! to that Work or Derivative Works thereof, that is intentionally ! submitted to Licensor for inclusion in the Work by the copyright owner ! or by an individual or Legal Entity authorized to submit on behalf of ! the copyright owner. For the purposes of this definition, "submitted" ! means any form of electronic, verbal, or written communication sent ! to the Licensor or its representatives, including but not limited to ! communication on electronic mailing lists, source code control systems, ! and issue tracking systems that are managed by, or on behalf of, the ! Licensor for the purpose of discussing and improving the Work, but ! excluding communication that is conspicuously marked or otherwise ! designated in writing by the copyright owner as "Not a Contribution." ! ! "Contributor" shall mean Licensor and any individual or Legal Entity ! on behalf of whom a Contribution has been received by Licensor and ! subsequently incorporated within the Work. ! ! 2. Grant of Copyright License. Subject to the terms and conditions of ! this License, each Contributor hereby grants to You a perpetual, ! worldwide, non-exclusive, no-charge, royalty-free, irrevocable ! copyright license to reproduce, prepare Derivative Works of, ! publicly display, publicly perform, sublicense, and distribute the ! Work and such Derivative Works in Source or Object form. ! ! 3. Grant of Patent License. Subject to the terms and conditions of ! this License, each Contributor hereby grants to You a perpetual, ! worldwide, non-exclusive, no-charge, royalty-free, irrevocable ! (except as stated in this section) patent license to make, have made, ! use, offer to sell, sell, import, and otherwise transfer the Work, ! where such license applies only to those patent claims licensable ! by such Contributor that are necessarily infringed by their ! Contribution(s) alone or by combination of their Contribution(s) ! with the Work to which such Contribution(s) was submitted. If You ! institute patent litigation against any entity (including a ! cross-claim or counterclaim in a lawsuit) alleging that the Work ! or a Contribution incorporated within the Work constitutes direct ! or contributory patent infringement, then any patent licenses ! granted to You under this License for that Work shall terminate ! as of the date such litigation is filed. ! ! 4. Redistribution. You may reproduce and distribute copies of the ! Work or Derivative Works thereof in any medium, with or without ! modifications, and in Source or Object form, provided that You ! meet the following conditions: ! ! (a) You must give any other recipients of the Work or ! Derivative Works a copy of this License; and ! ! (b) You must cause any modified files to carry prominent notices ! stating that You changed the files; and ! ! (c) You must retain, in the Source form of any Derivative Works ! that You distribute, all copyright, patent, trademark, and ! attribution notices from the Source form of the Work, ! excluding those notices that do not pertain to any part of ! the Derivative Works; and ! ! (d) If the Work includes a "NOTICE" text file as part of its ! distribution, then any Derivative Works that You distribute must ! include a readable copy of the attribution notices contained ! within such NOTICE file, excluding those notices that do not ! pertain to any part of the Derivative Works, in at least one ! of the following places: within a NOTICE text file distributed ! as part of the Derivative Works; within the Source form or ! documentation, if provided along with the Derivative Works; or, ! within a display generated by the Derivative Works, if and ! wherever such third-party notices normally appear. The contents ! of the NOTICE file are for informational purposes only and ! do not modify the License. You may add Your own attribution ! notices within Derivative Works that You distribute, alongside ! or as an addendum to the NOTICE text from the Work, provided ! that such additional attribution notices cannot be construed ! as modifying the License. ! ! You may add Your own copyright statement to Your modifications and ! may provide additional or different license terms and conditions ! for use, reproduction, or distribution of Your modifications, or ! for any such Derivative Works as a whole, provided Your use, ! reproduction, and distribution of the Work otherwise complies with ! the conditions stated in this License. ! ! 5. Submission of Contributions. Unless You explicitly state otherwise, ! any Contribution intentionally submitted for inclusion in the Work ! by You to the Licensor shall be under the terms and conditions of ! this License, without any additional terms or conditions. ! Notwithstanding the above, nothing herein shall supersede or modify ! the terms of any separate license agreement you may have executed ! with Licensor regarding such Contributions. ! ! 6. Trademarks. This License does not grant permission to use the trade ! names, trademarks, service marks, or product names of the Licensor, ! except as required for reasonable and customary use in describing the ! origin of the Work and reproducing the content of the NOTICE file. ! ! 7. Disclaimer of Warranty. Unless required by applicable law or ! agreed to in writing, Licensor provides the Work (and each ! Contributor provides its Contributions) on an "AS IS" BASIS, ! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or ! implied, including, without limitation, any warranties or conditions ! of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A ! PARTICULAR PURPOSE. You are solely responsible for determining the ! appropriateness of using or redistributing the Work and assume any ! risks associated with Your exercise of permissions under this License. ! ! 8. Limitation of Liability. In no event and under no legal theory, ! whether in tort (including negligence), contract, or otherwise, ! unless required by applicable law (such as deliberate and grossly ! negligent acts) or agreed to in writing, shall any Contributor be ! liable to You for damages, including any direct, indirect, special, ! incidental, or consequential damages of any character arising as a ! result of this License or out of the use or inability to use the ! Work (including but not limited to damages for loss of goodwill, ! work stoppage, computer failure or malfunction, or any and all ! other commercial damages or losses), even if such Contributor ! has been advised of the possibility of such damages. ! ! 9. Accepting Warranty or Additional Liability. While redistributing ! the Work or Derivative Works thereof, You may choose to offer, ! and charge a fee for, acceptance of support, warranty, indemnity, ! or other liability obligations and/or rights consistent with this ! License. However, in accepting such obligations, You may act only ! on Your own behalf and on Your sole responsibility, not on behalf ! of any other Contributor, and only if You agree to indemnify, ! defend, and hold each Contributor harmless for any liability ! incurred by, or claims asserted against, such Contributor by reason ! of your accepting any such warranty or additional liability. ! ! END OF TERMS AND CONDITIONS ! ! APPENDIX: How to apply the Apache License to your work. ! ! To apply the Apache License to your work, attach the following ! boilerplate notice, with the fields enclosed by brackets "[]" ! replaced with your own identifying information. (Don't include ! the brackets!) The text should be enclosed in the appropriate ! comment syntax for the file format. We also recommend that a ! file or class name and description of purpose be included on the ! same "printed page" as the copyright notice for easier ! identification within third-party archives. ! ! Copyright [yyyy] [name of copyright owner] ! ! Licensed under the Apache License, Version 2.0 (the "License"); ! you may not use this file except in compliance with the License. ! You may obtain a copy of the License at ! ! http://www.apache.org/licenses/LICENSE-2.0 ! ! Unless required by applicable law or agreed to in writing, software ! distributed under the License is distributed on an "AS IS" BASIS, ! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ! See the License for the specific language governing permissions and ! limitations under the License. Index: ChangeLog =================================================================== RCS file: /cvsroot/mod-auth/mod_authn_dbi/ChangeLog,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ChangeLog 25 Oct 2003 04:14:38 -0000 1.1 --- ChangeLog 8 Feb 2004 02:18:28 -0000 1.2 *************** *** 0 **** --- 1,9 ---- + -------------------------------------------------------------------------------------------------------- + 07.02.2004 19:19 (MST), firechipmunk + - Changed to ASL 2.0 + + -------------------------------------------------------------------------------------------------------- + 07.02.2004 19:12 (MST), firechipmunk + removed unneeded auto* foo + + Index: autogen.sh =================================================================== RCS file: /cvsroot/mod-auth/mod_authn_dbi/autogen.sh,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** autogen.sh 3 Nov 2003 16:03:22 -0000 1.3 --- autogen.sh 8 Feb 2004 02:18:28 -0000 1.4 *************** *** 2,7 **** # autogen.sh - generates configure using the autotools # $Id$ ! #libtoolize --force --copy ! libtoolize14 --force --copy aclocal autoheader --- 2,7 ---- # autogen.sh - generates configure using the autotools # $Id$ ! libtoolize --force --copy ! #libtoolize14 --force --copy aclocal autoheader *************** *** 13,19 **** echo autoconf - - ## autoconf 2.53 will not work, at least on FreeBSD. Change the following - ## line appropriately to call autoconf 2.13 instead. This one works for - ## FreeBSD 4.7: - autoconf213 --- 13,14 ---- --- NEWS DELETED --- --- install-sh DELETED --- --- ltmain.sh DELETED --- --- missing DELETED --- --- mkinstalldirs DELETED --- |
From: <fir...@us...> - 2004-01-06 01:31:06
|
Update of /cvsroot/mod-auth/mod_authn_cache/src In directory sc8-pr-cvs1:/tmp/cvs-serv5290/src Modified Files: mod_authn_cache.c Log Message: using buckets now Index: mod_authn_cache.c =================================================================== RCS file: /cvsroot/mod-auth/mod_authn_cache/src/mod_authn_cache.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** mod_authn_cache.c 2 Jan 2004 23:51:02 -0000 1.6 --- mod_authn_cache.c 6 Jan 2004 01:31:01 -0000 1.7 *************** *** 87,92 **** #define DFLT_HOSTNAME "localhost" #define DFLT_PORT (8008) ! #define DFLT_CONN_MIN (1) ! #define DFLT_CONN_SOFT (5) #define DFLT_CONN_MAX (25) #define DFLT_CONN_TTL (600) --- 87,92 ---- #define DFLT_HOSTNAME "localhost" #define DFLT_PORT (8008) ! #define DFLT_CONN_MIN (10) ! #define DFLT_CONN_SOFT (15) #define DFLT_CONN_MAX (25) #define DFLT_CONN_TTL (600) *************** *** 103,108 **** apr_sockaddr_t *sockaddr; apr_socket_t *sock; ! char* line_buff; ! apr_size_t line_buff_size; } mcd_res_t; --- 103,110 ---- apr_sockaddr_t *sockaddr; apr_socket_t *sock; ! apr_bucket_alloc_t *bb_l; ! apr_bucket_brigade *bb; ! apr_pool_t* pool; ! } mcd_res_t; *************** *** 112,121 **** apr_status_t rv = APR_SUCCESS; mcd_res_t *mcdres; ! mcdres = apr_palloc(pool, sizeof(*mcdres)); ! ! mcdres->line_buff = NULL; ! mcdres->line_buff_size = 0; ! rv = apr_sockaddr_info_get(&mcdres->sockaddr, DFLT_HOSTNAME, APR_UNSPEC, DFLT_PORT, 0, pool); if (rv != APR_SUCCESS) { --- 114,121 ---- apr_status_t rv = APR_SUCCESS; mcd_res_t *mcdres; ! apr_bucket *e; ! mcdres = apr_palloc(pool, sizeof(*mcdres)); ! rv = apr_sockaddr_info_get(&mcdres->sockaddr, DFLT_HOSTNAME, APR_UNSPEC, DFLT_PORT, 0, pool); if (rv != APR_SUCCESS) { *************** *** 141,144 **** --- 141,149 ---- } + mcdres->bb_l = apr_bucket_alloc_create(pool); + mcdres->bb = apr_brigade_create(pool, mcdres->bb_l); + e = apr_bucket_socket_create(mcdres->sock, mcdres->bb_l); + APR_BRIGADE_INSERT_TAIL(mcdres->bb, e); + mcdres->pool = pool; *resource = mcdres; return rv; *************** *** 150,153 **** --- 155,160 ---- mcd_res_t *mcd = resource; + apr_brigade_destroy(mcd->bb); + apr_bucket_alloc_destroy(mcd->bb_l); rv = apr_socket_close(mcd->sock); *************** *** 155,273 **** } ! #define RECVLEN 512 ! ! static apr_status_t getLine(request_rec * r, mcd_res_t* mcd, char **str, apr_size_t count) { ! apr_status_t rv = APR_SUCCESS; ! apr_size_t recvlen; ! char *recv = NULL; ! char *s; ! apr_size_t recv_total = 0; ! ! recvlen = RECVLEN; ! recv = apr_palloc(r->pool, RECVLEN); ! memset(recv, 0, RECVLEN); ! ! if(mcd->line_buff_size == 0) { ! mcd->line_buff = apr_palloc(r->pool, count); ! memset(mcd->line_buff, 0, count); ! } ! else { // existing line buffer ! ! } ! ! while(1){ ! rv = apr_socket_recv(mcd->sock, recv, &recvlen); ! if (rv != APR_SUCCESS) { ! ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, "getLine: apr_socket_recv"); ! if(mcd->line_buff_size > 0) { ! *str = apr_pstrcat(r->pool, mcd->line_buff, NULL); ! } ! else { ! *str = NULL; ! } ! return rv; ! } ! recv[recvlen] = 0; ! ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, "getline: read-> '%s'", recv); ! if(recvlen+recv_total > count) { ! // line is too big. ! recv[(recvlen+recv_total) - count] = 0; ! *str = apr_pstrcat(r->pool, mcd->line_buff, recv, NULL); ! ! break; ! } ! // find newline! ! s = strstr(recv, "\r\n"); ! if (!s) { ! // newline not found. lets append to the buffer and try again. ! mcd->line_buff = apr_pstrcat(r->pool, mcd->line_buff, recv, NULL); ! mcd->line_buff_size += recvlen; ! continue; ! } ! else { ! // newline was found. stop at it. ! *s = 0; // terminate on the \r ! *s++; // \r ! *s = 0; // terminate on the \n ! *str = apr_pstrcat(r->pool, mcd->line_buff, recv, NULL); ! // do we have an extra string left over? ! if( (recvlen-2) > strlen(recv) ) { ! *s++; // everything after the newline ! mcd->line_buff = apr_pstrcat(r->pool, recv, NULL); ! mcd->line_buff_size = strlen(recv); ! } ! else { ! // hmm ended on a newline? ! mcd->line_buff_size = 0; ! } ! break; ! } ! } ! // free buffers! ! return APR_SUCCESS; } static apr_status_t mcd_get(request_rec * r, mcd_res_t* mcd, const char* key, char** value) { ! apr_status_t rv = APR_SUCCESS; ! apr_size_t sendlen; ! apr_size_t recvlen; ! char *command; ! char *s = NULL; ! command = apr_psprintf(r->pool, "get %s\r\n", key); ! sendlen = strlen(command); ! rv = apr_socket_send(mcd->sock, command, &sendlen); ! if (rv != APR_SUCCESS) { ! ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, "mcd_get: apr_socket_send"); ! return rv; ! } ! getLine(r, mcd, &command, 5000); ! s = strstr("VALUE", command); ! if (*s != NULL) { ! // VALUE foo 0 5 ! char *pstr; ! char *tok_cntx; ! pstr = command; ! pstr = apr_strtok(pstr, " ", &tok_cntx); // value ! pstr = apr_strtok(pstr, " ", &tok_cntx); // key ! pstr = apr_strtok(pstr, " ", &tok_cntx); // flags ! pstr = apr_strtok(pstr, " ", &tok_cntx); // len ! // recvlen = ! } ! else { ! s = strstr("END", command); ! if (*s != NULL) { ! *value = NULL; ! } ! } ! ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, "mcd_get: got line: '%s'", command); ! return rv; } --- 162,330 ---- } ! #define MIN_LINE_ALLOC 80 ! static apr_status_t ap_mcd_getline(char **s, apr_size_t n, ! apr_size_t *read, apr_pool_t* pool, ! mcd_res_t *mcd) ! { ! apr_status_t rv; ! apr_bucket *e; ! apr_size_t bytes_handled = 0, current_alloc = 0; ! char *pos, *last_char = *s; ! int do_alloc = (*s == NULL), saw_eos = 0; ! apr_bucket_alloc_t *bb_l; ! apr_bucket_brigade *b; ! bb_l = apr_bucket_alloc_create(mcd->pool); ! b = apr_brigade_create(mcd->pool, bb_l); ! rv = apr_brigade_split_line(b, mcd->bb, APR_NONBLOCK_READ, n); ! /* Something horribly wrong happened. Someone didn't block! */ ! if (APR_BRIGADE_EMPTY(b)) { ! return APR_EGENERAL; ! } ! ! for (;;) { ! ! APR_BRIGADE_FOREACH(e, b) { ! const char *str; ! apr_size_t len; ! /* If we see an EOS, don't bother doing anything more. */ ! if (APR_BUCKET_IS_EOS(e)) { ! saw_eos = 1; ! break; ! } ! ! rv = apr_bucket_read(e, &str, &len, APR_NONBLOCK_READ); ! ! if (rv != APR_SUCCESS) { ! return rv; ! } ! if (len == 0) { ! /* no use attempting a zero-byte alloc (hurts when ! * using --with-efence --enable-pool-debug) or ! * doing any of the other logic either ! */ ! continue; ! } ! ! /* Would this overrun our buffer? If so, we'll die. */ ! if (n < bytes_handled + len) { ! *read = bytes_handled; ! return APR_ENOSPC; ! } ! /* Just copy the rest of the data to the end of the old buffer. */ ! pos = *s + bytes_handled; ! memcpy(pos, str, len); ! last_char = pos + len - 1; ! ! /* We've now processed that new data - update accordingly. */ ! bytes_handled += len; ! } ! ! /* If we got a full line of input, stop reading */ ! if (last_char && (*last_char == APR_ASCII_LF)) { ! break; ! } ! } ! ! /* We now go backwards over any CR (if present) or white spaces. ! * ! * Trim any extra trailing spaces or tabs except for the first ! * space or tab at the beginning of a blank string. This makes ! * it much easier to check field values for exact matches, and ! * saves memory as well. Terminate string at end of line. ! */ ! pos = last_char; ! if (pos > *s && *(pos - 1) == APR_ASCII_CR) { ! --pos; ! } ! ! /* Trim any extra trailing spaces or tabs except for the first ! * space or tab at the beginning of a blank string. This makes ! * it much easier to check field values for exact matches, and ! * saves memory as well. ! */ ! while (pos > ((*s) + 1) ! && (*(pos - 1) == APR_ASCII_BLANK || *(pos - 1) == APR_ASCII_TAB)) { ! --pos; ! } ! ! /* Since we want to remove the LF from the line, we'll go ahead ! * and set this last character to be the term NULL and reset ! * bytes_handled accordingly. ! */ ! *pos = '\0'; ! last_char = pos; ! bytes_handled = pos - *s; ! *read = bytes_handled; ! apr_brigade_destroy(b); ! apr_bucket_alloc_destroy(bb_l); ! return APR_SUCCESS; } + #define LINELEN 512 static apr_status_t mcd_get(request_rec * r, mcd_res_t* mcd, const char* key, char** value) { ! apr_status_t rv = APR_SUCCESS; ! apr_size_t sendlen; ! apr_size_t recvlen; ! apr_bucket *e; ! char *command = NULL; ! char *cmd; ! char *vlen; ! int i; ! ! command = apr_psprintf(mcd->pool, "get %s\r\n", key); ! sendlen = strlen(command); ! ! ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, "mcd_get: send line: '%s'", command); ! rv = apr_socket_send(mcd->sock, command, &sendlen); ! if (rv != APR_SUCCESS) { ! ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, "mcd_get: apr_socket_send"); ! return rv; ! } ! ! command = apr_palloc(r->pool, LINELEN); ! for(i=0;i<10;) { // prevent runways ! memset(command, 0, LINELEN); ! ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, "mcd_get: watiing for line'"); ! ap_mcd_getline(&command, LINELEN, &recvlen, r->pool, mcd); ! ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, "mcd_get: got line: '%s'", command); ! if(strcmp("END", command) == 0) { ! ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, "mcd_get: got END."); ! break; ! } ! if(strlen(command) == 0) { ! i++; ! } ! cmd = ap_getword_white_nc(r->pool, &command); ! if(strcmp("VALUE", cmd) == 0) { ! //foo 600 5 ! cmd = ap_getword_white_nc(r->pool, &command); ! cmd = ap_getword_white_nc(r->pool, &command); ! vlen = ap_getword_white_nc(r->pool, &command); ! recvlen = apr_strtoi64(vlen, NULL, 10); ! ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, "mcd_get: Looking for Value of Len: '%d'", recvlen); ! /* for (;;) { ! const char *str; ! apr_size_t len; ! APR_BRIGADE_FOREACH(e, mcd->bb) { ! rv = apr_bucket_read(e, &str, &len, APR_BLOCK_READ); ! if (rv != APR_SUCCESS) { ! return rv; ! } ! } ! } ! */ ! //break; ! } ! } ! ! return rv; } *************** *** 286,290 **** return rv; } ! getLine(r, mcd, &command, 5000); return rv; --- 343,347 ---- return rv; } ! //getLine(r, mcd, &command, 5000); return rv; *************** *** 386,392 **** current_provider = conf->providers; ! apr_reslist_acquire(reslist_pool, (void **) &mcd); ! mcd_get(r, mcd, "foo", &foo); ! do { const authn_provider *provider; --- 443,450 ---- current_provider = conf->providers; ! // apr_reslist_acquire(reslist_pool, (void **) &mcd); ! mcd_new_conn((void**)&mcd, NULL, r->pool); ! mcd_get(r, mcd, "foo", &foo); ! mcd_kill_conn((void*) mcd, NULL, r->pool); do { const authn_provider *provider; *************** *** 433,438 **** } ! mcd->line_buff_size = 0; ! apr_reslist_release(reslist_pool, (void **) mcd); return auth_result; --- 491,495 ---- } ! // apr_reslist_release(reslist_pool, (void **) mcd); return auth_result; *************** *** 468,480 **** } ! apr_reslist_create(&reslist_pool, DFLT_CONN_MIN, /* hard minimum */ ! DFLT_CONN_SOFT, /* soft maximum */ ! DFLT_CONN_MAX, /* hard maximum */ ! DFLT_CONN_TTL, /* Time to live -- mcd server might override/disconnect! */ ! mcd_new_conn, /* Make a New Connection */ ! mcd_kill_conn, /* Kill Old Connection */ ! (void *) NULL, p); ! apr_pool_cleanup_register(p, p, kill_mcd, apr_pool_cleanup_null); ap_add_version_component(p, "mod_authn_cache_mcd/0.1"); --- 525,537 ---- } ! // apr_reslist_create(&reslist_pool, DFLT_CONN_MIN, /* hard minimum */ ! // DFLT_CONN_SOFT, /* soft maximum */ ! // DFLT_CONN_MAX, /* hard maximum */ ! // DFLT_CONN_TTL, /* Time to live -- mcd server might override/disconnect! */ ! // mcd_new_conn, /* Make a New Connection */ ! // mcd_kill_conn, /* Kill Old Connection */ ! // (void *) NULL, p); ! // apr_pool_cleanup_register(p, p, kill_mcd, apr_pool_cleanup_null); ap_add_version_component(p, "mod_authn_cache_mcd/0.1"); |
From: <fir...@us...> - 2004-01-03 00:31:32
|
Update of /cvsroot/mod-auth/mod_dbi_pool In directory sc8-pr-cvs1:/tmp/cvs-serv30603 Added Files: TODO Log Message: Module is now under ASL. Thanks to Nick Kew! --- NEW FILE: TODO --- - Allow Multiple Configurations |
From: <fir...@us...> - 2004-01-03 00:31:32
|
Update of /cvsroot/mod-auth/mod_dbi_pool/src In directory sc8-pr-cvs1:/tmp/cvs-serv30603/src Modified Files: mod_dbi_pool.c Log Message: Module is now under ASL. Thanks to Nick Kew! Index: mod_dbi_pool.c =================================================================== RCS file: /cvsroot/mod-auth/mod_dbi_pool/src/mod_dbi_pool.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mod_dbi_pool.c 31 Dec 2003 08:31:38 -0000 1.1 --- mod_dbi_pool.c 3 Jan 2004 00:31:25 -0000 1.2 *************** *** 1,26 **** ! /* ! ! XXXXX: Get Permissions from Nick Kew to Change this to Apache License ! * based on mod_mysql_pool ! ! Author: Paul Querna <chip force-elite.com> ! Copyright (c) 2003, WebThing Ltd ! ! This program is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2 of the License, or ! (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ! */ --- 1,56 ---- ! /* ==================================================================== ! * The Apache Software License, Version 1.1 ! * ! * Copyright (c) 2000-2003 The Apache Software Foundation. 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. The end-user documentation included with the redistribution, ! * if any, must include the following acknowledgment: ! * "This product includes software developed by the ! * Apache Software Foundation (http://www.apache.org/)." ! * Alternately, this acknowledgment may appear in the software itself, ! * if and wherever such third-party acknowledgments normally appear. ! * ! * 4. The names "Apache" and "Apache Software Foundation" must ! * not be used to endorse or promote products derived from this ! * software without prior written permission. For written ! * permission, please contact ap...@ap.... ! * ! * 5. Products derived from this software may not be called "Apache", ! * nor may "Apache" appear in their name, without prior written ! * permission of the Apache Software Foundation. ! * ! * THIS SOFTWARE IS PROVIDED ``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 SOFTWARE FOUNDATION 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. ! * ==================================================================== ! */ + /* + Author: Paul Querna <chip force-elite.com> ! Originaly Based on mod_mysql_pool by Nick Kew: ! http://apache.webthing.com/ */ |
From: <fir...@us...> - 2004-01-02 23:51:07
|
Update of /cvsroot/mod-auth/mod_authn_cache/src In directory sc8-pr-cvs1:/tmp/cvs-serv22469 Modified Files: mod_authn_cache.c Log Message: does basic connects. need to write parsing code for memcached. this is why the world invented high level languages. string manipulation still sucks in c :) Index: mod_authn_cache.c =================================================================== RCS file: /cvsroot/mod-auth/mod_authn_cache/src/mod_authn_cache.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** mod_authn_cache.c 2 Jan 2004 22:59:41 -0000 1.5 --- mod_authn_cache.c 2 Jan 2004 23:51:02 -0000 1.6 *************** *** 157,161 **** #define RECVLEN 512 ! static apr_status_t getLine(request_rec * r, mcd_res_t* mcd, char *str, apr_size_t count) { apr_status_t rv = APR_SUCCESS; apr_size_t recvlen; --- 157,161 ---- #define RECVLEN 512 ! static apr_status_t getLine(request_rec * r, mcd_res_t* mcd, char **str, apr_size_t count) { apr_status_t rv = APR_SUCCESS; apr_size_t recvlen; *************** *** 180,191 **** if (rv != APR_SUCCESS) { ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, "getLine: apr_socket_recv"); return rv; } recv[recvlen] = 0; if(recvlen+recv_total > count) { // line is too big. recv[(recvlen+recv_total) - count] = 0; ! str = apr_pstrcat(r->pool, mcd->line_buff, recv, NULL); break; --- 180,199 ---- if (rv != APR_SUCCESS) { ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, "getLine: apr_socket_recv"); + if(mcd->line_buff_size > 0) { + *str = apr_pstrcat(r->pool, mcd->line_buff, NULL); + } + else { + *str = NULL; + } + return rv; } recv[recvlen] = 0; + ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, "getline: read-> '%s'", recv); if(recvlen+recv_total > count) { // line is too big. recv[(recvlen+recv_total) - count] = 0; ! *str = apr_pstrcat(r->pool, mcd->line_buff, recv, NULL); break; *************** *** 204,208 **** *s++; // \r *s = 0; // terminate on the \n ! str = apr_pstrcat(r->pool, mcd->line_buff, recv, NULL); // do we have an extra string left over? if( (recvlen-2) > strlen(recv) ) { --- 212,216 ---- *s++; // \r *s = 0; // terminate on the \n ! *str = apr_pstrcat(r->pool, mcd->line_buff, recv, NULL); // do we have an extra string left over? if( (recvlen-2) > strlen(recv) ) { *************** *** 224,231 **** } ! static apr_status_t mcd_get(request_rec * r, mcd_res_t* mcd, const char* key, char* value) { apr_status_t rv = APR_SUCCESS; apr_size_t sendlen; char *command; command = apr_psprintf(r->pool, "get %s\r\n", key); --- 232,241 ---- } ! static apr_status_t mcd_get(request_rec * r, mcd_res_t* mcd, const char* key, char** value) { apr_status_t rv = APR_SUCCESS; apr_size_t sendlen; + apr_size_t recvlen; char *command; + char *s = NULL; command = apr_psprintf(r->pool, "get %s\r\n", key); *************** *** 237,241 **** return rv; } ! getLine(r, mcd, command, 5000); return rv; --- 247,272 ---- return rv; } ! getLine(r, mcd, &command, 5000); ! ! s = strstr("VALUE", command); ! if (*s != NULL) { ! // VALUE foo 0 5 ! char *pstr; ! char *tok_cntx; ! pstr = command; ! pstr = apr_strtok(pstr, " ", &tok_cntx); // value ! pstr = apr_strtok(pstr, " ", &tok_cntx); // key ! pstr = apr_strtok(pstr, " ", &tok_cntx); // flags ! pstr = apr_strtok(pstr, " ", &tok_cntx); // len ! // recvlen = ! } ! else { ! s = strstr("END", command); ! if (*s != NULL) { ! *value = NULL; ! } ! } ! ! ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, "mcd_get: got line: '%s'", command); return rv; *************** *** 255,259 **** return rv; } ! getLine(r, mcd, command, 5000); return rv; --- 286,290 ---- return rv; } ! getLine(r, mcd, &command, 5000); return rv; *************** *** 356,360 **** apr_reslist_acquire(reslist_pool, (void **) &mcd); ! mcd_get(r, mcd, "foo", foo); do { --- 387,391 ---- apr_reslist_acquire(reslist_pool, (void **) &mcd); ! mcd_get(r, mcd, "foo", &foo); do { *************** *** 401,404 **** --- 432,438 ---- "NOT adding user(but auth good?): %s to cache for realm: %s!",user,ap_auth_name(r)); } + + mcd->line_buff_size = 0; + apr_reslist_release(reslist_pool, (void **) mcd); return auth_result; |
Update of /cvsroot/mod-auth/mod_authn_cache/src In directory sc8-pr-cvs1:/tmp/cvs-serv12565 Modified Files: mod_authn_cache.c Removed Files: authn_scache.c authn_scache_shmht.c authn_util_table.c authn_util_table.h Log Message: little progress. code is evil however. Index: mod_authn_cache.c =================================================================== RCS file: /cvsroot/mod-auth/mod_authn_cache/src/mod_authn_cache.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** mod_authn_cache.c 30 Dec 2003 01:13:54 -0000 1.4 --- mod_authn_cache.c 2 Jan 2004 22:59:41 -0000 1.5 *************** *** 103,106 **** --- 103,108 ---- apr_sockaddr_t *sockaddr; apr_socket_t *sock; + char* line_buff; + apr_size_t line_buff_size; } mcd_res_t; *************** *** 113,116 **** --- 115,121 ---- mcdres = apr_palloc(pool, sizeof(*mcdres)); + mcdres->line_buff = NULL; + mcdres->line_buff_size = 0; + rv = apr_sockaddr_info_get(&mcdres->sockaddr, DFLT_HOSTNAME, APR_UNSPEC, DFLT_PORT, 0, pool); if (rv != APR_SUCCESS) { *************** *** 118,122 **** return rv; } ! if (apr_socket_create(&mcdres->sock, mcdres->sockaddr->family, SOCK_STREAM, 0, pool) != APR_SUCCESS) { ap_log_perror(APLOG_MARK, APLOG_ERR, rv, pool, "apr_socket_create"); --- 123,127 ---- return rv; } ! if (apr_socket_create_ex(&mcdres->sock, mcdres->sockaddr->family, SOCK_STREAM, 0, pool) != APR_SUCCESS) { ap_log_perror(APLOG_MARK, APLOG_ERR, rv, pool, "apr_socket_create"); *************** *** 150,161 **** } ! static apr_status_t mcd_get(mcd_res_t mcd, const char* key) { ! apr_status_t rv = APR_SUCCESS; return rv; } ! static apr_status_t mcd_put(mcd_res_t mcd, const char* key) { apr_status_t rv = APR_SUCCESS; return rv; --- 155,259 ---- } ! #define RECVLEN 512 ! ! static apr_status_t getLine(request_rec * r, mcd_res_t* mcd, char *str, apr_size_t count) { ! apr_status_t rv = APR_SUCCESS; ! apr_size_t recvlen; ! char *recv = NULL; ! char *s; ! apr_size_t recv_total = 0; ! ! recvlen = RECVLEN; ! recv = apr_palloc(r->pool, RECVLEN); ! memset(recv, 0, RECVLEN); ! ! if(mcd->line_buff_size == 0) { ! mcd->line_buff = apr_palloc(r->pool, count); ! memset(mcd->line_buff, 0, count); ! } ! else { // existing line buffer ! ! } ! ! while(1){ ! rv = apr_socket_recv(mcd->sock, recv, &recvlen); ! if (rv != APR_SUCCESS) { ! ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, "getLine: apr_socket_recv"); ! return rv; ! } ! recv[recvlen] = 0; ! ! if(recvlen+recv_total > count) { ! // line is too big. ! recv[(recvlen+recv_total) - count] = 0; ! str = apr_pstrcat(r->pool, mcd->line_buff, recv, NULL); ! ! break; ! } ! // find newline! ! s = strstr(recv, "\r\n"); ! if (!s) { ! // newline not found. lets append to the buffer and try again. ! mcd->line_buff = apr_pstrcat(r->pool, mcd->line_buff, recv, NULL); ! mcd->line_buff_size += recvlen; ! continue; ! } ! else { ! // newline was found. stop at it. ! *s = 0; // terminate on the \r ! *s++; // \r ! *s = 0; // terminate on the \n ! str = apr_pstrcat(r->pool, mcd->line_buff, recv, NULL); ! // do we have an extra string left over? ! if( (recvlen-2) > strlen(recv) ) { ! *s++; // everything after the newline ! mcd->line_buff = apr_pstrcat(r->pool, recv, NULL); ! mcd->line_buff_size = strlen(recv); ! } ! else { ! // hmm ended on a newline? ! mcd->line_buff_size = 0; ! } ! break; ! } ! } ! ! // free buffers! ! ! return APR_SUCCESS; ! } ! ! static apr_status_t mcd_get(request_rec * r, mcd_res_t* mcd, const char* key, char* value) { ! apr_status_t rv = APR_SUCCESS; ! apr_size_t sendlen; ! char *command; ! ! command = apr_psprintf(r->pool, "get %s\r\n", key); ! sendlen = strlen(command); + rv = apr_socket_send(mcd->sock, command, &sendlen); + if (rv != APR_SUCCESS) { + ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, "mcd_get: apr_socket_send"); + return rv; + } + getLine(r, mcd, command, 5000); + return rv; } ! static apr_status_t mcd_set(request_rec * r, mcd_res_t* mcd, const char* key) { apr_status_t rv = APR_SUCCESS; + apr_size_t sendlen; + char *command; + + command = apr_psprintf(r->pool, "set %s\r\n", key); + sendlen = strlen(command); + + rv = apr_socket_send(mcd->sock, command, &sendlen); + if (rv != APR_SUCCESS) { + ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, "mcd_get: apr_socket_send"); + return rv; + } + getLine(r, mcd, command, 5000); return rv; *************** *** 249,253 **** { authn_status auth_result; ! authn_provider_list *current_provider; authn_cache_conf_t *conf = ap_get_module_config(r->per_dir_config, --- 347,352 ---- { authn_status auth_result; ! char* foo; ! mcd_res_t *mcd; authn_provider_list *current_provider; authn_cache_conf_t *conf = ap_get_module_config(r->per_dir_config, *************** *** 255,258 **** --- 354,360 ---- current_provider = conf->providers; + + apr_reslist_acquire(reslist_pool, (void **) &mcd); + mcd_get(r, mcd, "foo", foo); do { --- authn_scache.c DELETED --- --- authn_scache_shmht.c DELETED --- --- authn_util_table.c DELETED --- --- authn_util_table.h DELETED --- |
From: <ho...@us...> - 2004-01-01 16:34:23
|
Update of /cvsroot/mod-auth/mod_authn_dbi/src In directory sc8-pr-cvs1:/tmp/cvs-serv26989 Modified Files: mod_authn_dbi.c Log Message: forgot one change.. Index: mod_authn_dbi.c =================================================================== RCS file: /cvsroot/mod-auth/mod_authn_dbi/src/mod_authn_dbi.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** mod_authn_dbi.c 1 Jan 2004 16:29:49 -0000 1.8 --- mod_authn_dbi.c 1 Jan 2004 16:34:19 -0000 1.9 *************** *** 444,451 **** e = (r->connection->remote_ip ? r->connection->remote_ip : EMPTY_VAR); } - /* umm... *coughuglycough*... */ else if (!strcasecmp(var, "RemoteHost")) { ! e = (ap_get_remote_host(r->connection, r->per_dir_config, REMOTE_NOLOOKUP, NULL) ? ! ap_get_remote_host(r->connection, r->per_dir_config, REMOTE_NOLOOKUP, NULL) : EMPTY_VAR); } else if (!strcasecmp(var, "LocalIP")) { --- 444,450 ---- e = (r->connection->remote_ip ? r->connection->remote_ip : EMPTY_VAR); } else if (!strcasecmp(var, "RemoteHost")) { ! e = ap_get_remote_host(r->connection, r->per_dir_config, REMOTE_NOLOOKUP, NULL); ! (e?e : EMPTY_VAR); } else if (!strcasecmp(var, "LocalIP")) { |
From: <ho...@us...> - 2004-01-01 16:29:53
|
Update of /cvsroot/mod-auth/mod_authn_dbi/src In directory sc8-pr-cvs1:/tmp/cvs-serv25713 Modified Files: mod_authn_dbi.c Log Message: 3 new variables: LocalIP, RemoteIP and RemoteHost. semantics of RemoteHost may (and probably will) change soon. Index: mod_authn_dbi.c =================================================================== RCS file: /cvsroot/mod-auth/mod_authn_dbi/src/mod_authn_dbi.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** mod_authn_dbi.c 3 Nov 2003 16:03:25 -0000 1.7 --- mod_authn_dbi.c 1 Jan 2004 16:29:49 -0000 1.8 *************** *** 441,444 **** --- 441,455 ---- e = (ap_auth_name(r) ? ap_auth_name(r) : EMPTY_VAR); } + else if (!strcasecmp(var, "RemoteIP")) { + e = (r->connection->remote_ip ? r->connection->remote_ip : EMPTY_VAR); + } + /* umm... *coughuglycough*... */ + else if (!strcasecmp(var, "RemoteHost")) { + e = (ap_get_remote_host(r->connection, r->per_dir_config, REMOTE_NOLOOKUP, NULL) ? + ap_get_remote_host(r->connection, r->per_dir_config, REMOTE_NOLOOKUP, NULL) : EMPTY_VAR); + } + else if (!strcasecmp(var, "LocalIP")) { + e = (r->connection->local_ip ? r->connection->local_ip : EMPTY_VAR); + } else if (!strcasecmp(var, "ConfigHostname")) { e = (r->server->server_hostname ? r->server-> |
From: <fir...@us...> - 2003-12-31 08:31:41
|
Update of /cvsroot/mod-auth/mod_dbi_pool/src In directory sc8-pr-cvs1:/tmp/cvs-serv5710/src Added Files: mod_dbi_pool.c Log Message: initial generic dbi pooling. based on stuff by Nick Kew at: http://apache.webthing.com/ Still needs to support multiple pools to be of any use to us. NOTE: This code is currently 'infected' with the GPL. I plan to Talk to Nick about putting it under the Apache Software License --- NEW FILE: mod_dbi_pool.c --- /* XXXXX: Get Permissions from Nick Kew to Change this to Apache License * based on mod_mysql_pool Author: Paul Querna <chip force-elite.com> Copyright (c) 2003, WebThing Ltd This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* mod_dbi_pool: manage a pool of libdbi connections. EXPORTS: dbi_conn* dbipool_open(server_rec*) - retrieve a connection from the pool and check it's valid - May return null and log a message on error. void dbipool_close(server_rec*, dbi_conn*) - return a connection to the pool after use CONFIG: See the code round about line 106 */ #include <ctype.h> #include <dbi/dbi.h> #include <httpd.h> #include <http_protocol.h> #include <http_config.h> #include <http_log.h> #include <apr_reslist.h> #include <apr_strings.h> extern module AP_MODULE_DECLARE_DATA dbi_pool_module; /************ svr cfg: manage db connection pool ****************/ typedef struct svr_cfg { apr_reslist_t *dbpool; int nmin; int nkeep; int nmax; int exptime; const char *host; int port; const char *db; const char *dbi_driver; const char *user; const char *pass; } svr_cfg; typedef enum { cmd_host, cmd_port, cmd_db, cmd_dbi_driver, cmd_user, cmd_pass, cmd_min, cmd_keep, cmd_max, cmd_exp } cmd_parts; #define ISINT(val) \ for ( p = val; *p; ++p) \ if ( ! isdigit(*p) ) \ return "Argument must be numeric!" static const char *set_param(cmd_parms * cmd, void *cfg, const char *val) { const char *p; svr_cfg *svr = (svr_cfg *) ap_get_module_config (cmd->server->module_config, &dbi_pool_module); switch ((int) cmd->info) { case cmd_host: svr->host = val; break; case cmd_port: ISINT(val); svr->port = atoi(val); break; case cmd_db: svr->db = val; break; case cmd_dbi_driver: svr->dbi_driver = val; break; case cmd_user: svr->user = val; break; case cmd_pass: svr->pass = val; break; case cmd_min: ISINT(val); svr->nmin = atoi(val); break; case cmd_keep: ISINT(val); svr->nkeep = atoi(val); break; case cmd_max: ISINT(val); svr->nmax = atoi(val); break; case cmd_exp: ISINT(val); svr->exptime = atoi(val); break; } return NULL; } static const command_rec dbi_pool_cmds[] = { AP_INIT_TAKE1("DbiPoolHost", set_param, (void *) cmd_host, RSRC_CONF, "DBI Host"), AP_INIT_TAKE1("DbiPoolPort", set_param, (void *) cmd_port, RSRC_CONF, "DBI Port"), AP_INIT_TAKE1("DbiPoolDB", set_param, (void *) cmd_db, RSRC_CONF, "DBI Database"), AP_INIT_TAKE1("DbiPoolUser", set_param, (void *) cmd_user, RSRC_CONF, "DBI Username"), AP_INIT_TAKE1("DbiPoolPass", set_param, (void *) cmd_pass, RSRC_CONF, "DBI Password"), AP_INIT_TAKE1("DbiPoolMin", set_param, (void *) cmd_min, RSRC_CONF, "Minimum number of connections"), AP_INIT_TAKE1("DbiPoolKeep", set_param, (void *) cmd_keep, RSRC_CONF, "Maximum number of sustained connections"), AP_INIT_TAKE1("DbiPoolMax", set_param, (void *) cmd_max, RSRC_CONF, "Maximum number of connections"), AP_INIT_TAKE1("DbiPoolTTL", set_param, (void *) cmd_exp, RSRC_CONF, "Keepalive time for idle connections"), {NULL} }; static void *dbi_pool_cfg(apr_pool_t * p, server_rec * x) { svr_cfg *svr = (svr_cfg *) apr_pcalloc(p, sizeof(svr_cfg)); return svr; } /************ svr cfg: manage db connection pool ****************/ /* an apr_reslist_constructor for DBI connections */ static apr_status_t dbipool_construct(void **db, void *params, apr_pool_t * pool) { svr_cfg *svr = (svr_cfg *) params; int err_num = 0; const char *err_str; *db = dbi_conn_new(svr->dbi_driver); dbi_conn_set_option(*db, "host", svr->host); dbi_conn_set_option(*db, "username", svr->user); dbi_conn_set_option(*db, "password", svr->pass); dbi_conn_set_option(*db, "dbname", svr->db); if (dbi_conn_connect(*db) != 0) { err_num = dbi_conn_error(*db, &err_str); /* Connetion Failed */ ap_log_perror(APLOG_MARK, APLOG_CRIT, 0, pool, "[mod_authn_dbi.c] DBI Connection to %s://%s@%s/%s Failed. Error: (%d) %s", svr->dbi_driver, svr->user, svr->host, svr->db, err_num, err_str); return APR_EGENERAL; } return APR_SUCCESS; } static apr_status_t dbipool_destruct(void *sql, void *params, apr_pool_t * pool) { dbi_conn_close((dbi_conn *) sql); return APR_SUCCESS; } static int setup_db_pool(apr_pool_t * p, apr_pool_t * plog, apr_pool_t * ptemp, server_rec * s) { svr_cfg *svr = (svr_cfg *) ap_get_module_config(s->module_config, &dbi_pool_module); if (apr_reslist_create(&svr->dbpool, svr->nmin, svr->nkeep, svr->nmax, svr->exptime, dbipool_construct, dbipool_destruct, svr, p) != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_CRIT, 0, s, "DBIPool: failed to initialise"); return 500; } apr_pool_cleanup_register(p, svr->dbpool, (void *) apr_reslist_destroy, apr_pool_cleanup_null); return OK; } static void dbi_pool_hooks(apr_pool_t * p) { ap_hook_post_config(setup_db_pool, NULL, NULL, APR_HOOK_MIDDLE); } module AP_MODULE_DECLARE_DATA dbi_pool_module = { STANDARD20_MODULE_STUFF, NULL, NULL, dbi_pool_cfg, NULL, dbi_pool_cmds, dbi_pool_hooks }; /* Functions we export for modules to use: - open acquires a connection from the pool (opens one if necessary) - close releases it back in to the pool */ dbi_conn *dbipool_open(server_rec * s) { dbi_conn *ret = NULL; svr_cfg *svr = (svr_cfg *) ap_get_module_config(s->module_config, &dbi_pool_module); if (apr_reslist_acquire(svr->dbpool, (void **) &ret) != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, "Failed to acquire DBI connection from pool!"); return NULL; } return ret; } void dbipool_close(server_rec * s, dbi_conn * sql) { svr_cfg *svr = (svr_cfg *) ap_get_module_config(s->module_config, &dbi_pool_module); apr_reslist_release(svr->dbpool, sql); } |
From: <fir...@us...> - 2003-12-31 08:29:05
|
Update of /cvsroot/mod-auth/mod_dbi_pool/src In directory sc8-pr-cvs1:/tmp/cvs-serv5665/mod_dbi_pool/src Log Message: Directory /cvsroot/mod-auth/mod_dbi_pool/src added to the repository |
From: <fir...@us...> - 2003-12-31 08:28:57
|
Update of /cvsroot/mod-auth/mod_dbi_pool In directory sc8-pr-cvs1:/tmp/cvs-serv5640/mod_dbi_pool Log Message: Directory /cvsroot/mod-auth/mod_dbi_pool added to the repository |
From: <fir...@us...> - 2003-12-31 05:36:17
|
Update of /cvsroot/mod-auth/mod_authn_dbi In directory sc8-pr-cvs1:/tmp/cvs-serv14406 Modified Files: TODO Log Message: added lots of plans, some are beyond the scope of just authn_dbi Index: TODO =================================================================== RCS file: /cvsroot/mod-auth/mod_authn_dbi/TODO,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TODO 27 Oct 2003 05:20:34 -0000 1.3 --- TODO 31 Dec 2003 05:36:13 -0000 1.4 *************** *** 3,7 **** + = Complete ! 0.0.7 ? Create automake/configure scripts ! ? Merge in Changes from Axel Grossklaus ! + Move to new configuration system --- 3,57 ---- + = Complete ! ----- Upcoming Versions: ! ! 1.0.0 ! - Testimonials / Who is using it - put it on the website? ! - Some Sort of Official Security Audit ! - Benchmarks? ! - vs File, DBM and No Authentication? ! - High Load Throughput? ! - with mod_authn_cache? ! - Classic MySQL, PgSQL, SQLite.. etc? ! - Create Patches to use 2.1 Authentication on 2.0.XX Releases? ! - Update Documentation (README Specificly needs to be reworked) ! - Test on all supported libdbi databases. ! - Test on 32bit, 64bit, little/big endian machines (might be a little exterme) ! - Linux x86 ! - FreeBSD 5 x86 [chip] ! - Linux SPARC [chip] ! - AMD64? ! - Linux MIPS [chip] ! - PPC? ! - Create Binary Releases (rpm and deb?) ! * For now perhaps just create /debian/ and RPM .specs files, ! pending a 2.1/2.2 -release of Apache? ! - Get into Package Systems: (post 1.0?) ! * requires httpd 2.1 or 2.2 -release? ! - Debian ! - FreeBSD ! - Gentoo ! - Lunar ! ! 0.9.0 ! - Include HTML/XML Documentation in Releases? ! - Bigger Files... ! - Use APXS for Makefiles [chip] ! - Remove extra files from CVS (autoconf/make stuff we don't need) [chip] ! - Have external people look for security issues (Prep for 1.0) ! - Create "security-issues" contact address (for whole auth project?) ! - Mangle usernames [axel] ! - More SQL Variables [axel] ! - Support mod_dbi_pool [chip?] ! - Merge In Cyan changes to Mainline? [chip] ! * These Officaly Might break how the Digest RFC Works... ! - Send Announcements: ! - SourceForge ! - FreshMeat [chip] ! - modules.apache.org [chip] ! - Other? ! ! ----- Released Versions: ! ! 0.0.7 + Create automake/configure scripts [chip] ! + Merge in Changes from Axel Grossklaus [axel] ! + Move to new configuration system [chip] |
From: <fir...@us...> - 2003-12-30 01:13:58
|
Update of /cvsroot/mod-auth/mod_authn_cache/src In directory sc8-pr-cvs1:/tmp/cvs-serv24798 Modified Files: mod_authn_cache.c Log Message: working on memcached version Index: mod_authn_cache.c =================================================================== RCS file: /cvsroot/mod-auth/mod_authn_cache/src/mod_authn_cache.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** mod_authn_cache.c 17 Nov 2003 04:07:37 -0000 1.3 --- mod_authn_cache.c 30 Dec 2003 01:13:54 -0000 1.4 *************** *** 85,96 **** #include "util_md5.h" ! #if !APR_HAS_SHARED_MEMORY ! #error Shared Memory is required to use authn_cache ! #endif ! #include "util_authn_cache.h" module AP_MODULE_DECLARE_DATA authn_cache_module; typedef struct authn_cache_conf_t { authn_provider_list *providers; --- 85,166 ---- #include "util_md5.h" ! #define DFLT_HOSTNAME "localhost" ! #define DFLT_PORT (8008) ! #define DFLT_CONN_MIN (1) ! #define DFLT_CONN_SOFT (5) ! #define DFLT_CONN_MAX (25) ! #define DFLT_CONN_TTL (600) ! #define DFLT_TIMEOUT (6) ! #define DFLT_OPTIONS (0) ! static int mcd_conn_count = 0; ! static apr_reslist_t *reslist_pool; module AP_MODULE_DECLARE_DATA authn_cache_module; + typedef struct mcd_rest_struct + { + apr_sockaddr_t *sockaddr; + apr_socket_t *sock; + } mcd_res_t; + + + static apr_status_t mcd_new_conn(void **resource, void *params, apr_pool_t * pool) + { + apr_status_t rv = APR_SUCCESS; + mcd_res_t *mcdres; + + mcdres = apr_palloc(pool, sizeof(*mcdres)); + + rv = apr_sockaddr_info_get(&mcdres->sockaddr, DFLT_HOSTNAME, APR_UNSPEC, DFLT_PORT, 0, pool); + if (rv != APR_SUCCESS) { + ap_log_perror(APLOG_MARK, APLOG_ERR, rv, pool, "apr_sockaddr_info_get"); + return rv; + } + if (apr_socket_create(&mcdres->sock, mcdres->sockaddr->family, SOCK_STREAM, 0, + pool) != APR_SUCCESS) { + ap_log_perror(APLOG_MARK, APLOG_ERR, rv, pool, "apr_socket_create"); + return rv; + } + + rv = apr_socket_timeout_set(mcdres->sock, DFLT_TIMEOUT); + if (rv != APR_SUCCESS) { + ap_log_perror(APLOG_MARK, APLOG_ERR, rv, pool, "apr_socket_timeout_set"); + return rv; + } + + rv = apr_socket_connect(mcdres->sock, mcdres->sockaddr); + if (rv != APR_SUCCESS) { + ap_log_perror(APLOG_MARK, APLOG_ERR, rv, pool, "apr_socket_connect"); + return rv; + } + + *resource = mcdres; + return rv; + } + + static apr_status_t mcd_kill_conn(void *resource, void *params, apr_pool_t * pool) + { + apr_status_t rv = APR_SUCCESS; + mcd_res_t *mcd = resource; + + rv = apr_socket_close(mcd->sock); + + return rv; + } + + static apr_status_t mcd_get(mcd_res_t mcd, const char* key) { + apr_status_t rv = APR_SUCCESS; + + return rv; + } + + static apr_status_t mcd_put(mcd_res_t mcd, const char* key) { + apr_status_t rv = APR_SUCCESS; + + return rv; + } + + typedef struct authn_cache_conf_t { authn_provider_list *providers; *************** *** 111,128 **** - static void *create_authn_cache_config(apr_pool_t *p, server_rec *s) - { - util_cache_state_t *st; - st = (util_cache_state_t *) apr_pcalloc(p, sizeof(util_cache_state_t)); - if (st == NULL) { - return NULL; - } - - st->pool = p; - st->cache_bytes = 100000; - st->cache_size = 1000; - return st; - } - static const char *add_authn_provider(cmd_parms *cmd, void *config, const char *arg) --- 181,184 ---- *************** *** 178,203 **** } - static const char *util_authn_set_cache_file(cmd_parms *cmd, void *dummy, const char *file) - { - util_cache_state_t *st = - (util_cache_state_t *)ap_get_module_config(cmd->server->module_config, - &authn_cache_module); - - if (file) { - st->cache_file = ap_server_root_relative(st->pool, file); - } - else { - st->cache_file = NULL; - } - - ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, cmd->server, - "AuthnCache: Setting shared memory cache file to '%s'", - st->cache_file); - - return NULL; - } - - - static const command_rec authn_cache_cmds[] = { /* per auth section */ --- 234,237 ---- *************** *** 205,212 **** "The name of the configuration to use for this section"), /* global config */ - AP_INIT_TAKE1("AuthnCacheSharedCacheFile", util_authn_set_cache_file, NULL, RSRC_CONF, - "Sets the file of the shared memory cache." - "Nothing means disable the shared memory cache."), - {NULL} --- 239,242 ---- *************** *** 219,269 **** { authn_status auth_result; ! util_authn_any_node_t newnode; ! util_authn_any_node_t *node = NULL; ! util_authn_vhost_node_t *curl = NULL; ! util_authn_vhost_node_t curnode; authn_provider_list *current_provider; authn_cache_conf_t *conf = ap_get_module_config(r->per_dir_config, &authn_cache_module); - util_cache_state_t *st = ap_get_module_config(r->server->module_config, - &authn_cache_module); - - AUTHN_CACHE_RDLOCK(); - curnode.vhost = r->server->server_hostname; - - if(st->util_authn_cache_d == NULL) - { - util_authn_cache_init(st->pool, st); - ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, - "creating a new util_authn_cache_d!"); - } - - curl = (util_authn_vhost_node_t* )util_authn_fetch(st->util_authn_cache_d, &curnode); - if (curl == NULL) { - curl = util_authn_create_caches(st, curnode.vhost); - ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, - "creating new cache on vhost: %s cache: 0x%08x", r->server->server_hostname,curl); - } - else - { - ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, - "existing cache on vhost: %s! cache: 0x%08x", r->server->server_hostname,curl); - } - newnode.username = user; - newnode.realm = ap_auth_name(r); - ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, - "checking cache for username: %s in realm: %s on vhost: %s cache: 0x%08x node: 0x%08x", newnode.username, newnode.realm, r->server->server_hostname, curl->auth_cache, node); - node = util_authn_fetch(curl->auth_cache, &newnode); - if (node != NULL) { - AUTHN_CACHE_UNLOCK(); - ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, - "used cached auth!"); - return AUTH_GRANTED; - } - ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, - "NOT used cached auth! node: 0x%08x newnode.user:%s newnode.realm:%s",node,newnode.username,newnode.realm); - AUTHN_CACHE_UNLOCK(); - current_provider = conf->providers; --- 249,257 ---- { authn_status auth_result; ! authn_provider_list *current_provider; authn_cache_conf_t *conf = ap_get_module_config(r->per_dir_config, &authn_cache_module); current_provider = conf->providers; *************** *** 305,321 **** if(auth_result == AUTH_GRANTED) { ! ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, ! "adding user: %s to cache for realm: %s cache: 0x%08x auth cache: 0x%08x",user,ap_auth_name(r), curl, curl->auth_cache); ! // add to cache ! AUTHN_CACHE_WRLOCK(); ! newnode.username = user; ! newnode.realm = ap_auth_name(r); ! util_authn_insert(curl->auth_cache, &newnode); ! AUTHN_CACHE_UNLOCK(); ! } ! else { ! ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, ! "NOT adding user(but auth good?): %s to cache for realm: %s!",user,ap_auth_name(r)); ! } return auth_result; --- 293,302 ---- if(auth_result == AUTH_GRANTED) { ! ! } ! else { ! ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, ! "NOT adding user(but auth good?): %s to cache for realm: %s!",user,ap_auth_name(r)); ! } return auth_result; *************** *** 328,375 **** return AUTH_USER_NOT_FOUND; } static int init_authn_cache(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s) { ! char buf[MAX_STRING_LEN]; ! apr_status_t result; ! ! util_cache_state_t *st = (util_cache_state_t *)ap_get_module_config(s->module_config, &authn_cache_module); ! ! ! st->pool = p; ! #if APR_HAS_SHARED_MEMORY ! server_rec *s_vhost; ! util_cache_state_t *st_vhost; ! ! /* initializing cache if file is here and we already don't have shm addr*/ ! if (st->cache_file && !st->cache_shm) { ! #endif ! AUTHN_CACHE_LOCK_CREATE(p); ! result = util_authn_cache_init(p, st); ! apr_strerror(result, buf, sizeof(buf)); ! ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, result, s, ! "AuthnCache init: %s", buf); ! #if APR_HAS_SHARED_MEMORY ! /* merge config in all vhost */ ! s_vhost = s->next; ! while (s_vhost) { ! ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, result, s, ! "Authn merging Shared Cache conf: shm=0x%x rmm=0x%x for VHOST: %s", ! st->cache_shm, st->cache_rmm, s_vhost->server_hostname); ! st_vhost = (util_cache_state_t *)ap_get_module_config(s_vhost->module_config, &authn_cache_module); ! st_vhost->cache_shm = st->cache_shm; ! st_vhost->cache_rmm = st->cache_rmm; ! st_vhost->cache_file = st->cache_file; ! s_vhost = s_vhost->next; ! } ! } ! else { ! ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0 , s, "AuthnCache: Unable to init Shared Cache: no file"); ! } ! #endif return 0; --- 309,346 ---- return AUTH_USER_NOT_FOUND; } + static apr_status_t kill_mcd(void *p) + { + apr_status_t rv = APR_SUCCESS; + apr_reslist_destroy(reslist_pool); + return rv; + } static int init_authn_cache(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s) { + apr_status_t rv; ! void *data; ! const char *userdata_key = "mod_authn_dbi_init"; ! ! apr_pool_userdata_get(&data, userdata_key, s->process->pool); ! ! if (!data) { ! apr_pool_userdata_set((const void *) 1, userdata_key, ! apr_pool_cleanup_null, s->process->pool); ! return OK; ! } ! apr_reslist_create(&reslist_pool, DFLT_CONN_MIN, /* hard minimum */ ! DFLT_CONN_SOFT, /* soft maximum */ ! DFLT_CONN_MAX, /* hard maximum */ ! DFLT_CONN_TTL, /* Time to live -- mcd server might override/disconnect! */ ! mcd_new_conn, /* Make a New Connection */ ! mcd_kill_conn, /* Kill Old Connection */ ! (void *) NULL, p); ! apr_pool_cleanup_register(p, p, kill_mcd, apr_pool_cleanup_null); ! ! ap_add_version_component(p, "mod_authn_cache_mcd/0.1"); return 0; *************** *** 385,427 **** { ap_hook_post_config(init_authn_cache, NULL, NULL, APR_HOOK_MIDDLE); ! ap_register_provider(p, AUTHN_PROVIDER_GROUP, "cache", "0", &authn_cache_provider); } - int authn_mutex_on(server_rec *s) - { - SSLModConfigRec *mc = myModConfig(s); - apr_status_t rv; - - if (mc->nMutexMode == SSL_MUTEXMODE_NONE) - return TRUE; - if ((rv = apr_global_mutex_lock(mc->pMutex)) != APR_SUCCESS) { - ap_log_error(APLOG_MARK, APLOG_WARNING, rv, s, - "Failed to acquire global mutex lock"); - return FALSE; - } - return TRUE; - } - - int authn_mutex_off(server_rec *s) - { - SSLModConfigRec *mc = myModConfig(s); - apr_status_t rv; - - if (mc->nMutexMode == SSL_MUTEXMODE_NONE) - return TRUE; - if ((rv = apr_global_mutex_unlock(mc->pMutex)) != APR_SUCCESS) { - ap_log_error(APLOG_MARK, APLOG_WARNING, rv, s, - "Failed to release global mutex lock"); - return FALSE; - } - return TRUE; - } - module AP_MODULE_DECLARE_DATA authn_cache_module = { STANDARD20_MODULE_STUFF, ! create_authn_cache_dconfig, /* dir config creater */ NULL, /* dir merger --- default is to override */ ! create_authn_cache_config, /* server config creator */ NULL, /* merge server config */ authn_cache_cmds, /* command apr_table_t */ --- 356,368 ---- { ap_hook_post_config(init_authn_cache, NULL, NULL, APR_HOOK_MIDDLE); ! ap_register_provider(p, AUTHN_PROVIDER_GROUP, "cache_mcd", "0", &authn_cache_provider); } module AP_MODULE_DECLARE_DATA authn_cache_module = { STANDARD20_MODULE_STUFF, ! create_authn_cache_dconfig, /* dir config creater */ NULL, /* dir merger --- default is to override */ ! NULL, /* server config creator */ NULL, /* merge server config */ authn_cache_cmds, /* command apr_table_t */ |
From: <ho...@us...> - 2003-12-28 23:21:52
|
Update of /cvsroot/mod-auth/mod_auth_webspace/htdocs/docs/mod_authn_dbi In directory sc8-pr-cvs1:/tmp/cvs-serv29551 Modified Files: index.xml Log Message: just an note that SHA1 support will move into apr_password_validate() Index: index.xml =================================================================== RCS file: /cvsroot/mod-auth/mod_auth_webspace/htdocs/docs/mod_authn_dbi/index.xml,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** index.xml 26 Dec 2003 00:11:28 -0000 1.10 --- index.xml 28 Dec 2003 23:21:48 -0000 1.11 *************** *** 627,631 **** <p> Passwords are in a format that can be handled ! by the apr_password_validate function of the libapr-util library, which is part of the apache project and comes bundled with the releases of --- 627,631 ---- <p> Passwords are in a format that can be handled ! by the <code>apr_password_validate()</code> function of the libapr-util library, which is part of the apache project and comes bundled with the releases of *************** *** 649,653 **** </p> </li> ! <li><code>AprSHA1</code> <p> Passwords are in the SHA1 format of libapr-util, --- 649,653 ---- </p> </li> ! <li><code>AprSHA1</code> (this option will disappear very soon when libapr-util also handles SHA1 in <code>apr_password_validate()</code>, just use <code>Apr</code> then) <p> Passwords are in the SHA1 format of libapr-util, |
From: <ho...@us...> - 2003-12-26 00:11:32
|
Update of /cvsroot/mod-auth/mod_auth_webspace/htdocs/docs/mod_authn_dbi In directory sc8-pr-cvs1:/tmp/cvs-serv22259 Modified Files: index.xml Log Message: keep on doccin'.... :-} Index: index.xml =================================================================== RCS file: /cvsroot/mod-auth/mod_auth_webspace/htdocs/docs/mod_authn_dbi/index.xml,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** index.xml 1 Dec 2003 22:07:16 -0000 1.9 --- index.xml 26 Dec 2003 00:11:28 -0000 1.10 *************** *** 190,195 **** <code>AuthnDbiTable Server1 MyDatabaseTable</code> <br /><br /> ! This says that the config with the name "Server1" should use ! the table "MyDatabaseTable" instead of the default "AuthDB", you get the idea... </p> --- 190,195 ---- <code>AuthnDbiTable Server1 MyDatabaseTable</code> <br /><br /> ! This says that the config with the name "<code>Server1</code>" should use ! the table "<code>MyDatabaseTable</code>" instead of the default "<code>AuthDB</code>", you get the idea... </p> *************** *** 250,254 **** orthogonality in the configuration. There is not much (up-to-date) documentation at the moment. There is documentation about <code><a ! href="http://httpd.apache.org/docs-2.1/mod/mod_auth_basic.html">mod_auth_basic</a></code> and <code><a href="http://httpd.apache.org/docs-2.1/mod/mod_auth_digest.html">mod_auth_digest</a></code> the two main parts of the authentication part ("<code>authn</code>") of the framework . Refer to the slides of the talk at the O'Reilly Open Source conference --- 250,254 ---- orthogonality in the configuration. There is not much (up-to-date) documentation at the moment. There is documentation about <code><a ! href="http://httpd.apache.org/docs-2.1/mod/mod_auth_basic.html">mod_auth_basic</a></code> and <code><a href="http://httpd.apache.org/docs-2.1/mod/mod_auth_digest.html">mod_auth_digest</a></code>, the two main parts of the authentication part ("<code>authn</code>") of the framework. Refer to the slides of the talk at the O'Reilly Open Source conference *************** *** 349,352 **** --- 349,356 ---- </b> </p> + <p> + If you have done something nifty with <code>mode_authn_dbi</code> we + would appreciate it if you contributed it as an example for this section.... + </p> </section> *************** *** 368,372 **** When a client request comes in that needs to be Authenticated, a database connection is requested from the connection pool of the matching ! configuration set. The connection is used for autentication and then released back into the pool of idle connections. If no idle connection is available and the number of connections in the pool has not reached its --- 372,376 ---- When a client request comes in that needs to be Authenticated, a database connection is requested from the connection pool of the matching ! configuration set. The connection is used for authentication and then released back into the pool of idle connections. If no idle connection is available and the number of connections in the pool has not reached its *************** *** 383,387 **** These four directives can be used to control the various limits: <ul> ! <li><code><a href="#AuthnDbiConnMin">AuthnDbiConnMin</a></code>- The minimum (and initial) number of connections.</li> <li><code><a href="#AuthnDbiConnSoftMax">AuthnDbiConnSoftMax</a></code> - --- 387,391 ---- These four directives can be used to control the various limits: <ul> ! <li><code><a href="#AuthnDbiConnMin">AuthnDbiConnMin</a></code> - The minimum (and initial) number of connections.</li> <li><code><a href="#AuthnDbiConnSoftMax">AuthnDbiConnSoftMax</a></code> - *************** *** 592,596 **** </table> This list of variables is just what looked useful at the time of ! coding. Others will be added if requested. </p> </usage> --- 596,601 ---- </table> This list of variables is just what looked useful at the time of ! coding. Others will be added <em>if</em> requested (yes, that means <em>you</em> ! have to <b>give us feedback</b> about what <em>you</em> would like to be able to to with <code>mod_authn_dbi</code>!). </p> </usage> *************** *** 633,640 **** by <code>htdigest</code>. <br /><br /> ! An example password in crypt format would be: <code>O8D24p2LCO7PA</code> <br /><br /> ! An example password in md5 format would be: <code>$apr1$SvzPV/..$CJl3oQ/ko4Tq5eg6L2Fk..</code><br /><br /> --- 638,645 ---- by <code>htdigest</code>. <br /><br /> ! An example password in crypt format: <code>O8D24p2LCO7PA</code> <br /><br /> ! An example password in md5 format: <code>$apr1$SvzPV/..$CJl3oQ/ko4Tq5eg6L2Fk..</code><br /><br /> *************** *** 649,653 **** again like they are used by <code>htpasswd</code>. <br /><br /> ! An example password in SHA1 format would be: <code>sha1:{SHA}C+7Hteo/D9vJXQ3UfzxbwnXaijM=</code> <br /><br /> --- 654,658 ---- again like they are used by <code>htpasswd</code>. <br /><br /> ! An example password in SHA1 format: <code>sha1:{SHA}C+7Hteo/D9vJXQ3UfzxbwnXaijM=</code> <br /><br /> *************** *** 660,664 **** <br /><br /> ! An example for a password in Digest format would be: <code>90b9659ffec980fdfd41f14c31a07887</code> <br /><br /> --- 665,669 ---- <br /><br /> ! An example for a password in Digest format: <code>90b9659ffec980fdfd41f14c31a07887</code> <br /><br /> *************** *** 683,687 **** <usage> <p> ! The name of the table that will be used. </p> </usage> --- 688,692 ---- <usage> <p> ! The name of the table in the database that will be used. </p> </usage> *************** *** 753,759 **** </contextlist> <usage> ! <p> See section "<a ! href="#pooling">Pooling of database connections</a>" for now. More info follows soon. </p> </usage> --- 758,768 ---- </contextlist> <usage> ! <p>The minimum number of connections to the database server that ! <code>mod_authn_dbi</code> will maintain for this configuration ! set. This is also the number of connections that ! <code>mod_authn_dbi</code> will create on start-up for the given ! configuration set. See section "<a ! href="#pooling">Pooling of database connections</a>" for more information. </p> </usage> *************** *** 770,776 **** </contextlist> <usage> ! <p> See section "<a ! href="#pooling">Pooling of database connections</a>" for now. More info follows soon. </p> </usage> --- 779,789 ---- </contextlist> <usage> ! <p>The soft maximum number of connections to the database server that ! <code>mod_authn_dbi</code> will maintain for this configuration ! set. Idle connections above this limit will be closed after the time ! set by <code><a href="#AuthnDbiConnTTL">AuthnDbiConnTTL</a></code> has ! expired for them. See section "<a ! href="#pooling">Pooling of database connections</a>" for more information. </p> </usage> *************** *** 787,793 **** </contextlist> <usage> ! <p> See section "<a ! href="#pooling">Pooling of database connections</a>" for now. More info follows soon. </p> </usage> --- 800,807 ---- </contextlist> <usage> ! <p>This is the absolute maximum number of connections that ! <code>mod_authn_dbi</code> will open for this configuration set. See section "<a ! href="#pooling">Pooling of database connections</a>" for more information. </p> </usage> *************** *** 796,800 **** <directivesynopsis> <name>AuthnDbiConnTTL</name> ! <description>The database pool time to live for each connection.</description> <syntax>AuthnDbiConnTTL <var>DbiConfigName</var> <var>seconds</var></syntax> --- 810,814 ---- <directivesynopsis> <name>AuthnDbiConnTTL</name> ! <description>The database pool time-to-live for each connection.</description> <syntax>AuthnDbiConnTTL <var>DbiConfigName</var> <var>seconds</var></syntax> *************** *** 804,810 **** </contextlist> <usage> ! <p> See section "<a ! href="#pooling">Pooling of database connections</a>" for now. More info follows soon. </p> </usage> --- 818,825 ---- </contextlist> <usage> ! <p>This gives the time in seconds after which idle connections above the ! soft limit will be closed. See section "<a ! href="#pooling">Pooling of database connections</a>" for more information. </p> </usage> *************** *** 822,826 **** This directive gives a list of options to control the behaviour of a dbi-configuration. At the moment, only one option can be given. More ! might follow later. <table> --- 837,842 ---- This directive gives a list of options to control the behaviour of a dbi-configuration. At the moment, only one option can be given. More ! might follow later. Give us feedback about what you would like to see ! added here. <table> *************** *** 849,854 **** <p> This option invokes a configuration that was created with the other ! configuration directives. It is the only directive that may appear in a ! Directory/Location context or <code>.htaccess</code> file. <example> <pre> --- 865,870 ---- <p> This option invokes a configuration that was created with the other ! configuration directives. <b>It is the only directive that may appear in a ! Directory/Location context or <code>.htaccess</code> file!</b> <example> <pre> |
From: <ho...@us...> - 2003-12-02 03:57:01
|
Update of /cvsroot/mod-auth/mod_auth_webspace/htdocs/docs/mod_authn_dbi In directory sc8-pr-cvs1:/tmp/cvs-serv7044 Modified Files: index.xml Log Message: some more documentation on how to configure and use mod_authn_dbi Index: index.xml =================================================================== RCS file: /cvsroot/mod-auth/mod_auth_webspace/htdocs/docs/mod_authn_dbi/index.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** index.xml 24 Nov 2003 23:15:22 -0000 1.8 --- index.xml 1 Dec 2003 22:07:16 -0000 1.9 *************** *** 28,32 **** </p> <p> ! <code>mod_authn_dbi</code> is quite flexible and offers several levels of customization. This makes it easy to integrate it into existing installations and authenticate users without having to alter the --- 28,32 ---- </p> <p> ! <code>mod_authn_dbi</code> is <em>very flexible</em> and offers several levels of customization. This makes it easy to integrate it into existing installations and authenticate users without having to alter the *************** *** 107,172 **** /><br /> to your <code>httpd.conf</code> as usual and restart Apache. - </p> - - </section> - <section id="overview"> - <title>An overview of mod_authn_dbi</title> - <p><b>in progress....</b></p> - <p> - The configuration of <code>mod_authn_dbi</code> consists of two main - parts. First, you configure one or more configuration sets. Second, you use - these configuration sets in any number of basic or digest authentication realms. </p> <p> ! <h3>Configuration sets</h3> ! Most configuration directives of <code>mod_authn_dbi</code> are of the ! format<br /><br /> ! <code>DirectiveName <name> <value></code> ! <br /><br /> ! Configuration sets are implicitely created each time you specify a ! <code><name></code> that has not been used before. All directives that are not ! specified for a given configuration set remain at their default ! values. So the minimum to create a usable configuration set is just one ! of the directives.<br /> ! Configuration sets contain all the information needed to connect to the ! database server, choose the correct database and table and extract the ! values needed for authenticating users. Additionally, you can specify ! options that for example influence the pooling of connections (see below) ! or the way that the data in the table is interpreted. ! ! <example> ! <title>An example configuration set</title> ! <pre> ! AuthnDbiDriver Server1 mysql ! AuthnDbiHost Server1 mycoolcatserver.com ! AuthnDbiUsername Server1 MyUser ! AuthnDbiPassword Server1 MyPass ! AuthnDbiName Server1 MyDatabaseName ! AuthnDbiTable Server1 MyDatabaseTable ! AuthnDbiUsernameField Server1 theUserNameField ! AuthnDbiPasswordField Server1 PasswordField ! AuthnDbiIsActiveField Server1 IsActiveField ! AuthnDbiConnMin Server1 3 ! AuthnDbiConnSoftMax Server1 12 ! AuthnDbiConnHardMax Server1 20 ! AuthnDbiConnTTL Server1 600 ! </pre> ! </example> ! </p> ! <p> ! <h3>Authentication realms</h3> ! <example> ! <title>An example authentication realm</title> ! <pre> ! <Directory "/path/to/htdocs/to/be/area_1_protected"> ! AuthType Basic ! AuthName "basic authn_dbi testing area" ! AuthBasicProvider dbi ! AuthnDbiServerConfig Server1 ! Require valid-user ! </Directory> ! </pre> ! </example> ! </p> </section> <section id="db"> --- 107,120 ---- /><br /> to your <code>httpd.conf</code> as usual and restart Apache. </p> <p> ! Upon startup, <code>mod_authn_dbi</code> will read in all drivers that ! are in the driver directory of <code>libdbi</code>. This directory is a ! default vaule compiled into <code>libdbi</code> (usually ! <em><installation prefix of libdbi></em><code>/lib/dbd/</code>). If ! you want <code>mod_authn_dbi</code> to look into a different directory, ! have a look at the <a ! href="#authndbidriverdir"><code>AuthnDbiDriverDir</code></a> directive. ! </p> </section> <section id="db"> *************** *** 221,245 **** <section id="basic"> <title>Basic configuration of mod_authn_dbi</title> ! <p><b>Draft...</b></p> ! <p> ! At the moment, there is only one global option (AuthnDbiDriverDir), ! which you will probably not need at first, so we will start with the ! section about mod_authn_dbi server configs. ! All options that are used for the creation of server configs take ! the name of the server config as first parameter and then some ! value(s) behind that. Server configs are created implicitly, each ! time the module encounters a configuration directive with a config ! name that it has not seen yet. ! To quote from the example above: ! AuthnDbiTable Server1 MyDatabaseTable - This says that the config with the name "Server1" should use - the table "MyDatabaseTable" instead of the default "AuthDB", - you get the idea... - </p> </section> --- 169,337 ---- <section id="basic"> <title>Basic configuration of mod_authn_dbi</title> ! <p> ! The configuration of <code>mod_authn_dbi</code> consists of two main ! parts. First, you configure one or more configuration sets. Then, you use ! these configuration sets in any number of basic or digest authentication realms. ! </p> ! <p> ! At the moment, there is only one global option (<code>AuthnDbiDriverDir</code>), ! which you will probably not need at first, so we will start with the ! section about mod_authn_dbi server configs. ! ! All options that are used for the creation of server configs take ! the name of the server config as first parameter and then some ! value(s) behind that. Server configs are created implicitly, each ! time the module encounters a configuration directive with a config ! name that it has not seen yet.<br /><br /> ! ! For example:<br /><br /> ! ! <code>AuthnDbiTable Server1 MyDatabaseTable</code> ! <br /><br /> ! This says that the config with the name "Server1" should use ! the table "MyDatabaseTable" instead of the default "AuthDB", ! you get the idea... ! </p> ! + <p> + <h3>Creating Configuration sets</h3> + Most configuration directives of <code>mod_authn_dbi</code> are of the + format<br /><br /> + <code>DirectiveName <name> <value></code> + <br /><br /> + Configuration sets are implicitely created each time you specify a + <code><name></code> that has not been used before (so beware of + typos in the sets name). There is no enclosing syntactic structure around + the directives and directives of different sets may be mixed, but it is + probably best to keep all directives of one set together like in the + example below. All directives that are not + specified for a given configuration set remain at their default + values. So the minimum to create a usable configuration set is just one + of the directives.<br /> + Configuration sets contain all the information needed to connect to the + database server, choose the correct database and table and extract the + values needed for authenticating users. Additionally, you can specify + options that for example influence the pooling of connections (see below) + or the way that the data in the table is interpreted. + + <example> + <title>An example configuration set</title> + <pre> + AuthnDbiDriver Server1 mysql + AuthnDbiHost Server1 mycoolcatserver.com + AuthnDbiUsername Server1 MyUser + AuthnDbiPassword Server1 MyPass + AuthnDbiName Server1 MyDatabaseName + AuthnDbiTable Server1 MyDatabaseTable + AuthnDbiUsernameField Server1 theUserNameField + AuthnDbiPasswordField Server1 PasswordField + AuthnDbiIsActiveField Server1 IsActiveField + AuthnDbiConnMin Server1 3 + AuthnDbiConnSoftMax Server1 12 + AuthnDbiConnHardMax Server1 20 + AuthnDbiConnTTL Server1 600 + </pre> + </example> + Configuration sets can only be defined in the main Apache configuration + file or one that is included into it. Specifying configuration sets in a + <code>.htaccess</code> files is <em>not</em> supported at the moment, + altough it might be added in a future release. If this is a feature you + would like to see, e.g. to provide hosting users with a possibility to use + their own database for authentication, then tell us so on the + "mod-auth-devel" mailinglist. + </p> + <p> + <h3>Defining Authentication realms</h3> + The authentication of users has changed a lot between versions 1.x/2.0 and + 2.1 of Apache. An AAA framework (Authentication, Authorization, + Access-Control) has been introduced that allows for more flexibility and + orthogonality in the configuration. There is not much (up-to-date) documentation at the moment. + There is documentation about <code><a + href="http://httpd.apache.org/docs-2.1/mod/mod_auth_basic.html">mod_auth_basic</a></code> and <code><a href="http://httpd.apache.org/docs-2.1/mod/mod_auth_digest.html">mod_auth_digest</a></code> the two main parts of the authentication part ("<code>authn</code>") of the framework . + + Refer to the slides of the talk at the O'Reilly Open Source conference + by Justin Erenkrantz "<a + href="http://www.erenkrantz.com/oscon/">Authentication in Apache HTTP + Server 2.1</a>" for some additional information about the new + framework. More documentation will be available on this site Real Soon Now[tm]. + The an updated version of the official authentication tutorial will be available in the manual + section "<a + href="http://httpd.apache.org/docs-2.1/howto/auth.html">Authentication, + Authorization and Access + Control</a>", but at the moment, that page still documents the old + system from 2.0 and earlier. + <br /><br /> + </p> + <p> + <code>mod_authn_dbi</code> registers itself as an Authentication + Provider with the name "<code>dbi</code>" in Apache's Authentication + Framework. It provides authenticating users with both Basic and Digest + Authentication. Basic Authentication is by far the more common one, but + you might want to consider Digest Authentication as well, since it is + more secure than Basic Authentication and supported by all major + browsers. To the user, both will look the same, i.e. appear as a dialog + box requesting username and password. The two mechanisms just differ in + the way data is exchanged in the background between browser and + webserver. + <br /> + </p> + <p> + To use a configuration set (in one of Apaches central configuration files), you will need the + <code><a href="#authndbiserverconfig">AuthnDbiServerConfig</a></code> directive from + <code>mod_authn_dbi</code> plus at least <code>AuthType</code>, + <code><a + href="http://httpd.apache.org/docs-2.1/mod/mod_auth_digest.html#authdigestprovider">AuthDigestProvider</a></code> or <code><a + href="http://httpd.apache.org/docs-2.1/mod/mod_auth_basic.html#authbasicprovider">AuthBasicProvider</a></code> + (depending on the value you pass to <code><a + href="http://httpd.apache.org/docs-2.1/mod/core.html#authtype">AuthType</a></code>) and + <code><a href="http://httpd.apache.org/docs-2.1/mod/core.html#require">Require</a></code> and a <a + href="http://httpd.apache.org/docs-2.1/sections.html">directory-level + container</a> like <code><Location></code> or + <code><Directory></code> to use them in. + </p> + <p> + First, decide wheter to use Basic or Digest Authentication and set + <code><a + href="http://httpd.apache.org/docs-2.1/mod/core.html#authtype">AuthType</a></code> to <code>Digest</code> or <code>Basic</code> accordingly. + Then, set the matching provider directive (<code><a + href="http://httpd.apache.org/docs-2.1/mod/mod_auth_digest.html#authdigestprovider">AuthDigestProvider</a></code> or <code><a + href="http://httpd.apache.org/docs-2.1/mod/mod_auth_basic.html#authbasicprovider">AuthBasicProvider</a></code>) to "<code>dbi</code>", this links <code>mod_authn_dbi</code> to this authentication section. Next, you need to tell <code>mod_authn_dbi</code> which configuration set to use by setting <code><a href="#authndbiserverconfig">AuthnDbiServerConfig</a></code> to the name of the set. Configuration sets can be used for both Basic and Digest Authentication (even at the same time) and for any number of authentication sections. Now, this authentication section is linked to a specific configuration set within <code>mod_authn_dbi</code>. If you specify <code><a href="#authndbiserverconfig">AuthnDbiServerConfig</a></code> more than once, the last value will be used.<br /> + Finally, you specify who may access the section with <code><a + href="http://httpd.apache.org/docs-2.1/mod/core.html#require">Require</a></code> to actually use this authentication section when a client request comes in. (Well, most of this is not really <em>that</em> different from what is is in 2.0 and earlier). Authentication realms that use <code>mod_authn_dbi</code> can also be used + from a <code>.htaccess</code> file as usual. Just leave off the container directives. ! </p> ! <p> ! Below you find two example configurations, one for Basic and one for ! Digest Authentication. ! <example> ! <title>An example authentication realm for Digest Authentication</title> ! <pre> ! <Directory "/path/to/htdocs/to/be/area_1_protected"> ! AuthType Digest ! AuthName "digest authn_dbi testing area" ! AuthDigestProvider dbi ! AuthnDbiServerConfig Server1 ! Require valid-user ! </Directory> ! </pre> ! </example> ! <example> ! <title>An example authentication realm for Basic Authentication</title> ! <pre> ! <Directory "/path/to/htdocs/to/be/area_2_protected"> ! AuthType Basic ! AuthName "basic authn_mysql testing area" ! AuthBasicProvider dbi ! AuthnDbiServerConfig Server1 ! Require valid-user ! </Directory> ! </pre> ! </example> ! </p> </section> *************** *** 247,252 **** <title>Advanced configuration of mod_authn_dbi</title> <p> ! insert kung-foo here... </p> </section> --- 339,353 ---- <title>Advanced configuration of mod_authn_dbi</title> <p> ! As mentioned earlier, <code>mode_authn_dbi</code> is very flexible. You ! can do all kinds of nifty things, with (or even without) your user ! database, especially with the <a ! href="#AuthnDbiPasswordQuery">AuthnDbiPasswordQuery</a>. ! </p> ! <p> ! <b> ! More kung-foo will be added here soon... ! </b> </p> + </section> *************** *** 254,258 **** <title>Pooling of database connections</title> <p> ! coming soon... </p> </section> --- 355,395 ---- <title>Pooling of database connections</title> <p> ! To handle incoming requests in an efficient but also performant way, ! <code>mod_authn_dbi</code> organizes connections to the database ! server(s) into pools, with one connection pool per configuration set. It ! opens and closes connections depending on the load the webserver is ! experiencing at a given time. The pooling mechanism is built on the ! <a href="http://apr.apache.org/">Resource List Routines</a> of <code><a ! href="http://apr.apache.org/docs/apr-util/group__APR__Util__RL.html">libapr-util</a></code> (and you probably had to download separately) and is similar to the way Apache manages the number of server processes or threads. ! </p> ! <p> ! When first started, <code>mod_authn_dbi</code> creates a mimimum number of ! connections to the database server before accepting client requests. ! When a client request comes in that needs to be Authenticated, a database ! connection is requested from the connection pool of the matching ! configuration set. The connection is used for autentication and then ! released back into the pool of idle connections. If no idle connection is ! available and the number of connections in the pool has not reached its ! hard maximum, a new connection to the database is created and used. After ! use, it is not destroyed but added as idle connection to the pool of ! connections.<br /> ! Each configuration contains soft maximum value and a time-to-live (TTL) ! value (e.g. 600 seconds). If more than the soft maximum number of idle ! database connections is in a given pool, connections that have been idle ! for longer than the time-to-live value will be closed until a value not ! larger than the soft maximum is reached. ! </p> ! <p> ! These four directives can be used to control the various limits: ! <ul> ! <li><code><a href="#AuthnDbiConnMin">AuthnDbiConnMin</a></code>- The ! minimum (and initial) number of connections.</li> ! <li><code><a href="#AuthnDbiConnSoftMax">AuthnDbiConnSoftMax</a></code> - ! The soft maximum value of connections.</li> ! <li><code><a href="#AuthnDbiConnHardMax">AuthnDbiConnHardMax</a></code> - ! The hard maximum of connections.</li> ! <li><code><a href="#AuthnDbiConnTTL">AuthnDbiConnTTL</a></code> - The ! time-to-live in seconds.</li> ! </ul> </p> </section> *************** *** 401,410 **** foot). Changing its value may also change the behaviour of <code>AuthnDbiUsernameField</code>, <code>AuthnDbiPasswordField</code>, ! <code>AuthnDbiIsActiveField</code>, <code>AuthnDbiTable</code> from what is documented in here. </p> <p> For <em>each request</em> that is received (not just at configuration ! time), mod_authn_dbi will go through the following steps: <ol> <li><b>Replace variables in the query string by their corresponding --- 538,547 ---- foot). Changing its value may also change the behaviour of <code>AuthnDbiUsernameField</code>, <code>AuthnDbiPasswordField</code>, ! <code>AuthnDbiIsActiveField</code>, <code>AuthnDbiTable</code> from what is documented in here. </p> <p> For <em>each request</em> that is received (not just at configuration ! time), <code>mod_authn_dbi</code> will go through the following steps: <ol> <li><b>Replace variables in the query string by their corresponding *************** *** 617,622 **** <usage> <p> ! See <a ! href="http://apr.apache.org/docs/apr-util/group__APR__Util__RL.html">http://apr.apache.org/docs/apr-util/group__APR__Util__RL.html</a> for now. More info follows soon. </p> </usage> --- 754,759 ---- <usage> <p> ! See section "<a ! href="#pooling">Pooling of database connections</a>" for now. More info follows soon. </p> </usage> *************** *** 634,639 **** <usage> <p> ! See <a ! href="http://apr.apache.org/docs/apr-util/group__APR__Util__RL.html">http://apr.apache.org/docs/apr-util/group__APR__Util__RL.html</a> for now. More info follows soon. </p> </usage> --- 771,776 ---- <usage> <p> ! See section "<a ! href="#pooling">Pooling of database connections</a>" for now. More info follows soon. </p> </usage> *************** *** 651,656 **** <usage> <p> ! See <a ! href="http://apr.apache.org/docs/apr-util/group__APR__Util__RL.html">http://apr.apache.org/docs/apr-util/group__APR__Util__RL.html</a> for now. More info follows soon. </p> </usage> --- 788,793 ---- <usage> <p> ! See section "<a ! href="#pooling">Pooling of database connections</a>" for now. More info follows soon. </p> </usage> *************** *** 668,673 **** <usage> <p> ! See <a ! href="http://apr.apache.org/docs/apr-util/group__APR__Util__RL.html">http://apr.apache.org/docs/apr-util/group__APR__Util__RL.html</a> for now. More info follows soon. </p> </usage> --- 805,810 ---- <usage> <p> ! See section "<a ! href="#pooling">Pooling of database connections</a>" for now. More info follows soon. </p> </usage> |
From: <ho...@us...> - 2003-11-24 23:15:25
|
Update of /cvsroot/mod-auth/mod_auth_webspace/htdocs/docs/mod_authn_dbi In directory sc8-pr-cvs1:/tmp/cvs-serv13179 Modified Files: index.xml Log Message: a few lines more docs Index: index.xml =================================================================== RCS file: /cvsroot/mod-auth/mod_auth_webspace/htdocs/docs/mod_authn_dbi/index.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** index.xml 11 Nov 2003 00:03:02 -0000 1.7 --- index.xml 24 Nov 2003 23:15:22 -0000 1.8 *************** *** 109,119 **** </p> ! </section> ! <section id="db"> ! <title>Preparing the Database</title> ! <p><b>Draft....</b></p> ! <p> ! Of course, before you can use mod_authn_dbi, you will need to decide which database to use and create it if it does not already exists. mod_authn_dbi is pretty flexible and --- 109,177 ---- </p> ! </section> ! <section id="overview"> ! <title>An overview of mod_authn_dbi</title> ! <p><b>in progress....</b></p> ! <p> ! The configuration of <code>mod_authn_dbi</code> consists of two main ! parts. First, you configure one or more configuration sets. Second, you use ! these configuration sets in any number of basic or digest authentication realms. ! </p> <p> ! <h3>Configuration sets</h3> ! Most configuration directives of <code>mod_authn_dbi</code> are of the ! format<br /><br /> ! <code>DirectiveName <name> <value></code> ! <br /><br /> ! Configuration sets are implicitely created each time you specify a ! <code><name></code> that has not been used before. All directives that are not ! specified for a given configuration set remain at their default ! values. So the minimum to create a usable configuration set is just one ! of the directives.<br /> ! Configuration sets contain all the information needed to connect to the ! database server, choose the correct database and table and extract the ! values needed for authenticating users. Additionally, you can specify ! options that for example influence the pooling of connections (see below) ! or the way that the data in the table is interpreted. ! ! <example> ! <title>An example configuration set</title> ! <pre> ! AuthnDbiDriver Server1 mysql ! AuthnDbiHost Server1 mycoolcatserver.com ! AuthnDbiUsername Server1 MyUser ! AuthnDbiPassword Server1 MyPass ! AuthnDbiName Server1 MyDatabaseName ! AuthnDbiTable Server1 MyDatabaseTable ! AuthnDbiUsernameField Server1 theUserNameField ! AuthnDbiPasswordField Server1 PasswordField ! AuthnDbiIsActiveField Server1 IsActiveField ! AuthnDbiConnMin Server1 3 ! AuthnDbiConnSoftMax Server1 12 ! AuthnDbiConnHardMax Server1 20 ! AuthnDbiConnTTL Server1 600 ! </pre> ! </example> ! </p> ! <p> ! <h3>Authentication realms</h3> ! <example> ! <title>An example authentication realm</title> ! <pre> ! <Directory "/path/to/htdocs/to/be/area_1_protected"> ! AuthType Basic ! AuthName "basic authn_dbi testing area" ! AuthBasicProvider dbi ! AuthnDbiServerConfig Server1 ! Require valid-user ! </Directory> ! </pre> ! </example> ! </p> ! </section> ! <section id="db"> ! <title>Preparing the Database</title> ! <p> ! Of course, before you can use <code>mod_authn_dbi</code>, you will need to decide which database to use and create it if it does not already exists. mod_authn_dbi is pretty flexible and *************** *** 131,139 **** these requirements will change or go away. </p> <p> ! The default structure that mod_authn_dbi expects is a database ! called "AuthDB", which contains a table called "Users". ! In this table, it expects two string (VARCHAR or similar) columns ! "Username" and "Password" containing the usernames and for each of them the password in plaintext. </p> --- 189,198 ---- these requirements will change or go away. </p> + <h4>Starting from scratch...</h4><br /> <p> ! The default structure that <code>mod_authn_dbi</code> expects is a database ! called "<code>AuthDB</code>", which contains a table called "<code>Users</code>". ! In this table, it expects two string (<code>VARCHAR</code> or similar) columns ! "<code>Username</code>" and "<code>Password</code>" containing the usernames and for each of them the password in plaintext. </p> *************** *** 149,156 **** <code>CREATE table Users (Username VARCHAR(32), Password VARCHAR(32));</code> </p> <p> In the first step of customization, you can change the values for driver, host, user, password, database, table, column names and ! the password format. </p><p> So, let's continue with... --- 208,216 ---- <code>CREATE table Users (Username VARCHAR(32), Password VARCHAR(32));</code> </p> + <p> In the first step of customization, you can change the values for driver, host, user, password, database, table, column names and ! the password format to match a table in an existing database. </p><p> So, let's continue with... *************** *** 181,204 **** the table "MyDatabaseTable" instead of the default "AuthDB", you get the idea... - </p><p> - <example> - <title>Example Config</title> - <pre> - AuthnDbiDriver Server1 mysql - AuthnDbiHost Server1 mycoolcatserver.com - AuthnDbiUsername Server1 MyUser - AuthnDbiPassword Server1 MyPass - AuthnDbiName Server1 MyDatabaseName - AuthnDbiTable Server1 MyDatabaseTable - AuthnDbiUsernameField Server1 theUserNameField - AuthnDbiPasswordField Server1 PasswordField - AuthnDbiIsActiveField Server1 IsActiveField - - AuthnDbiConnMin Server1 3 - AuthnDbiConnSoftMax Server1 12 - AuthnDbiConnHardMax Server1 20 - AuthnDbiConnTTL Server1 600 - </pre> - </example> </p> </section> --- 241,244 ---- *************** *** 211,214 **** --- 251,261 ---- </section> + <section id="pooling"> + <title>Pooling of database connections</title> + <p> + coming soon... + </p> + </section> + <directivesynopsis> <name>AuthnDbiDriver</name> *************** *** 645,649 **** given, all accounts that have "<code>::</code>" as password value will be accepted with <em>any</em> password that the user ! supplies. With this options, you can for example implement guest-accounts.</td></tr> </table> </p> --- 692,699 ---- given, all accounts that have "<code>::</code>" as password value will be accepted with <em>any</em> password that the user ! supplies. With this options, you can for example implement ! guest-accounts. (The name of this option does not really fit its ! behaviour, but somehow i could not think of a better name when ! implementing it.)</td></tr> </table> </p> |
From: <fir...@us...> - 2003-11-17 18:39:06
|
Update of /cvsroot/mod-auth/mod_auth_webspace/htdocs/docs/mod_authn_cache In directory sc8-pr-cvs1:/tmp/cvs-serv2847/mod_authn_cache Added Files: index.xml index.xml.meta Log Message: add docs for mod_authn_cache --- NEW FILE: index.xml --- <?xml version="1.0"?> <!DOCTYPE modulesynopsis SYSTEM "../../style/modulesynopsis.dtd"> <?xml-stylesheet type="text/xsl" href="../../style/manual.en.xsl"?> <modulesynopsis metafile="index.xml.meta"> <name>mod_authn_cache</name> <description>User authentication Caching</description> <status>External</status> <sourcefile>mod_authn_cache.c</sourcefile> <identifier>authn_cache</identifier> <compatibility>Apache 2.1 or greater</compatibility> <summary> <p> The module <code>mod_authn_cache</code> caches authentication information generated from other modules </p> </summary> <section id="compilation"> <title>Compilation</title> <p> <code>mod_authn_cache</code> uses the "<code>configure/make/make install</code>" mechanism common to many Open Source programs. Most of the dirty work is handled by either configure or Apache's apxs utility. If you have built apache modules before, there shouldn't be any surprises for you. </p> <p> Before you can begin compiling <code>mod_authn_cache</code>, you will need a working installation of Apache 2.1-dev (any earlier version, including Apache 2.0.x will NOT work). </p> <p> The interesting options you can pass to configure are: <ul> <li><code>--with-apxs=/path/to/apache/dir/bin/apxs</code> <p> This option is used to specify the location of the apxs utility that was installed as part of apache. Specify the location of the binary, not the directory it is located in. </p> </li> </ul> </p> <p> Call configure with your site-specific values and then "make" and "make install" as usual. The module will be installed in the module directory of your Apache installation. </p> </section> <section id="integration"> <title>Integration into Apache</title> <p>Again <code>mod_authn_cache</code> behave like your average next-door Apache module. Just add<br /><br /> <code>LoadModule authn_cache_module modules/mod_authn_cache.so</code><br /><br /> to your <code>httpd.conf</code> as usual and restart Apache. </p> </section> <section id="basic"> <title>Basic configuration of mod_authn_cache</title> <p><b>Draft...</b></p> <p> <example> <title>Example Config</title> <pre> <Location /secure-area> AuthType Basic AuthName "basic authn_cache testing area" AuthBasicProvider cache AuthnCacheProvider file AuthnCacheType shmht:logs/authn_cache.shm(10000) AuthUserFile .htpasswd Require valid-user </Location> </pre> </example> </p> </section> <directivesynopsis> <name>AuthnCacheProvider</name> <description>Name of the Authentication Provider</description> <syntax>AuthnCacheProvider <var>AuthnProvider</var></syntax> <default>none</default> <contextlist> <context>.htaccess</context> </contextlist> <usage> <p> </p> </usage> </directivesynopsis> <directivesynopsis> <name>AuthnCacheType</name> <description>Type of Global Cache</description> <syntax>AuthnCacheType <var>shmht:file(size)</var></syntax> <default>none</default> <contextlist> <context>.htaccess</context> </contextlist> <usage> <p> </p> </usage> </directivesynopsis> </modulesynopsis> --- NEW FILE: index.xml.meta --- <?xml version="1.0" encoding="UTF-8" ?> <metafile> <basename>mod_authn_cache</basename> <path>../</path> <relpath>../../</relpath> <variants> <variant>en</variant> </variants> </metafile> |
From: <fir...@us...> - 2003-11-17 18:37:51
|
Update of /cvsroot/mod-auth/mod_auth_webspace/htdocs/docs/mod_authn_cache In directory sc8-pr-cvs1:/tmp/cvs-serv2724/mod_authn_cache Log Message: Directory /cvsroot/mod-auth/mod_auth_webspace/htdocs/docs/mod_authn_cache added to the repository |
From: <fir...@us...> - 2003-11-17 04:33:32
|
Update of /cvsroot/mod-auth/mod_auth_webspace/htdocs/docs In directory sc8-pr-cvs1:/tmp/cvs-serv12064/docs Modified Files: index.xml Log Message: added initial stuff about authn_cache. Index: index.xml =================================================================== RCS file: /cvsroot/mod-auth/mod_auth_webspace/htdocs/docs/index.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** index.xml 10 Nov 2003 15:32:20 -0000 1.5 --- index.xml 17 Nov 2003 04:32:48 -0000 1.6 *************** *** 25,28 **** --- 25,29 ---- <category id="modules"><title>Modules</title> + <page href="mod_authn_cache/">mod_authn_cache</page> <page href="mod_authn_dbi/">mod_authn_dbi</page> <page href="mod_authn_mysql/">mod_authn_mysql</page> |
From: <fir...@us...> - 2003-11-17 04:33:32
|
Update of /cvsroot/mod-auth/mod_auth_webspace/htdocs In directory sc8-pr-cvs1:/tmp/cvs-serv12064 Modified Files: index.xml Log Message: added initial stuff about authn_cache. Index: index.xml =================================================================== RCS file: /cvsroot/mod-auth/mod_auth_webspace/htdocs/index.xml,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** index.xml 11 Nov 2003 04:34:38 -0000 1.10 --- index.xml 17 Nov 2003 04:32:48 -0000 1.11 *************** *** 43,46 **** --- 43,53 ---- <section id="Projects"> <title>Projects</title> + <section id="mod_authn_cache"> + <title>mod_authn_cache</title> Caches Authentication information from other modules in shared memory to improve performance.<br/> + [Status: <span style="color: red;">In Development</span>] + [<a href="docs/mod_authn_cache">docs</a>] + [download] + [<a href="http://cvs.sourceforge.net/viewcvs.py/mod-auth/mod_authn_cache/">cvsweb</a>] + </section> <section id="mod_authn_dbi"> <title>mod_authn_dbi</title> Uses <a href="http://libdbi.sourceforge.net/">libdbi</a> to provide a cross database authentication module.<br/> *************** *** 52,56 **** <section id=">mod_authn_mysql"> <title>mod_authn_mysql</title> Uses the <a href="http://www.mysql.com/">libmysqlclient</a> to provide database based authentication.<br/> ! [Status: <span style="color: red;">Broken</span>] [<a href="docs/mod_authn_mysql">docs</a>] [no downloads] --- 59,63 ---- <section id=">mod_authn_mysql"> <title>mod_authn_mysql</title> Uses the <a href="http://www.mysql.com/">libmysqlclient</a> to provide database based authentication.<br/> ! [Status: <span style="color: red;">In Development</span>] [<a href="docs/mod_authn_mysql">docs</a>] [no downloads] *************** *** 59,63 **** <section id="mod_authn_pam"> <title>mod_authn_pam</title> Authenticate using the <a href="http://www.kernel.org/pub/linux/libs/pam/">PAM</a> framework.<br/> ! [Status: <span style="color: red;">In Development</span>] [<a href="docs/mod_authn_pam">docs</a>] [no downloads] --- 66,70 ---- <section id="mod_authn_pam"> <title>mod_authn_pam</title> Authenticate using the <a href="http://www.kernel.org/pub/linux/libs/pam/">PAM</a> framework.<br/> ! [Status: <span style="color: blue;">Working</span>] [<a href="docs/mod_authn_pam">docs</a>] [no downloads] |