You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rs...@hyperreal.org on 1998/10/23 10:15:02 UTC

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

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 <ro...@ckm.ucsf.edu>
  PR: 3171
  
  Revision  Changes    Path
  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 <ro...@ckm.ucsf.edu>] PR#3171
  +
     *) PORT: DSO support for UnixWare 7
        [Ralf S. Engelschall, Ron Record <rr...@sco.com>]
   
  
  
  
  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