php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #3577 Invalid "#define" directive in crypt.c
Submitted: 2000-02-23 02:50 UTC Modified: 2000-02-25 22:38 UTC
From: agm30 at tid dot es Assigned:
Status: Closed Package: Compile Failure
PHP Version: 4.0 Beta 4 OS: sparc-sun-solaris2.5.1
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: agm30 at tid dot es
New email:
PHP Version: OS:

 

 [2000-02-23 02:50 UTC] agm30 at tid dot es
Hi.

  Trying to install PHP4b4 with these options:

configure  --enable-debug --enable-shared --enable-static --enable-track-vars --enable-xml --with-apxs=/d1/apache1.3/sbin/apxs --with-config-file-path=/d1/apache1.3/conf --with-ftp --with-gd=/usr/local --with-gdbm=/opt/gnu/lib --with-java=/d1/Java/J2SE --with-jpeg-dir=/d1/PHP/Libs/jpeg/jpeg-6b --with-ldap=/usr/local/ldapsdk --with-oci8=/d1/oracle805 --with-oracle=/d1/oracle805 --with-pdflib=/usr/local --with-png-dir=/d1/PHP/Libs/PNG/libpng-1.0.5 --with-png=yes --with-tiff-dir=/d1/PHP/Libs/tiff/tiff-v3.5.4 --with-xml --with-zlib-dir=/d1/PHP/Libs/zLib/zlib-1.1.3 --with-zlib=/usr/local

  and these environ variables:

LDFLAGS="-L/opt/gnu -L/opt/gnu/lib -L/usr/local -L/usr/local/lib -L/usr/lib -L/usr/ucblib -L/d1/apache1.3/libexec"
CPPFLAGS="-I/opt/gnu -I/opt/gnu/include -I/usr/local -I/usr/local/include -I/usr/include -I/usr/ucbinclude"

  I returned this from "make":

.../...
Making all in standard
.../...
crypt.c: In function `php_if_crypt':
crypt.c:120: `PHP3_MAX_SALT_LEN' undeclared (first use in this function)
crypt.c:120: (Each undeclared identifier is reported only once
crypt.c:120: for each function it appears in.)
crypt.c:120: size of array `salt' has non-integer type
crypt.c: At top level:
crypt.c:111: warning: `php_to64' defined but not used
.../...

  Any ideas?
  Many thanks.

  Arturo Garcia
  agm30@tid.es

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-02-23 03:26 UTC] agm30 at tid dot es
Trying to "solve" this bug, I added the next code to ext/standard/crypt.c at line 93:

/*
 * BEGIN OF: Added on: 23 / 02 / 2000, 09:14:29 MET
 */
#ifndef PHP3_MAX_SALT_LEN
#define PHP3_MAX_SALT_LEN 17
#endif
/*
 * END OF: Added on: 23 / 02 / 2000, 09:14:29 MET
 */

and it works. ;)

The question is whether "17" is a valid value for undefined "PHP3_MAX_SALT_LEN".

Many thanks.
Arturo (agm30@tid.es)
 [2000-02-23 09:00 UTC] sas at cvs dot php dot net
Please have a look at config.log, search for "standard DES" and append the compiler's error messages to this bug report.
 [2000-02-23 09:28 UTC] agm30 at tid dot es
Hi. Looking at config.log (after setting PHP3_MAX_SALT_LEN 17) looks like this:

[BEGIN]

.../...

