From c56b20e6f6dfb2f047e951bb700a14b9c1127359 Mon Sep 17 00:00:00 2001 From: tholo Date: Tue, 18 Mar 1997 02:09:39 +0000 Subject: [PATCH] Integrate local changes --- gnu/usr.bin/cvs/Makefile.in | 2 +- gnu/usr.bin/cvs/configure | 804 +++++++++------------------- gnu/usr.bin/cvs/configure.in | 16 +- gnu/usr.bin/cvs/contrib/Makefile.in | 12 +- gnu/usr.bin/cvs/macintosh/Makefile | 80 --- gnu/usr.bin/cvs/src/NOTES | 60 --- gnu/usr.bin/cvs/src/commit.c | 60 ++- gnu/usr.bin/cvs/src/cvs.h | 55 +- gnu/usr.bin/cvs/src/ignore.c | 20 +- gnu/usr.bin/cvs/src/lock.c | 81 ++- gnu/usr.bin/cvs/src/main.c | 39 +- gnu/usr.bin/cvs/src/patch.c | 92 +++- gnu/usr.bin/cvs/src/rcscmds.c | 34 +- gnu/usr.bin/cvs/src/server.c | 216 +++++--- gnu/usr.bin/cvs/src/update.c | 129 ++++- 15 files changed, 828 insertions(+), 872 deletions(-) delete mode 100644 gnu/usr.bin/cvs/macintosh/Makefile delete mode 100644 gnu/usr.bin/cvs/src/NOTES diff --git a/gnu/usr.bin/cvs/Makefile.in b/gnu/usr.bin/cvs/Makefile.in index 5189e3305c8..15e87e85493 100644 --- a/gnu/usr.bin/cvs/Makefile.in +++ b/gnu/usr.bin/cvs/Makefile.in @@ -84,7 +84,7 @@ FLAGS_TO_PASS = \ DISTFILES = \ COPYING COPYING.LIB INSTALL README TODO PROJECTS \ - BUGS MINOR-BUGS FAQ HACKING TESTS \ + BUGS MINOR-BUGS FAQ HACKING DEVEL-CVS TESTS \ README.VMS build.com \ ChangeLog NEWS ChangeLog.zoo \ configure configure.in stamp-h.in config.h.in Makefile.in acconfig.h \ diff --git a/gnu/usr.bin/cvs/configure b/gnu/usr.bin/cvs/configure index 62cf2287987..55356ba59bd 100644 --- a/gnu/usr.bin/cvs/configure +++ b/gnu/usr.bin/cvs/configure @@ -1,7 +1,7 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.12 +# Generated automatically using autoconf version 2.10 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation @@ -59,8 +59,6 @@ mandir='${prefix}/man' # Initialize some other variables. subdirs= MFLAGS= MAKEFLAGS= -# Maximum number of lines to put in a shell here document. -ac_max_here_lines=12 ac_prev= for ac_option @@ -342,7 +340,7 @@ EOF verbose=yes ;; -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.12" + echo "configure generated by autoconf version 2.10" exit 0 ;; -with-* | --with-*) @@ -444,14 +442,11 @@ do done # NLS nuisances. -# Only set these to C if already set. These must not be set unconditionally -# because not all systems understand e.g. LANG=C (notably SCO). -# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! -# Non-C LC_CTYPE values break the ctype check. -if test "${LANG+set}" = set; then LANG=C; export LANG; fi +# Only set LANG and LC_ALL to C if already set. +# These must not be set unconditionally because not all systems understand +# e.g. LANG=C (notably SCO). if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi -if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi -if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi +if test "${LANG+set}" = set; then LANG=C; export LANG; fi # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h @@ -513,7 +508,6 @@ ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. @@ -533,7 +527,6 @@ fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:537: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -562,7 +555,6 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:566: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -609,47 +601,7 @@ fi test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:614: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then - ac_cv_prog_cc_works=yes - # If we can't run a trivial program, we are probably using a cross compiler. - if (./conftest; exit) 2>/dev/null; then - ac_cv_prog_cc_cross=no - else - ac_cv_prog_cc_cross=yes - fi -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_prog_cc_works=no -fi -rm -fr conftest* - -echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 -if test $ac_cv_prog_cc_works = no; then - { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } -fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:648: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 -echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 -cross_compiling=$ac_cv_prog_cc_cross - echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:653: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -658,7 +610,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:662: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:614: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -666,34 +618,29 @@ fi fi echo "$ac_t""$ac_cv_prog_gcc" 1>&6 - if test $ac_cv_prog_gcc = yes; then GCC=yes - ac_test_CFLAGS="${CFLAGS+set}" - ac_save_CFLAGS="$CFLAGS" - CFLAGS= - echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:677: checking whether ${CC-cc} accepts -g" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + if test "${CFLAGS+set}" != set; then + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_prog_gcc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then - ac_cv_prog_cc_g=yes + ac_cv_prog_gcc_g=yes else - ac_cv_prog_cc_g=no + ac_cv_prog_gcc_g=no fi rm -f conftest* fi -echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 - if test "$ac_test_CFLAGS" = set; then - CFLAGS="$ac_save_CFLAGS" - elif test $ac_cv_prog_cc_g = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-O2" +echo "$ac_t""$ac_cv_prog_gcc_g" 1>&6 + if test $ac_cv_prog_gcc_g = yes; then + CFLAGS="-g -O" + else + CFLAGS="-O" + fi fi else GCC= @@ -702,7 +649,6 @@ fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:706: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -717,37 +663,33 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:727: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:673: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : else echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:744: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:688: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : else echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 rm -rf conftest* CPP=/lib/cpp fi @@ -763,9 +705,8 @@ fi echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for AIX""... $ac_c" 1>&6 -echo "configure:767: checking for AIX" >&5 cat > conftest.$ac_ext <&6 -echo "configure:792: checking for minix/config.h" >&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:802: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:742: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` 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 @@ -836,7 +774,6 @@ EOF fi echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 -echo "configure:840: checking for POSIXized ISC" >&5 if test -d /etc/conf/kconfig.d && grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 then @@ -862,11 +799,10 @@ LIBS="-lcrypt $LIBS" fi if test "x$prefix" = xNONE; then -echo $ac_n "checking for prefix by $ac_c" 1>&6 +echo $ac_n "checking for prefix by ""... $ac_c" 1>&6 # Extract the first word of "cvs", so it can be a program name with args. set dummy cvs; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:870: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_CVS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -900,18 +836,43 @@ fi fi +# If we cannot run a trivial program, we must be cross compiling. +echo $ac_n "checking whether cross-compiling""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_c_cross'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + ac_cv_c_cross=yes +else +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } +if test -s conftest && (./conftest; exit) 2>/dev/null; then + ac_cv_c_cross=no +else + ac_cv_c_cross=yes +fi +fi +rm -fr conftest* +fi + +echo "$ac_t""$ac_cv_c_cross" 1>&6 +cross_compiling=$ac_cv_c_cross echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:907: 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:922: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_c_const=no fi rm -f conftest* + fi echo "$ac_t""$ac_cv_c_const" 1>&6 @@ -1008,12 +968,11 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:1012: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:" + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do # Account for people who put trailing slashes in PATH elements. case "$ac_dir/" in @@ -1036,7 +995,7 @@ else ;; esac done - IFS="$ac_save_IFS" + IFS="$ac_save_ifs" fi if test "${ac_cv_path_install+set}" = set; then @@ -1060,7 +1019,6 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1064: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1091,7 +1049,6 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1095: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1121,8 +1078,7 @@ done test -n "$YACC" || YACC="yacc" echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:1125: checking whether ${MAKE-make} sets \${MAKE}" >&5 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +set dummy ${MAKE-make}; ac_make=$2 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1151,7 +1107,6 @@ fi # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1155: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_perl_path'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1183,7 +1138,6 @@ fi # Extract the first word of "csh", so it can be a program name with args. set dummy csh; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1187: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_csh_path'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1216,7 +1170,6 @@ fi # Pull the hash mark out of the macro call to avoid m4 problems. ac_msg="whether #! works in shell scripts" echo $ac_n "checking $ac_msg""... $ac_c" 1>&6 -echo "configure:1220: checking $ac_msg" >&5 if eval "test \"`echo '$''{'ac_cv_sys_interpreter'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1242,12 +1195,11 @@ if test X"$ac_cv_sys_interpreter" != X"yes" ; then fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1246: 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 @@ -1255,15 +1207,13 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1259: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1211: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* ac_cv_header_stdc=yes else echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_header_stdc=no fi @@ -1272,7 +1222,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 @@ -1290,7 +1240,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 @@ -1310,8 +1260,8 @@ if test $ac_cv_header_stdc = yes; then if test "$cross_compiling" = yes; then : else - cat > conftest.$ac_ext < conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1322,18 +1272,14 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:1326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null -then +{ (eval echo configure:1276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } +if test -s conftest && (./conftest; exit) 2>/dev/null; then : else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* ac_cv_header_stdc=no fi -rm -fr conftest* fi - +rm -fr conftest* fi fi @@ -1349,27 +1295,24 @@ for ac_hdr in errno.h unistd.h string.h memory.h utime.h fcntl.h ndbm.h \ sys/param.h sys/select.h sys/time.h sys/timeb.h \ io.h direct.h sys/bsdtypes.h sys/resource.h do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +ac_safe=`echo "$ac_hdr" | tr './\055' '___'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1355: 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:1365: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1310: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` 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 @@ -1377,7 +1320,7 @@ 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___%'` + ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdefghijklmnopqrstuvwxyz./\055' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ___'` cat >> confdefs.h <&6 -echo "configure:1392: 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 @@ -1403,22 +1345,22 @@ else #ifndef WIFEXITED #define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif -int main() { +int main() { return 0; } +int t() { int s; wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF -if { (eval echo configure:1413: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1356: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_header_sys_wait_h=no fi rm -f conftest* + fi echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6 @@ -1430,12 +1372,11 @@ EOF fi echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6 -echo "configure:1434: checking whether stat file-mode macros are broken" >&5 if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1486,30 +1427,29 @@ EOF fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:1490: 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 #include -int main() { +int main() { return 0; } +int t() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:1504: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1445: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_header_time=no fi rm -f conftest* + fi echo "$ac_t""$ac_cv_header_time" 1>&6 @@ -1523,35 +1463,34 @@ 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_%'` +ac_safe=`echo "$ac_hdr" | tr './\055' '___'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:1529: 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> -int main() { +int main() { return 0; } +int t() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:1542: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1482: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=no" fi rm -f conftest* + fi if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdedfghijklmnopqrstuvwxyz./\055' 'ABCDEDFGHIJKLMNOPQRSTUVWXYZ___'` cat >> confdefs.h <&6 -echo "configure:1567: checking for opendir in -ldir" >&5 -ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` +echo $ac_n "checking for -ldir""... $ac_c" 1>&6 +ac_lib_var=`echo dir'_'opendir | tr './+\055' '__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="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1525: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; 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 @@ -1603,32 +1540,30 @@ else fi else -echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:1608: checking for opendir in -lx" >&5 -ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` +echo $ac_n "checking for -lx""... $ac_c" 1>&6 +ac_lib_var=`echo x'_'opendir | tr './+\055' '__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="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1564: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; 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 @@ -1646,12 +1581,11 @@ fi fi echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:1650: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1664,20 +1598,20 @@ extern "C" void (*signal (int, void (*)(int)))(int); void (*signal ()) (); #endif -int main() { +int main() { return 0; } +int t() { int i; ; return 0; } EOF -if { (eval echo configure:1672: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1607: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_type_signal=int fi rm -f conftest* + fi echo "$ac_t""$ac_cv_type_signal" 1>&6 @@ -1687,12 +1621,11 @@ EOF echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:1691: 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 @@ -1721,21 +1654,19 @@ EOF fi echo $ac_n "checking for mode_t""... $ac_c" 1>&6 -echo "configure:1725: checking for mode_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS #include -#include #endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + egrep "mode_t" >/dev/null 2>&1; then rm -rf conftest* ac_cv_type_mode_t=yes else @@ -1754,21 +1685,19 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:1758: 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 #include -#include #endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + egrep "size_t" >/dev/null 2>&1; then rm -rf conftest* ac_cv_type_size_t=yes else @@ -1787,21 +1716,19 @@ EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:1791: 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 #include -#include #endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + egrep "pid_t" >/dev/null 2>&1; then rm -rf conftest* ac_cv_type_pid_t=yes else @@ -1822,12 +1749,11 @@ fi for ac_func in getwd mkdir rename strdup strstr dup2 strerror valloc waitpid vasprintf strtoul do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1826: 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; then +if { (eval echo configure:1781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* -fi +fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 LIBOBJS="$LIBOBJS ${ac_func}.o" fi -done +done -for ac_func in fchmod fsync ftime mkfifo putenv setvbuf vfork vprintf ftruncate timezone getpagesize initgroups fchdir sigaction sigprocmask sigvec sigsetmask sigblock tzset readlink +for ac_func in fchmod fsync ftime mkfifo putenv vfork vprintf ftruncate timezone getpagesize initgroups fchdir sigaction sigprocmask sigvec sigsetmask sigblock tzset readlink wait3 do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1883: 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; then +if { (eval echo configure:1832: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* -fi +fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` @@ -1933,36 +1852,33 @@ done echo $ac_n "checking for evidence of shadow passwords""... $ac_c" 1>&6 -echo "configure:1937: checking for evidence of shadow passwords" >&5 if test -f /etc/shadow \ || test -f /etc/security/passwd.adjunct ; then echo "yup" - echo $ac_n "checking for getspnam in -lsec""... $ac_c" 1>&6 -echo "configure:1942: checking for getspnam in -lsec" >&5 -ac_lib_var=`echo sec'_'getspnam | sed 'y%./+-%__p_%'` + echo $ac_n "checking for -lsec""... $ac_c" 1>&6 +ac_lib_var=`echo sec'_'getspnam | tr './+\055' '__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="-lsec $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1879: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; 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 @@ -1972,8 +1888,7 @@ LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo sec | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + ac_tr_lib=HAVE_LIB`echo sec | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <&6 -echo "configure:1991: 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; then +if { (eval echo configure:1934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* -fi +fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` @@ -2044,12 +1957,11 @@ else fi echo $ac_n "checking for re_exec""... $ac_c" 1>&6 -echo "configure:2048: checking for re_exec" >&5 if eval "test \"`echo '$''{'ac_cv_func_re_exec'+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; then +if { (eval echo configure:1989: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* eval "ac_cv_func_re_exec=yes" else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_re_exec=no" fi rm -f conftest* -fi +fi if eval "test \"`echo '$ac_cv_func_'re_exec`\" = yes"; then echo "$ac_t""yes" 1>&6 : @@ -2093,7 +2004,6 @@ LIBOBJS="$LIBOBJS regex.o" fi echo $ac_n "checking whether utime accepts a null argument""... $ac_c" 1>&6 -echo "configure:2097: checking whether utime accepts a null argument" >&5 if eval "test \"`echo '$''{'ac_cv_func_utime_null'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2102,8 +2012,8 @@ else if test "$cross_compiling" = yes; then ac_cv_func_utime_null=no else - cat > conftest.$ac_ext < conftest.$ac_ext < #include @@ -2114,18 +2024,14 @@ exit(!(stat ("conftestdata", &s) == 0 && utime("conftestdata", (long *)0) == 0 && t.st_mtime - s.st_mtime < 120)); } EOF -if { (eval echo configure:2118: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null -then +{ (eval echo configure:2028: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } +if test -s conftest && (./conftest; exit) 2>/dev/null; then ac_cv_func_utime_null=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* ac_cv_func_utime_null=no fi -rm -fr conftest* fi - +rm -fr conftest* rm -f core core.* *.core fi @@ -2138,27 +2044,19 @@ EOF fi echo $ac_n "checking for long file names""... $ac_c" 1>&6 -echo "configure:2142: checking for long file names" >&5 if eval "test \"`echo '$''{'ac_cv_sys_long_file_names'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_sys_long_file_names=yes # Test for long file names in all the places we know might matter: # . the current directory, where building will happen -# $prefix/lib where we will be installing things -# $exec_prefix/lib likewise -# eval it to expand exec_prefix. -# $TMPDIR if set, where it might want to write temporary files -# if $TMPDIR is not set: # /tmp where it might want to write temporary files # /var/tmp likewise # /usr/tmp likewise -if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then - ac_tmpdirs="$TMPDIR" -else - ac_tmpdirs='/tmp /var/tmp /usr/tmp' -fi -for ac_dir in . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do +# $prefix/lib where we will be installing things +# $exec_prefix/lib likewise +# eval it to expand exec_prefix. +for ac_dir in `eval echo . /tmp /var/tmp /usr/tmp $prefix/lib $exec_prefix/lib` ; do test -d $ac_dir || continue test -w $ac_dir || continue # It is less confusing to not echo anything here. (echo 1 > $ac_dir/conftest9012345) 2>/dev/null @@ -2183,15 +2081,14 @@ fi echo $ac_n "checking for working fnmatch function""... $ac_c" 1>&6 -echo "configure:2187: checking for working fnmatch function" >&5 if eval "test \"`echo '$''{'ccvs_cv_sys_working_fnmatch'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ccvs_cv_sys_working_fnmatch=no else - cat > conftest.$ac_ext < conftest.$ac_ext < @@ -2203,18 +2100,14 @@ main () ? 0 : 1); } EOF -if { (eval echo configure:2207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null -then +{ (eval echo configure:2104: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } +if test -s conftest && (./conftest; exit) 2>/dev/null; then ccvs_cv_sys_working_fnmatch=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* ccvs_cv_sys_working_fnmatch=no fi -rm -fr conftest* fi - +rm -fr conftest* fi if test $ccvs_cv_sys_working_fnmatch = no; then @@ -2228,12 +2121,11 @@ echo "$ac_t""$ccvs_cv_sys_working_fnmatch" 1>&6 # only looks in /etc/hosts), so we only look for -lsocket if we need # it. echo $ac_n "checking for connect""... $ac_c" 1>&6 -echo "configure:2232: checking for connect" >&5 if eval "test \"`echo '$''{'ac_cv_func_connect'+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; then +if { (eval echo configure:2153: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* eval "ac_cv_func_connect=yes" else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_connect=no" fi rm -f conftest* -fi +fi if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then echo "$ac_t""yes" 1>&6 : @@ -2275,32 +2166,30 @@ else echo "$ac_t""no" 1>&6 case "$LIBS" in *-lnsl*) ;; -*) echo $ac_n "checking for printf in -lnsl_s""... $ac_c" 1>&6 -echo "configure:2280: checking for printf in -lnsl_s" >&5 -ac_lib_var=`echo nsl_s'_'printf | sed 'y%./+-%__p_%'` +*) echo $ac_n "checking for -lnsl_s""... $ac_c" 1>&6 +ac_lib_var=`echo nsl_s'_'printf | tr './+\055' '__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="-lnsl_s $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; 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 @@ -2310,8 +2199,7 @@ LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + ac_tr_lib=HAVE_LIB`echo nsl_s | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <&6 -echo "configure:2330: checking for printf in -lnsl" >&5 -ac_lib_var=`echo nsl'_'printf | sed 'y%./+-%__p_%'` +*) echo $ac_n "checking for -lnsl""... $ac_c" 1>&6 +ac_lib_var=`echo nsl'_'printf | tr './+\055' '__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="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2237: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; 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 @@ -2360,8 +2246,7 @@ LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + ac_tr_lib=HAVE_LIB`echo nsl | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <&6 -echo "configure:2380: checking for connect in -lsocket" >&5 -ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'` +*) echo $ac_n "checking for -lsocket""... $ac_c" 1>&6 +ac_lib_var=`echo socket'_'connect | tr './+\055' '__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="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2284: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; 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 @@ -2410,8 +2293,7 @@ LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + ac_tr_lib=HAVE_LIB`echo socket | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <&6 -echo "configure:2430: checking for connect in -linet" >&5 -ac_lib_var=`echo inet'_'connect | sed 'y%./+-%__p_%'` +*) echo $ac_n "checking for -linet""... $ac_c" 1>&6 +ac_lib_var=`echo inet'_'connect | tr './+\055' '__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="-linet $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2331: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; 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 @@ -2460,8 +2340,7 @@ LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + ac_tr_lib=HAVE_LIB`echo inet | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <&6 -echo "configure:2498: checking size of long" >&5 -if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - 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 < -main() -{ - FILE *f=fopen("conftestval", "w"); - if (!f) exit(1); - fprintf(f, "%d\n", sizeof(long)); - exit(0); -} -EOF -if { (eval echo configure:2517: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null -then - ac_cv_sizeof_long=`cat conftestval` -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_sizeof_long=0 -fi -rm -fr conftest* -fi - -fi -echo "$ac_t""$ac_cv_sizeof_long" 1>&6 -cat >> confdefs.h <&6 -echo "configure:2537: checking size of int" >&5 -if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - 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 < -main() -{ - FILE *f=fopen("conftestval", "w"); - if (!f) exit(1); - fprintf(f, "%d\n", sizeof(int)); - exit(0); -} -EOF -if { (eval echo configure:2556: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null -then - ac_cv_sizeof_int=`cat conftestval` -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_sizeof_int=0 -fi -rm -fr conftest* -fi - -fi -echo "$ac_t""$ac_cv_sizeof_int" 1>&6 -cat >> confdefs.h <&6 -echo "configure:2578: checking for krb.h" >&5 cat > conftest.$ac_ext < -int main() { +int main() { return 0; } +int t() { int i; ; return 0; } EOF -if { (eval echo configure:2587: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2387: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* krb_h=yes krb_incdir= else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 rm -rf conftest* if test "$cross_compiling" != yes && test -r $KRB4/include/krb.h; then hold_cflags=$CFLAGS CFLAGS="$CFLAGS -I$KRB4/include" cat > conftest.$ac_ext < -int main() { +int main() { return 0; } +int t() { int i; ; return 0; } EOF -if { (eval echo configure:2605: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2404: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* krb_h=yes krb_incdir=$KRB4/include -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 fi rm -f conftest* + CFLAGS=$hold_cflags fi fi rm -f conftest* + if test -z "$krb_h"; then cat > conftest.$ac_ext < -int main() { +int main() { return 0; } +int t() { int i; ; return 0; } EOF -if { (eval echo configure:2626: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* krb_h=yes krb_incdir= else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 rm -rf conftest* if test "$cross_compiling" != yes && test -r $KRB4/include/kerberosIV/krb.h; then hold_cflags=$CFLAGS CFLAGS="$CFLAGS -I$KRB4/include/kerberosIV" cat > conftest.$ac_ext < -int main() { +int main() { return 0; } +int t() { int i; ; return 0; } EOF -if { (eval echo configure:2644: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2442: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* krb_h=yes krb_incdir=$KRB4/include/kerberosIV -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 fi rm -f conftest* + CFLAGS=$hold_cflags fi fi rm -f conftest* + fi echo "$ac_t""$krb_h" 1>&6 if test -n "$krb_h"; then krb_lib= - echo $ac_n "checking for printf in -lkrb""... $ac_c" 1>&6 -echo "configure:2662: checking for printf in -lkrb" >&5 -ac_lib_var=`echo krb'_'printf | sed 'y%./+-%__p_%'` + echo $ac_n "checking for -lkrb""... $ac_c" 1>&6 +ac_lib_var=`echo krb'_'printf | tr './+\055' '__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="-lkrb $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2478: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; 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 @@ -2712,32 +2507,30 @@ EOF # the user's setting for LDFLAGS hold_ldflags=$LDFLAGS test -n "${krb_libdir}" && LDFLAGS="$LDFLAGS -L${krb_libdir}" - echo $ac_n "checking for printf in -ldes""... $ac_c" 1>&6 -echo "configure:2717: checking for printf in -ldes" >&5 -ac_lib_var=`echo des'_'printf | sed 'y%./+-%__p_%'` + echo $ac_n "checking for -ldes""... $ac_c" 1>&6 +ac_lib_var=`echo des'_'printf | tr './+\055' '__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="-ldes $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2531: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; 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 @@ -2762,12 +2555,11 @@ fi for ac_func in krb_get_err_text do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2766: 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; then +if { (eval echo configure:2587: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* -fi +fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` @@ -2835,12 +2626,11 @@ EOF fi echo $ac_n "checking for gethostname""... $ac_c" 1>&6 -echo "configure:2839: checking for gethostname" >&5 if eval "test \"`echo '$''{'ac_cv_func_gethostname'+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; then +if { (eval echo configure:2658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* eval "ac_cv_func_gethostname=yes" else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_gethostname=no" fi rm -f conftest* -fi +fi if eval "test \"`echo '$ac_cv_func_'gethostname`\" = yes"; then echo "$ac_t""yes" 1>&6 : @@ -2934,32 +2723,30 @@ fi ### there's any harm in just testing for -lcrypt first. if test "$enable_server" = yes; then -echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6 -echo "configure:2939: checking for crypt in -lcrypt" >&5 -ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'` +echo $ac_n "checking for -lcrypt""... $ac_c" 1>&6 +ac_lib_var=`echo crypt'_'crypt | tr './+\055' '__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="-lcrypt $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; 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 @@ -2969,8 +2756,7 @@ LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo crypt | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + ac_tr_lib=HAVE_LIB`echo crypt | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <&6 -echo "configure:2988: 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; then +if { (eval echo configure:2802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* -fi +fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` @@ -3069,25 +2853,11 @@ cat > confcache <<\EOF # --recheck option to rerun configure. # EOF -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | - case `(ac_space=' '; set) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote substitution - # turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - -e "s/'/'\\\\''/g" \ - -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' - ;; - esac >> confcache + sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\${\1='\2'}/p" \ + >> confcache if cmp -s $cache_file confcache; then : else @@ -3142,7 +2912,7 @@ do echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.12" + echo "$CONFIG_STATUS generated by autoconf version 2.10" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; @@ -3156,7 +2926,8 @@ ac_given_INSTALL="$INSTALL" trap 'rm -fr `echo "Makefile lib/Makefile src/Makefile zlib/Makefile doc/Makefile \ man/Makefile tools/Makefile tools/pcl-cvs/Makefile \ contrib/Makefile contrib/elib/Makefile \ - windows-NT/Makefile os2/Makefile macintosh/Makefile vms/Makefile \ + windows-NT/Makefile windows-NT/SCC/Makefile \ + os2/Makefile macintosh/Makefile vms/Makefile \ stamp-h config.h src/options.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF - -# Split the substitutions into bite-sized pieces for seds with -# small command number limits, like on Digital OSF/1 and HP-UX. -ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. -ac_file=1 # Number of current file. -ac_beg=1 # First line for current file. -ac_end=$ac_max_sed_cmds # Line after last line for current file. -ac_more_lines=: -ac_sed_cmds="" -while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file - else - sed "${ac_end}q" conftest.subs > conftest.s$ac_file - fi - if test ! -s conftest.s$ac_file; then - ac_more_lines=false - rm -f conftest.s$ac_file - else - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f conftest.s$ac_file" - else - ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" - fi - ac_file=`expr $ac_file + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_cmds` - fi -done -if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat -fi -EOF - cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + # Support "outfile[:infile]", defaulting infile="outfile.in". case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac - # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + # Adjust relative srcdir, etc. for subdirectories. # Remove last slash and all that follows it. Not all systems have dirname. ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` @@ -3284,7 +3020,6 @@ for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then [/$]*) INSTALL="$ac_given_INSTALL" ;; *) INSTALL="$ac_dots$ac_given_INSTALL" ;; esac - echo creating "$ac_file" rm -f "$ac_file" configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." @@ -3293,16 +3028,14 @@ for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then # $configure_input" ;; *) ac_comsub= ;; esac - - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` sed -e "$ac_comsub s%@configure_input@%$configure_input%g s%@srcdir@%$srcdir%g s%@top_srcdir@%$top_srcdir%g s%@INSTALL@%$INSTALL%g -" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +" -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file fi; done -rm -f conftest.s* +rm -f conftest.subs # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. @@ -3323,17 +3056,11 @@ ac_eB='$%\1#\2define\3' ac_eC=' ' ac_eD='%g' -if test "${CONFIG_HEADERS+set}" != set; then -EOF -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -fi +CONFIG_HEADERS=${CONFIG_HEADERS-"config.h src/options.h"} for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + # Support "outfile[:infile]", defaulting infile="outfile.in". case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac @@ -3341,8 +3068,7 @@ for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then echo creating $ac_file rm -f conftest.frag conftest.in conftest.out - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - cat $ac_file_inputs > conftest.in + cp $ac_given_srcdir/$ac_file_in conftest.in EOF @@ -3370,6 +3096,8 @@ EOF # Break up conftest.vals because some shells have a limit on # the size of here documents, and old seds have small limits too. +# Maximum number of lines to put in a single here document. +ac_max_here_lines=12 rm -f conftest.tail while : @@ -3411,11 +3139,7 @@ cat >> $CONFIG_STATUS <<\EOF fi fi; done -EOF -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF exit 0 EOF diff --git a/gnu/usr.bin/cvs/configure.in b/gnu/usr.bin/cvs/configure.in index 7aa52401cae..71482d674e5 100644 --- a/gnu/usr.bin/cvs/configure.in +++ b/gnu/usr.bin/cvs/configure.in @@ -1,6 +1,11 @@ dnl configure.in for cvs AC_INIT(src/cvs.h) +dnl AC_PREREQ(2.4)dnl Required Autoconf version. +dnl Do not use autoconf 2.12; it produces a configure script which produces +dnl a "internal 2K buffer" error on HPUX when run with /bin/sh. +dnl autoconf 2.10 seems like a good choice. +dnl AC_CONFIG_HEADER(config.h src/options.h) AC_PROG_CC @@ -15,6 +20,9 @@ fi AC_PREFIX_PROGRAM(cvs) +dnl FIXME: AC_C_CROSS is considered obsolete by autoconf 2.12, and is +dnl pretty ugly to start with. But it isn't obvious to me how we should +dnl be handling the uses of cross_compiling below. AC_C_CROSS AC_C_CONST @@ -48,7 +56,7 @@ AC_TYPE_MODE_T AC_TYPE_SIZE_T AC_TYPE_PID_T AC_REPLACE_FUNCS(getwd mkdir rename strdup strstr dup2 strerror valloc waitpid vasprintf strtoul) -AC_CHECK_FUNCS(fchmod fsync ftime mkfifo putenv setvbuf vfork vprintf ftruncate timezone getpagesize initgroups fchdir sigaction sigprocmask sigvec sigsetmask sigblock tzset readlink) +AC_CHECK_FUNCS(fchmod fsync ftime mkfifo putenv vfork vprintf ftruncate timezone getpagesize initgroups fchdir sigaction sigprocmask sigvec sigsetmask sigblock tzset readlink wait3) dnl dnl Look for shadow password files before we go ahead and set getspnam. @@ -134,9 +142,6 @@ echo "default place for krb4 is $KRB4" AC_SUBST(KRB4)])dnl WITH_KRB4 -AC_CHECK_SIZEOF(long) -AC_CHECK_SIZEOF(int) - krb_h= AC_MSG_CHECKING([for krb.h]) AC_TRY_LINK([#include ],[int i;], @@ -253,5 +258,6 @@ test -f src/options.h && ( AC_OUTPUT(Makefile lib/Makefile src/Makefile zlib/Makefile doc/Makefile \ man/Makefile tools/Makefile tools/pcl-cvs/Makefile \ contrib/Makefile contrib/elib/Makefile \ - windows-NT/Makefile os2/Makefile macintosh/Makefile vms/Makefile \ + windows-NT/Makefile windows-NT/SCC/Makefile \ + os2/Makefile macintosh/Makefile vms/Makefile \ stamp-h) diff --git a/gnu/usr.bin/cvs/contrib/Makefile.in b/gnu/usr.bin/cvs/contrib/Makefile.in index 9a558fe90ee..c93fdf35274 100644 --- a/gnu/usr.bin/cvs/contrib/Makefile.in +++ b/gnu/usr.bin/cvs/contrib/Makefile.in @@ -41,10 +41,10 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ DISTFILES = \ ChangeLog README .cvsignore intro.doc \ - Makefile.in clmerge.pl cln_hist.pl commit_prep.pl cvs_acls.pl \ - cvscheck.sh cvscheck.man cvshelp.man descend.sh descend.man \ - dirfns.shar log.pl log_accum.pl mfpipe.pl rcs-to-cvs.sh rcs2log.sh \ - rcslock.pl sccs2rcs.csh rcs2sccs.sh + Makefile.in clmerge.pl cln_hist.pl commit_prep.pl cvs2vendor.sh \ + cvs_acls.pl cvscheck.sh cvscheck.man cvshelp.man descend.sh \ + descend.man dirfns.shar log.pl log_accum.pl mfpipe.pl rcs-to-cvs.sh \ + rcs2log.sh rcslock.pl sccs2rcs.csh rcs2sccs.sh # files installed in $(libdir)/cvs/contrib # @@ -53,8 +53,8 @@ CONTRIB_FILES = README intro.doc cvscheck.man # things we actually build and install.... # PROGS = rcs2log -CONTRIB_PROGS = clmerge cln_hist commit_prep cvs_acls cvscheck log log_accum \ - mfpipe rcs-to-cvs rcs2log rcslock sccs2rcs +CONTRIB_PROGS = clmerge cln_hist commit_prep cvs2vendor cvs_acls cvscheck \ + log log_accum mfpipe rcs-to-cvs rcs2log rcslock sccs2rcs .SUFFIXES: .pl .sh .csh diff --git a/gnu/usr.bin/cvs/macintosh/Makefile b/gnu/usr.bin/cvs/macintosh/Makefile deleted file mode 100644 index bcb4692c7e2..00000000000 --- a/gnu/usr.bin/cvs/macintosh/Makefile +++ /dev/null @@ -1,80 +0,0 @@ -# Generated automatically from Makefile.in by configure. -#### Under MacOS and CodeWarrier, we use project files, not -#### this makefile. However, we need this file in order for 'make -#### dist' to work properly on Unix machines. - -srcdir = ../../work/ccvs/macintosh -top_srcdir = ../../work/ccvs -cvs_srcdir = ../../work/ccvs/src -VPATH = ../../work/ccvs/macintosh - -SHELL = /bin/sh - -prefix = /usr -exec_prefix = ${prefix} - - -HEADERS = \ - config.h \ - mac_config.h \ - options.h \ - pwd.h \ - maccvs.pch - -SOURCES = \ - ae_if.c \ - filesubr.c \ - mac_init.c \ - macos_filesys.c \ - pwd.c \ - rcmd.c \ - run.c \ - server_if.c - -DISTFILES = \ - ${HEADERS} \ - ${SOURCES} \ - README.MacCVS \ - ChangeLog \ - Makefile.in \ - services \ - AE_example.pl \ - maccvs.r \ - MacCVS68k.sit.hqx \ - MacCVSPPC.sit.hqx - -all: - -.PHONY: all install uninstall -all install uninstall: - -installdirs: -.PHONY: installdirs - -.PHONY: tags TAGS -tags TAGS: - -.PHONY: ls -ls: - @echo ${DISTFILES} - -.PHONY: clean distclean realclean mostlyclean -clean distclean realclean mostlyclean: - -.PHONY: lint -lint: - -.PHONY: dist-dir -dist-dir: - mkdir ${DISTDIR} - for i in ${DISTFILES}; do \ - ln $(srcdir)/$${i} ${DISTDIR}; \ - done - ln Makefile ${DISTDIR} - -clean: - @echo make clean does nothing in macintosh subdir - -subdir = macintosh -Makefile: ../config.status Makefile.in - cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status diff --git a/gnu/usr.bin/cvs/src/NOTES b/gnu/usr.bin/cvs/src/NOTES deleted file mode 100644 index 646ebdf8520..00000000000 --- a/gnu/usr.bin/cvs/src/NOTES +++ /dev/null @@ -1,60 +0,0 @@ -wishlist - Tue Nov 2 15:22:58 PST 1993 - -* bcopy -> memcpy & friends. - ** done 12/18/93 - -* remove static buffers. -* replace list & node cache with recursive obstacks, (xmalloc, - getnode, getlist) -* check all io functions for error return codes. also check all - system calls. -* error check mkdir. - ---- -Old notes... - -* All sizing limits are gone. The rest of these items were incidental - in that effort. - -* login name from history was duplicated. taught existing routine to - cache and use that instead. Also add routines to cache uid, pid, - etc. - -* ign strings were never freed. Now they are. - -* there was a printf("... %s ...", cp) vs *cp bug in history.c. Now - fixed. - -* The environment variables TMPDIR, HOME, and LOGNAME were not - honored. Now they are. - -* extra line inserted by do_editor() is gone. Then obviated. Editor - is now called exactly once per checkin. - -* revised editor behaviour. Never use /dev/tty. If the editor - session fails, we haven't yet done anything. Therefor the user can - safely rerun cvs and we should just fail. Also use the editor for - initial log messages on added files. Also omit the confirmation - when adding directories. Adding directories will require an - explicit "commit" step soon. Make it possible to prevent null login - messages using #define REQUIRE_LOG_MESSAGES - -* prototypes for all callbacks. - -* all callbacks get ref pointers. - -* do_recursion/start_recursion now use recusion_frame's rather than a - list of a lot of pointers and global variables. - -* corrected types on status_dirproc(). - -* CONFIRM_DIRECTORY_ADDS - -* re_comp was innappropriate in a few places. I've eliminated it. - -* FORCE_MESSAGE_ON_ADD - -* So I built a regression test. Let's call it a sanity check to be - less ambitious. It exposed that cvs is difficult to call from - scripts. - diff --git a/gnu/usr.bin/cvs/src/commit.c b/gnu/usr.bin/cvs/src/commit.c index 308c726684c..ae2699ecade 100644 --- a/gnu/usr.bin/cvs/src/commit.c +++ b/gnu/usr.bin/cvs/src/commit.c @@ -254,7 +254,9 @@ find_fileproc (callerdat, finfo) status = T_ADDED; else if (vers->ts_user != NULL && vers->ts_rcs != NULL - && strcmp (vers->ts_user, vers->ts_rcs) != 0) + && (force_ci || strcmp (vers->ts_user, vers->ts_rcs) != 0)) + /* If we are forcing commits, pretend that the file is + modified. */ status = T_MODIFIED; else { @@ -533,7 +535,7 @@ commit (argc, argv) previous versions of client/server CVS, but it probably is a Good Thing, or at least Not Such A Bad Thing. */ send_file_names (find_args.argc, find_args.argv, 0); - send_files (find_args.argc, find_args.argv, local, 0, 0); + send_files (find_args.argc, find_args.argv, local, 0, 0, force_ci); send_to_server ("ci\012", 0); return get_responses_and_close (); @@ -2020,23 +2022,57 @@ lock_RCS (user, rcs, rev, repository) return (1); } -/* - * Called when "add"ing files to the RCS respository, as it is necessary to - * preserve the file modes in the same fashion that RCS does. This would be - * automatic except that we are placing the RCS ,v file very far away from - * the user file, and I can't seem to convince RCS of the location of the - * user file. So we munge it here, after the ,v file has been successfully - * initialized with "rcs -i". - */ +/* Called when "add"ing files to the RCS respository. It doesn't seem to + be possible to get RCS to use the right mode, so we change it after + the fact. */ + static void fix_rcs_modes (rcs, user) char *rcs; char *user; { struct stat sb; + mode_t rcs_mode; + + if (CVS_STAT (user, &sb) < 0) + { + /* FIXME: Should be ->fullname. */ + error (0, errno, "warning: cannot stat %s", user); + return; + } - if ( CVS_STAT (user, &sb) != -1) - (void) chmod (rcs, (int) sb.st_mode & ~0222); + /* Now we compute the new mode. + + The algorithm that we use is: + + Write permission is always off (this is what RCS and CVS have always + done). + + If S_IRUSR is on (user read), then the read permission of + the RCS file will be on. It would seem that if this is off, + then other users can't do "cvs update" and such, so perhaps this + should be hardcoded to being on (it is a strange case, though--the + case in which a user file doesn't have user read permission on). + + If S_IXUSR is on (user execute), then set execute permission + on the RCS file. This allows other users who check out the file + to get the right setting for whether a shell script (for example) + has the executable bit set. + + The result of that calculation is modified by CVSUMASK. The + reason, of course, that the read and execute settings take the + user bit and copy it to all three bits (user, group, other), is + that it should be CVSUMASK, not the umask of individual users, + which is the sole determiner of modes in the repository. */ + + rcs_mode = 0; + if (sb.st_mode & S_IRUSR) + rcs_mode |= S_IRUSR | S_IRGRP | S_IROTH; + if (sb.st_mode & S_IXUSR) + rcs_mode |= S_IXUSR | S_IXGRP | S_IXOTH; + rcs_mode &= ~cvsumask; + if (chmod (rcs, rcs_mode) < 0) + error (0, errno, "warning: cannot change mode of %s", rcs); } /* diff --git a/gnu/usr.bin/cvs/src/cvs.h b/gnu/usr.bin/cvs/src/cvs.h index 1d48096bdf9..ce90e6f3946 100644 --- a/gnu/usr.bin/cvs/src/cvs.h +++ b/gnu/usr.bin/cvs/src/cvs.h @@ -1,3 +1,11 @@ +/* + * Copyright (c) 1992, Brian Berliner and Jeff Polk + * Copyright (c) 1989-1992, Brian Berliner + * + * You may distribute under the terms of the GNU General Public License as + * specified in the README file that comes with the CVS kit. + */ + /* * basic information used in all source files * @@ -90,7 +98,10 @@ extern int errno; #include "rcs.h" -/* XXX - for now this is static */ +/* This actually gets set in system.h. Note that the _ONLY_ reason for + this is if various system calls (getwd, getcwd, readlink) require/want + us to use it. All other parts of CVS allocate pathname buffers + dynamically, and we want to keep it that way. */ #ifndef PATH_MAX #ifdef MAXPATHLEN #define PATH_MAX MAXPATHLEN+2 @@ -99,16 +110,8 @@ extern int errno; #endif #endif /* PATH_MAX */ -/* - * Copyright (c) 1992, Brian Berliner and Jeff Polk - * Copyright (c) 1989-1992, Brian Berliner - * - * You may distribute under the terms of the GNU General Public License as - * specified in the README file that comes with the CVS 1.4 kit. - * - * Definitions for the CVS Administrative directory and the files it contains. - * Here as #define's to make changing the names a simple task. - */ +/* Definitions for the CVS Administrative directory and the files it contains. + Here as #define's to make changing the names a simple task. */ #ifdef USE_VMS_FILENAMES #define CVSADM "CVS" @@ -203,7 +206,15 @@ extern int errno; /* Command attributes -- see function lookup_command_attribute(). */ #define CVS_CMD_IGNORE_ADMROOT 1 + +/* Set if CVS does _not_ need to create a CVS/Root file upon + completion of this command. The name is confusing, both because + the meaning is closer to "does not use working directory" than + "uses working directory" and because the flag isn't really as + general purpose as it seems (cvs release sets it). */ + #define CVS_CMD_USES_WORK_DIR 2 + #define CVS_CMD_MODIFIES_REPOSITORY 4 /* miscellaneous CVS defines */ @@ -275,16 +286,10 @@ extern int errno; */ #define REPOS_STRIP "/master/" -/* - * The maximum number of files per each CVS directory. This is mainly for - * sizing arrays statically rather than dynamically. 3000 seems plenty for - * now. - */ -#define MAXFILEPERDIR 3000 -#define MAXLINELEN 5000 /* max input line from a file */ -#define MAXPROGLEN 30000 /* max program length to system() */ -#define MAXLISTLEN 40000 /* For [A-Z]list holders */ -#define MAXDATELEN 50 /* max length for a date */ +/* Large enough to hold DATEFORM. Not an arbitrary limit as long as + it is used for that purpose, and not to hold a string from the + command line, the client, etc. */ +#define MAXDATELEN 50 /* The type of an entnode. */ enum ent_type @@ -426,10 +431,13 @@ char *Short_Repository PROTO((char *repository)); char *gca PROTO((char *rev1, char *rev2)); char *getcaller PROTO((void)); char *time_stamp PROTO((char *file)); + char *xmalloc PROTO((size_t bytes)); void *xrealloc PROTO((void *ptr, size_t bytes)); +void expand_string PROTO ((char **, size_t *, size_t)); char *xstrdup PROTO((const char *str)); void strip_trailing_newlines PROTO((char *str)); + typedef int (*CALLPROC) PROTO((char *repository, char *value)); int Parse_Info PROTO((char *infofile, char *repository, CALLPROC callproc, int all)); typedef RETSIGTYPE (*SIGCLEANUPPROC) PROTO(()); @@ -493,7 +501,7 @@ extern int ign_case; #include "update.h" -void line2argv PROTO((int *pargc, char *argv[], char *line)); +void line2argv PROTO ((int *pargc, char ***argv, char *line)); void make_directories PROTO((const char *name)); void make_directory PROTO((const char *name)); extern int mkdir_if_needed PROTO ((char *name)); @@ -743,7 +751,7 @@ int wrap_name_has PROTO((const char *name,WrapMergeHas has)); char *wrap_rcsoption PROTO ((const char *fileName, int asFlag)); char *wrap_tocvs_process_file PROTO((const char *fileName)); int wrap_merge_is_copy PROTO((const char *fileName)); -char *wrap_fromcvs_process_file PROTO((const char *fileName)); +void wrap_fromcvs_process_file PROTO ((const char *fileName)); void wrap_add_file PROTO((const char *file,int temp)); void wrap_add PROTO((char *line,int temp)); void wrap_send PROTO ((void)); @@ -772,6 +780,7 @@ extern int import PROTO ((int argc, char **argv)); extern int cvslog PROTO ((int argc, char **argv)); #ifdef AUTH_CLIENT_SUPPORT extern int login PROTO((int argc, char **argv)); +int logout PROTO((int argc, char **argv)); #endif /* AUTH_CLIENT_SUPPORT */ extern int patch PROTO((int argc, char **argv)); extern int release PROTO((int argc, char **argv)); diff --git a/gnu/usr.bin/cvs/src/ignore.c b/gnu/usr.bin/cvs/src/ignore.c index 1a839586f46..379b92b5bba 100644 --- a/gnu/usr.bin/cvs/src/ignore.c +++ b/gnu/usr.bin/cvs/src/ignore.c @@ -1,8 +1,19 @@ +/* This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. */ + /* * .cvsignore file support contributed by David G. Grubbs */ #include "cvs.h" +#include "getline.h" /* * Ignore file section. @@ -96,8 +107,8 @@ ign_add_file (file, hold) int hold; { FILE *fp; - /* FIXME: arbitrary limit. */ - char line[1024]; + char *line = NULL; + size_t line_allocated = 0; /* restore the saved list (if any) */ if (s_ign_list != NULL) @@ -141,10 +152,13 @@ ign_add_file (file, hold) error (0, errno, "cannot open %s", file); return; } - while (fgets (line, sizeof (line), fp)) + while (getline (&line, &line_allocated, fp) >= 0) ign_add (line, hold); + if (ferror (fp)) + error (0, errno, "cannot read %s", file); if (fclose (fp) < 0) error (0, errno, "cannot close %s", file); + free (line); } /* Parse a line of space-separated wildcards and add them to the list. */ diff --git a/gnu/usr.bin/cvs/src/lock.c b/gnu/usr.bin/cvs/src/lock.c index 99772392d5b..1ff6864e4d7 100644 --- a/gnu/usr.bin/cvs/src/lock.c +++ b/gnu/usr.bin/cvs/src/lock.c @@ -101,8 +101,18 @@ static void lock_simple_remove PROTO ((struct lock *lock)); static void lock_wait PROTO((char *repository)); static void lock_obtained PROTO((char *repository)); -static char lockers_name[20]; -static char readlock[PATH_MAX], writelock[PATH_MAX], masterlock[PATH_MAX]; +/* Malloc'd array containing the username of the whoever has the lock. + Will always be non-NULL in the cases where it is needed. */ +static char *lockers_name; +/* Malloc'd array specifying name of a readlock within a directory. + Or NULL if none. */ +static char *readlock; +/* Malloc'd array specifying name of a writelock within a directory. + Or NULL if none. */ +static char *writelock; +/* Malloc'd array specifying the name of a CVSLCK file (absolute pathname). + Will always be non-NULL in the cases where it is used. */ +static char *masterlock; static List *locklist; #define L_OK 0 /* success */ @@ -181,38 +191,44 @@ static void lock_simple_remove (lock) struct lock *lock; { - char tmp[PATH_MAX]; + char *tmp; /* If readlock is set, the lock directory *might* have been created, but since Reader_Lock doesn't use SIG_beginCrSect the way that set_lock does, we don't know that. That is why we need to check for existence_error here. */ - if (readlock[0] != '\0') + if (readlock != NULL) { + tmp = xmalloc (strlen (lock->repository) + strlen (readlock) + 10); (void) sprintf (tmp, "%s/%s", lock->repository, readlock); if ( CVS_UNLINK (tmp) < 0 && ! existence_error (errno)) error (0, errno, "failed to remove lock %s", tmp); + free (tmp); } /* If writelock is set, the lock directory *might* have been created, but since write_lock doesn't use SIG_beginCrSect the way that set_lock does, we don't know that. That is why we need to check for existence_error here. */ - if (writelock[0] != '\0') + if (writelock != NULL) { + tmp = xmalloc (strlen (lock->repository) + strlen (writelock) + 10); (void) sprintf (tmp, "%s/%s", lock->repository, writelock); if ( CVS_UNLINK (tmp) < 0 && ! existence_error (errno)) error (0, errno, "failed to remove lock %s", tmp); + free (tmp); } if (lock->have_lckdir) { + tmp = xmalloc (strlen (lock->repository) + sizeof (CVSLCK) + 10); (void) sprintf (tmp, "%s/%s", lock->repository, CVSLCK); SIG_beginCrSect (); if (CVS_RMDIR (tmp) < 0) error (0, errno, "failed to remove lock dir %s", tmp); lock->have_lckdir = 0; SIG_endCrSect (); + free (tmp); } } @@ -225,7 +241,7 @@ Reader_Lock (xrepository) { int err = 0; FILE *fp; - char tmp[PATH_MAX]; + char *tmp; if (noexec || readonlyfs) return (0); @@ -237,14 +253,17 @@ Reader_Lock (xrepository) return (1); } - if (readlock[0] == '\0') - (void) sprintf (readlock, + if (readlock == NULL) + { + readlock = xmalloc (strlen (hostname) + sizeof (CVSRFL) + 40); + (void) sprintf (readlock, #ifdef HAVE_LONG_FILE_NAMES - "%s.%s.%ld", CVSRFL, hostname, + "%s.%s.%ld", CVSRFL, hostname, #else - "%s.%ld", CVSRFL, + "%s.%ld", CVSRFL, #endif - (long) getpid ()); + (long) getpid ()); + } /* remember what we're locking (for Lock_Cleanup) */ global_readlock.repository = xrepository; @@ -254,7 +273,9 @@ Reader_Lock (xrepository) { error (0, 0, "failed to obtain dir lock in repository `%s'", xrepository); - readlock[0] = '\0'; + if (readlock != NULL) + free (readlock); + readlock = NULL; /* We don't set global_readlock.repository to NULL. I think this only works because recurse.c will give a fatal error if we return a nonzero value. */ @@ -262,14 +283,18 @@ Reader_Lock (xrepository) } /* write a read-lock */ + tmp = xmalloc (strlen (xrepository) + strlen (readlock) + 10); (void) sprintf (tmp, "%s/%s", xrepository, readlock); if ((fp = CVS_FOPEN (tmp, "w+")) == NULL || fclose (fp) == EOF) { error (0, errno, "cannot create read lock in repository `%s'", xrepository); - readlock[0] = '\0'; + if (readlock != NULL) + free (readlock); + readlock = NULL; err = 1; } + free (tmp); /* free the lock dir */ clear_lock (&global_readlock); @@ -308,7 +333,9 @@ Writer_Lock (list) lock_error = L_OK; /* init for set_writelock_proc */ lock_error_repos = (char *) NULL; /* init for set_writelock_proc */ locklist = list; /* init for Lock_Cleanup */ - (void) strcpy (lockers_name, "unknown"); + if (lockers_name != NULL) + free (lockers_name); + lockers_name = xstrdup ("unknown"); (void) walklist (list, set_writelock_proc, NULL); @@ -373,16 +400,19 @@ write_lock (lock) { int status; FILE *fp; - char tmp[PATH_MAX]; + char *tmp; - if (writelock[0] == '\0') + if (writelock == NULL) + { + writelock = xmalloc (strlen (hostname) + sizeof (CVSWFL) + 40); (void) sprintf (writelock, #ifdef HAVE_LONG_FILE_NAMES - "%s.%s.%ld", CVSWFL, hostname, + "%s.%s.%ld", CVSWFL, hostname, #else - "%s.%ld", CVSWFL, + "%s.%ld", CVSWFL, #endif - (long) getpid()); + (long) getpid()); + } /* make sure the lock dir is ours (not necessarily unique to us!) */ status = set_lock (lock, 0); @@ -402,6 +432,7 @@ write_lock (lock) } /* write the write-lock file */ + tmp = xmalloc (strlen (lock->repository) + strlen (writelock) + 10); (void) sprintf (tmp, "%s/%s", lock->repository, writelock); if ((fp = CVS_FOPEN (tmp, "w+")) == NULL || fclose (fp) == EOF) { @@ -419,8 +450,10 @@ write_lock (lock) /* return the error */ error (0, xerrno, "cannot create write lock in repository `%s'", lock->repository); + free (tmp); return (L_ERROR); } + free (tmp); return (L_OK); } else @@ -511,13 +544,18 @@ set_lockers_name (statp) { struct passwd *pw; + if (lockers_name != NULL) + free (lockers_name); if ((pw = (struct passwd *) getpwuid (statp->st_uid)) != (struct passwd *) NULL) { - (void) strcpy (lockers_name, pw->pw_name); + lockers_name = xstrdup (pw->pw_name); } else + { + lockers_name = xmalloc (20); (void) sprintf (lockers_name, "uid%lu", (unsigned long) statp->st_uid); + } } /* @@ -537,6 +575,9 @@ set_lock (lock, will_wait) time_t now; #endif + if (masterlock != NULL) + free (masterlock); + masterlock = xmalloc (strlen (lock->repository) + sizeof (CVSLCK) + 10); (void) sprintf (masterlock, "%s/%s", lock->repository, CVSLCK); /* diff --git a/gnu/usr.bin/cvs/src/main.c b/gnu/usr.bin/cvs/src/main.c index 0127d653dd0..c9d6d34ee1e 100644 --- a/gnu/usr.bin/cvs/src/main.c +++ b/gnu/usr.bin/cvs/src/main.c @@ -24,9 +24,9 @@ char *program_name; char *program_path; char *command_name; -/* - * Since some systems don't define this... - */ +/* I'd dynamically allocate this, but it seems like gethostname + requires a fixed size array. If I'm remembering the RFCs right, + 256 should be enough. */ #ifndef MAXHOSTNAMELEN #define MAXHOSTNAMELEN 256 #endif @@ -102,6 +102,7 @@ static const struct cmd { "log", "lo", "rlog", cvslog }, #ifdef AUTH_CLIENT_SUPPORT { "login", "logon", "lgn", login }, + { "logout", NULL, NULL, logout }, #ifdef SERVER_SUPPORT { "pserver", NULL, NULL, server }, /* placeholder */ #endif @@ -171,6 +172,7 @@ static const char *const cmd_usage[] = " log Print out history information for files\n", #ifdef AUTH_CLIENT_SUPPORT " login Prompt for password for authenticating server.\n", + " logout Removes entry in .cvspass for remote repository.\n", #endif /* AUTH_CLIENT_SUPPORT */ " rdiff Create 'patch' format diffs between releases\n", " release Indicate that a Module is no longer in use\n", @@ -207,7 +209,10 @@ cmd_synonyms () { if (c->nick1 || c->nick2) { - *line = xmalloc(100); /* wild guess */ + *line = xmalloc (strlen (c->fullname) + + (c->nick1 != NULL ? strlen (c->nick1) : 0) + + (c->nick2 != NULL ? strlen (c->nick2) : 0) + + 40); sprintf(*line, " %-12s %s %s\n", c->fullname, c->nick1 ? c->nick1 : "", c->nick2 ? c->nick2 : ""); @@ -221,7 +226,8 @@ cmd_synonyms () unsigned long int -lookup_command_attribute (char *cmd_name) +lookup_command_attribute (cmd_name) + char *cmd_name; { unsigned long int ret = 0; @@ -230,16 +236,18 @@ lookup_command_attribute (char *cmd_name) ret |= CVS_CMD_IGNORE_ADMROOT; } - + if ((strcmp (cmd_name, "checkout") != 0) && + (strcmp (cmd_name, "init") != 0) && (strcmp (cmd_name, "login") != 0) && + (strcmp (cmd_name, "logout") != 0) && (strcmp (cmd_name, "rdiff") != 0) && (strcmp (cmd_name, "release") != 0) && (strcmp (cmd_name, "rtag") != 0)) { ret |= CVS_CMD_USES_WORK_DIR; } - + /* The following commands do not modify the repository; we conservatively assume that everything else does. Feel free to @@ -717,9 +725,13 @@ main (argc, argv) if (!client_active) { - char path[PATH_MAX]; + char *path; int save_errno; + path = xmalloc (strlen (CVSroot_directory) + + sizeof (CVSROOTADM) + + 20 + + sizeof (CVSROOTADM_HISTORY)); (void) sprintf (path, "%s/%s", CVSroot_directory, CVSROOTADM); if (!isaccessible (path, R_OK | X_OK)) { @@ -739,6 +751,7 @@ main (argc, argv) error (1, save_errno, "%s", path); } parseopts(CVSroot_directory); + free (path); } #ifdef HAVE_PUTENV @@ -761,15 +774,15 @@ main (argc, argv) and/or remote path, on the other hand I'm not sure whether it is worth the trouble. */ - CurDir = xmalloc (PATH_MAX); #ifdef SERVER_SUPPORT if (strcmp (command_name, "server") == 0) - strcpy (CurDir, ""); + CurDir = xstrdup (""); else #endif { - if (!getwd (CurDir)) - error (1, 0, "cannot get working directory: %s", CurDir); + CurDir = xgetwd (); + if (CurDir == NULL) + error (1, errno, "cannot get working directory"); } if (Tmpdir == NULL || Tmpdir[0] == '\0') @@ -882,7 +895,7 @@ Make_Date (rawdate) { struct tm *ftm; time_t unixtime; - char date[256]; /* XXX bigger than we'll ever need? */ + char date[MAXDATELEN]; char *ret; unixtime = get_date (rawdate, (struct timeb *) NULL); diff --git a/gnu/usr.bin/cvs/src/patch.c b/gnu/usr.bin/cvs/src/patch.c index 10e33b065c6..97386247a8b 100644 --- a/gnu/usr.bin/cvs/src/patch.c +++ b/gnu/usr.bin/cvs/src/patch.c @@ -124,12 +124,31 @@ patch (argc, argv) options = RCS_check_kflag (optarg); break; case 'V': + /* This option is pretty seriously broken: + 1. It is not clear what it does (does it change keyword + expansion behavior? If so, how? Or does it have + something to do with what version of RCS we are using? + Or the format we write RCS files in?). + 2. Because both it and -k use the options variable, + specifying both -V and -k doesn't work. + 3. At least as of CVS 1.9, it doesn't work (failed + assertion in RCS_checkout where it asserts that options + starts with -k). Few people seem to be complaining. + In the future (perhaps the near future), I have in mind + removing it entirely, and updating NEWS and cvs.texinfo, + but in case it is a good idea to give people more time + to complain if they would miss it, I'll just add this + quick and dirty error message for now. */ + error (1, 0, + "the -V option is obsolete and should not be used"); +#if 0 if (atoi (optarg) <= 0) error (1, 0, "must specify a version number to -V"); if (options) free (options); options = xmalloc (strlen (optarg) + 1 + 2); /* for the -V */ (void) sprintf (options, "-V%s", optarg); +#endif break; case 'u': unidiff = 1; /* Unidiff */ @@ -239,7 +258,6 @@ patch (argc, argv) * callback proc for doing the real work of patching */ /* ARGSUSED */ -static char where[PATH_MAX]; static int patch_proc (pargc, argv, xwhere, mwhere, mfile, shorten, local_specified, mname, msg) @@ -255,16 +273,21 @@ patch_proc (pargc, argv, xwhere, mwhere, mfile, shorten, local_specified, { int err = 0; int which; - char repository[PATH_MAX]; + char *repository; + char *where; + repository = xmalloc (strlen (CVSroot_directory) + strlen (argv[0]) + + (mfile == NULL ? 0 : strlen (mfile)) + 30); (void) sprintf (repository, "%s/%s", CVSroot_directory, argv[0]); + where = xmalloc (strlen (argv[0]) + (mfile == NULL ? 0 : strlen (mfile)) + + 10); (void) strcpy (where, argv[0]); /* if mfile isn't null, we need to set up to do only part of the module */ if (mfile != NULL) { char *cp; - char path[PATH_MAX]; + char *path; /* if the portion of the module is a path, put the dir part on repos */ if ((cp = strrchr (mfile, '/')) != NULL) @@ -278,6 +301,7 @@ patch_proc (pargc, argv, xwhere, mwhere, mfile, shorten, local_specified, } /* take care of the rest */ + path = xmalloc (strlen (repository) + strlen (mfile) + 5); (void) sprintf (path, "%s/%s", repository, mfile); if (isdir (path)) { @@ -296,14 +320,17 @@ patch_proc (pargc, argv, xwhere, mwhere, mfile, shorten, local_specified, argv[1] = xstrdup (mfile); (*pargc) = 2; } + free (path); } /* cd to the starting repository */ if ( CVS_CHDIR (repository) < 0) { error (0, errno, "cannot chdir to %s", repository); + free (repository); return (1); } + free (repository); if (force_tag_match) which = W_REPOS | W_ATTIC; @@ -326,6 +353,7 @@ patch_proc (pargc, argv, xwhere, mwhere, mfile, shorten, local_specified, (DIRLEAVEPROC) NULL, NULL, *pargc - 1, argv + 1, local, which, 0, 1, where, 1); + free (where); return (err); } @@ -342,14 +370,15 @@ patch_fileproc (callerdat, finfo) { struct utimbuf t; char *vers_tag, *vers_head; - char rcsspace[1][PATH_MAX]; - char *rcs = rcsspace[0]; + char *rcs = NULL; RCSNode *rcsfile; FILE *fp1, *fp2, *fp3; int ret = 0; int isattic = 0; int retcode = 0; - char file1[PATH_MAX], file2[PATH_MAX], strippath[PATH_MAX]; + char *file1; + char *file2; + char *strippath; char *line1, *line2; size_t line1_chars_allocated; size_t line2_chars_allocated; @@ -363,10 +392,14 @@ patch_fileproc (callerdat, finfo) /* find the parsed rcs file */ if ((rcsfile = finfo->rcs) == NULL) - return (1); + { + ret = 1; + goto out2; + } if ((rcsfile->flags & VALID) && (rcsfile->flags & INATTIC)) isattic = 1; + rcs = xmalloc (strlen (finfo->file) + sizeof (RCSEXT) + 5); (void) sprintf (rcs, "%s%s", finfo->file, RCSEXT); /* if vers_head is NULL, may have been removed from the release */ @@ -386,17 +419,21 @@ patch_fileproc (callerdat, finfo) if (toptwo_diffs) { if (vers_head == NULL) - return (1); + { + ret = 1; + goto out2; + } if (!date1) - date1 = xmalloc (50); /* plenty big :-) */ + date1 = xmalloc (MAXDATELEN); *date1 = '\0'; if (RCS_getrevtime (rcsfile, vers_head, date1, 1) == -1) { if (!really_quiet) error (0, 0, "cannot find date in rcs file %s revision %s", rcs, vers_head); - return (1); + ret = 1; + goto out2; } } vers_tag = RCS_getversion (rcsfile, rev1, date1, force_tag_match, @@ -408,10 +445,18 @@ patch_fileproc (callerdat, finfo) } if (vers_tag == NULL && vers_head == NULL) - return (0); /* nothing known about specified revs */ + { + /* Nothing known about specified revs. */ + ret = 0; + goto out2; + } if (vers_tag && vers_head && strcmp (vers_head, vers_tag) == 0) - return (0); /* not changed between releases */ + { + /* Not changed between releases. */ + ret = 0; + goto out2; + } if (patch_short) { @@ -432,7 +477,8 @@ patch_fileproc (callerdat, finfo) else (void) printf ("changed from revision %s to %s\n", vers_tag, vers_head); - return (0); + ret = 0; + goto out2; } tmpfile1 = cvs_temp_name (); if ((fp1 = CVS_FOPEN (tmpfile1, "w+")) != NULL) @@ -549,19 +595,29 @@ patch_fileproc (callerdat, finfo) } } if (CVSroot_directory != NULL) + { + strippath = xmalloc (strlen (CVSroot_directory) + 10); (void) sprintf (strippath, "%s/", CVSroot_directory); + } else - (void) strcpy (strippath, REPOS_STRIP); + strippath = xstrdup (REPOS_STRIP); if (strncmp (rcs, strippath, strlen (strippath)) == 0) rcs += strlen (strippath); + free (strippath); if (vers_tag != NULL) { + file1 = xmalloc (strlen (finfo->fullname) + + strlen (vers_tag) + + 10); (void) sprintf (file1, "%s:%s", finfo->fullname, vers_tag); } else { - (void) strcpy (file1, DEVNULL); + file1 = xstrdup (DEVNULL); } + file2 = xmalloc (strlen (finfo->fullname) + + (vers_head != NULL ? strlen (vers_head) : 10) + + 10); (void) sprintf (file2, "%s:%s", finfo->fullname, vers_head ? vers_head : "removed"); @@ -584,6 +640,8 @@ patch_fileproc (callerdat, finfo) while (getline (&line1, &line1_chars_allocated, fp) >= 0) (void) fputs (line1, stdout); (void) fclose (fp); + free (file1); + free (file2); break; default: error (0, 0, "diff failed for %s", finfo->fullname); @@ -601,6 +659,10 @@ patch_fileproc (callerdat, finfo) free (tmpfile2); free (tmpfile3); tmpfile1 = tmpfile2 = tmpfile3 = NULL; + + out2: + if (rcs != NULL) + free (rcs); return (ret); } diff --git a/gnu/usr.bin/cvs/src/rcscmds.c b/gnu/usr.bin/cvs/src/rcscmds.c index 3bfa944c233..ebea517bd65 100644 --- a/gnu/usr.bin/cvs/src/rcscmds.c +++ b/gnu/usr.bin/cvs/src/rcscmds.c @@ -195,7 +195,11 @@ RCS_exec_checkout (rcsfile, workfile, tag, options, sout) RCS_FLAGS_QUIET, tell ci to be quiet. If FLAGS & RCS_FLAGS_MODTIME, use the working file's modification time for the checkin time. WORKFILE is the working file to check in from, or NULL to use the usual - RCS rules for deriving it from the RCSFILE. */ + RCS rules for deriving it from the RCSFILE. + + Return value is -1 for error (and errno is set to indicate the + error), positive for error (and an error message has been printed), + or zero for success. */ int RCS_checkin (rcsfile, workfile, message, rev, flags) char *rcsfile; @@ -204,6 +208,25 @@ RCS_checkin (rcsfile, workfile, message, rev, flags) char *rev; int flags; { + /* The desired behavior regarding permissions is to preserve the + permissions on RCSFILE if it already exists. Based on looking + at the RCS 5.7 source, it would appear that RCS_CI does this + except when it is creating RCSFILE (reasonable), or when + RCSFILE was created with rcs -i (this is strange, and quite + possibly unintentional). In those two cases it copies the + permissions from the workfile. + + Anyway, the fix is simple enough: we preserve the mode ourself. */ + struct stat sb; + int fix_mode = 1; + int retval; + + if (CVS_STAT (rcsfile, &sb) < 0) + { + fix_mode = 0; + if (!existence_error (errno)) + error (0, errno, "warning: cannot stat %s", rcsfile); + } run_setup ("%s%s -x,v/ -f %s%s", Rcsbin, RCS_CI, rev ? "-r" : "", rev ? rev : ""); if (flags & RCS_FLAGS_DEAD) @@ -216,5 +239,12 @@ RCS_checkin (rcsfile, workfile, message, rev, flags) if (workfile != NULL) run_arg (workfile); run_arg (rcsfile); - return run_exec (RUN_TTY, RUN_TTY, RUN_TTY, RUN_NORMAL); + retval = run_exec (RUN_TTY, RUN_TTY, RUN_TTY, RUN_NORMAL); + if (retval == 0 && fix_mode) + { + if (chmod (rcsfile, sb.st_mode) < 0) + error (0, errno, "warning: cannot change permissions on %s", + rcsfile); + } + return retval; } diff --git a/gnu/usr.bin/cvs/src/server.c b/gnu/usr.bin/cvs/src/server.c index 2490230c79a..be434016a59 100644 --- a/gnu/usr.bin/cvs/src/server.c +++ b/gnu/usr.bin/cvs/src/server.c @@ -60,10 +60,6 @@ static Key_schedule sched; #include #endif -#if HAVE_FCNTL_H -#include -#endif - #ifndef O_NONBLOCK #define O_NONBLOCK O_NDELAY #endif @@ -318,6 +314,8 @@ mkdir_p (dir) if (q == NULL) return ENOMEM; + retval = 0; + /* * Skip over leading slash if present. We won't bother to try to * make '/'. @@ -333,10 +331,12 @@ mkdir_p (dir) q[p - dir] = '\0'; if (CVS_MKDIR (q, 0777) < 0) { - if (errno != EEXIST - && (errno != EACCES || !isdir(q))) + int saved_errno = errno; + + if (saved_errno != EEXIST + && (saved_errno != EACCES || !isdir (q))) { - retval = errno; + retval = saved_errno; goto done; } } @@ -346,8 +346,6 @@ mkdir_p (dir) { if (CVS_MKDIR (dir, 0777) < 0) retval = errno; - else - retval = 0; goto done; } } @@ -416,6 +414,28 @@ print_pending_error () /* Is an error pending? */ #define error_pending() (pending_error || pending_error_text) + +static int alloc_pending PROTO ((size_t size)); + +/* Allocate SIZE bytes for pending_error_text and return nonzero + if we could do it. */ +static int +alloc_pending (size) + size_t size; +{ + if (error_pending ()) + /* Probably alloc_pending callers will have already checked for + this case. But we might as well handle it if they don't, I + guess. */ + return 0; + pending_error_text = malloc (size); + if (pending_error_text == NULL) + { + pending_error = ENOMEM; + return 0; + } + return 1; +} static int supported_response PROTO ((char *)); @@ -494,13 +514,24 @@ serve_root (arg) char *arg; { char *env; - char path[PATH_MAX]; + char *path; int save_errno; if (error_pending()) return; + if (!isabsolute (arg)) + { + if (alloc_pending (80 + strlen (arg))) + sprintf (pending_error_text, + "E Root %s must be an absolute pathname", arg); + return; + } set_local_cvsroot (arg); - + + path = xmalloc (strlen (CVSroot_directory) + + sizeof (CVSROOTADM) + + sizeof (CVSROOTADM_HISTORY) + + 10); (void) sprintf (path, "%s/%s", CVSroot_directory, CVSROOTADM); if (!isaccessible (path, R_OK | X_OK)) { @@ -521,6 +552,7 @@ serve_root (arg) Sorry, you don't have read/write access to the history file %s", path); pending_error = save_errno; } + free (path); #ifdef HAVE_PUTENV env = malloc (strlen (CVSROOT_ENV) + strlen (CVSroot_directory) + 1 + 1); @@ -599,8 +631,8 @@ dirswitch (dir, repos) && status != EEXIST) { pending_error = status; - pending_error_text = malloc (80 + strlen(dir_name)); - sprintf(pending_error_text, "E cannot mkdir %s", dir_name); + if (alloc_pending (80 + strlen (dir_name))) + sprintf (pending_error_text, "E cannot mkdir %s", dir_name); return; } @@ -612,8 +644,8 @@ dirswitch (dir, repos) if ( CVS_CHDIR (dir_name) < 0) { pending_error = errno; - pending_error_text = malloc (80 + strlen(dir_name)); - sprintf(pending_error_text, "E cannot change to %s", dir_name); + if (alloc_pending (80 + strlen (dir_name))) + sprintf (pending_error_text, "E cannot change to %s", dir_name); return; } /* @@ -671,15 +703,15 @@ dirswitch (dir, repos) if (f == NULL) { pending_error = errno; - pending_error_text = malloc (80 + strlen(CVSADM_ENT)); - sprintf(pending_error_text, "E cannot open %s", CVSADM_ENT); + if (alloc_pending (80 + strlen (CVSADM_ENT))) + sprintf (pending_error_text, "E cannot open %s", CVSADM_ENT); return; } if (fclose (f) == EOF) { pending_error = errno; - pending_error_text = malloc (80 + strlen(CVSADM_ENT)); - sprintf(pending_error_text, "E cannot close %s", CVSADM_ENT); + if (alloc_pending (80 + strlen (CVSADM_ENT))) + sprintf (pending_error_text, "E cannot close %s", CVSADM_ENT); return; } } @@ -747,15 +779,15 @@ serve_static_directory (arg) if (f == NULL) { pending_error = errno; - pending_error_text = malloc (80 + strlen(CVSADM_ENTSTAT)); - sprintf(pending_error_text, "E cannot open %s", CVSADM_ENTSTAT); + if (alloc_pending (80 + strlen (CVSADM_ENTSTAT))) + sprintf (pending_error_text, "E cannot open %s", CVSADM_ENTSTAT); return; } if (fclose (f) == EOF) { pending_error = errno; - pending_error_text = malloc (80 + strlen(CVSADM_ENTSTAT)); - sprintf(pending_error_text, "E cannot close %s", CVSADM_ENTSTAT); + if (alloc_pending (80 + strlen (CVSADM_ENTSTAT))) + sprintf (pending_error_text, "E cannot close %s", CVSADM_ENTSTAT); return; } } @@ -772,22 +804,22 @@ serve_sticky (arg) if (f == NULL) { pending_error = errno; - pending_error_text = malloc (80 + strlen(CVSADM_TAG)); - sprintf(pending_error_text, "E cannot open %s", CVSADM_TAG); + if (alloc_pending (80 + strlen (CVSADM_TAG))) + sprintf (pending_error_text, "E cannot open %s", CVSADM_TAG); return; } if (fprintf (f, "%s\n", arg) < 0) { pending_error = errno; - pending_error_text = malloc (80 + strlen(CVSADM_TAG)); - sprintf(pending_error_text, "E cannot write to %s", CVSADM_TAG); + if (alloc_pending (80 + strlen (CVSADM_TAG))) + sprintf (pending_error_text, "E cannot write to %s", CVSADM_TAG); return; } if (fclose (f) == EOF) { pending_error = errno; - pending_error_text = malloc (80 + strlen(CVSADM_TAG)); - sprintf(pending_error_text, "E cannot close %s", CVSADM_TAG); + if (alloc_pending (80 + strlen (CVSADM_TAG))) + sprintf (pending_error_text, "E cannot close %s", CVSADM_TAG); return; } } @@ -1154,8 +1186,8 @@ server_write_entries () if (f == NULL) { pending_error = errno; - pending_error_text = malloc (80 + strlen(CVSADM_ENT)); - sprintf(pending_error_text, "E cannot open %s", CVSADM_ENT); + if (alloc_pending (80 + strlen (CVSADM_ENT))) + sprintf (pending_error_text, "E cannot open %s", CVSADM_ENT); } } for (p = entries; p != NULL;) @@ -1165,8 +1197,9 @@ server_write_entries () if (fprintf (f, "%s\n", p->entry) < 0) { pending_error = errno; - pending_error_text = malloc (80 + strlen(CVSADM_ENT)); - sprintf(pending_error_text, "E cannot write to %s", CVSADM_ENT); + if (alloc_pending (80 + strlen(CVSADM_ENT))) + sprintf (pending_error_text, + "E cannot write to %s", CVSADM_ENT); } } free (p->entry); @@ -1178,8 +1211,8 @@ server_write_entries () if (f != NULL && fclose (f) == EOF && !error_pending ()) { pending_error = errno; - pending_error_text = malloc (80 + strlen(CVSADM_ENT)); - sprintf(pending_error_text, "E cannot close %s", CVSADM_ENT); + if (alloc_pending (80 + strlen (CVSADM_ENT))) + sprintf (pending_error_text, "E cannot close %s", CVSADM_ENT); } } @@ -1436,9 +1469,10 @@ serve_global_option (arg) if (arg[0] != '-' || arg[1] == '\0' || arg[2] != '\0') { error_return: - pending_error_text = malloc (strlen (arg) + 80); - sprintf (pending_error_text, "E Protocol error: bad global option %s", - arg); + if (alloc_pending (strlen (arg) + 80)) + sprintf (pending_error_text, + "E Protocol error: bad global option %s", + arg); return; } switch (arg[1]) @@ -1631,7 +1665,8 @@ input_memory_error (buf) * Else just return 0 to indicate that command is illegal. */ static int -check_command_legal_p (char *cmd_name) +check_command_legal_p (cmd_name) + char *cmd_name; { /* Right now, only pserver notices illegal commands -- namely, * write attempts by a read-only user. Therefore, if CVS_Username @@ -2842,6 +2877,14 @@ static void serve_init (arg) char *arg; { + if (!isabsolute (arg)) + { + if (alloc_pending (80 + strlen (arg))) + sprintf (pending_error_text, + "E Root %s must be an absolute pathname", arg); + /* Fall through to do_cvs_command which will return the + actual error. */ + } set_local_cvsroot (arg); do_cvs_command ("init", init); @@ -3002,6 +3045,9 @@ server_updated (finfo, vers, updated, file_info, checksum) if (updated == SERVER_UPDATED) { + Node *node; + Entnode *entnode; + if (!(supported_response ("Created") && supported_response ("Update-existing"))) buf_output0 (protocol, "Updated "); @@ -3013,6 +3059,14 @@ server_updated (finfo, vers, updated, file_info, checksum) else buf_output0 (protocol, "Update-existing "); } + + /* Now munge the entries to say that the file is unmodified, + in case we end up processing it again (e.g. modules3-6 + in the testsuite). */ + node = findnode_fn (finfo->entries, finfo->file); + entnode = (Entnode *)node->data; + free (entnode->timestamp); + entnode->timestamp = xstrdup ("="); } else if (updated == SERVER_MERGED) buf_output0 (protocol, "Merged "); @@ -3473,22 +3527,23 @@ serve_checkin_prog (arg) if (f == NULL) { pending_error = errno; - pending_error_text = malloc (80 + strlen(CVSADM_CIPROG)); - sprintf(pending_error_text, "E cannot open %s", CVSADM_CIPROG); + if (alloc_pending (80 + strlen (CVSADM_CIPROG))) + sprintf (pending_error_text, "E cannot open %s", CVSADM_CIPROG); return; } if (fprintf (f, "%s\n", arg) < 0) { pending_error = errno; - pending_error_text = malloc (80 + strlen(CVSADM_CIPROG)); - sprintf(pending_error_text, "E cannot write to %s", CVSADM_CIPROG); + if (alloc_pending (80 + strlen (CVSADM_CIPROG))) + sprintf (pending_error_text, + "E cannot write to %s", CVSADM_CIPROG); return; } if (fclose (f) == EOF) { pending_error = errno; - pending_error_text = malloc (80 + strlen(CVSADM_CIPROG)); - sprintf(pending_error_text, "E cannot close %s", CVSADM_CIPROG); + if (alloc_pending (80 + strlen (CVSADM_CIPROG))) + sprintf (pending_error_text, "E cannot close %s", CVSADM_CIPROG); return; } } @@ -3502,22 +3557,22 @@ serve_update_prog (arg) if (f == NULL) { pending_error = errno; - pending_error_text = malloc (80 + strlen(CVSADM_UPROG)); - sprintf(pending_error_text, "E cannot open %s", CVSADM_UPROG); + if (alloc_pending (80 + strlen (CVSADM_UPROG))) + sprintf (pending_error_text, "E cannot open %s", CVSADM_UPROG); return; } if (fprintf (f, "%s\n", arg) < 0) { pending_error = errno; - pending_error_text = malloc (80 + strlen(CVSADM_UPROG)); - sprintf(pending_error_text, "E cannot write to %s", CVSADM_UPROG); + if (alloc_pending (80 + strlen (CVSADM_UPROG))) + sprintf (pending_error_text, "E cannot write to %s", CVSADM_UPROG); return; } if (fclose (f) == EOF) { pending_error = errno; - pending_error_text = malloc (80 + strlen(CVSADM_UPROG)); - sprintf(pending_error_text, "E cannot close %s", CVSADM_UPROG); + if (alloc_pending (80 + strlen (CVSADM_UPROG))) + sprintf (pending_error_text, "E cannot close %s", CVSADM_UPROG); return; } } @@ -3933,17 +3988,26 @@ error ENOMEM Virtual memory exhausted.\n"); 700, to discourage random people from tampering with it. */ status = mkdir_p (server_temp_dir); - if (status == EEXIST) - status = 0; -#ifndef CHMOD_BROKEN - if (status == 0) - status = chmod (server_temp_dir, S_IRWXU); -#endif - if (status != 0) + if (status != 0 && status != EEXIST) { - pending_error_text = "E can't create temporary directory"; + if (alloc_pending (80)) + strcpy (pending_error_text, + "E can't create temporary directory"); pending_error = status; } +#ifndef CHMOD_BROKEN + else + { + if (chmod (server_temp_dir, S_IRWXU) < 0) + { + int save_errno = errno; + if (alloc_pending (80)) + strcpy (pending_error_text, "\ +E cannot change permissions on temporary directory"); + pending_error = save_errno; + } + } +#endif } } @@ -4340,10 +4404,15 @@ handle_return: void pserver_authenticate_connection () { - char tmp[PATH_MAX]; - char repository[PATH_MAX]; - char username[PATH_MAX]; - char password[PATH_MAX]; + char *tmp = NULL; + size_t tmp_allocated = 0; + char *repository = NULL; + size_t repository_allocated = 0; + char *username = NULL; + size_t username_allocated = 0; + char *password = NULL; + size_t password_allocated = 0; + char *host_user; char *descrambled_password; int verify_and_exit = 0; @@ -4402,16 +4471,22 @@ pserver_authenticate_connection () #endif /* Make sure the protocol starts off on the right foot... */ - fgets (tmp, PATH_MAX, stdin); + if (getline (&tmp, &tmp_allocated, stdin) < 0) + /* FIXME: what? We could try writing error/eof, but chances + are the network connection is dead bidirectionally. log it + somewhere? */ + ; + if (strcmp (tmp, "BEGIN VERIFICATION REQUEST\n") == 0) verify_and_exit = 1; else if (strcmp (tmp, "BEGIN AUTH REQUEST\n") != 0) error (1, 0, "bad auth protocol start: %s", tmp); /* Get the three important pieces of information in order. */ - fgets (repository, PATH_MAX, stdin); - fgets (username, PATH_MAX, stdin); - fgets (password, PATH_MAX, stdin); + /* See above comment about error handling. */ + getline (&repository, &repository_allocated, stdin); + getline (&username, &username_allocated, stdin); + getline (&password, &password_allocated, stdin); /* Make them pure. */ strip_trailing_newlines (repository); @@ -4419,7 +4494,8 @@ pserver_authenticate_connection () strip_trailing_newlines (password); /* ... and make sure the protocol ends on the right foot. */ - fgets (tmp, PATH_MAX, stdin); + /* See above comment about error handling. */ + getline (&tmp, &tmp_allocated, stdin); if (strcmp (tmp, verify_and_exit ? "END VERIFICATION REQUEST\n" : "END AUTH REQUEST\n") @@ -4474,6 +4550,10 @@ pserver_authenticate_connection () /* Switch to run as this user. */ switch_to_user (host_user); + free (tmp); + free (repository); + free (username); + free (password); } #endif /* AUTH_SERVER_SUPPORT */ diff --git a/gnu/usr.bin/cvs/src/update.c b/gnu/usr.bin/cvs/src/update.c index 87d338a0e3f..dcb793b21fa 100644 --- a/gnu/usr.bin/cvs/src/update.c +++ b/gnu/usr.bin/cvs/src/update.c @@ -41,6 +41,7 @@ #include "watch.h" #include "fileattr.h" #include "edit.h" +#include "getline.h" static int checkout_file PROTO ((struct file_info *finfo, Vers_TS *vers_ts, int adding)); @@ -206,9 +207,12 @@ update (argc, argv) #ifdef CLIENT_SUPPORT if (client_active) { + int pass; + /* The first pass does the regular update. If we receive at least one patch which failed, we do a second pass and just fetch those files whose patches failed. */ + pass = 1; do { int status; @@ -256,7 +260,7 @@ update (argc, argv) if (failed_patches == NULL) { send_file_names (argc, argv, SEND_EXPAND_WILD); - send_files (argc, argv, local, aflag, update_build_dirs); + send_files (argc, argv, local, aflag, update_build_dirs, 0); } else { @@ -275,7 +279,7 @@ update (argc, argv) (void) unlink_file (failed_patches[i]); send_file_names (failed_patches_count, failed_patches, 0); send_files (failed_patches_count, failed_patches, local, - aflag, update_build_dirs); + aflag, update_build_dirs, 0); } failed_patches = NULL; @@ -284,9 +288,27 @@ update (argc, argv) send_to_server ("update\012", 0); status = get_responses_and_close (); - if (status != 0) + + /* If there are any conflicts, the server will return a + non-zero exit status. If any patches failed, we still + want to run the update again. We use a pass count to + avoid an endless loop. */ + + /* Notes: (1) assuming that status != 0 implies a + potential conflict is the best we can cleanly do given + the current protocol. I suppose that trying to + re-fetch in cases where there was a more serious error + is probably more or less harmless, but it isn't really + ideal. (2) it would be nice to have a testsuite case for the + conflict-and-patch-failed case. */ + + if (status != 0 + && (failed_patches == NULL || pass > 1)) + { return status; + } + ++pass; } while (failed_patches != NULL); return 0; @@ -767,8 +789,9 @@ update_dirent_proc (callerdat, dir, repository, update_dir, entries) { if (update_build_dirs) { - char tmp[PATH_MAX]; + char *tmp; + tmp = xmalloc (strlen (dir) + sizeof (CVSADM_ENTSTAT) + 10); (void) sprintf (tmp, "%s/%s", dir, CVSADM_ENTSTAT); if (unlink_file (tmp) < 0 && ! existence_error (errno)) error (1, errno, "cannot remove file %s", tmp); @@ -776,6 +799,7 @@ update_dirent_proc (callerdat, dir, repository, update_dir, entries) if (server_active) server_clear_entstat (update_dir, repository); #endif + free (tmp); } /* keep the CVS/Tag file current with the specified arguments */ @@ -816,15 +840,18 @@ update_dirleave_proc (callerdat, dir, err, update_dir, entries) FILE *fp; /* run the update_prog if there is one */ + /* FIXME: should be checking for errors from CVS_FOPEN and printing + them if not existence_error. */ if (err == 0 && !pipeout && !noexec && (fp = CVS_FOPEN (CVSADM_UPROG, "r")) != NULL) { char *cp; char *repository; - char line[MAXLINELEN]; + char *line = NULL; + size_t line_allocated = 0; repository = Name_Repository ((char *) NULL, update_dir); - if (fgets (line, sizeof (line), fp) != NULL) + if (getline (&line, &line_allocated, fp) >= 0) { if ((cp = strrchr (line, '\n')) != NULL) *cp = '\0'; @@ -837,7 +864,15 @@ update_dirleave_proc (callerdat, dir, err, update_dir, entries) cvs_output ("'\n", 0); (void) run_exec (RUN_TTY, RUN_TTY, RUN_TTY, RUN_NORMAL); } - (void) fclose (fp); + else if (ferror (fp)) + error (0, errno, "cannot read %s", CVSADM_UPROG); + else + error (0, 0, "unexpected end of file on %s", CVSADM_UPROG); + + if (fclose (fp) < 0) + error (0, errno, "cannot close %s", CVSADM_UPROG); + if (line != NULL) + free (line); free (repository); } @@ -974,7 +1009,7 @@ checkout_file (finfo, vers_ts, adding) Vers_TS *vers_ts; int adding; { - char backup[PATH_MAX]; + char *backup; int set_time, retval = 0; int retcode = 0; int status; @@ -983,11 +1018,17 @@ checkout_file (finfo, vers_ts, adding) /* don't screw with backup files if we're going to stdout */ if (!pipeout) { + backup = xmalloc (strlen (finfo->file) + + sizeof (CVSADM) + + sizeof (CVSPREFIX) + + 10); (void) sprintf (backup, "%s/%s%s", CVSADM, CVSPREFIX, finfo->file); if (isfile (finfo->file)) rename_file (finfo->file, backup); else - (void) unlink_file (backup); + /* If -f/-t wrappers are being used to wrap up a directory, + then backup might be a directory instead of just a file. */ + (void) unlink_file_dir (backup); } file_is_dead = RCS_isdead (vers_ts->srcfile, vers_ts->vn_rcs); @@ -1133,7 +1174,12 @@ VERS: ", 0); } if (!pipeout) - (void) unlink_file (backup); + { + /* If -f/-t wrappers are being used to wrap up a directory, + then backup might be a directory instead of just a file. */ + (void) unlink_file_dir (backup); + free (backup); + } return (retval); } @@ -1151,9 +1197,9 @@ patch_file (finfo, vers_ts, docheckout, file_info, checksum) struct stat *file_info; unsigned char *checksum; { - char backup[PATH_MAX]; - char file1[PATH_MAX]; - char file2[PATH_MAX]; + char *backup; + char *file1; + char *file2; int retval = 0; int retcode = 0; int fail; @@ -1168,13 +1214,25 @@ patch_file (finfo, vers_ts, docheckout, file_info, checksum) return 0; } + backup = xmalloc (strlen (finfo->file) + + sizeof (CVSADM) + + sizeof (CVSPREFIX) + + 10); (void) sprintf (backup, "%s/%s%s", CVSADM, CVSPREFIX, finfo->file); if (isfile (finfo->file)) rename_file (finfo->file, backup); else (void) unlink_file (backup); - + + file1 = xmalloc (strlen (finfo->file) + + sizeof (CVSADM) + + sizeof (CVSPREFIX) + + 10); (void) sprintf (file1, "%s/%s%s-1", CVSADM, CVSPREFIX, finfo->file); + file2 = xmalloc (strlen (finfo->file) + + sizeof (CVSADM) + + sizeof (CVSPREFIX) + + 10); (void) sprintf (file2, "%s/%s%s-2", CVSADM, CVSPREFIX, finfo->file); fail = 0; @@ -1368,6 +1426,9 @@ patch_file (finfo, vers_ts, docheckout, file_info, checksum) (void) unlink_file (file1); (void) unlink_file (file2); + free (backup); + free (file1); + free (file2); return (retval); } #endif @@ -1407,9 +1468,10 @@ merge_file (finfo, vers) struct file_info *finfo; Vers_TS *vers; { - char backup[PATH_MAX]; + char *backup; int status; int retcode = 0; + int retval; /* * The users currently modified file is moved to a backup file name @@ -1418,6 +1480,10 @@ merge_file (finfo, vers) * is the version of the file that the user was most up-to-date with * before the merge. */ + backup = xmalloc (strlen (finfo->file) + + strlen (vers->vn_user) + + sizeof (BAKPREFIX) + + 10); (void) sprintf (backup, "%s%s.%s", BAKPREFIX, finfo->file, vers->vn_user); (void) unlink_file (backup); @@ -1449,8 +1515,10 @@ merge_file (finfo, vers) error (0, 0, "file from working directory is now in %s", backup); write_letter (finfo->file, 'C', finfo->update_dir); - history_write ('C', finfo->update_dir, vers->vn_rcs, finfo->file, finfo->repository); - return 0; + history_write ('C', finfo->update_dir, vers->vn_rcs, finfo->file, + finfo->repository); + retval = 0; + goto out; } status = RCS_merge(vers->srcfile->path, @@ -1462,7 +1530,8 @@ merge_file (finfo, vers) error (status == -1 ? 1 : 0, 0, "restoring %s from backup file %s", finfo->fullname, backup); rename_file (backup, finfo->file); - return (1); + retval = 1; + goto out; } if (strcmp (vers->options, "-V4") == 0) @@ -1504,8 +1573,10 @@ merge_file (finfo, vers) { printf ("%s already contains the differences between %s and %s\n", finfo->fullname, vers->vn_user, vers->vn_rcs); - history_write ('G', finfo->update_dir, vers->vn_rcs, finfo->file, finfo->repository); - return (0); + history_write ('G', finfo->update_dir, vers->vn_rcs, finfo->file, + finfo->repository); + retval = 0; + goto out; } if (status == 1) @@ -1520,14 +1591,19 @@ merge_file (finfo, vers) } else if (retcode == -1) { - error (1, errno, "fork failed while examining update of %s", finfo->fullname); + error (1, errno, "fork failed while examining update of %s", + finfo->fullname); } else { write_letter (finfo->file, 'M', finfo->update_dir); - history_write ('G', finfo->update_dir, vers->vn_rcs, finfo->file, finfo->repository); + history_write ('G', finfo->update_dir, vers->vn_rcs, finfo->file, + finfo->repository); } - return (0); + retval = 0; + out: + free (backup); + return retval; } /* @@ -1539,7 +1615,7 @@ join_file (finfo, vers) struct file_info *finfo; Vers_TS *vers; { - char backup[PATH_MAX]; + char *backup; char *options; int status; @@ -1865,6 +1941,10 @@ join_file (finfo, vers) * is the version of the file that the user was most up-to-date with * before the merge. */ + backup = xmalloc (strlen (finfo->file) + + strlen (vers->vn_user) + + sizeof (BAKPREFIX) + + 10); (void) sprintf (backup, "%s%s.%s", BAKPREFIX, finfo->file, vers->vn_user); (void) unlink_file (backup); @@ -1923,6 +2003,7 @@ join_file (finfo, vers) (struct stat *) NULL, (unsigned char *) NULL); } #endif + free (backup); } int -- 2.20.1