cvs commit: apache-1.3/src/modules/standard mod_auth_db.c

1999-11-28 Thread rse
rse 99/11/28 04:59:52

  Modified:src  CHANGES
   src/modules/standard mod_auth_db.c
  Log:
  Added support for Berkeley-DB/3.x to mod_auth_db.
  
  Submitted by: Steve Atkins [EMAIL PROTECTED]
  Cleaned up and reviewed by: Ralf S. Engelschall
  PR: 5382
  
  Revision  ChangesPath
  1.1456+3 -0  apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1455
  retrieving revision 1.1456
  diff -u -r1.1455 -r1.1456
  --- CHANGES   1999/11/28 12:41:54 1.1455
  +++ CHANGES   1999/11/28 12:59:49 1.1456
  @@ -1,4 +1,7 @@
   Changes with Apache 1.3.10
  + 
  +  *) Added support for Berkeley-DB/3.x to mod_auth_db.
  + [Steve Atkins [EMAIL PROTECTED], Ralf S. Engelschall] PR#5382
   
 *) Fixed mod_auth_digest.c: result of an open() call was being 
checked against the wrong failure value.
  
  
  
  1.43  +12 -4 apache-1.3/src/modules/standard/mod_auth_db.c
  
  Index: mod_auth_db.c
  ===
  RCS file: /home/cvs/apache-1.3/src/modules/standard/mod_auth_db.c,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- mod_auth_db.c 1999/08/02 20:50:22 1.42
  +++ mod_auth_db.c 1999/11/28 12:59:51 1.43
  @@ -97,9 +97,14 @@
   #include http_protocol.h
   #include db.h
   
  -#if defined(DB_VERSION_MAJOR)  (DB_VERSION_MAJOR == 2)
  +#if defined(DB_VERSION_MAJOR)
  +#if (DB_VERSION_MAJOR == 2)
   #define DB2
   #endif
  +#if (DB_VERSION_MAJOR == 3)
  +#define DB3
  +#endif
  +#endif
   
   typedef struct {
   
  @@ -161,7 +166,10 @@
   q.data = user;
   q.size = strlen(q.data);
   
  -#ifdef DB2
  +#if defined(DB3)
  +if (   db_create(f, NULL, 0) != 0 
  +|| f-open(f, auth_dbpwfile, NULL, DB_HASH, DB_RDONLY, 0664) != 0) {
  +#elif defined(DB2)
   if (db_open(auth_dbpwfile, DB_HASH, DB_RDONLY, 0664, NULL, NULL, f) != 
0) {
   #else
   if (!(f = dbopen(auth_dbpwfile, O_RDONLY, 0664, DB_HASH, NULL))) {
  @@ -171,7 +179,7 @@
return NULL;
   }
   
  -#ifdef DB2
  +#if defined(DB2) || defined(DB3)
   if (!((f-get) (f, NULL, q, d, 0))) {
   #else
   if (!((f-get) (f, q, d, 0))) {
  @@ -181,7 +189,7 @@
pw[d.size] = '\0';  /* Terminate the string */
   }
   
  -#ifdef DB2
  +#if defined(DB2) || defined(DB3)
   (f-close) (f, 0);
   #else
   (f-close) (f);
  
  
  


cvs commit: apache-1.3/src/modules/standard mod_auth_db.c

1998-10-23 Thread rse
rse 98/10/23 01:15:01

  Modified:src  CHANGES
   src/modules/standard mod_auth_db.c
  Log:
  Fix Berkeley-DB/2.x support in mod_auth_db: The data structures were not
  initialized correctly and the db_open() call used an invalid mode
  parameter.
  
  Because compare especially this section from db_dbt(3):
  
  | In  order  to ensure compatibility with future releases of DB, all
  | fields of the DBT structure that are  not  explic- itly  set should be
  | initialized to 0 before the first time the structure is used.  Do this
  | by declaring the structure external  or  static,  or by calling the C
  | library routine bzero(3) or memset(3).
  
  Submitted by: Ron Klatchko [EMAIL PROTECTED]
  PR: 3171
  
  Revision  ChangesPath
  1.1119+4 -0  apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1118
  retrieving revision 1.1119
  diff -u -r1.1118 -r1.1119
  --- CHANGES   1998/10/23 08:12:03 1.1118
  +++ CHANGES   1998/10/23 08:14:58 1.1119
  @@ -1,5 +1,9 @@
   Changes with Apache 1.3.4
   
  +  *) Fix Berkeley-DB/2.x support in mod_auth_db: The data structures were not
  + initialized correctly and the db_open() call used an invalid mode
  + parameter. [Ron Klatchko [EMAIL PROTECTED]] PR#3171
  +
 *) PORT: DSO support for UnixWare 7
[Ralf S. Engelschall, Ron Record [EMAIL PROTECTED]]
   
  
  
  
  1.35  +4 -1  apache-1.3/src/modules/standard/mod_auth_db.c
  
  Index: mod_auth_db.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_auth_db.c,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- mod_auth_db.c 1998/10/03 15:11:52 1.34
  +++ mod_auth_db.c 1998/10/23 08:15:01 1.35
  @@ -155,11 +155,14 @@
   DBT d, q;
   char *pw = NULL;
   
  +memset(d, 0, sizeof(d));
  +memset(q, 0, sizeof(q));
  +
   q.data = user;
   q.size = strlen(q.data);
   
   #ifdef DB2
  -if (db_open(auth_dbpwfile, DB_HASH, O_RDONLY, 0664, NULL, NULL,  f) != 
0) {
  +if (db_open(auth_dbpwfile, DB_HASH, DB_RDONLY, 0664, NULL, NULL, f) != 
0) {
   #else
   if (!(f = dbopen(auth_dbpwfile, O_RDONLY, 0664, DB_HASH, NULL))) {
   #endif
  
  
  


cvs commit: apache-1.3/src/modules/standard mod_auth_db.c

1998-03-20 Thread Ralf S. Engelschall
rse 98/03/20 01:42:46

  Modified:htdocs/manual/mod mod_auth_db.html
   src/modules/standard mod_auth_db.c
  Log:
  Added hints to the source and documentation what version is needed
  and where to find that version on the net.
  
  PR#: 1423
  
  Revision  ChangesPath
  1.14  +10 -0 apache-1.3/htdocs/manual/mod/mod_auth_db.html
  
  Index: mod_auth_db.html
  ===
  RCS file: /export/home/cvs/apache-1.3/htdocs/manual/mod/mod_auth_db.html,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- mod_auth_db.html  1998/02/05 22:33:55 1.13
  +++ mod_auth_db.html  1998/03/20 09:42:44 1.14
  @@ -21,6 +21,16 @@
   files for those systems which support DB and not DBM. It is only
   available in Apache 1.1 and later.
   
  +P
  +On some BSD systems (e.g. FreeBSD and NetBSD) dbm is automatically mapped to
  +Berkeley DB. You can use either A HREF=mod_auth_dbm.htmlmod_auth_dbm/A
  +or mod_auth_db. The latter makes it more obvious that it's Berkeley DB.  On
  +other platforms where you want to use the DB library you usually have to
  +install it first. See A
  +HREF=http://www.sleepycat.com/;http://www.sleepycat.com//A for the
  +distribution. The interface this module uses is the one from DB version 1.85
  +and 1.86, but DB version 2.x can also be used when compatibility mode is
  +enabled.
   
   MENU
   LIA HREF=#authdbgroupfileAuthDBGroupFile/A
  
  
  
  1.28  +5 -0  apache-1.3/src/modules/standard/mod_auth_db.c
  
  Index: mod_auth_db.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_auth_db.c,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- mod_auth_db.c 1998/03/13 19:20:30 1.27
  +++ mod_auth_db.c 1998/03/20 09:42:46 1.28
  @@ -73,6 +73,11 @@
* On some BSD systems (e.g. FreeBSD and NetBSD) dbm is automatically
* mapped to Berkeley DB. You can use either mod_auth_dbm or
* mod_auth_db. The latter makes it more obvious that it's Berkeley.
  + * On other platforms where you want to use the DB library you
  + * usually have to install it first. See http://www.sleepycat.com/
  + * for the distribution. The interface this module uses is the
  + * one from DB version 1.85 and 1.86, but DB version 2.x
  + * can also be used when compatibility mode is enabled.
*
* dirkx - Added Authoritative control to allow passing on to lower  
* modules if and only if the user-id is not known to this