From 37627eb57118108d35b251aafdd156f03ff9d443 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Sat, 10 May 2003 04:03:37 +0000 Subject: [PATCH] Remove HPUX 9 rint() test. Cleanup new crypt() source code. --- configure | 154 ----------------------------------------------- configure.in | 18 +----- src/port/crypt.c | 12 ++-- 3 files changed, 8 insertions(+), 176 deletions(-) diff --git a/configure b/configure index 2d277dde6dd..13de7fd2f05 100755 --- a/configure +++ b/configure @@ -11263,159 +11263,6 @@ LIBOBJS="$LIBOBJS dirmod.$ac_objext" LIBOBJS="$LIBOBJS opendir.$ac_objext" ;; esac -# Now that rint() is /port, I am not sure this still works, bjm 2003-05-09 -# On HPUX 9, rint() is not in regular libm.a but in /lib/pa1.1/libm.a; -# this hackery with HPUXMATHLIB allows us to cope. -HPUXMATHLIB="" -case $host_cpu in - hppa1.1) - if test -r /lib/pa1.1/libm.a ; then - HPUXMATHLIB="-L /lib/pa1.1 -lm" - fi ;; -esac - - - -for ac_func in rint -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. */ -#include -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -char (*f) (); - -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif -int -main () -{ -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -f = $ac_func; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -eval "$as_ac_var=no" -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -else - echo "$as_me:$LINENO: checking for rint in -lm" >&5 -echo $ECHO_N "checking for rint in -lm... $ECHO_C" >&6 -if test "${ac_cv_lib_m_rint+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lm $HPUXMATHLIB $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char rint (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif -int -main () -{ -rint (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_m_rint=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_lib_m_rint=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_m_rint" >&5 -echo "${ECHO_T}$ac_cv_lib_m_rint" >&6 -if test $ac_cv_lib_m_rint = yes; then - cat >>confdefs.h <<\_ACEOF -#define HAVE_RINT 1 -_ACEOF - -fi - -fi -done - - - if test "$with_readline" = yes; then echo "$as_me:$LINENO: checking for rl_completion_append_character" >&5 echo $ECHO_N "checking for rl_completion_append_character... $ECHO_C" >&6 @@ -17230,7 +17077,6 @@ s,@python_moduleexecdir@,$python_moduleexecdir,;t t s,@python_includespec@,$python_includespec,;t t s,@python_libspec@,$python_libspec,;t t s,@LIBOBJS@,$LIBOBJS,;t t -s,@HPUXMATHLIB@,$HPUXMATHLIB,;t t s,@HAVE_POSIX_SIGNALS@,$HAVE_POSIX_SIGNALS,;t t s,@MSGFMT@,$MSGFMT,;t t s,@MSGMERGE@,$MSGMERGE,;t t diff --git a/configure.in b/configure.in index a8408e64a9f..b7f5aa63d08 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -dnl $Header: /cvsroot/pgsql/configure.in,v 1.248 2003/05/09 16:52:10 momjian Exp $ +dnl $Header: /cvsroot/pgsql/configure.in,v 1.249 2003/05/10 04:03:37 momjian Exp $ dnl dnl Developers, please strive to achieve this order: dnl @@ -867,22 +867,6 @@ AC_LIBOBJ(dirmod) AC_LIBOBJ(opendir) ;; esac -# Now that rint() is /port, I am not sure this still works, bjm 2003-05-09 -# On HPUX 9, rint() is not in regular libm.a but in /lib/pa1.1/libm.a; -# this hackery with HPUXMATHLIB allows us to cope. -HPUXMATHLIB="" -case $host_cpu in - hppa1.1) - if test -r /lib/pa1.1/libm.a ; then - HPUXMATHLIB="-L /lib/pa1.1 -lm" - fi ;; -esac -AC_SUBST(HPUXMATHLIB) - -AC_CHECK_FUNCS(rint, [], - [AC_CHECK_LIB(m, rint, AC_DEFINE(HAVE_RINT), , $HPUXMATHLIB)]) - - if test "$with_readline" = yes; then PGAC_VAR_RL_COMPLETION_APPEND_CHARACTER AC_CHECK_FUNCS([rl_completion_matches rl_filename_completion_function]) diff --git a/src/port/crypt.c b/src/port/crypt.c index 08664dcf4e2..a76a0934e49 100644 --- a/src/port/crypt.c +++ b/src/port/crypt.c @@ -53,7 +53,10 @@ __RCSID("$NetBSD: crypt.c,v 1.18 2001/03/01 14:37:35 wiz Exp $"); #include #include -#include "crypt.h" +static int des_setkey(const char *key); +static int des_cipher(const char *in, char *out, long salt, int num_iter); +static int setkey(const char *key); +static int encrypt(char *block, int flag); /* * UNIX password, and DES, encryption. @@ -473,7 +476,6 @@ static C_block CF6464[64/CHUNKBITS][1<