From 49ec7989a58fef13b7235116af8ae04bd736d421 Mon Sep 17 00:00:00 2001 From: "Andrew G. Morgan" Date: Sun, 3 Dec 2000 23:35:29 +0000 Subject: [PATCH] Relevant BUGIDs: 124136 Purpose of commit: bugfix Commit summary: --------------- Makefile dependencies pam_userdb did not compile on a Red Hat 5.2 system. It does now. --- Make.Rules.in | 1 + Makefile | 6 +- _pam_aconf.h.in | 10 +-- configure | 144 +++++++++++++++++++++----------- configure.in | 8 +- modules/pam_userdb/Makefile | 8 +- modules/pam_userdb/pam_userdb.c | 10 +-- 7 files changed, 118 insertions(+), 69 deletions(-) diff --git a/Make.Rules.in b/Make.Rules.in index 96337eb0..1a81f89f 100644 --- a/Make.Rules.in +++ b/Make.Rules.in @@ -44,6 +44,7 @@ NEED_LINK_LIB_C=@PAM_NEEDS_LIBC@ HAVE_LCKPWDF=@HAVE_LCKPWDF@ HAVE_LIBCRACK=@HAVE_LIBCRACK@ HAVE_LIBCRYPT=@HAVE_LIBCRYPT@ +HAVE_NDBM_H=@HAVE_NDBM_H@ HAVE_LIBNDBM=@HAVE_LIBNDBM@ HAVE_LIBDB=@HAVE_LIBDB@ HAVE_LIBFL=@HAVE_LIBFL@ diff --git a/Makefile b/Makefile index 26e0f468..2f57fff7 100644 --- a/Makefile +++ b/Makefile @@ -42,12 +42,14 @@ Make.Rules: configure Make.Rules.in _pam_aconf.h.in @echo XXX - by hand, with the options you want. ./configure +_pam_aconf.h: Make.Rules + configure: configure.in - @$(MAKE) distclean @echo - @echo You do not appear to have a ./configure file. + @echo You do not appear to have an up-to-date ./configure file. @echo Please run autoconf, and then ./configure [..options..] @echo + @rm -f configure @exit 1 $(THINGSTOMAKE): _pam_aconf.h prep diff --git a/_pam_aconf.h.in b/_pam_aconf.h.in index 4c18f6cf..3a200514 100644 --- a/_pam_aconf.h.in +++ b/_pam_aconf.h.in @@ -35,13 +35,9 @@ #undef HAVE_LIBCRYPT #undef HAVE_CRYPT_H -/* we have libdb */ -#undef HAVE_LIBDB - -#ifndef HAVE_LIBDB -/* we have libndbm - instead of libdb */ -#undef HAVE_LIBNDBM -#endif /* HAVE_LIBDB */ +/* we have libndbm and/or libdb */ +#undef HAVE_DB_H +#undef HAVE_NDBM_H /* have libfl (Flex) */ #undef HAVE_LIBFL diff --git a/configure b/configure index 653e9087..338d885b 100755 --- a/configure +++ b/configure @@ -555,7 +555,7 @@ fi LIBPAM_VERSION_MAJOR=0 -LIBPAM_VERSION_MINOR=73 +LIBPAM_VERSION_MINOR=74 @@ -2141,7 +2141,7 @@ fi done -for ac_hdr in lastlog.h utmp.h utmpx.h +for ac_hdr in ndbm.h db.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 @@ -2181,10 +2181,53 @@ else fi done +HAVE_NDBM_H=$ac_cv_header_ndbm_h + + +for ac_hdr in lastlog.h utmp.h utmpx.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:2192: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2202: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + echo $ac_n "checking path to cracklib dictionary""... $ac_c" 1>&6 -echo "configure:2188: checking path to cracklib dictionary" >&5 +echo "configure:2231: checking path to cracklib dictionary" >&5 DICT_DIR_CANDIDATES="/usr/lib /usr/share/dict /usr/share/lib \ /usr/local/lib /usr/local/share/lib" DICT_FILE_CANDIDATES="pw_dict cracklib_dict" @@ -2247,14 +2290,14 @@ fi echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:2251: checking whether byte ordering is bigendian" >&5 +echo "configure:2294: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < #include @@ -2265,11 +2308,11 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:2269: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2312: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < #include @@ -2280,7 +2323,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:2284: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2327: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -2300,7 +2343,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2360: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no else @@ -2337,12 +2380,12 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:2341: checking for working const" >&5 +echo "configure:2384: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2438: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -2412,12 +2455,12 @@ EOF fi echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:2416: checking for uid_t in sys/types.h" >&5 +echo "configure:2459: checking for uid_t in sys/types.h" >&5 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -2446,12 +2489,12 @@ EOF fi echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:2450: checking for off_t" >&5 +echo "configure:2493: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2479,12 +2522,12 @@ EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:2483: checking for pid_t" >&5 +echo "configure:2526: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2512,12 +2555,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:2516: checking for size_t" >&5 +echo "configure:2559: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2545,12 +2588,12 @@ EOF fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:2549: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:2592: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2559,7 +2602,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:2563: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2606: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -2580,12 +2623,12 @@ EOF fi echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 -echo "configure:2584: checking whether struct tm is in sys/time.h or time.h" >&5 +echo "configure:2627: checking whether struct tm is in sys/time.h or time.h" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2593,7 +2636,7 @@ int main() { struct tm *tp; tp->tm_sec; ; return 0; } EOF -if { (eval echo configure:2597: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2640: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else @@ -2615,7 +2658,7 @@ fi echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6 -echo "configure:2619: checking type of array argument to getgroups" >&5 +echo "configure:2662: checking type of array argument to getgroups" >&5 if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2623,7 +2666,7 @@ else ac_cv_type_getgroups=cross else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2695: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_type_getgroups=gid_t else @@ -2662,7 +2705,7 @@ fi if test $ac_cv_type_getgroups = cross; then cat > conftest.$ac_ext < EOF @@ -2687,13 +2730,13 @@ EOF if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 -echo "configure:2691: checking whether ${CC-cc} needs -traditional" >&5 +echo "configure:2734: checking whether ${CC-cc} needs -traditional" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_pattern="Autoconf.*'x'" cat > conftest.$ac_ext < Autoconf TIOCGETP @@ -2711,7 +2754,7 @@ rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext < Autoconf TCGETA @@ -2733,7 +2776,7 @@ echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6 fi echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6 -echo "configure:2737: checking for 8-bit clean memcmp" >&5 +echo "configure:2780: checking for 8-bit clean memcmp" >&5 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2741,7 +2784,7 @@ else ac_cv_func_memcmp_clean=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2798: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_memcmp_clean=yes else @@ -2769,12 +2812,12 @@ echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}" echo $ac_n "checking for vprintf""... $ac_c" 1>&6 -echo "configure:2773: checking for vprintf" >&5 +echo "configure:2816: checking for vprintf" >&5 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2844: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_vprintf=yes" else @@ -2821,12 +2864,12 @@ fi if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 -echo "configure:2825: checking for _doprnt" >&5 +echo "configure:2868: checking for _doprnt" >&5 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2896: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func__doprnt=yes" else @@ -2876,12 +2919,12 @@ fi for ac_func in gethostname gettimeofday mkdir select strcspn strdup strerror strspn strstr strtol uname do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2880: checking for $ac_func" >&5 +echo "configure:2923: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2951: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2932,7 +2975,7 @@ done # Extract the first word of "sgml2txt", so it can be a program name with args. set dummy sgml2txt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2936: checking for $ac_word" >&5 +echo "configure:2979: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_HAVE_SGML2TXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2962,7 +3005,7 @@ fi # Extract the first word of "sgml2html", so it can be a program name with args. set dummy sgml2html; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2966: checking for $ac_word" >&5 +echo "configure:3009: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_HAVE_SGML2HTML'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2992,7 +3035,7 @@ fi # Extract the first word of "sgml2latex", so it can be a program name with args. set dummy sgml2latex; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2996: checking for $ac_word" >&5 +echo "configure:3039: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_HAVE_SGML2LATEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3029,7 +3072,7 @@ else # Extract the first word of "sgml2ps", so it can be a program name with args. set dummy sgml2ps; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3033: checking for $ac_word" >&5 +echo "configure:3076: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_HAVE_SGML2PS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3237,6 +3280,7 @@ s%@HAVE_LIBFL@%$HAVE_LIBFL%g s%@HAVE_LIBNSL@%$HAVE_LIBNSL%g s%@HAVE_LIBPWDB@%$HAVE_LIBPWDB%g s%@CPP@%$CPP%g +s%@HAVE_NDBM_H@%$HAVE_NDBM_H%g s%@CRACKLIB_DICTPATH@%$CRACKLIB_DICTPATH%g s%@OS_CFLAGS@%$OS_CFLAGS%g s%@WARNINGS@%$WARNINGS%g diff --git a/configure.in b/configure.in index b5500102..5efe87eb 100644 --- a/configure.in +++ b/configure.in @@ -9,7 +9,7 @@ dnl Release specific dnl LIBPAM_VERSION_MAJOR=0 -LIBPAM_VERSION_MINOR=73 +LIBPAM_VERSION_MINOR=74 AC_SUBST(LIBPAM_VERSION_MAJOR) AC_SUBST(LIBPAM_VERSION_MINOR) @@ -178,6 +178,12 @@ AC_CHECK_HEADERS(features.h) dnl For module/pam_cracklib AC_CHECK_HEADERS(crypt.h) +dnl For module/pam_userdb +AC_CHECK_HEADERS(ndbm.h db.h) +dnl I suspect the following two lines are a hack. +HAVE_NDBM_H=$ac_cv_header_ndbm_h +AC_SUBST(HAVE_NDBM_H) + dnl For module/pam_lastlog AC_CHECK_HEADERS(lastlog.h utmp.h utmpx.h) diff --git a/modules/pam_userdb/Makefile b/modules/pam_userdb/Makefile index 8951fd91..aeee0c03 100644 --- a/modules/pam_userdb/Makefile +++ b/modules/pam_userdb/Makefile @@ -10,13 +10,13 @@ include ../../Make.Rules TITLE=pam_userdb +ifeq ($(HAVE_NDBM_H),yes) + WHICH_DB=ndbm + MODULE_SIMPLE_EXTRALIBS = -lndbm +else ifeq ($(HAVE_LIBDB),yes) WHICH_DB=db MODULE_SIMPLE_EXTRALIBS = -ldb -else -ifeq ($(HAVE_LIBNDBM),yes) - WHICH_DB=ndbm - MODULE_SIMPLE_EXTRALIBS = -lndbm else WHICH_DB=none endif diff --git a/modules/pam_userdb/pam_userdb.c b/modules/pam_userdb/pam_userdb.c index 7af5d384..497cf0be 100644 --- a/modules/pam_userdb/pam_userdb.c +++ b/modules/pam_userdb/pam_userdb.c @@ -20,12 +20,12 @@ #include "pam_userdb.h" -#ifdef HAVE_LIBDB -# define DB_DBM_HSEARCH 1 /* use the dbm interface */ -# include +#ifdef HAVE_NDBM_H +# include #else -# ifdef HAVE_LIBNDBM -# include +# ifdef HAVE_DB_H +# define DB_DBM_HSEARCH 1 /* use the dbm interface */ +# include # else # error "failed to find a libdb or equivalent" # endif -- 2.40.0