diff options
Diffstat (limited to 'contrib/cvs')
45 files changed, 526 insertions, 189 deletions
diff --git a/contrib/cvs/ChangeLog b/contrib/cvs/ChangeLog index 229d05d..7265268 100644 --- a/contrib/cvs/ChangeLog +++ b/contrib/cvs/ChangeLog @@ -1,3 +1,71 @@ +2003-01-16 Derek Price <derek@ximbiot.com> + + * NEWS: Add 1.11.4 entry in regards to + <http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2003-0015>. + The Common Vulnerabilities and Exposures project (cve.mitre.org) + has assigned the name CAN-2003-0015 to this issue. + * configure.in: Update to CVS version 1.11.5. + + * configure: Regenerated. + +2002-01-16 Derek Price <derek@ximbiot.com> + + * configure.in: Update to dev version (1.11.4.1). + * configure: Regenerated. + +2002-12-28 Derek Price <derek@ximbiot.com> + + * NEWS: Add since 1.11.3 entry. + * configure.in: Update to version 1.11.4. + * configure: Regenerated. + +2002-12-27 Derek Price <derek@ximbiot.com> + + * NEWS: Add dummy entry for since 1.11.3. + * configure.in: Update to dev version 1.11.3.1. + * configure: Regenerated. + +2002-12-27 Derek Price <derek@ximbiot.com> + + * .cvsignore: Add bz2. + * NEWS: Add note about options.h. + * configure.in: Set version to 1.11.3. + * cvs.spec.in: No longer need to remove config.cache between runs + of configure. + + * configure: Regenerated. + +2002-12-20 Derek Price <derek@ximbiot.com> + + * cvsnt.mak: Make previous rule more like Visual Studio expects. + +2002-12-19 Derek Price <derek@ximbiot.com> + + * cvsnt.mak: Add lib/fnmatch.h.in -> lib/fnmatch.h rule. + +2002-12-19 Derek Price <derek@ximbiot.com> + + * INSTALL: Remove references to options.h. + * cvsnt.mak: Ditto. + * FAQ: Ditto, plus some references to installing RCS & DIFF. Wow. + That was _really_ out of date. + * configure.in: Define MY_NDBM here rather than in src/options.h. + + * config.h.in: Regenerated. + * configure: Ditto. + +2002-12-16 Derek Price <derek@ximbiot.com> + + * INSTALL: Add a platform to the tested platforms list. + (Thanks to Johan Vermeire <Johan.Vermeire@skynet.be>.) + +2002-12-04 Derek Price <derek@ximbiot.com> + + * configure.in: Add --with switch for specifying CVS_ADMIN_GROUP. + + * config.h.in: Regenerated. + * configure: Ditto. + 2002-11-21 Larry Jones <lawrence.jones@eds.com> * configure.in: Add contrib/check_cvs. diff --git a/contrib/cvs/FAQ b/contrib/cvs/FAQ index 7a1b4e8..a7941d3 100644 --- a/contrib/cvs/FAQ +++ b/contrib/cvs/FAQ @@ -1523,9 +1523,6 @@ You can branch a branch. Read the README, INSTALL and ChangeLog files to see what you are getting into. - Make sure you have versions of all the programs mentioned in the - "cvs/src/options.h" and "cvs/src/rcs.h" files. - Though you can probably muddle along without it, you should appoint one or more "Repository Administrators" who will be responsible for maintaining the Repository structure, administrative files and the @@ -1542,17 +1539,6 @@ You can branch a branch. files and possibly the ChangeLogs in each directory, the Makefile.in files and the "cvsinit.sh" program. - Edit the "options.h" file in the "src" directory. - - You might need to specify a few site-specific pieces of information - including the names of a number of functions. - - Hint1: You probably want to set the DIFF macro to use your version of - the GNU diff program with the '-a' option. Ours is set to "gdiff -a". - - Hint2: You want to use RCS 5.6.0.1 or greater and set the "HAVE_RCS5" - macro. - Execute the ./configure command. Type "make". @@ -1572,15 +1558,6 @@ You can branch a branch. The man page is useful too. If you plan to report bugs, you should also install "cvsbug". - Make sure you have versions of all the programs mentioned in the - options.h file, most of which are included in a standard Unix system. - - Unless you plan to reimplement RCS [:-)], you must install RCS. - - It is a very good idea to examine the RCS installation instructions - and make sure you are using the GNU versions of "diff" and "diff3" or - merges (an important part of CVS) will not work as well as you'd like. - Set your $CVSROOT environment variable and create the Repository (which you planned out in 4A.1) with the "cvsinit" command at the top of the CVS sources. diff --git a/contrib/cvs/INSTALL b/contrib/cvs/INSTALL index fe3242c..1ca97a2 100644 --- a/contrib/cvs/INSTALL +++ b/contrib/cvs/INSTALL @@ -191,6 +191,7 @@ SPARC: Sun UltraSPARC running Solaris 2.6 using gcc 2.8.1 (1.10) NextSTEP 3.3 (1.7) Sun SPARC running Linux 2.0.17, gcc 2.7.2 (1.8.87) + Sun UltraSPARC running Solaris 2.8 using gcc 2.95.3 VAX: VAX running VMS 6.2 (1.9+patches, client-only) (see README.VMS for information on necessary hacks). @@ -337,9 +338,9 @@ Building from source code under Unix: By default, CVS uses some built-in ndbm emulation code to allow CVS to work in a heterogeneous environment. However, if you have a very large modules database, this may not work well. You will - need to edit src/options.h to turn off the MY_NDBM #define and - re-run configure. If you do this, the following comments apply. - If not, you may safely skip these comments. + need to supply the --disable-cvs-ndbm option to configure to + accomplish this. If you do this, the following comments apply. If + not, you may safely skip these comments. If you configure CVS to use the real ndbm(3) libraries and you do not have them installed in a "normal" place, you will diff --git a/contrib/cvs/NEWS b/contrib/cvs/NEWS index 453236f..f065d83 100644 --- a/contrib/cvs/NEWS +++ b/contrib/cvs/NEWS @@ -1,8 +1,23 @@ -Changes since 1.11.2: +Changes since 1.11.4: + +* Fixed a security hole by which users with read only access could gain +write access. The Common Vulnerabilities and Exposures project (cve.mitre.org) +has assigned the name CAN-2003-0015 to this issue. See +<http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2003-0015> for more +information. + +Changes from 1.11.3 to 1.11.4: + +* Some minor changes to allow the code to compile on Windows platforms. + +Changes from 1.11.2 to 1.11.3: * When waiting for another user's lock, the message timestamps are now in UTC rather than the server's local time. +* The options.h file is no longer used. This fixes a bug that occurred when +1.11.2 was compiled on Windows platforms. + * We've standardized on Automake version 1.6.3 and Autoconf version 2.53. They are cleaner, less bug prone, and will hopfully allow me to start updating sanity.sh to use Autotest and Autoshell. Again, this should only really affect diff --git a/contrib/cvs/config.h.in b/contrib/cvs/config.h.in index ceeade3..66910f0 100644 --- a/contrib/cvs/config.h.in +++ b/contrib/cvs/config.h.in @@ -13,6 +13,15 @@ /* Define to 1 if the `closedir' function returns void instead of `int'. */ #undef CLOSEDIR_VOID +/* The CVS admin command is restricted to the members of the group + CVS_ADMIN_GROUP. If this group does not exist, all users are allowed to run + CVS admin. To disable the CVS admin command for all users, create an empty + CVS_ADMIN_GROUP by running configure with the --with-cvs-admin-group= + option. To disable access control for CVS admin, run configure with the + --without-cvs-admin-group option in order to comment out the define below. + */ +#undef CVS_ADMIN_GROUP + /* When committing a permanent change, CVS and RCS make a log entry of who committed the change. If you are committing the change logged in as "root" (not under "su" or other root-priv giving program), CVS/RCS cannot @@ -352,6 +361,12 @@ /* Define to 1 if `vfork' works. */ #undef HAVE_WORKING_VFORK +/* By default, CVS stores its modules and other such items in flat text files + (MY_NDBM enables this). Turning off MY_NDBM causes CVS to look for a + system-supplied ndbm database library and use it instead. That may speed + things up, but the default setting generally works fine too. */ +#undef MY_NDBM + /* Define to 1 if your C compiler doesn't accept -c and -o together. */ #undef NO_MINUS_C_MINUS_O diff --git a/contrib/cvs/configure b/contrib/cvs/configure index 5932504..6397ca9 100755 --- a/contrib/cvs/configure +++ b/contrib/cvs/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.53 for Concurrent Versions System (CVS) 1.11.2.1. +# Generated by GNU Autoconf 2.53 for Concurrent Versions System (CVS) 1.11.5. # # Report bugs to <bug-cvs@gnu.org>. # @@ -256,8 +256,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='Concurrent Versions System (CVS)' PACKAGE_TARNAME='cvs' -PACKAGE_VERSION='1.11.2.1' -PACKAGE_STRING='Concurrent Versions System (CVS) 1.11.2.1' +PACKAGE_VERSION='1.11.5' +PACKAGE_STRING='Concurrent Versions System (CVS) 1.11.5' PACKAGE_BUGREPORT='bug-cvs@gnu.org' ac_unique_file="src/cvs.h" @@ -766,7 +766,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures Concurrent Versions System (CVS) 1.11.2.1 to adapt to many kinds of systems. +\`configure' configures Concurrent Versions System (CVS) 1.11.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -828,7 +828,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of Concurrent Versions System (CVS) 1.11.2.1:";; + short | recursive ) echo "Configuration of Concurrent Versions System (CVS) 1.11.5:";; esac cat <<\_ACEOF @@ -837,6 +837,9 @@ Optional Features: --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-dependency-tracking Speeds up one-time builds --enable-dependency-tracking Do not reject slow dependency extractors + --enable-cvs-ndbm Use the NDBM library distributed with CVS rather + than attempting to use a system NDBM library. + Disabling this may not work. (default) --enable-client Include code for running as a remote client (default) --enable-password-authenticated-client @@ -876,6 +879,15 @@ Optional Packages: (default autoselects) --with-umask Set the umask CVS will use by default in the repository (default 002) + --with-cvs-admin-group=GROUP + The CVS admin command is restricted to the members + of this group. If this group does not exist, all + users are allowed to run CVS admin. To disable the + CVS admin command for all users, create an empty + group by specifying the --with-cvs-admin-group= + option. To disable access control for CVS admin, run + configure with the --without-cvs-admin-group option. + (default 'cvsadmin') Some influential environment variables: CC C compiler command @@ -953,7 +965,7 @@ fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF -Concurrent Versions System (CVS) configure 1.11.2.1 +Concurrent Versions System (CVS) configure 1.11.5 generated by GNU Autoconf 2.53 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 @@ -968,7 +980,7 @@ cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by Concurrent Versions System (CVS) $as_me 1.11.2.1, which was +It was created by Concurrent Versions System (CVS) $as_me 1.11.5, which was generated by GNU Autoconf 2.53. Invocation command line was $ $0 $@ @@ -1501,7 +1513,7 @@ fi # Define the identity of the package. PACKAGE=cvs - VERSION=1.11.2.1 + VERSION=1.11.5 # Some tools Automake needs. @@ -9187,6 +9199,44 @@ _ACEOF +# Check whether --with-cvs-admin-group or --without-cvs-admin-group was given. +if test "${with_cvs_admin_group+set}" = set; then + withval="$with_cvs_admin_group" + +else + with_cvs_admin_group=cvsadmin +fi; + +if test yes = "$with_cvs_admin_group"; then + with_cvs_admin_group=cvsadmin +fi +if test no != "$with_cvs_admin_group"; then + +cat >>confdefs.h <<_ACEOF +#define CVS_ADMIN_GROUP "$with_cvs_admin_group" +_ACEOF + +fi + + +# Check whether --enable-cvs-ndbm or --disable-cvs-ndbm was given. +if test "${enable_cvs_ndbm+set}" = set; then + enableval="$enable_cvs_ndbm" + +else + enable_cvs_ndbm=yes +fi; +if test no != "$enable_cvs_ndbm"; then + +cat >>confdefs.h <<\_ACEOF +#define MY_NDBM 1 +_ACEOF + +fi + + + + @@ -9490,6 +9540,7 @@ fi + echo "$as_me:$LINENO: checking for cygwin32" >&5 echo $ECHO_N "checking for cygwin32... $ECHO_C" >&6 if test "${ccvs_cv_sys_cygwin32+set}" = set; then @@ -9924,7 +9975,7 @@ _ASBOX } >&5 cat >&5 <<_CSEOF -This file was extended by Concurrent Versions System (CVS) $as_me 1.11.2.1, which was +This file was extended by Concurrent Versions System (CVS) $as_me 1.11.5, which was generated by GNU Autoconf 2.53. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -9989,7 +10040,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -Concurrent Versions System (CVS) config.status 1.11.2.1 +Concurrent Versions System (CVS) config.status 1.11.5 configured by $0, generated by GNU Autoconf 2.53, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" diff --git a/contrib/cvs/configure.in b/contrib/cvs/configure.in index 901d71d..c3bcbe3 100644 --- a/contrib/cvs/configure.in +++ b/contrib/cvs/configure.in @@ -1,5 +1,5 @@ dnl configure.in for cvs -AC_INIT([Concurrent Versions System (CVS)],[1.11.2.1],[bug-cvs@gnu.org],[cvs]) +AC_INIT([Concurrent Versions System (CVS)],[1.11.5],[bug-cvs@gnu.org],[cvs]) AC_CONFIG_SRCDIR(src/cvs.h) AM_INIT_AUTOMAKE([gnu 1.5 dist-bzip2 no-define]) AC_PREREQ(2.53) @@ -518,6 +518,79 @@ dnl dnl Done setting default umask dnl +dnl +dnl Set CVS Administrator Group +dnl +AC_ARG_WITH( + [cvs-admin-group], + AC_HELP_STRING( + [--with-cvs-admin-group=GROUP], + [The CVS admin command is restricted to the members of this group. + If this group does not exist, all users are allowed to run CVS admin. + To disable the CVS admin command for all users, create an empty group + by specifying the --with-cvs-admin-group= option. To disable access + control for CVS admin, run configure with the --without-cvs-admin-group + option. (default 'cvsadmin')]), , + [with_cvs_admin_group=cvsadmin]) + +if test yes = "$with_cvs_admin_group"; then + with_cvs_admin_group=cvsadmin +fi +if test no != "$with_cvs_admin_group"; then + dnl FIXME We should warn if the group doesn't exist + AC_DEFINE_UNQUOTED( + [CVS_ADMIN_GROUP], ["$with_cvs_admin_group"], + [The CVS admin command is restricted to the members of the group + CVS_ADMIN_GROUP. If this group does not exist, all users are + allowed to run CVS admin. To disable the CVS admin command for + all users, create an empty CVS_ADMIN_GROUP by running configure + with the --with-cvs-admin-group= option. To disable access control + for CVS admin, run configure with the --without-cvs-admin-group + option in order to comment out the define below.]) +fi + +dnl +dnl Done setting CVS Administrator Group +dnl + +dnl +dnl Set the NDBM library to use. +dnl +dnl XXX - FIXME - FIXME - FIXME - XXX +dnl +dnl This is very bad. It should really autodetect an appropriate NDBM library +dnl and, if it doesn't find one, decide to use MY_NDBM. I'm am defining +dnl this here since this is no worse than it worked when it was in options.h +dnl and I am cleaning out options.h so that the Windows version of CVS will +dnl compile properly for the next release. +dnl +dnl That's why this option is in the --with-* section rather than the +dnl --enable-* section. +dnl +dnl XXX - FIXME - FIXME - FIXME - XXX +dnl +AC_ARG_ENABLE( + [cvs-ndbm], + AC_HELP_STRING( + [--enable-cvs-ndbm], + [Use the NDBM library distributed with CVS rather than attempting to use + a system NDBM library. Disabling this may not work. (default)]), , + [enable_cvs_ndbm=yes]) +if test no != "$enable_cvs_ndbm"; then + AC_DEFINE( + [MY_NDBM], [1], + [By default, CVS stores its modules and other such items in flat + text files (MY_NDBM enables this). Turning off MY_NDBM causes CVS + to look for a system-supplied ndbm database library and use it + instead. That may speed things up, but the default setting + generally works fine too.]) +fi + +dnl +dnl Done selecting NDBM library. +dnl + + dnl dnl end --with-* @@ -770,8 +843,9 @@ dnl end --enable-rootcommit dnl + dnl -dnl end --enables +dnl end --enable-* dnl diff --git a/contrib/cvs/contrib/ChangeLog b/contrib/cvs/contrib/ChangeLog index 5811d88..77f32b9 100644 --- a/contrib/cvs/contrib/ChangeLog +++ b/contrib/cvs/contrib/ChangeLog @@ -1,3 +1,14 @@ +2002-12-16 Derek Price <derek@ximbiot.com> + + * cvs_acls.in: Fix split loop error with Perl 5.8.0. + (Patch from Ville Skyttä <ville.skytta@iki.fi>.) + +2002-12-11 Larry Jones <lawrence.jones@eds.com> + + * Makefile.am (install-data-local): test -e isn't portable: use -f. + * Makefile.in: Regenerated. + (Reported by Philip Brown <phil@bolthole.com>.) + 2002-11-21 Larry Jones <lawrence.jones@eds.com> * .cvsignore: Add check_cvs. diff --git a/contrib/cvs/contrib/Makefile.am b/contrib/cvs/contrib/Makefile.am index 77e56d9..faf6510 100644 --- a/contrib/cvs/contrib/Makefile.am +++ b/contrib/cvs/contrib/Makefile.am @@ -67,9 +67,9 @@ install-data-local: @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_LINKS)'; for p in $$list; do \ - echo "test ! -e $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \ + echo "test ! -f $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \ echo " && cd $(DESTDIR)$(bindir) && $(LN_S) ../share/$(PACKAGE)/contrib/`echo $$p|sed '$(transform)'` ."; \ - (test ! -e $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'` \ + (test ! -f $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'` \ && cd $(DESTDIR)$(bindir) && $(LN_S) ../share/$(PACKAGE)/contrib/`echo $$p|sed '$(transform)'` .) \ || (echo "Link creation failed" && if test -f $$p; then \ echo " $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \ diff --git a/contrib/cvs/contrib/Makefile.in b/contrib/cvs/contrib/Makefile.in index 75eba60..93df76d 100644 --- a/contrib/cvs/contrib/Makefile.in +++ b/contrib/cvs/contrib/Makefile.in @@ -355,9 +355,9 @@ install-data-local: @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_LINKS)'; for p in $$list; do \ - echo "test ! -e $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \ + echo "test ! -f $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \ echo " && cd $(DESTDIR)$(bindir) && $(LN_S) ../share/$(PACKAGE)/contrib/`echo $$p|sed '$(transform)'` ."; \ - (test ! -e $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'` \ + (test ! -f $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'` \ && cd $(DESTDIR)$(bindir) && $(LN_S) ../share/$(PACKAGE)/contrib/`echo $$p|sed '$(transform)'` .) \ || (echo "Link creation failed" && if test -f $$p; then \ echo " $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \ diff --git a/contrib/cvs/contrib/cvs_acls.in b/contrib/cvs/contrib/cvs_acls.in index d151d9e..990f207 100755 --- a/contrib/cvs/contrib/cvs_acls.in +++ b/contrib/cvs/contrib/cvs_acls.in @@ -154,7 +154,7 @@ while (<AVAIL>) { # Module matches if it is a NULL module list in the avail line. If module # list is not null, we check every argument combination. if (!($in_repo = !$m)) { - @tmp = split(/[\s,]+/,$m); + my @tmp = split(/[\s,]+/,$m); for $j (@tmp) { # If the repos from avail is a parent(or equal) dir of $repos, OK $in_repo = 1, last if ($repos eq $j || $repos =~ /^$j\//); diff --git a/contrib/cvs/doc/ChangeLog b/contrib/cvs/doc/ChangeLog index 7662226..a75b2cc 100644 --- a/contrib/cvs/doc/ChangeLog +++ b/contrib/cvs/doc/ChangeLog @@ -1,3 +1,38 @@ +2003-01-16 Derek Price <derek@ximbiot.com> + + * stamp-1: Regenerated for version (1.11.5). + * stamp-vti: Ditto. + * version-client.texi: Ditto. + * version.texi: Ditto. + +2003-01-16 Derek Price <derek@ximbiot.com> + + * stamp-1: Regenerated for dev version (1.11.4.1). + * stamp-vti: Ditto. + * version-client.texi: Ditto. + * version.texi: Ditto. + +2002-12-28 Derek Price <derek@ximbiot.com> + + * stamp-1: Regenerated for version 1.11.4. + * stamp-vti: Ditto. + * version-client.texi: Ditto. + * version.texi: Ditto. + +2002-12-27 Derek Price <derek@ximbiot.com> + + * stamp-1: Regenerated for dev version 1.11.3.1. + * stamp-vti: Ditto. + * version-client.texi: Ditto. + * version.texi: Ditto. + +2002-12-27 Derek Price <derek@ximbiot.com> + + * stamp-1: Regenerated. + * stamp-vti: Ditto. + * version-client.texi: Ditto. + * version.texi: Ditto. + 2002-11-18 Derek Price <derek@ximbiot.com> * cvs.texinfo (commitinfo): Explain the environment of commands diff --git a/contrib/cvs/doc/stamp-1 b/contrib/cvs/doc/stamp-1 index 574c293..f923926 100644 --- a/contrib/cvs/doc/stamp-1 +++ b/contrib/cvs/doc/stamp-1 @@ -1,4 +1,4 @@ @set UPDATED 5 September 2001 @set UPDATED-MONTH September 2001 -@set EDITION 1.11.2.1 -@set VERSION 1.11.2.1 +@set EDITION 1.11.5 +@set VERSION 1.11.5 diff --git a/contrib/cvs/doc/stamp-vti b/contrib/cvs/doc/stamp-vti index 5ebdc85..e0a9c13 100644 --- a/contrib/cvs/doc/stamp-vti +++ b/contrib/cvs/doc/stamp-vti @@ -1,4 +1,4 @@ @set UPDATED 18 November 2002 @set UPDATED-MONTH November 2002 -@set EDITION 1.11.2.1 -@set VERSION 1.11.2.1 +@set EDITION 1.11.5 +@set VERSION 1.11.5 diff --git a/contrib/cvs/doc/version-client.texi b/contrib/cvs/doc/version-client.texi index 574c293..f923926 100644 --- a/contrib/cvs/doc/version-client.texi +++ b/contrib/cvs/doc/version-client.texi @@ -1,4 +1,4 @@ @set UPDATED 5 September 2001 @set UPDATED-MONTH September 2001 -@set EDITION 1.11.2.1 -@set VERSION 1.11.2.1 +@set EDITION 1.11.5 +@set VERSION 1.11.5 diff --git a/contrib/cvs/doc/version.texi b/contrib/cvs/doc/version.texi index 5ebdc85..e0a9c13 100644 --- a/contrib/cvs/doc/version.texi +++ b/contrib/cvs/doc/version.texi @@ -1,4 +1,4 @@ @set UPDATED 18 November 2002 @set UPDATED-MONTH November 2002 -@set EDITION 1.11.2.1 -@set VERSION 1.11.2.1 +@set EDITION 1.11.5 +@set VERSION 1.11.5 diff --git a/contrib/cvs/lib/ChangeLog b/contrib/cvs/lib/ChangeLog index 7039e28..8cf3e6f 100644 --- a/contrib/cvs/lib/ChangeLog +++ b/contrib/cvs/lib/ChangeLog @@ -1,3 +1,7 @@ +2002-12-27 Derek Price <derek@ximbiot.com> + + * getdate.c: Regenerated with Bison 1.35. + 2002-11-04 Derek Price <derek@ximbiot.com> * getdate.y (Convert): Add comment as to the effectiveness of diff --git a/contrib/cvs/src/ChangeLog b/contrib/cvs/src/ChangeLog index ed1188b..656ca2f 100644 --- a/contrib/cvs/src/ChangeLog +++ b/contrib/cvs/src/ChangeLog @@ -1,3 +1,92 @@ +2003-01-15 Karl Fogel <kfogel@collab.net> + + * server.c (dirswitch): Don't free dir_name until right before + allocating it again. This removes a potential double-free + problem, whereby this function could free dir_name and then + immediately return due to invalid directory syntax (without ever + reassigning dir_name), then reenter and free dir_name again. + + Thanks to Stefan Esser <s.esser@e-matters.de> for the fix. + +2003-01-08 Larry Jones <lawrence.jones@eds.com> + + * client.c (update_entries): Only "0" is a special version number; + other numbers starting with 0 (like 0.1) are normal version numbers. + * commit.c (find_fileproc): Ditto. Also reorganize the code to + simplify the conditions. + (Reported by Michele Zamparelli <michele.zamparelli@eso.org>.) + +2003-01-02 Larry Jones <lawrence.jones@eds.com> + + * rcs.c (getdelta): Use RCSDEAD rather than literal "dead". + +2002-12-27 Derek Price <derek@ximbiot.com> + + * admin.c: s/LOCK_(NONE|WRITE|READ)/CVS_$&/g; since the definition of + LOCK_WRITE clashes with a definition in objidl.h on Windoze platforms. + * annotate.c: Ditto. + * client.c: Ditto. + * commit.c: Ditto. + * cvs.h: Ditto. + * diff.c: Ditto. + * edit.c: Ditto. + * lock.c: Ditto. + * log.c: Ditto. + * patch.c: Ditto. + * recurse.c: Ditto. + * remove.c: Ditto. + * status.c: Ditto. + * tag.c: Ditto. + * update.c: Ditto. + * watch.c: Ditto. + * myndbm.c: Ditto & define O_ACCMODE when it isn't defined, as under + Windoze. + (Thanks to Stephane Rouleau <s.rouleau@videotron.ca>, + Cristopher Seawood <cls@seawood.org>, and + Frederico Costa <frederico.costa@tiscali.no> for all their hints, + tips, and patches for this problem.) + +2002-12-20 Derek Price <derek@ximbiot.com> + + * client.c (send_a_repository): Suppress a warning under Windoze. + +2002-12-19 Derek Price <derek@ximbiot.com> + + * Makefile.am: Remove reference to options.h. + * cvs.h: Ditto. + * options.h: Remove this obsolete file. + * sanity.sh: Remove comment about external diffs causing tests to fail + since CVS hasn't used external diffs in years. + + * Makefile.in: Regenerated. + +2002-12-16 Derek Price <derek@ximbiot.com> + + * admin.c: Disable cvsadmin group checking on the client. + (Reported by Dan Peterson <dbpete@aol.com>.) + +2002-12-06 Derek Price <derek@ximbiot.com> + + * buffer.c: Replace calls to malloc with calls to xmalloc and calls to + realloc with calls to xrealloc. + * parseinfo.c: Ditto. + * root.c: Ditto. + * server.c: Ditto. + * zlib.c: Ditto. + * scramble.c: Change some comments to refer to xmalloc rather than + malloc. + (Reported by Dan Peterson <dbpete@aol.com>.) + +2002-12-04 Derek Price <derek@ximbiot.com> + + * options.h: Remove CVS_ADMIN_GROUP. + +2002-12-02 Larry Jones <lawrence.jones@eds.com> + + * commit.c (commit): Strip leading zeros from numeric revision + in addition to trailing dots. + (Reported by Peter Meszaros <pme@prolan.hu>.) + 2002-11-22 Larry Jones <lawrence.jones@eds.com> * sanity.sh: Note that the tests run for a long time. diff --git a/contrib/cvs/src/Makefile.am b/contrib/cvs/src/Makefile.am index 3338eec..0195f56 100644 --- a/contrib/cvs/src/Makefile.am +++ b/contrib/cvs/src/Makefile.am @@ -89,7 +89,6 @@ cvs_SOURCES = \ hardlink.h \ hash.h \ myndbm.h \ - options.h \ rcs.h \ root.h \ server.h \ diff --git a/contrib/cvs/src/Makefile.in b/contrib/cvs/src/Makefile.in index 3a56e0c..189cd28 100644 --- a/contrib/cvs/src/Makefile.in +++ b/contrib/cvs/src/Makefile.in @@ -175,7 +175,6 @@ cvs_SOURCES = \ hardlink.h \ hash.h \ myndbm.h \ - options.h \ rcs.h \ root.h \ server.h \ diff --git a/contrib/cvs/src/admin.c b/contrib/cvs/src/admin.c index 8c4fce3..6a5649a 100644 --- a/contrib/cvs/src/admin.c +++ b/contrib/cvs/src/admin.c @@ -377,9 +377,19 @@ admin (argc, argv) #ifdef CVS_ADMIN_GROUP /* The use of `cvs admin -k' is unrestricted. However, any other - option is restricted if the group CVS_ADMIN_GROUP exists. */ - if (!only_k_option && - (grp = getgrnam(CVS_ADMIN_GROUP)) != NULL) + option is restricted if the group CVS_ADMIN_GROUP exists on the + server. */ + if ( +# ifdef CLIENT_SUPPORT + /* This is only "secure" on the server, since the user could edit the + * RCS file on a local host, but some people like this kind of + * check anyhow. The alternative would be to check only when + * (server_active) rather than when not on the client. + */ + !current_parsed_root->isremote && +# endif /* CLIENT_SUPPORT */ + !only_k_option + && (grp = getgrnam(CVS_ADMIN_GROUP)) != NULL) { #ifdef HAVE_GETGROUPS gid_t *grps; @@ -411,7 +421,7 @@ admin (argc, argv) CVS_ADMIN_GROUP); #endif } -#endif +#endif /* defined CVS_ADMIN_GROUP */ for (i = 0; i < admin_data.ac; ++i) { @@ -510,7 +520,7 @@ admin (argc, argv) err = start_recursion (admin_fileproc, (FILESDONEPROC) NULL, admin_dirproc, (DIRLEAVEPROC) NULL, (void *)&admin_data, argc, argv, 0, - W_LOCAL, 0, LOCK_NONE, (char *) NULL, 1); + W_LOCAL, 0, CVS_LOCK_NONE, (char *) NULL, 1); Lock_Cleanup (); return_it: diff --git a/contrib/cvs/src/annotate.c b/contrib/cvs/src/annotate.c index 8c72962..2e3cb89 100644 --- a/contrib/cvs/src/annotate.c +++ b/contrib/cvs/src/annotate.c @@ -248,7 +248,7 @@ rannotate_proc (argc, argv, xwhere, mwhere, mfile, shorten, local, mname, msg) err = start_recursion (annotate_fileproc, (FILESDONEPROC) NULL, (DIRENTPROC) NULL, (DIRLEAVEPROC) NULL, NULL, - argc - 1, argv + 1, local, which, 0, LOCK_READ, + argc - 1, argv + 1, local, which, 0, CVS_LOCK_READ, where, 1); return err; } diff --git a/contrib/cvs/src/buffer.c b/contrib/cvs/src/buffer.c index ba98b4f..fd98d82 100644 --- a/contrib/cvs/src/buffer.c +++ b/contrib/cvs/src/buffer.c @@ -106,7 +106,7 @@ allocate_buffer_datas () #define ALLOC_COUNT (16) alc = ((struct buffer_data *) - malloc (ALLOC_COUNT * sizeof (struct buffer_data))); + xmalloc (ALLOC_COUNT * sizeof (struct buffer_data))); space = (char *) valloc (ALLOC_COUNT * BUFFER_DATA_SIZE); if (alc == NULL || space == NULL) return; @@ -154,7 +154,7 @@ buf_empty_p (buf) #ifdef SERVER_FLOWCONTROL /* * Count how much data is stored in the buffer.. - * Note that each buffer is a malloc'ed chunk BUFFER_DATA_SIZE. + * Note that each buffer is a xmalloc'ed chunk BUFFER_DATA_SIZE. */ int @@ -794,7 +794,7 @@ buf_read_line (buf, line, lenp) char *p; struct buffer_data *nldata; - p = malloc (len + 1); + p = xmalloc (len + 1); if (p == NULL) return -2; *line = p; @@ -1233,7 +1233,7 @@ stdio_buffer_initialize (fp, child_pid, input, memory) int input; void (*memory) PROTO((struct buffer *)); { - struct stdio_buffer_closure *bc = malloc (sizeof (*bc)); + struct stdio_buffer_closure *bc = xmalloc (sizeof (*bc)); bc->fp = fp; bc->child_pid = child_pid; @@ -1677,7 +1677,7 @@ packetizing_buffer_input (closure, data, need, size, got) /* We didn't allocate enough space in the initialize function. */ - n = realloc (pb->holdbuf, count + 2); + n = xrealloc (pb->holdbuf, count + 2); if (n == NULL) { (*pb->buf->memory_error) (pb->buf); @@ -1739,7 +1739,7 @@ packetizing_buffer_input (closure, data, need, size, got) outbuf = stackoutbuf; else { - outbuf = malloc (count); + outbuf = xmalloc (count); if (outbuf == NULL) { (*pb->buf->memory_error) (pb->buf); @@ -1811,7 +1811,7 @@ packetizing_buffer_output (closure, data, have, wrote) if (have > BUFFER_DATA_SIZE) { - /* It would be easy to malloc a buffer, but I don't think this + /* It would be easy to xmalloc a buffer, but I don't think this case can ever arise. */ abort (); } diff --git a/contrib/cvs/src/client.c b/contrib/cvs/src/client.c index a5a15e14..94e902a 100644 --- a/contrib/cvs/src/client.c +++ b/contrib/cvs/src/client.c @@ -2175,7 +2175,7 @@ update_entries (data_arg, ent_list, short_pathname, filename) * date. Create a dummy timestamp which will never compare * equal to the timestamp of the file. */ - if (vn[0] == '\0' || vn[0] == '0' || vn[0] == '-') + if (vn[0] == '\0' || strcmp (vn, "0") == 0 || vn[0] == '-') local_timestamp = "dummy timestamp"; else if (local_timestamp == NULL) { @@ -3001,7 +3001,7 @@ send_a_repository (dir, repository, update_dir) && (strcmp (repository + repository_len - update_dir_len, update_dir) == 0) /* TOPLEVEL_REPOS shouldn't be above current_parsed_root->directory */ - && ((repository_len - update_dir_len) + && ((size_t)(repository_len - update_dir_len) > strlen (current_parsed_root->directory))) { /* The repository name contains UPDATE_DIR. Set @@ -5631,7 +5631,7 @@ send_files (argc, argv, local, aflag, flags) err = start_recursion (send_fileproc, send_filesdoneproc, send_dirent_proc, send_dirleave_proc, (void *) &args, - argc, argv, local, W_LOCAL, aflag, LOCK_NONE, (char *)NULL, 0); + argc, argv, local, W_LOCAL, aflag, CVS_LOCK_NONE, (char *)NULL, 0); if (err) error_exit (); if (toplevel_repos == NULL) diff --git a/contrib/cvs/src/commit.c b/contrib/cvs/src/commit.c index d67d0a1..0d19d31 100644 --- a/contrib/cvs/src/commit.c +++ b/contrib/cvs/src/commit.c @@ -248,26 +248,7 @@ find_fileproc (callerdat, finfo) xfinfo.rcs = NULL; vers = Version_TS (&xfinfo, NULL, saved_tag, NULL, 0, 0); - if (vers->ts_user == NULL - && vers->vn_user != NULL - && (vers->vn_user[0] == '0' || vers->vn_user[0] == '-')) - { - if ( vers->vn_user[0] == '0') - { - /* This happens when one has `cvs add'ed a file, but it no - longer exists in the working directory at commit time. */ - status = T_ADDED; - } - else - { - /* FIXME: If vn_user is starts with "-" but ts_user is - non-NULL, what classify_file does is print "%s should be - removed and is still there". I'm not sure what it does - then. We probably should do the same. */ - status = T_REMOVED; - } - } - else if (vers->vn_user == NULL) + if (vers->vn_user == NULL) { if (vers->ts_user == NULL) error (0, 0, "nothing known about `%s'", finfo->fullname); @@ -277,16 +258,28 @@ find_fileproc (callerdat, finfo) freevers_ts (&vers); return 1; } - else if (vers->ts_user != NULL - && vers->vn_user != NULL - && vers->vn_user[0] == '0') - /* FIXME: If vn_user is "0" but ts_user is NULL, what classify_file - does is print "new-born %s has disappeared" and removes the entry. - We probably should do the same. No! Not here. Otherwise, a commit - would succeed in some cases when it should fail. See above. */ + if (vers->ts_user == NULL) + { + if (strcmp (vers->vn_user, "0") == 0) + /* This happens when one has `cvs add'ed a file, but it no + longer exists in the working directory at commit time. + FIXME: What classify_file does in this case is print + "new-born %s has disappeared" and removes the entry. + We probably should do the same. */ + status = T_ADDED; + else if (vers->vn_user[0] == '-') + status = T_REMOVED; + else + { + /* FIXME: What classify_file does in this case is print + "%s was lost". We probably should do the same. */ + freevers_ts (&vers); + return 0; + } + } + else if (strcmp (vers->vn_user, "0") == 0) status = T_ADDED; - else if (vers->ts_user != NULL - && vers->ts_rcs != NULL + else if (vers->ts_rcs != NULL && (args->force || strcmp (vers->ts_user, vers->ts_rcs) != 0)) /* If we are forcing commits, pretend that the file is modified. */ @@ -427,10 +420,12 @@ commit (argc, argv) /* numeric specified revision means we ignore sticky tags... */ if (saved_tag && isdigit ((unsigned char) *saved_tag)) { + char *p = saved_tag + strlen (saved_tag); aflag = 1; - /* strip trailing dots */ - while (saved_tag[strlen (saved_tag) - 1] == '.') - saved_tag[strlen (saved_tag) - 1] = '\0'; + /* strip trailing dots and leading zeros */ + while (*--p == '.') ; + p[1] = '\0'; + while (*saved_tag == '0') ++saved_tag; } /* some checks related to the "-F logfile" option */ @@ -466,7 +461,7 @@ commit (argc, argv) err = start_recursion (find_fileproc, find_filesdoneproc, find_dirent_proc, (DIRLEAVEPROC) NULL, (void *)&find_args, - argc, argv, local, W_LOCAL, 0, LOCK_NONE, + argc, argv, local, W_LOCAL, 0, CVS_LOCK_NONE, (char *)NULL, 0); if (err) error (1, 0, "correct above errors first!"); @@ -647,7 +642,7 @@ commit (argc, argv) */ err = start_recursion (check_fileproc, check_filesdoneproc, check_direntproc, (DIRLEAVEPROC) NULL, NULL, argc, - argv, local, W_LOCAL, aflag, LOCK_NONE, + argv, local, W_LOCAL, aflag, CVS_LOCK_NONE, (char *) NULL, 1); if (err) { @@ -662,7 +657,7 @@ commit (argc, argv) if (noexec == 0) err = start_recursion (commit_fileproc, commit_filesdoneproc, commit_direntproc, commit_dirleaveproc, NULL, - argc, argv, local, W_LOCAL, aflag, LOCK_NONE, + argc, argv, local, W_LOCAL, aflag, CVS_LOCK_NONE, (char *) NULL, 1); /* diff --git a/contrib/cvs/src/cvs.h b/contrib/cvs/src/cvs.h index 799a3f3..9b8a8b4 100644 --- a/contrib/cvs/src/cvs.h +++ b/contrib/cvs/src/cvs.h @@ -15,9 +15,6 @@ #ifdef HAVE_CONFIG_H # include <config.h> /* this is stuff found via autoconf */ #endif /* CONFIG_H */ -#include "options.h" /* these are some larger questions which - can't easily be automatically checked - for */ /* Changed from if __STDC__ to ifdef __STDC__ because of Sun's acc compiler */ @@ -266,12 +263,10 @@ extern int errno; #define CVSREAD_DFLT 0 /* writable files by default */ #define TMPDIR_ENV "TMPDIR" /* Temporary directory */ -/* #define TMPDIR_DFLT Set by options.h */ #define EDITOR1_ENV "CVSEDITOR" /* which editor to use */ #define EDITOR2_ENV "VISUAL" /* which editor to use */ #define EDITOR3_ENV "EDITOR" /* which editor to use */ -/* #define EDITOR_DFLT Set by options.h */ #define CVSROOT_ENV "CVSROOT" /* source directory root */ #define CVSROOT_DFLT NULL /* No dflt; must set for checkout */ @@ -280,7 +275,6 @@ extern int errno; #define WRAPPER_ENV "CVSWRAPPERS" /* name of the wrapper file */ #define CVSUMASK_ENV "CVSUMASK" /* Effective umask for repository */ -/* #define CVSUMASK_DFLT Set by options.h */ /* * If the beginning of the Repository matches the following string, strip it @@ -365,9 +359,9 @@ typedef enum direnter_type Dtype; #endif /* Recursion processor lock types */ -#define LOCK_NONE 0 -#define LOCK_READ 1 -#define LOCK_WRITE 2 +#define CVS_LOCK_NONE 0 +#define CVS_LOCK_READ 1 +#define CVS_LOCK_WRITE 2 extern char *program_name, *program_path, *command_name; extern char *Tmpdir, *Editor; diff --git a/contrib/cvs/src/diff.c b/contrib/cvs/src/diff.c index 2efa1e3..88af651 100644 --- a/contrib/cvs/src/diff.c +++ b/contrib/cvs/src/diff.c @@ -422,7 +422,7 @@ diff (argc, argv) /* start the recursion processor */ err = start_recursion (diff_fileproc, diff_filesdoneproc, diff_dirproc, diff_dirleaveproc, NULL, argc, argv, local, - which, 0, LOCK_READ, (char *) NULL, 1); + which, 0, CVS_LOCK_READ, (char *) NULL, 1); /* clean up */ free (options); diff --git a/contrib/cvs/src/edit.c b/contrib/cvs/src/edit.c index e0995e5..cde03f9 100644 --- a/contrib/cvs/src/edit.c +++ b/contrib/cvs/src/edit.c @@ -103,7 +103,7 @@ watch_onoff (argc, argv) err = start_recursion (onoff_fileproc, onoff_filesdoneproc, (DIRENTPROC) NULL, (DIRLEAVEPROC) NULL, NULL, - argc, argv, local, W_LOCAL, 0, LOCK_NONE, + argc, argv, local, W_LOCAL, 0, CVS_LOCK_NONE, (char *)NULL, 0); Lock_Cleanup (); diff --git a/contrib/cvs/src/lock.c b/contrib/cvs/src/lock.c index 986e0cb..9333d9b 100644 --- a/contrib/cvs/src/lock.c +++ b/contrib/cvs/src/lock.c @@ -925,7 +925,7 @@ lock_tree_for_write (argc, argv, local, which, aflag) lock_tree_list = getlist (); err = start_recursion ((FILEPROC) NULL, lock_filesdoneproc, (DIRENTPROC) NULL, (DIRLEAVEPROC) NULL, NULL, argc, - argv, local, which, aflag, LOCK_NONE, + argv, local, which, aflag, CVS_LOCK_NONE, (char *) NULL, 0); sortlist (lock_tree_list, fsortcmp); if (Writer_Lock (lock_tree_list) != 0) diff --git a/contrib/cvs/src/log.c b/contrib/cvs/src/log.c index c7e5600..ce9ba5c0 100644 --- a/contrib/cvs/src/log.c +++ b/contrib/cvs/src/log.c @@ -550,7 +550,7 @@ rlog_proc (argc, argv, xwhere, mwhere, mfile, shorten, local, mname, msg) err = start_recursion (log_fileproc, (FILESDONEPROC) NULL, log_dirproc, (DIRLEAVEPROC) NULL, (void *) &log_data, - argc - 1, argv + 1, local, which, 0, LOCK_READ, + argc - 1, argv + 1, local, which, 0, CVS_LOCK_READ, where, 1); return err; } diff --git a/contrib/cvs/src/myndbm.c b/contrib/cvs/src/myndbm.c index 69c0836..aa71ca8 100644 --- a/contrib/cvs/src/myndbm.c +++ b/contrib/cvs/src/myndbm.c @@ -18,6 +18,9 @@ #include "getline.h" #ifdef MY_NDBM +# ifndef O_ACCMODE +# define O_ACCMODE O_RDONLY|O_WRONLY|O_RDWR +# endif /* defined O_ACCMODE */ static void mydbm_load_file PROTO ((FILE *, List *, char *)); diff --git a/contrib/cvs/src/parseinfo.c b/contrib/cvs/src/parseinfo.c index e0eb3a5..9771692 100644 --- a/contrib/cvs/src/parseinfo.c +++ b/contrib/cvs/src/parseinfo.c @@ -234,7 +234,7 @@ parse_config (cvsroot) return 0; parsed = 1; - infopath = malloc (strlen (cvsroot) + infopath = xmalloc (strlen (cvsroot) + sizeof (CVSROOTADM_CONFIG) + sizeof (CVSROOTADM) + 10); @@ -385,7 +385,7 @@ warning: this CVS does not support PreservePermissions"); { if (strcmp (p, "all") != 0) { - logHistory=malloc(strlen (p) + 1); + logHistory=xmalloc(strlen (p) + 1); strcpy (logHistory, p); } } diff --git a/contrib/cvs/src/patch.c b/contrib/cvs/src/patch.c index 4a027a1..e6a25f5 100644 --- a/contrib/cvs/src/patch.c +++ b/contrib/cvs/src/patch.c @@ -356,7 +356,7 @@ patch_proc (argc, argv, xwhere, mwhere, mfile, shorten, local_specified, err = start_recursion (patch_fileproc, (FILESDONEPROC) NULL, patch_dirproc, (DIRLEAVEPROC) NULL, NULL, argc - 1, argv + 1, local_specified, - which, 0, LOCK_READ, where, 1); + which, 0, CVS_LOCK_READ, where, 1); free (where); return (err); diff --git a/contrib/cvs/src/rcs.c b/contrib/cvs/src/rcs.c index 7105540..2b2725d 100644 --- a/contrib/cvs/src/rcs.c +++ b/contrib/cvs/src/rcs.c @@ -7533,7 +7533,7 @@ unable to parse %s; `author' not in the expected place", rcsfile); unable to parse %s; `state' not in the expected place", rcsfile); vnode->state = rcsbuf_valcopy (rcsbuf, value, 0, (size_t *) NULL); /* The value is optional, according to rcsfile(5). */ - if (value != NULL && STREQ (value, "dead")) + if (value != NULL && STREQ (value, RCSDEAD)) { vnode->dead = 1; } @@ -7619,7 +7619,7 @@ unable to parse %s; `state' not in the expected place", rcsfile); vnode->dead = 1; if (vnode->state != NULL) free (vnode->state); - vnode->state = xstrdup ("dead"); + vnode->state = xstrdup (RCSDEAD); continue; } /* if we have a new revision number, we're done with this delta */ diff --git a/contrib/cvs/src/recurse.c b/contrib/cvs/src/recurse.c index e7cb861..d5eeabf 100644 --- a/contrib/cvs/src/recurse.c +++ b/contrib/cvs/src/recurse.c @@ -511,7 +511,7 @@ do_recursion (frame) if (frame->flags == R_SKIP_ALL) return (0); - locktype = noexec ? LOCK_NONE : frame->locktype; + locktype = noexec ? CVS_LOCK_NONE : frame->locktype; /* The fact that locks are not active here is what makes us fail to have the @@ -551,7 +551,7 @@ do_recursion (frame) * generating data, to give the buffers a chance to drain to the * remote client. We should not have locks active at this point, * but if there are writelocks around, we cannot pause here. */ - if (server_active && locktype != LOCK_NONE) + if (server_active && locktype != CVS_LOCK_NONE) server_pause_check(); #endif @@ -706,12 +706,12 @@ do_recursion (frame) /* read lock it if necessary */ if (repository) { - if (locktype == LOCK_READ) + if (locktype == CVS_LOCK_READ) { if (Reader_Lock (repository) != 0) error (1, 0, "read lock failed - giving up"); } - else if (locktype == LOCK_WRITE) + else if (locktype == CVS_LOCK_WRITE) lock_dir_for_write (repository); } @@ -736,7 +736,7 @@ do_recursion (frame) err += walklist (filelist, do_file_proc, &frfile); /* unlock it */ - if (locktype != LOCK_NONE) + if (locktype != CVS_LOCK_NONE) Lock_Cleanup (); /* clean up */ diff --git a/contrib/cvs/src/remove.c b/contrib/cvs/src/remove.c index c9224bd..01cdfb4 100644 --- a/contrib/cvs/src/remove.c +++ b/contrib/cvs/src/remove.c @@ -90,7 +90,7 @@ cvsremove (argc, argv) start_recursion (remove_force_fileproc, (FILESDONEPROC) NULL, (DIRENTPROC) NULL, (DIRLEAVEPROC) NULL, (void *) NULL, argc, argv, local, W_LOCAL, - 0, LOCK_NONE, (char *) NULL, 0); + 0, CVS_LOCK_NONE, (char *) NULL, 0); } /* else FIXME should probably act as if the file doesn't exist in doing the following checks. */ @@ -114,7 +114,7 @@ cvsremove (argc, argv) err = start_recursion (remove_fileproc, (FILESDONEPROC) NULL, remove_dirproc, (DIRLEAVEPROC) NULL, NULL, argc, argv, - local, W_LOCAL, 0, LOCK_READ, (char *) NULL, 1); + local, W_LOCAL, 0, CVS_LOCK_READ, (char *) NULL, 1); if (removed_files && !really_quiet) error (0, 0, "use '%s commit' to remove %s permanently", program_name, diff --git a/contrib/cvs/src/root.c b/contrib/cvs/src/root.c index 9bbbe47..8308e97 100644 --- a/contrib/cvs/src/root.c +++ b/contrib/cvs/src/root.c @@ -191,13 +191,13 @@ root_allow_add (arg) { root_allow_size = 1; root_allow_vector = - (char **) malloc (root_allow_size * sizeof (char *)); + (char **) xmalloc (root_allow_size * sizeof (char *)); } else { root_allow_size *= 2; root_allow_vector = - (char **) realloc (root_allow_vector, + (char **) xrealloc (root_allow_vector, root_allow_size * sizeof (char *)); } @@ -212,7 +212,7 @@ error ENOMEM Virtual memory exhausted.\n"); error_exit (); } } - p = malloc (strlen (arg) + 1); + p = xmalloc (strlen (arg) + 1); if (p == NULL) goto no_memory; strcpy (p, arg); diff --git a/contrib/cvs/src/sanity.sh b/contrib/cvs/src/sanity.sh index 935b78c..c6e504e 100755 --- a/contrib/cvs/src/sanity.sh +++ b/contrib/cvs/src/sanity.sh @@ -4336,9 +4336,6 @@ ${PROG} [a-z]*: use .${PROG} commit. to remove this file permanently" dotest_fail death2-diff-1 "${testcvs} -q diff file1" \ "${PROG} [a-z]*: file1 was removed, no comparison available" - # If the DIFF that CVS is using (options.h) is Sun diff, this - # test is said to fail (I think the /dev/null is the part - # that differs), along with a number of the other similar tests. dotest_fail death2-diff-2 "${testcvs} -q diff -N -c file1" \ "Index: file1 =================================================================== diff --git a/contrib/cvs/src/scramble.c b/contrib/cvs/src/scramble.c index 77376fa..487cbf4 100644 --- a/contrib/cvs/src/scramble.c +++ b/contrib/cvs/src/scramble.c @@ -75,14 +75,14 @@ shifts[] = { * single letter indicating the scrambling method. As of this * writing, the only legal method is 'A', but check the code for more * up-to-date information. The copy will have been allocated with - * malloc(). + * xmalloc(). * - * descramble(SCRM) returns STR, again in its own malloc'd space. + * descramble(SCRM) returns STR, again in its own xmalloc'd space. * descramble() uses SCRM[0] to determine which method of unscrambling * to use. If it does not recognize the method, it dies with error. */ -/* Return a malloc'd, scrambled version of STR. */ +/* Return a xmalloc'd, scrambled version of STR. */ char * scramble (str) char *str; diff --git a/contrib/cvs/src/server.c b/contrib/cvs/src/server.c index 9a0c132..04d912c 100644 --- a/contrib/cvs/src/server.c +++ b/contrib/cvs/src/server.c @@ -349,17 +349,17 @@ create_adm_p (base_dir, dir) return 0; /* nothing to do */ /* Allocate some space for our directory-munging string. */ - p = malloc (strlen (dir) + 1); + p = xmalloc (strlen (dir) + 1); if (p == NULL) return ENOMEM; - dir_where_cvsadm_lives = malloc (strlen (base_dir) + strlen (dir) + 100); + dir_where_cvsadm_lives = xmalloc (strlen (base_dir) + strlen (dir) + 100); if (dir_where_cvsadm_lives == NULL) return ENOMEM; /* Allocate some space for the temporary string in which we will construct filenames. */ - tmp = malloc (strlen (base_dir) + strlen (dir) + 100); + tmp = xmalloc (strlen (base_dir) + strlen (dir) + 100); if (tmp == NULL) return ENOMEM; @@ -399,7 +399,7 @@ create_adm_p (base_dir, dir) differently. */ char *empty; - empty = malloc (strlen (current_parsed_root->directory) + empty = xmalloc (strlen (current_parsed_root->directory) + sizeof (CVSROOTADM) + sizeof (CVSNULLREPOS) + 3); @@ -517,7 +517,7 @@ mkdir_p (dir) char *dir; { char *p; - char *q = malloc (strlen (dir) + 1); + char *q = xmalloc (strlen (dir) + 1); int retval; if (q == NULL) @@ -644,7 +644,7 @@ alloc_pending (size) this case. But we might as well handle it if they don't, I guess. */ return 0; - pending_error_text = malloc (size); + pending_error_text = xmalloc (size); if (pending_error_text == NULL) { pending_error = ENOMEM; @@ -772,7 +772,7 @@ E Protocol error: Root says \"%s\" but pserver says \"%s\"", nothing. But for rsh, we need to do it now. */ parse_config (current_parsed_root->directory); - path = malloc (strlen (current_parsed_root->directory) + path = xmalloc (strlen (current_parsed_root->directory) + sizeof (CVSROOTADM) + 2); if (path == NULL) @@ -791,7 +791,7 @@ E Protocol error: Root says \"%s\" but pserver says \"%s\"", free (path); #ifdef HAVE_PUTENV - env = malloc (strlen (CVSROOT_ENV) + strlen (current_parsed_root->directory) + 2); + env = xmalloc (strlen (CVSROOT_ENV) + strlen (current_parsed_root->directory) + 2); if (env == NULL) { pending_error = ENOMEM; @@ -922,7 +922,7 @@ serve_max_dotdot (arg) if (lim < 0) return; - p = malloc (strlen (server_temp_dir) + 2 * lim + 10); + p = xmalloc (strlen (server_temp_dir) + 2 * lim + 10); if (p == NULL) { pending_error = ENOMEM; @@ -971,9 +971,6 @@ dirswitch (dir, repos) return; } - if (dir_name != NULL) - free (dir_name); - dir_len = strlen (dir); /* Check for a trailing '/'. This is not ISDIRSEP because \ in the @@ -989,7 +986,10 @@ dirswitch (dir, repos) return; } - dir_name = malloc (strlen (server_temp_dir) + dir_len + 40); + if (dir_name != NULL) + free (dir_name); + + dir_name = xmalloc (strlen (server_temp_dir) + dir_len + 40); if (dir_name == NULL) { pending_error = ENOMEM; @@ -1161,7 +1161,7 @@ serve_directory (arg) } else { - pending_error_text = malloc (80 + strlen (arg)); + pending_error_text = xmalloc (80 + strlen (arg)); if (pending_error_text == NULL) { pending_error = ENOMEM; @@ -1268,7 +1268,7 @@ receive_partial_file (size, file) pending_error = ENOMEM; else { - pending_error_text = malloc (80); + pending_error_text = xmalloc (80); if (pending_error_text == NULL) pending_error = ENOMEM; else if (status == -1) @@ -1355,7 +1355,7 @@ receive_file (size, file, gzipped) char *filebuf; char *p; - filebuf = malloc (size); + filebuf = xmalloc (size); p = filebuf; /* If NULL, we still want to read the data and discard it. */ @@ -1371,7 +1371,7 @@ receive_file (size, file, gzipped) pending_error = ENOMEM; else { - pending_error_text = malloc (80); + pending_error_text = xmalloc (80); if (pending_error_text == NULL) pending_error = ENOMEM; else if (status == -1) @@ -1417,7 +1417,7 @@ receive_file (size, file, gzipped) if (pending_error_text) { - char *p = realloc (pending_error_text, + char *p = xrealloc (pending_error_text, strlen (pending_error_text) + strlen (arg) + 30); if (p) { @@ -1474,7 +1474,7 @@ serve_modified (arg) pending_error = ENOMEM; else { - pending_error_text = malloc (80 + strlen (arg)); + pending_error_text = xmalloc (80 + strlen (arg)); if (pending_error_text == NULL) pending_error = ENOMEM; else @@ -1500,7 +1500,7 @@ serve_modified (arg) pending_error = ENOMEM; else { - pending_error_text = malloc (80 + strlen (arg)); + pending_error_text = xmalloc (80 + strlen (arg)); if (pending_error_text == NULL) pending_error = ENOMEM; else @@ -1714,13 +1714,13 @@ serve_is_modified (arg) { /* We got Is-modified but no Entry. Add a dummy entry. The "D" timestamp is what makes it a dummy. */ - p = (struct an_entry *) malloc (sizeof (struct an_entry)); + p = (struct an_entry *) xmalloc (sizeof (struct an_entry)); if (p == NULL) { pending_error = ENOMEM; return; } - p->entry = malloc (strlen (arg) + 80); + p->entry = xmalloc (strlen (arg) + 80); if (p->entry == NULL) { pending_error = ENOMEM; @@ -1751,14 +1751,14 @@ serve_entry (arg) struct an_entry *p; char *cp; if (error_pending()) return; - p = (struct an_entry *) malloc (sizeof (struct an_entry)); + p = (struct an_entry *) xmalloc (sizeof (struct an_entry)); if (p == NULL) { pending_error = ENOMEM; return; } /* Leave space for serve_unchanged to write '=' if it wants. */ - cp = malloc (strlen (arg) + 2); + cp = xmalloc (strlen (arg) + 2); if (cp == NULL) { pending_error = ENOMEM; @@ -1800,7 +1800,7 @@ serve_kopt (arg) return; } - kopt = malloc (strlen (arg) + 1); + kopt = xmalloc (strlen (arg) + 1); if (kopt == NULL) { pending_error = ENOMEM; @@ -1894,13 +1894,13 @@ server_write_entries () } struct notify_note { - /* Directory in which this notification happens. malloc'd*/ + /* Directory in which this notification happens. xmalloc'd*/ char *dir; - /* malloc'd. */ + /* xmalloc'd. */ char *filename; - /* The following three all in one malloc'd block, pointed to by TYPE. + /* The following three all in one xmalloc'd block, pointed to by TYPE. Each '\0' terminated. */ /* "E" or "U". */ char *type; @@ -1933,14 +1933,14 @@ serve_notify (arg) if (dir_name == NULL) goto error; - new = (struct notify_note *) malloc (sizeof (struct notify_note)); + new = (struct notify_note *) xmalloc (sizeof (struct notify_note)); if (new == NULL) { pending_error = ENOMEM; return; } - new->dir = malloc (strlen (dir_name) + 1); - new->filename = malloc (strlen (arg) + 1); + new->dir = xmalloc (strlen (dir_name) + 1); + new->filename = xmalloc (strlen (arg) + 1); if (new->dir == NULL || new->filename == NULL) { pending_error = ENOMEM; @@ -1959,7 +1959,7 @@ serve_notify (arg) pending_error = ENOMEM; else { - pending_error_text = malloc (80 + strlen (arg)); + pending_error_text = xmalloc (80 + strlen (arg)); if (pending_error_text == NULL) pending_error = ENOMEM; else @@ -2119,7 +2119,7 @@ serve_argument (arg) { argument_vector_size *= 2; argument_vector = - (char **) realloc ((char *)argument_vector, + (char **) xrealloc ((char *)argument_vector, argument_vector_size * sizeof (char *)); if (argument_vector == NULL) { @@ -2127,7 +2127,7 @@ serve_argument (arg) return; } } - p = malloc (strlen (arg) + 1); + p = xmalloc (strlen (arg) + 1); if (p == NULL) { pending_error = ENOMEM; @@ -2146,7 +2146,7 @@ serve_argumentx (arg) if (error_pending()) return; p = argument_vector[argument_count - 1]; - p = realloc (p, strlen (p) + 1 + strlen (arg) + 1); + p = xrealloc (p, strlen (p) + 1 + strlen (arg) + 1); if (p == NULL) { pending_error = ENOMEM; @@ -3857,7 +3857,7 @@ serve_co (arg) * The client has not sent a "Repository" line. Check out * into a pristine directory. */ - tempdir = malloc (strlen (server_temp_dir) + 80); + tempdir = xmalloc (strlen (server_temp_dir) + 80); if (tempdir == NULL) { buf_output0 (buf_to_net, "E Out of memory\n"); @@ -5060,7 +5060,7 @@ server (argc, argv) int status; int i = 0; - server_temp_dir = malloc (strlen (Tmpdir) + 80); + server_temp_dir = xmalloc (strlen (Tmpdir) + 80); if (server_temp_dir == NULL) { /* diff --git a/contrib/cvs/src/status.c b/contrib/cvs/src/status.c index 6057ec2..b7853e5 100644 --- a/contrib/cvs/src/status.c +++ b/contrib/cvs/src/status.c @@ -107,7 +107,7 @@ cvsstatus (argc, argv) err = start_recursion (status_fileproc, (FILESDONEPROC) NULL, status_dirproc, (DIRLEAVEPROC) NULL, NULL, argc, argv, local, - W_LOCAL, 0, LOCK_READ, (char *) NULL, 1); + W_LOCAL, 0, CVS_LOCK_READ, (char *) NULL, 1); return (err); } diff --git a/contrib/cvs/src/tag.c b/contrib/cvs/src/tag.c index 467ba9d..73c241e 100644 --- a/contrib/cvs/src/tag.c +++ b/contrib/cvs/src/tag.c @@ -382,7 +382,7 @@ rtag_proc (argc, argv, xwhere, mwhere, mfile, shorten, local_specified, err = start_recursion (check_fileproc, check_filesdoneproc, (DIRENTPROC) NULL, (DIRLEAVEPROC) NULL, NULL, argc - 1, argv + 1, local_specified, which, 0, - LOCK_READ, where, 1); + CVS_LOCK_READ, where, 1); if (err) { @@ -397,7 +397,7 @@ rtag_proc (argc, argv, xwhere, mwhere, mfile, shorten, local_specified, err = start_recursion (is_rtag ? rtag_fileproc : tag_fileproc, (FILESDONEPROC) NULL, tag_dirproc, (DIRLEAVEPROC) NULL, NULL, argc - 1, argv + 1, - local_specified, which, 0, LOCK_WRITE, where, 1); + local_specified, which, 0, CVS_LOCK_WRITE, where, 1); dellist (&mtlist); if (where != NULL) free (where); @@ -1285,7 +1285,7 @@ Numeric tag %s contains characters other than digits and '.'", name); val_direntproc, (DIRLEAVEPROC) NULL, (void *)&the_val_args, argc, argv, local, which, aflag, - LOCK_READ, NULL, 1); + CVS_LOCK_READ, NULL, 1); if (repository != NULL && repository[0] != '\0') { if (restore_cwd (&cwd, NULL)) diff --git a/contrib/cvs/src/update.c b/contrib/cvs/src/update.c index af9a2bd..b7c21eb 100644 --- a/contrib/cvs/src/update.c +++ b/contrib/cvs/src/update.c @@ -492,7 +492,7 @@ do_update (argc, argv, xoptions, xtag, xdate, xforce, local, xbuild, xaflag, follows it; someone should make sure that I did it right. */ err = start_recursion (get_linkinfo_proc, (FILESDONEPROC) NULL, (DIRENTPROC) NULL, (DIRLEAVEPROC) NULL, NULL, - argc, argv, local, which, aflag, LOCK_READ, + argc, argv, local, which, aflag, CVS_LOCK_READ, preload_update_dir, 1); if (err) return (err); @@ -508,7 +508,7 @@ do_update (argc, argv, xoptions, xtag, xdate, xforce, local, xbuild, xaflag, /* call the recursion processor */ err = start_recursion (update_fileproc, update_filesdone_proc, update_dirent_proc, update_dirleave_proc, NULL, - argc, argv, local, which, aflag, LOCK_READ, + argc, argv, local, which, aflag, CVS_LOCK_READ, preload_update_dir, 1); #ifdef SERVER_SUPPORT diff --git a/contrib/cvs/src/watch.c b/contrib/cvs/src/watch.c index 96d6b04..8c57ebe 100644 --- a/contrib/cvs/src/watch.c +++ b/contrib/cvs/src/watch.c @@ -341,7 +341,7 @@ watch_addremove (argc, argv) err = start_recursion (addremove_fileproc, addremove_filesdoneproc, (DIRENTPROC) NULL, (DIRLEAVEPROC) NULL, NULL, - argc, argv, local, W_LOCAL, 0, LOCK_NONE, + argc, argv, local, W_LOCAL, 0, CVS_LOCK_NONE, (char *)NULL, 1); Lock_Cleanup (); @@ -515,6 +515,6 @@ watchers (argc, argv) return start_recursion (watchers_fileproc, (FILESDONEPROC) NULL, (DIRENTPROC) NULL, (DIRLEAVEPROC) NULL, NULL, - argc, argv, local, W_LOCAL, 0, LOCK_READ, + argc, argv, local, W_LOCAL, 0, CVS_LOCK_READ, (char *)NULL, 1); } diff --git a/contrib/cvs/src/zlib.c b/contrib/cvs/src/zlib.c index 1fc7a72..00b3682 100644 --- a/contrib/cvs/src/zlib.c +++ b/contrib/cvs/src/zlib.c @@ -153,10 +153,10 @@ compress_buffer_input (closure, data, need, size, got) bd = cb->buf->data; if (bd == NULL) { - bd = ((struct buffer_data *) malloc (sizeof (struct buffer_data))); + bd = ((struct buffer_data *) xmalloc (sizeof (struct buffer_data))); if (bd == NULL) return -2; - bd->text = (char *) malloc (BUFFER_DATA_SIZE); + bd->text = (char *) xmalloc (BUFFER_DATA_SIZE); if (bd->text == NULL) { free (bd); @@ -535,7 +535,7 @@ gunzip_and_write (fd, fullname, buf, size) } /* Read all of FD and put the gzipped data (RFC1952/RFC1951) into *BUF, - replacing previous contents of *BUF. *BUF is malloc'd and *SIZE is + replacing previous contents of *BUF. *BUF is xmalloc'd and *SIZE is its allocated size. Put the actual number of bytes of data in *LEN. If something goes wrong, give a nonfatal error mentioning FULLNAME as the name of the file for FD, and return 1 if we can't @@ -561,7 +561,7 @@ read_and_gzip (fd, fullname, buf, size, len, level) unsigned char *newbuf; *size = 1024; - newbuf = realloc (*buf, *size); + newbuf = xrealloc (*buf, *size); if (newbuf == NULL) { error (0, 0, "out of memory"); @@ -622,7 +622,7 @@ read_and_gzip (fd, fullname, buf, size, len, level) offset = zstr.next_out - *buf; *size *= 2; - newbuf = realloc (*buf, *size); + newbuf = xrealloc (*buf, *size); if (newbuf == NULL) { error (0, 0, "out of memory"); |