Bug #11150 HP-UX yaSSL/OpenSSL configure/header problem
Submitted: 7 Jun 2005 23:55 Modified: 10 Jun 2005 19:54
Reporter: Kent Boortz Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S2 (Serious)
Version:5.0.7-pre OS:HP/UX (HP-UX 11.00)
Assigned to: Sergey Vojtovich CPU Architecture:Any

[7 Jun 2005 23:55] Kent Boortz
Description:
There is a call to crypt() in "item_strfunc.cc" that seems to be
enabled if "crypt" exists as a function, i.e. HAVE_CRYPT is
set. But when --openssl or --yassl is defined, then
HAVE_OPENSSL will be defined, and the following code
will be enabled in "my_global.h"

#ifdef HAVE_UNISTD_H
#if defined(HAVE_OPENSSL) && !defined(__FreeBSD__) && !defined(NeXT) && !defined(__OpenBSD__) && !defined(__APPLE__)
#define crypt unistd_crypt
#endif
#include <unistd.h>
#ifdef HAVE_OPENSSL
#undef crypt
#endif

This will make the header define "unistd_crypt" instead of "crypt",
causing the compile to fail

Error 328: "item_strfunc.cc", line 1467 # Function 'crypt' has not
been defined yet; cannot call.
      char *tmp=crypt(res->c_ptr(),salt_ptr);
                ^^^^^

How to repeat:
Compile 5.0.6-pre on HP-UX 11.00 with the configure
flags --with-openssl or --with-yassl

Suggested fix:
Remove the strange test in "my_global.h", and add proper
configure tests. This test should also cover bug#10675, i.e.
it seems that crypt() is sometimes defined in "unistd.h"
instead of "crypt.h".
[8 Jun 2005 16:03] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/25762
[10 Jun 2005 7:45] Sergey Vojtovich
Fixed in 4.0.25, 4.1.13, 5.0.8.
ChangeSet 1.2116
[10 Jun 2005 19:54] Paul DuBois
Noted in 4.0.25, 4.1.13, 5.0.8 changelogs.