From e509c5af6f70eb3cfd846004b82caaca24fd4a3b Mon Sep 17 00:00:00 2001 From: "Andrew G. Morgan" Date: Wed, 29 May 2002 06:35:46 +0000 Subject: [PATCH] Relevant BUGIDs: 491466 Purpose of commit: cleanup Commit summary: --------------- These were all suggestions from the OS X patch provided by Luke Howard. There is another proposed patch for OS X support which promises to be a little cleaner with the heavy stuff, so I am committing these simple changes now, with the intention of moving to the other patch for the big stuff (see 534205). --- CHANGELOG | 3 + Make.Rules.in | 8 ++ conf/pam_conv1/Makefile | 7 +- conf/pam_conv1/pam_conv.y | 3 +- configure | 269 ++++++++++++++++++++++++++------------ configure.in | 11 ++ doc/Makefile | 3 +- examples/test.c | 88 ------------- libpam/pam_strerror.c | 2 +- 9 files changed, 216 insertions(+), 178 deletions(-) delete mode 100644 examples/test.c diff --git a/CHANGELOG b/CHANGELOG index a7487dde..b608fc3b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -55,6 +55,9 @@ bug report - outstanding bugs are listed here: 0.76: please submit patches for this section with actual code/doc patches! +* absorbed some of the proposed darwin (OS X) changes from Luke Howard + (of PADL software) - hopefully will get the rest (see Rob Braun's + 534205) by 0.77 (Bug 491466 - agmorgan). * README fix for pam_unix from Nalin (Bug 476971 - agmorgan). * add support for building pdf files from the documentation - request from 'lolive' (Bug 471377 - agmorgan). diff --git a/Make.Rules.in b/Make.Rules.in index 894ea4ac..d705bd0e 100644 --- a/Make.Rules.in +++ b/Make.Rules.in @@ -52,6 +52,14 @@ HAVE_LIBFL=@HAVE_LIBFL@ HAVE_LIBNSL=@HAVE_LIBNSL@ HAVE_LIBPWDB=@HAVE_LIBPWDB@ +ifeq (@HAVE_LIBFLEX@,yes) +LINK_LIBLEX=-lfl +else +ifeq (@HAVE_LIBLEX@,yes) +LINK_LIBLEX=-ll +endif +endif + # documentation support HAVE_SGML2TXT=@HAVE_SGML2TXT@ HAVE_SGML2HTML=@HAVE_SGML2HTML@ diff --git a/conf/pam_conv1/Makefile b/conf/pam_conv1/Makefile index 7691dc31..2fda767e 100644 --- a/conf/pam_conv1/Makefile +++ b/conf/pam_conv1/Makefile @@ -1,4 +1,9 @@ # +# $Id$ +# + +include ../../Make.Rules + # ifeq ($(OS),solaris) @@ -16,7 +21,7 @@ else all: pam_conv1 pam_conv1: pam_conv.tab.c lex.yy.c - $(CC) -o pam_conv1 pam_conv.tab.c -lfl + $(CC) -o pam_conv1 pam_conv.tab.c $(LINK_LIBLEX) pam_conv.tab.c: pam_conv.y lex.yy.c bison pam_conv.y diff --git a/conf/pam_conv1/pam_conv.y b/conf/pam_conv1/pam_conv.y index 18bedccf..f42b634e 100644 --- a/conf/pam_conv1/pam_conv.y +++ b/conf/pam_conv1/pam_conv.y @@ -193,11 +193,12 @@ void yyerror(const char *format, ...) fprintf(stderr, "\n"); } -void main() +int main(int argc, char *argv[]) { if (mkdir(PAM_D, PAM_D_MODE) != 0) { yyerror(PAM_D " already exists.. aborting"); exit(1); } yyparse(); + exit(0); } diff --git a/configure b/configure index 776fe27c..99af1cad 100755 --- a/configure +++ b/configure @@ -1867,18 +1867,108 @@ HAVE_LIBPWDB=no fi +echo $ac_n "checking for yywrap in -lfl""... $ac_c" 1>&6 +echo "configure:1872: checking for yywrap in -lfl" >&5 +ac_lib_var=`echo fl'_'yywrap | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lfl $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + HAVE_LIBFLEX=yes ; cat >> confdefs.h <<\EOF +#define HAVE_LIBFLEX 1 +EOF + +else + echo "$ac_t""no" 1>&6 +HAVE_LIBFLEX=no +fi + + +echo $ac_n "checking for yywrap in -ll""... $ac_c" 1>&6 +echo "configure:1917: checking for yywrap in -ll" >&5 +ac_lib_var=`echo l'_'yywrap | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ll $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + HAVE_LIBLEX=yes ; cat >> confdefs.h <<\EOF +#define HAVE_LIBLEX 1 +EOF + +else + echo "$ac_t""no" 1>&6 +HAVE_LIBLEX=no +fi + + ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:1877: checking for $ac_hdr that defines DIR" >&5 +echo "configure:1967: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> @@ -1886,7 +1976,7 @@ int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:1890: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1980: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -1911,7 +2001,7 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:1915: checking for opendir in -ldir" >&5 +echo "configure:2005: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1919,7 +2009,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2024: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1952,7 +2042,7 @@ fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:1956: checking for opendir in -lx" >&5 +echo "configure:2046: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1960,7 +2050,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2065: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1994,12 +2084,12 @@ fi fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1998: checking for ANSI C header files" >&5 +echo "configure:2088: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2007,7 +2097,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2011: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2101: \"$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* @@ -2024,7 +2114,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2042,7 +2132,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2063,7 +2153,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2074,7 +2164,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:2078: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2168: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -2098,12 +2188,12 @@ EOF fi echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 -echo "configure:2102: checking for sys/wait.h that is POSIX.1 compatible" >&5 +echo "configure:2192: checking for sys/wait.h that is POSIX.1 compatible" >&5 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2119,7 +2209,7 @@ wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF -if { (eval echo configure:2123: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2213: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else @@ -2143,17 +2233,17 @@ for ac_hdr in fcntl.h limits.h malloc.h sys/file.h sys/ioctl.h sys/time.h syslog do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2147: checking for $ac_hdr" >&5 +echo "configure:2237: 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:2157: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2247: \"$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* @@ -2184,17 +2274,17 @@ for ac_hdr in features.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2188: checking for $ac_hdr" >&5 +echo "configure:2278: 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:2198: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2288: \"$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* @@ -2225,17 +2315,17 @@ for ac_hdr in crypt.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2229: checking for $ac_hdr" >&5 +echo "configure:2319: 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:2239: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2329: \"$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* @@ -2266,17 +2356,17 @@ 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 -echo "configure:2270: checking for $ac_hdr" >&5 +echo "configure:2360: 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:2280: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2370: \"$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* @@ -2309,17 +2399,17 @@ 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:2313: checking for $ac_hdr" >&5 +echo "configure:2403: 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:2323: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2413: \"$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* @@ -2348,7 +2438,7 @@ done echo $ac_n "checking path to cracklib dictionary""... $ac_c" 1>&6 -echo "configure:2352: checking path to cracklib dictionary" >&5 +echo "configure:2442: 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" @@ -2424,6 +2514,11 @@ else ### Non-gcc needs attention on per-OS basis ### case "$OS" in + darwin) +# add some stuff here (see sourceforge bug 534205) +# DOCDIR=/System/Documentation/Administration/Libraries/PAM +# MANDIR=/usr/share/man + ;; solaris) ### Support for Solaris-C OS_CFLAGS="" @@ -2471,14 +2566,14 @@ fi echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:2475: checking whether byte ordering is bigendian" >&5 +echo "configure:2570: 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 @@ -2489,11 +2584,11 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:2493: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2588: \"$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 @@ -2504,7 +2599,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:2508: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2603: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -2524,7 +2619,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:2636: \"$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 @@ -2561,12 +2656,12 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:2565: checking for working const" >&5 +echo "configure:2660: 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:2714: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -2636,12 +2731,12 @@ EOF fi echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:2640: checking for uid_t in sys/types.h" >&5 +echo "configure:2735: 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 @@ -2670,12 +2765,12 @@ EOF fi echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:2674: checking for off_t" >&5 +echo "configure:2769: 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 @@ -2703,12 +2798,12 @@ EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:2707: checking for pid_t" >&5 +echo "configure:2802: 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 @@ -2736,12 +2831,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:2740: checking for size_t" >&5 +echo "configure:2835: 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 @@ -2769,12 +2864,12 @@ EOF fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:2773: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:2868: 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 @@ -2783,7 +2878,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:2787: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2882: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -2804,12 +2899,12 @@ EOF fi echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 -echo "configure:2808: checking whether struct tm is in sys/time.h or time.h" >&5 +echo "configure:2903: 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 @@ -2817,7 +2912,7 @@ int main() { struct tm *tp; tp->tm_sec; ; return 0; } EOF -if { (eval echo configure:2821: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2916: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else @@ -2839,7 +2934,7 @@ fi echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6 -echo "configure:2843: checking type of array argument to getgroups" >&5 +echo "configure:2938: 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 @@ -2847,7 +2942,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:2971: \"$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 @@ -2886,7 +2981,7 @@ fi if test $ac_cv_type_getgroups = cross; then cat > conftest.$ac_ext < EOF @@ -2911,13 +3006,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:2915: checking whether ${CC-cc} needs -traditional" >&5 +echo "configure:3010: 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 @@ -2935,7 +3030,7 @@ rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext < Autoconf TCGETA @@ -2957,7 +3052,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:2961: checking for 8-bit clean memcmp" >&5 +echo "configure:3056: 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 @@ -2965,7 +3060,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:3074: \"$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 @@ -2993,12 +3088,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:2997: checking for vprintf" >&5 +echo "configure:3092: 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:3120: \"$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 @@ -3045,12 +3140,12 @@ fi if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 -echo "configure:3049: checking for _doprnt" >&5 +echo "configure:3144: 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:3172: \"$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 @@ -3100,12 +3195,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:3104: checking for $ac_func" >&5 +echo "configure:3199: 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:3227: \"$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 @@ -3156,12 +3251,12 @@ done for ac_func in getpwnam_r getgrnam_r do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3160: checking for $ac_func" >&5 +echo "configure:3255: 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:3283: \"$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 @@ -3212,7 +3307,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:3216: checking for $ac_word" >&5 +echo "configure:3311: 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 @@ -3242,7 +3337,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:3246: checking for $ac_word" >&5 +echo "configure:3341: 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 @@ -3272,7 +3367,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:3276: checking for $ac_word" >&5 +echo "configure:3371: 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 @@ -3308,7 +3403,7 @@ if test $HAVE_SGML2LATEX = "yes" ; then # Extract the first word of "ps2pdf", so it can be a program name with args. set dummy ps2pdf; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3312: checking for $ac_word" >&5 +echo "configure:3407: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_HAVE_PS2PDF'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3339,7 +3434,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:3343: checking for $ac_word" >&5 +echo "configure:3438: 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 @@ -3552,6 +3647,8 @@ s%@HAVE_LIBDB@%$HAVE_LIBDB%g s%@HAVE_LIBFL@%$HAVE_LIBFL%g s%@HAVE_LIBNSL@%$HAVE_LIBNSL%g s%@HAVE_LIBPWDB@%$HAVE_LIBPWDB%g +s%@HAVE_LIBFLEX@%$HAVE_LIBFLEX%g +s%@HAVE_LIBLEX@%$HAVE_LIBLEX%g s%@HAVE_NDBM_H@%$HAVE_NDBM_H%g s%@CRACKLIB_DICTPATH@%$CRACKLIB_DICTPATH%g s%@DYNTYPE@%$DYNTYPE%g diff --git a/configure.in b/configure.in index f4048fef..69087a03 100644 --- a/configure.in +++ b/configure.in @@ -222,6 +222,12 @@ AC_SUBST(HAVE_LIBNSL) AC_CHECK_LIB(pwdb, pwdb_db_name, HAVE_LIBPWDB=yes ; AC_DEFINE(HAVE_LIBPWDB), HAVE_LIBPWDB=no) AC_SUBST(HAVE_LIBPWDB) +AC_CHECK_LIB(fl, yywrap, HAVE_LIBFLEX=yes ; AC_DEFINE(HAVE_LIBFLEX), + HAVE_LIBFLEX=no) +AC_SUBST(HAVE_LIBFLEX) +AC_CHECK_LIB(l, yywrap, HAVE_LIBLEX=yes ; AC_DEFINE(HAVE_LIBLEX), + HAVE_LIBLEX=no) +AC_SUBST(HAVE_LIBLEX) dnl Checks for header files. AC_HEADER_DIRENT @@ -337,6 +343,11 @@ else ### Non-gcc needs attention on per-OS basis ### case "$OS" in + darwin) +# add some stuff here (see sourceforge bug 534205) +# DOCDIR=/System/Documentation/Administration/Libraries/PAM +# MANDIR=/usr/share/man + ;; solaris) ### Support for Solaris-C OS_CFLAGS="" diff --git a/doc/Makefile b/doc/Makefile index 0d9adfa6..63c11fbf 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -138,7 +138,8 @@ ifeq ($(HAVE_SGML2HTML),yes) install -m 644 $$file $(FAKEROOT)$(DOCDIR)/html ; \ done endif - mkdir -p $(FAKEROOT)$(MANDIR)/man{3,8} + mkdir -p $(FAKEROOT)$(MANDIR)/man3 + mkdir -p $(FAKEROOT)$(MANDIR)/man8 for file in man/*.3 ; do \ install -m 644 $$file $(FAKEROOT)$(MANDIR)/man3 ; \ done diff --git a/examples/test.c b/examples/test.c deleted file mode 100644 index 7e166b48..00000000 --- a/examples/test.c +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Marc Ewing (marc@redhat.com) - original test code - * Alexander O. Yuriev (alex@bach.cis.temple.edu) - * Andrew Morgan (morgan@physics.ucla.edu) - */ - -#include -#include -#include - -#include - -/* this program is not written to the PAM spec: it tests the - * pam_[sg]et_data() functions. Which is usually reserved for modules */ - -#include -#include - -#define USERNAMESIZE 1024 - -static int test_conv( int num_msg, - const struct pam_message **msgm, - struct pam_response **response, - void *appdata_ptr ) -{ - return 0; -} - -static struct pam_conv conv = { - test_conv, - NULL -}; - -static int cleanup_func(pam_handle_t *pamh, void *data, int error_status) -{ - printf("Cleaning up!\n"); - return PAM_SUCCESS; -} - -void main( void ) -{ - pam_handle_t *pamh; - char *name = ( char *) malloc( USERNAMESIZE + 1 ); - char *p = NULL; - char *s = NULL; - - if (! name ) - { - perror( "Ouch, don't have enough memory"); - exit( -1 ); - } - - - - - fprintf( stdout, "Enter a name of a user to authenticate : "); - name = fgets( name , USERNAMESIZE, stdin ); - if ( !name ) - { - perror ( "Hey, how can authenticate " - "someone whos name I don't know?" ); - exit ( -1 ); - } - - *( name + strlen ( name ) - 1 ) = 0; - - pam_start( "login", name, &conv, &pamh ); - - p = x_strdup( getpass ("Password: ") ); - if ( !p ) - { - perror ( "You love NULL pointers, " - "don't you? I don't "); - exit ( -1 ); - } - pam_set_item ( pamh, PAM_AUTHTOK, p ); - pam_get_item ( pamh, PAM_USER, (void**) &s); - pam_set_data(pamh, "DATA", "Hi there! I'm data!", cleanup_func); - pam_get_data(pamh, "DATA", (void **) &s); - printf("%s\n", s); - - fprintf( stdout, "*** Attempting to perform " - "PAM authentication...\n"); - fprintf( stdout, "%s\n", - pam_strerror( pam_authenticate( pamh, 0 ) ) ) ; - - pam_end(pamh, PAM_SUCCESS); -} diff --git a/libpam/pam_strerror.c b/libpam/pam_strerror.c index 2c588258..de857fd8 100644 --- a/libpam/pam_strerror.c +++ b/libpam/pam_strerror.c @@ -89,5 +89,5 @@ const char *pam_strerror(pam_handle_t *pamh, int errnum) return "Application needs to call libpam again"; } - return "Unknown Linux-PAM error (need to upgrde libpam?)"; + return "Unknown PAM error"; } -- 2.40.0