Hi David,
sorry for the delay, I've been out the whole day...
> "David K." wrote:
>
> Hi Alessandro,
>
> I am sending this truss trace to you because it is pretty long [...]
> it can be posted to the group if you wish.
Truss trace definitely confirms it is the strcmp in do_authcheckpassword,
comparing a NULL crypt(password) with the encripted password:
[...]
> -> libc:fprintf(0x804c958, 0xd277c3cf, 0xd253833c, 0xd277c336)
> write(2, " D E B U G : a u t h v".., 19) = 19
> write(2, " c l e a r p a s s w d =", 12) = 12
> write(2, " < n u l l >", 6) = 6
> write(2, " , p a s s w d =", 9) = 9
> write(2, " $ 1 9 r P z / 1 D g 0 w".., 13) = 13
> write(2, "\n", 1) = 1
> <- libc:fprintf() = 60
> <- libcourierauth:courier_authdebug_authinfo() = 0
> -> libcourierauthcommon:authcheckpassword(0x804d20c, 0xd253bf46,
> 0xd277bb7b, 0xd252e84c)
> -> libc:strncasecmp(0xd253bf46, 0xd2797080, 0x5, 0xd253bf46)
> <- libc:strncasecmp() = -87
> -> libc:strncasecmp(0xd253bf46, 0xd279711a, 0x5, 0xd279707f)
> <- libc:strncasecmp() = -87
> -> libc:crypt()
> <- libc:crypt() = 0
> -> libc:strcmp()
> Incurred fault #6, FLTBOUNDS %pc = 0xD26CF539
> siginfo: SIGSEGV SEGV_MAPERR addr=0x00000000
> Received signal #11, SIGSEGV [default]
> siginfo: SIGSEGV SEGV_MAPERR addr=0x00000000
Hmmm... the manual says crypt may only fail with error ENOSYS:
"The functionality is not supported on this implementation".
Does this mean you are missing the crypt function?
Would you mind compiling the attached test program to check that?
(As usual, you may compile it with/without, say, -D_XOPEN_SOURCE=400
see man standards -shouldn't really change much in this case.)
> Alessandro Vesely wrote:
>
> >> "David K." wrote:
> >>
> >> I have the daemons in authdaemonrc reduced to 1, and this is
> >> the begining of the truss output of authdaemond:
> >>
> >> Received signal #18, SIGCLD, in poll() [caught]
> >> siginfo: SIGCLD CLD_DUMPED pid=24336 status=0x000B
> >> poll(0x08046CEC, 1, 300000) Err#4 EINTR
> >> close(4) = 0
> >> sigaction(SIGHUP, 0x08046A00, 0x08046A70) = 0
> >>
> >>
> > Ooops, wrong daemon: it was the parent. Try truss the next process
> > number (ps -ef | grep authdaemon shows me 2 whith "daemons=1".)
> > You should see an accept as the first system call.
> >
> > Recall you can use
> >
> > truss -u "" -p nnnn
> >
> > for a reallty verbose output.
> >
> >
> >
> >> I'm not familiar with gdb, and it tells me:
> >>
> >> This GDB was configured as "i386-pc-solaris2.9"..."/etc/rc3.d/core": not
> >> in executable format: File format not recognized
> >>
> >>
> >
> > try
> >
> > gdb -core /etc/rc3.d/core
> >
> > and then use `bt', `up', `print' and `quit' as needed. See e.g.
> > http://sources.redhat.com/gdb/current/onlinedocs/gdb_9.html
> >
> >
> >
> >
> >> - David
> >>
> >> Alessandro Vesely wrote:
> >>
> >>
> >>
> >> > "David K." wrote:
> >> > [...]
> >> >
> >> >
> >> >
> >> >
> >> >> pstack core
> >> >> core 'core' of 17227: /usr/local/libexec/courier-authlib/authdaemond
> >> >> d26cf539 strcmp () + 115
> >> >> d2793d3d authcheckpassword (804d234, d254bba6, d277bb7b, d253e724) +
> >> >> 101
> >> >> d253e73d ???????? ()
> >> >>
> >> >>
> >> >>
> >> >>
> >> > Possibly that is a strcmp in do_authcheckpassword, comparing
> >> > crypt(password) with the encripted password? Then when the daemon
> >> > crashes the client gets an I/O error.
> >> >
> >> > You should investigate some more, either with gdb or, if
> >> > you can reduce daemons to 1 in authdaemonrc, pointing
> >> > truss to the running daemon. In case you have a MySQL query
> >> > log, that may provide some more hints as well.
> >> >
> >> >
> >> >
> >> >
> >
> >
> >
#include <unistd.h>
#include <stdio.h>
#define S(r) ((r) ? (r) : "NULL")
int main(void)
{
char *r = crypt("foo", "bar");
printf ("r=%s\n", S(r));
return 0;
}