ChangePassword for Linux compilation error
ChangePassword is the web CGI that allow the user to change their password thru the http/web instead of telner/SSH into the system in order to change their password. The installation source file can be found from http://changepassword.sourceforge.net/
Basically the configuration and compilation is simple as below:
1. Run ./configure
Example:
./configure –enable-cgidir=/var/www/cgi-bin –enable-smbpasswd=/usr/local/samba/private/smbpasswd –disable-squidpasswd
–enable-logo=brain-cluster.jpg
2) run “make”
3) run “make install”
4) copy the logo file (if set by –enable-logo option) to the website root htdocs folder
Problem: Error in compilation
You might encounter error during the “make” step for certain Linux distribution/version. Below is the error:
suse10:~/changepassword-0.9 # make
gcc -c -o smbencrypt/SMBPasswdGen.o smbencrypt/SMBPasswdGen.c
gcc -c -o smbencrypt/encrypt.o smbencrypt/encrypt.c
gcc -c -o smbencrypt/md4.o smbencrypt/md4.c
gcc -c -o smbencrypt/smbencrypt.o smbencrypt/smbencrypt.c
gcc changepassword.c -o changepassword.cgi smbencrypt/SMBPasswdGen.o smbencrypt/md4.o smbencrypt/smbencrypt.o smbencrypt/encrypt.o -lcrypt -DPACKAGE_NAME=\”\” -DPACKAGE_TARNAME=\”\” -DPACKAGE_VERSION=\”\” -DPACKAGE_STRING=\”\” -DPACKAGE_BUGREPORT=\”\” -DHAVE_LIBCRYPT=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_STDIO_H=1 -DHAVE_STRING_H=1 -DHAVE_STDLIB_H=1 -DHAVE_PWD_H=1 -DHAVE_ERRNO_H=1 -DHAVE_SIGNAL_H=1 -DHAVE_SHADOW_H=1 -DHAVE_TIME_H=1 -DEnglish -DSMBPASSWD=\”no\” -DSQUIDPASSWD=\”no\” -DLOGO=\”giant_logo.jpg\” -L./smbencrypt -ldes
/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/bin/ld: skipping incompatible ./smbencrypt/libdes.a when searching for -ldes
/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/bin/ld: cannot find -ldes
collect2: ld returned 1 exit status
make: *** [changepassword.cgi] Error 1
Solution: Recompile libdes.a
This is due to the incompatible file named libdes.a. Below is the solution
suse10:~/changepassword-0.9 # cd smbencrypt/
suse10:~/changepassword-0.9/smbencrypt # tar -xzvf libdes-4.04b.tar.gz
suse10:~/changepassword-0.9/smbencrypt # cd des/
suse10:~/changepassword-0.9/smbencrypt/des # make
suse10:~/changepassword-0.9/smbencrypt/des # cp libdes.a ..
suse10:~/changepassword-0.9/smbencrypt/des # cd ../..
run the “make” and “make install” again from the root of the changepassword installation source
suse10:~/changepassword-0.9 # make
suse10:~/changepassword-0.9 # make install
the compilation should be able to go thru.