Ok, so I finally figured this out.

I'm not sure WHY this was the case... but so it is:

I already had gdbm installed, and the db3 port installed.
For some reason although makeuserdb was creating gdbm databases, authuserdb
was trying to use Berkeley db to access these databases.

In the top level port makefile I had to add to the configure args:
--with-db=gdbm

And the following line:
CFLAGS+=        -I/usr/local/include -L/usr/local/lib

And everything worked like a charm.  Port maintainer, please make a note.

-Yanek.

> -----Original Message-----
> From: Yanek Korff [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, February 28, 2002 2:50 PM
> To: 'Roland Schneider'; '[EMAIL PROTECTED]'
> Subject: RE: [courier-users] Cannot authenticate;
> userdb/authdaemond/FreeB SD
> 
> 
> I've gone way farther than that at this point.  I'm 
> temporarily not using
> authdaemond.  And I have fprintfs everywhere:
> 
>  29588 authuserdb RET   wait4 29589/0x7395
>  29588 authuserdb CALL  wait4(0xffffffff,0xbfbff8f4,0,0)
>  29588 authuserdb RET   wait4 -1 errno 10 No child processes
>  29588 authuserdb CALL  write(0x2,0xbfbff1c0,0x14)
>  29588 authuserdb GIO   fd 2 wrote 20 bytes
>        "Entered auth_userdb
>        "
>  29588 authuserdb RET   write 20/0x14
>  29588 authuserdb CALL  write(0x2,0xbfbff150,0x1f)
>  29588 authuserdb GIO   fd 2 wrote 31 bytes
>        "Entered auth_userdb_pre_common
>        "
>  29588 authuserdb RET   write 31/0x1f
>  29588 authuserdb CALL  write(0x2,0xbfbff0b0,0x45)
>  29588 authuserdb GIO   fd 2 wrote 69 bytes
>        "Entering userdb_init for /usr/local/etc/userdb.dat; 
> (initialized: 0)
>        "
>  29588 authuserdb RET   write 69/0x45
>  29588 authuserdb CALL  stat(0x804d480,0xbfbff7d8)
>  29588 authuserdb NAMI  "/usr/local/etc/userdb.dat"
>  29588 authuserdb RET   stat 0
>  29588 authuserdb CALL  write(0x2,0xbfbff0b0,0xa)
>  29588 authuserdb GIO   fd 2 wrote 10 bytes
>        "last else
>        "
>  29588 authuserdb RET   write 10/0xa
>  29588 authuserdb CALL  write(0x2,0xbfbff0b0,0x3d)
>  29588 authuserdb GIO   fd 2 wrote 61 bytes
>        "!initialized, trying to dbobj_open /usr/local/etc/userdb.dat
>        "
>  29588 authuserdb RET   write 61/0x3d
>  29588 authuserdb CALL  stat(0x804d480,0xbfbff6a8)
>  29588 authuserdb NAMI  "/usr/local/etc/userdb.dat"
>  29588 authuserdb RET   stat 0
>  29588 authuserdb CALL  open(0x804d480,0,0x1b4)
>  29588 authuserdb NAMI  "/usr/local/etc/userdb.dat"
>  29588 authuserdb RET   open 3
>  29588 authuserdb CALL  fcntl(0x3,0x2,0x1)
>  29588 authuserdb RET   fcntl 0
>  29588 authuserdb CALL  read(0x3,0x8052000,0x104)
>  29588 authuserdb GIO   fd 3 read 260 bytes
>        "\M-N\M^ZW\^S\0 \0\0\0 \0\0\0\0\0\0\0 \0\0
>         \0\0\0\0
> \0\0Q\^A\0\0\0\M^@\0\0\0\0\0\0\M-&\^B\0\0\0\0\0\0\0\0\0\0\0\0\
> 0\0\0\0\0\0\0\
> 0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
> 0\0\0\0\0\0\0\
> 0\0\0\0\
>  
> \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
> \0\0\0\0\0\0\0
> \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
> \0\0\0\0\0\0\0
> \0\0\0\0\0\0\0\0\
>  
> \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
> \0\0\0\0\0\0\0
> \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
> \0\0\0\000"
>  29588 authuserdb RET   read 260/0x104
>  29588 authuserdb CALL  close(0x3)
>  29588 authuserdb RET   close 0
>  29588 authuserdb CALL  write(0x2,0xbfbff0b0,0x13)
>  29588 authuserdb GIO   fd 2 wrote 19 bytes
>        "dbobj_open success
>        "
>  29588 authuserdb RET   write 19/0x13
>  29588 authuserdb CALL  write(0x2,0xbfbff150,0x12)
>  29588 authuserdb GIO   fd 2 wrote 18 bytes
>        "called userdb_init"
>  29588 authuserdb RET   write 18/0x12
>  29588 authuserdb CALL  write(0x2,0xbfbff110,0x2c)
>  29588 authuserdb GIO   fd 2 wrote 44 bytes
>        "Entered userdb with u=test; (initialized=1)
>        "
>  29588 authuserdb RET   write 44/0x2c
>  29588 authuserdb CALL  write(0x2,0xbfbff110,0x28)
>  29588 authuserdb GIO   fd 2 wrote 40 bytes
>        "Calling dbobj_fetch for test, strlen(4)
>        "
>  29588 authuserdb RET   write 40/0x28
>  29588 authuserdb CALL  write(0x2,0xbfbff110,0x25)
>  29588 authuserdb GIO   fd 2 wrote 37 bytes
>        "I guess this means no such user test
>        "
>  29588 authuserdb RET   write 37/0x25
>  29588 authuserdb CALL  write(0x2,0xbfbff150,0x1d)
>  29588 authuserdb GIO   fd 2 wrote 29 bytes
>        "userdb(test) = (null), sorry
>        "
>  29588 authuserdb RET   write 29/0x1d
>  29588 authuserdb CALL  close(0x3)
>  29588 authuserdb RET   close -1 errno 9 Bad file descriptor
> 
> My next step is to figure out: why is gdobj_fetch failing?
> 
> I already modified the code in userdb.c from:
> 
>         if (!initialized)
>         {
>                 fprintf(stderr,"!initialized, trying to 
> dbobj_open %s\n",
> n);
>                 if (dbobj_open(&d, n, "R"))
>                 {
>                         return;
>                 }
>                 initialized=1;
>         }
> 
> to:
> 
>         if (!initialized)
>         {
>                 fprintf(stderr,"!initialized, trying to 
> dbobj_open %s\n",
> n);
>                 if (dbobj_open(&d, n, "R"))
>                 {
>                         initialized=1;
>                         fprintf (stderr,"dbobj_open success\n");
>                         return;
>                 }
>                 else {
>                         fprintf (stderr,"dbobj_open failed\n");
>                 }
>         }
> 
> in userdb_init.  Do I have that backwards?  I haven't looked 
> at dbobj_open
> yet -- I'm just assuming a return value means success.  So 
> I'll be digging
> in dbobj functions next.
> 
> -Yanek.
> 
> 
> > -----Original Message-----
> > From: Roland Schneider [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, February 28, 2002 2:08 PM
> > To: '[EMAIL PROTECTED]'
> > Subject: RE: [courier-users] Cannot authenticate;
> > userdb/authdaemond/FreeB SD
> > 
> > 
> > --Yanek Korff wrote on 28.02.2002 09:54 -0500:
> >  >> You also could configure --without-authdaemon, much easier
> > >> to debug with strace.
> > > ktrace okay?  Been using that -- easy enough to predict 
> > which authdaemon.
> > > It always chooses the lowest pid.
> > 
> > You want the other pid (with daemons=1 as recommended).
> > This script generates some lines useful output, at least
> > on FreeBSD with strace installed from the ports:
> > 
> > � #!/bin/sh -x
> > � strace -p `ps -ax | grep authdaemond | tail -n 1 | awk 
> > '{print $1}'` &
> > � ./authtest invalid@user
> > � sleep 1
> > � killall strace
> > � exit
> > 
> > 
> > Roland
> > 
> > 
> > _______________________________________________
> > courier-users mailing list
> > [EMAIL PROTECTED]
> > Unsubscribe: 
> https://lists.sourceforge.net/lists/listinfo/courier-users
> 
> _______________________________________________
> courier-users mailing list
> [EMAIL PROTECTED]
> Unsubscribe: 
https://lists.sourceforge.net/lists/listinfo/courier-users

_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to