In regard to: Re: [Imap-uw] 2006d Solaris 64 bit compile issues, Mark...:

On Wed, 20 Dec 2006, Tim Mooney wrote:
Basically, the idea is that if /lib/libc.a exists, we use the old logic of
searching libc.a for getpassphrase and linking to either the old or new
header.  If /lib/libc.a doesn't exist,  we're on a very recent version
of Solaris, and it therefore does have getpassphrase().
Mark, what do you think?

I've decided to adopt your change pretty much as-is, only changing the
test to the more modern use of square brackets:

I've found the problem that I mentioned earlier, that was causing a SEGV
in checkpw().

Basically, the issue is that there's no prototype visible for crypt(), so
the compiler is assuming it turns an int, and when that's cast to a (char
*) in the strcmp() for the getspnam() case, the resulting pointer is
invalid:


(dbx) next stopped in checkpw at line 154 in file "osdep.c"
  154           !strcmp (sp->sp_pwdp,(char *) crypt (pass,sp->sp_pwdp))) {
(dbx) next signal SEGV (no mapping at the fault address) in strcmp at 0xfffffd7ffef3d940
0xfffffd7ffef3d940: strcmp+0x0090:      movq     (%rsi,%rcx),%rax
dbx: read of 8 bytes at address fffff2a7 failed -- Error 0
dbx: attempt to read frame failed -- cannot get return address
0xfffffd7ffef3d940: strcmp+0x0090:      movq     (%rsi,%rcx),%rax


I tried compiling with -D__EXTENSIONS__ to make the prototype (from
unistd.h) visible, and that seemed to work.  I don't think that's
necessarily the best solution though.

Although I generally dislike re-prototyping system interfaces, it might
just be best to do something like

extern char * crypt(const char *k, const char *s);

in os_soln.h and os_solo.h.  The other option might be to add an
#include <crypt.h> in at least os_soln.h -- I checked Solaris 2.7 - 2.10,
and they all have crypt.h that has prototypes for crypt() and related
functions that are visible as long as __STDC__ is defined.

There are other prototypes that are missing (not visible) for various
files (especially mlock.c), but so far none of them seem to be causing
the same trouble that the missing prototype for crypt() was.

Tim
--
Tim Mooney                              [EMAIL PROTECTED]
Information Technology Services         (701) 231-1076 (Voice)
Room 242-J6, IACC Building              (701) 231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164
_______________________________________________
Imap-uw mailing list
[email protected]
https://mailman1.u.washington.edu/mailman/listinfo/imap-uw

Reply via email to