httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Florian Wunderlich <fwunderl...@devbrain.de>
Subject Re: [PATCH] fix mod_auth_dbm on Red Hat 7 (fwd)
Date Mon, 18 Dec 2000 23:48:42 GMT
Joe Orton wrote:
> 
> Hi,
> 
> On Mon, 18 Dec 2000, Florian Wunderlich wrote:
> > About glibc-2.2 and dbm support:
> >
> > I don't use Red Hat, so I don't know why they have /usr/include/db1 and
> > where this points to, but as glibc-2.2 does not have ndbm.h and db
> > support any more, a patch that would probably fix this issue for ALL
> > distributions and anyone would be:
> >
> > diff -ur apache_1.3.14/src/modules/standard/mod_auth_dbm.c
> > apache_1.3.14-new/src/modules/standard/mod_auth_dbm.c
> > --- apache_1.3.14/src/modules/standard/mod_auth_dbm.c Thu Sep 21
> > 15:19:33 2000
> > +++ apache_1.3.14-new/src/modules/standard/mod_auth_dbm.c     Mon Dec 18
> > 15:53:53 2000
> > @@ -80,7 +80,7 @@
> >  #define dbm_fetch sdbm_fetch
> >  #define dbm_close sdbm_close
> >  #elif defined(__GLIBC__) && defined(__GLIBC_MINOR__) \
> > -    && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
> > +    && __GLIBC__ >= 2 && __GLIBC_MINOR__ == 1
> >  #include <db1/ndbm.h>
> >  #else
> >  #include <ndbm.h>
> >
> >
> > I don't know why you have to patch find-dbm-lib; you simply have to use
> > gdbm or some other db package and if this has ndbm.h in the search path,
> > there should be no problem.
> 
> Yes, this looks better, but unfortunately it's not quite enough to get
> things working on RHL7, since no db library gets picked up by
> find-dbm-lib, and the link still fails.
> 
> Also, I am not totally sure it is a good idea to use the
> /usr/include/ndbm.h on RHL7, since this is the interface from GDBM which
> is under the GPL. Maybe you could use the GDBM header file, and link in
> the DB1 library, but that doesn't seem like a very good road to go down
> either.


Sorry, I don't get it. I searched the net which db library is used by
Red Hat, and I could only find sleepycat's db implementation.

So if you want to use sleepycat's instead of gdbm, modifying
find-dbm-lib would not make sense, as you search for dbm_open, which is
not in this library:

main:~$ nm -s /opt/libdb/lib/libdb.so | grep dbm_open
00036dac T __db_ndbm_open

dbm_open is #defined to __db_ndbm_open in the headers.

Thus, the only library I know of where dbm_open is defined is gdbm.


I suspect you have a header file db1/ndbm.h which just includes db.h in
turn, because sleepycat's db implementation doesn't come with an ndbm.h
header.

Probably the right thing to do would be:

#elif defined(__GLIBC__) && defined(__GLIBC_MINOR__) \
    && __GLIBC__ >= 2
#if __GLIBC_MINOR__ == 1
#include <db1/ndbm.h>
#else
/* all glibc-2.2 based systems */
#define DB_DBM_HSEARCH 1
#include <db.h>
#endif


And the find-dbm-lib script is broken anyway; you cannot assume that the
symbol appears exactly in the library as it is named in the specs. A
quick fix is obviously

elif ./helpers/TestCompile lib db __db_ndbm_open; then
	DBM_LIB="-ldb"

The long fix would probably be "use GNU autoconf".

> Regards,
> 
> joe
> 
> --
> Joe Orton, Red Hat Europe

Mime
View raw message