configure:15643: checking for crypt in -lcrypt
configure:15702: checking for getcwd
configure:15730: gcc -o conftest -g -O2   -R/usr/ucblib -L/usr/ucblib -R/usr/local/lib -L/usr/local/lib -R/d1/PHP/Libs/jpeg/jpeg-6b/lib -L/d1/PHP/Libs/jpeg/jpeg-6b/lib -R/d1/PHP/Libs/PNG/libpng-1.0.5/lib -L/d1/PHP/Libs/PNG/libpng-1.0.5/lib -R/d1/PHP/Libs/tiff/tiff-v3.5.4/lib -L/d1/PHP/Libs/tiff/tiff-v3.5.4/lib conftest.c -ldl -lpdf -ltiff -ljpeg -lz -lpng -lgd -lgdbm -lresolv -lresolv -lresolv -lm -lcrypt -lsocket -lnsl  -lsocket -lz -L/d1/PHP/Libs/jpeg/jpeg-6b/lib -ljpeg -L/d1/PHP/Libs/PNG/libpng-1.0.5/lib -lpng -L/d1/PHP/Libs/tiff/tiff-v3.5.4/lib -ltiff 1>&5
configure:15757: checking for getwd
configure:15785: gcc -o conftest -g -O2   -R/usr/ucblib -L/usr/ucblib -R/usr/local/lib -L/usr/local/lib -R/d1/PHP/Libs/jpeg/jpeg-6b/lib -L/d1/PHP/Libs/jpeg/jpeg-6b/lib -R/d1/PHP/Libs/PNG/libpng-1.0.5/lib -L/d1/PHP/Libs/PNG/libpng-1.0.5/lib -R/d1/PHP/Libs/tiff/tiff-v3.5.4/lib -L/d1/PHP/Libs/tiff/tiff-v3.5.4/lib conftest.c -ldl -lpdf -ltiff -ljpeg -lz -lpng -lgd -lgdbm -lresolv -lresolv -lresolv -lm -lcrypt -lsocket -lnsl  -lsocket -lz -L/d1/PHP/Libs/jpeg/jpeg-6b/lib -ljpeg -L/d1/PHP/Libs/PNG/libpng-1.0.5/lib -lpng -L/d1/PHP/Libs/tiff/tiff-v3.5.4/lib -ltiff 1>&5
configure:15840: checking for standard DES crypt
configure:15862: gcc -o conftest -g -O2   -R/usr/ucblib -L/usr/ucblib -R/usr/local/lib -L/usr/local/lib -R/d1/PHP/Libs/jpeg/jpeg-6b/lib -L/d1/PHP/Libs/jpeg/jpeg-6b/lib -R/d1/PHP/Libs/PNG/libpng-1.0.5/lib -L/d1/PHP/Libs/PNG/libpng-1.0.5/lib -R/d1/PHP/Libs/tiff/tiff-v3.5.4/lib -L/d1/PHP/Libs/tiff/tiff-v3.5.4/lib conftest.c -ldl -lpdf -ltiff -ljpeg -lz -lpng -lgd -lgdbm -lresolv -lresolv -lresolv -lm -lcrypt -lsocket -lnsl  -lsocket -lz -L/d1/PHP/Libs/jpeg/jpeg-6b/lib -ljpeg -L/d1/PHP/Libs/PNG/libpng-1.0.5/lib -lpng -L/d1/PHP/Libs/tiff/tiff-v3.5.4/lib -ltiff 1>&5
configure:15895: checking for extended DES crypt
configure:15917: gcc -o conftest -g -O2   -R/usr/ucblib -L/usr/ucblib -R/usr/local/lib -L/usr/local/lib -R/d1/PHP/Libs/jpeg/jpeg-6b/lib -L/d1/PHP/Libs/jpeg/jpeg-6b/lib -R/d1/PHP/Libs/PNG/libpng-1.0.5/lib -L/d1/PHP/Libs/PNG/libpng-1.0.5/lib -R/d1/PHP/Libs/tiff/tiff-v3.5.4/lib -L/d1/PHP/Libs/tiff/tiff-v3.5.4/lib conftest.c -ldl -lpdf -ltiff -ljpeg -lz -lpng -lgd -lgdbm -lresolv -lresolv -lresolv -lm -lcrypt -lsocket -lnsl  -lsocket -lz -L/d1/PHP/Libs/jpeg/jpeg-6b/lib -ljpeg -L/d1/PHP/Libs/PNG/libpng-1.0.5/lib -lpng -L/d1/PHP/Libs/tiff/tiff-v3.5.4/lib -ltiff 1>&5
configure: failed program was:
#line 15906 "configure"
#include "confdefs.h"

main() {
#if HAVE_CRYPT
    exit (strcmp((char *)crypt("rasmuslerdorf","_J9..rasm"),"_J9..rasmBYk8r9AiWNc"));
#else
	exit(0);
#endif
}
configure:15950: checking for MD5 crypt
configure:15981: gcc -o conftest -g -O2   -R/usr/ucblib -L/usr/ucblib -R/usr/local/lib -L/usr/local/lib -R/d1/PHP/Libs/jpeg/jpeg-6b/lib -L/d1/PHP/Libs/jpeg/jpeg-6b/lib -R/d1/PHP/Libs/PNG/libpng-1.0.5/lib -L/d1/PHP/Libs/PNG/libpng-1.0.5/lib -R/d1/PHP/Libs/tiff/tiff-v3.5.4/lib -L/d1/PHP/Libs/tiff/tiff-v3.5.4/lib conftest.c -ldl -lpdf -ltiff -ljpeg -lz -lpng -lgd -lgdbm -lresolv -lresolv -lresolv -lm -lcrypt -lsocket -lnsl  -lsocket -lz -L/d1/PHP/Libs/jpeg/jpeg-6b/lib -ljpeg -L/d1/PHP/Libs/PNG/libpng-1.0.5/lib -lpng -L/d1/PHP/Libs/tiff/tiff-v3.5.4/lib -ltiff 1>&5
configure: failed program was:
#line 15961 "configure"
#include "confdefs.h"

main() {
#if HAVE_CRYPT
    char salt[15], answer[40];

    salt[0]='$'; salt[1]='1'; salt[2]='$'; 
    salt[3]='r'; salt[4]='a'; salt[5]='s';
    salt[6]='m'; salt[7]='u'; salt[8]='s';
    salt[9]='l'; salt[10]='e'; salt[11]='$';
    salt[12]='\0';
    strcpy(answer,salt);
    strcat(answer,"rISCgZzpwk3UhDidwXvin0");
    exit (strcmp((char *)crypt("rasmuslerdorf",salt),answer));
#else
	exit(0);
#endif
}

.../...

[END]

 [2000-02-25 22:38 UTC] zeev at cvs dot php dot net
Fixed (verified with user)
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Mon Oct 12 22:00:01 2026 UTC