CVS 1.11.15

This commit is contained in:
itojun 2004-04-16 03:51:39 +00:00
parent ee00feaab9
commit 47d72b73de
56 changed files with 3128 additions and 622 deletions

4
gnu/dist/cvs/BUGS vendored
View File

@ -217,6 +217,10 @@ formats.
* `release' of a project subdir does not remove the `subdir' entry from
`./CVS/Entries'.
* The Windows Microsoft Visual C++ project files are out of date, but the
project can still be built under Windows using `nmake'. See the INSTALL
file for more.
* Status
/*-------.

257
gnu/dist/cvs/ChangeLog vendored
View File

@ -1,3 +1,260 @@
2004-04-13 Derek Price <derek@ximbiot.com>
* NEWS: Note validation of paths passed to the client.
2004-04-07 Derek Price <derek@ximbiot.com>
* NEWS: Clarify relative-path up-reference article.
2004-04-07 Derek Price <derek@ximbiot.com>
* NEWS: Note ignoring of method options in CVSROOTs.
2004-04-06 Derek Price <derek@ximbiot.com>
* TODO (196, 217, 219, 220, 222, 226): Remove completed items.
(230): New item.
2004-04-06 Derek Price <derek@ximbiot.com>
* NEWS: Note this change.
* configure.in: Do not try and use TMP, TEMP, or TMPDIR as default
temporary directories.
* configure: Regenerated.
2004-04-04 Derek Price <derek@ximbiot.com>
* NEWS: Note Cygwin handles paths like X:\.
2004-04-02 Derek Price <derek@ximbiot.com>
* NEWS: Note Windows ISDIRSEP fix.
2004-04-02 Derek Price <derek@ximbiot.com>
* INSTALL: Instruct users to use the Workspace file and not the project
file for MSVC++.
(Patch from Conrad T. Pino <conrad@pino.com>.)
2004-04-02 Derek Price <derek@ximbiot.com>
* NEWS: Make some notes as to client/serverness of changes.
2004-04-02 Derek Price <derek@ximbiot.com>
* NEWS: Note relative path fix.
2004-04-01 Derek Price <derek@ximbiot.com>
* NEWS: Record run race removal.
2004-03-31 Mark D. Baushke <mdb@cvshome.org>
* cvs.spec.in (BuildRequires): Do not fail if info DIR file does
not exist. (Not everyone has an install-info that generates the
dir file that we want deleted.)
(Report from Geoff Beier <geoff@caradas.com>.)
2004-03-25 Derek Price <derek@ximbiot.com>
* NEWS: Note failure of Cygwin to convert back slashes to slashes.
2004-03-25 Derek Price <derek@ximbiot.com>
* cvs.spec.in (BuildRoot): Use a more unique directory name.
2004-03-22 Derek Price <derek@ximbiot.com>
* INSTALL: Note compilation & --without-gssapi requirement for HPPA
with HP-UX 11.11.
(Report from Nicolas Vervelle <nicolas.vervelle@steria.com>.)
2004-03-20 Derek Price <derek@ximbiot.com>
* NEWS: Note resurrection fixes.
2004-03-18 Derek Price <derek@ximbiot.com>
* NEWS: Back out previous NEWS change at Larry Jones' suggestion.
2004-03-17 Derek Price <derek@ximbiot.com>
* configure.in (--enable-password-authentication-client): Correct
error message text.
* NEWS: Note this change.
* configure: Regenerated.
2004-03-15 Derek Price <derek@ximbiot.com>
* NEWS: Note cvs release + Kerberos fix.
2004-03-15 Derek Price <derek@ximbiot.com>
* configure.in: Correct grammar in help text.
* configure: Regenerated.
2004-03-15 Derek Price <derek@ximbiot.com>
* macintosh/.cvsignore: Complete pruning of directory started in 1999.
2004-03-14 Derek Price <derek@ximbiot.com>
* NEWS: Note resurrection fix.
2004-03-14 Derek Price <derek@ximbiot.com>
* NEWS: Note error & status message corrections.
2004-03-14 Derek Price <derek@ximbiot.com>
* NEWS: Note diff of added files against arbitrary revisions fix.
2004-03-12 Derek Price <derek@ximbiot.com>
* NEWS: Note Larry's recent documentation fixes.
2004-03-03 Derek Price <derek@ximbiot.com>
* NEWS: Note that directories and files named `CVS' are now also
rejected by import.
2004-02-25 Derek Price <derek@ximbiot.com>
* NEWS: Update dying gasp note.
2004-02-25 Derek Price <derek@ximbiot.com>
* NEWS: Note `cvs release' Entries corruption fix.
2004-02-20 Derek Price <derek@ximbiot.com>
* NEWS: Note that the dying gasp check has now been completely removed.
2004-02-17 Derek Price <derek@ximbiot.com>
* NEWS: Note spec file fix.
* cvs.spec: Update to avoid the error checking algorithm's of more
recent version of RPM.
2004-02-17 Derek Price <derek@ximbiot.com>
* NEWS: Note recent commenting of src/checkout.c and Mark's leak fixes.
2004-02-12 Derek Price <derek@ximbiot.com>
* NEWS: Note Mark D. Baushke's recent memory leak plugs.
2004-02-12 Derek Price <derek@ximbiot.com>
* NEWS: Note Ville Skyttä's other recent man page patch.
2004-02-12 Derek Price <derek@ximbiot.com>
* NEWS: Note Ville Skyttä's recent man page patch.
2004-02-11 Derek Price <derek@ximbiot.com>
* NEWS: Note :fork: segfault avoidance.
2004-02-11 Derek Price <derek@ximbiot.com>
* NEWS: Note readability improvements.
2004-02-10 Derek Price <derek@ximbiot.com>
* NEWS: Note dying gasp check.
2004-02-10 Derek Price <derek@ximbiot.com>
* NEWS: Note flow control pipe race fix.
2004-02-10 Derek Price <derek@ximbiot.com>
* BUGS: Note problems building with MSVC++ under Windows and
workaround.
* INSTALL: Ditto.
2004-02-10 Derek Price <derek@ximbiot.com>
* cvsnt.mak: Add stack.c and stack.h in order to compile under Windows.
* NEWS: Note Windows fixes.
* README: Update copyright notice.
2004-02-09 Derek Price <derek@ximbiot.com>
* NEWS: Note new tests in sanity.sh.
2004-02-06 Derek Price <derek@ximbiot.com>
* README: Undo accidental overwrite.
2004-02-04 Derek Price <derek@ximbiot.com>
* NEWS: Note that alias module recursion is now more comprehensive.
2004-02-03 Derek Price <derek@ximbiot.com>
* NEWS: Note case insensitive client directory case preservation.
2004-02-02 Derek Price <derek@ximbiot.com>
* NEWS: Note new join-rm tests.
2004-02-02 Derek Price <derek@ximbiot.com>
* NEWS: Note removal from the server of support for case insensitive
clients.
2004-01-30 Derek Price <derek@ximbiot.com>
* NEWS: Note man page fix.
2004-01-30 Derek Price <derek@ximbiot.com>
* NEWS: Note contrib/log_accum tidy.
2004-01-25 Derek Price <derek@ximbiot.com>
* NEWS: Note Kerberos 4 fix.
2004-01-22 Derek Price <derek@ximbiot.com>
* NEWS: Note recent infinite alias loop fix.
2004-01-22 Derek Price <derek@ximbiot.com>
* INSTALL: Remove a note about an Automake bug that has been fixed for
quite awhile.
2004-01-22 Derek Price <derek@ximbiot.com>
* INSTALL: s/Automake 1.7.5/Automake 1.7.9/.
2004-01-14 Derek Price <derek@ximbiot.com>
* NEWS: Note Larrys recent mktemp.sh inclusion, documentation reorg,
and zlib code fix.
2003-12-23 Larry Jones <lawrence.jones@ugsplm.com>
* Makefile.am: Add mktemp.sh to EXTRA_DIST.
* Makefile.in: Regenerated.
* configure.in: Get mktemp.sh from $srcdir.
* configure: Regenerated.
(Reported by Matt Selsky <selsky@columbia.edu>.)
2003-12-18 Derek Price <derek@ximbiot.com>
* NEWS: Add since 1.11.11 section.
* configure.in: Update for dev 1.11.11.1.
* configure: Regenerated.
2003-12-18 Derek Price <derek@ximbiot.com>
* configure.in: Update for release 1.11.11.
* configure: Regenerated.
2003-12-18 Derek Price <derek@ximbiot.com>
* NEWS: Note syslog of root attempts.

27
gnu/dist/cvs/INSTALL vendored
View File

@ -123,6 +123,7 @@ HPPA:
HPPA running HP-UX 9.05 (1.9)
HPPA running HP-UX 10.01 (1.7)
HPPA running HP-UX 10.20 (1.10.7)
HPPA running HP-UX 11.11 (1.11.13) (footnote 12)
HPPA 2.0 running HP-UX 10.20 (1.10.9) (footnote 13)
NextSTEP 3.3 (1.7)
i386 family:
@ -246,7 +247,7 @@ VAX:
Need to `configure --without-gssapi' unless you have installed Kerberos 5
libraries on the system yourself. For some reason Apple ships OS X with
the Kerberos 5 headers installed and not the libraries, which confuses the
current configure script. Some Sun and BSD boxes hace similar problems.
current configure script. Some HP, BSD, & Sun boxes have similar problems.
(footnote 13)
A build under HP PA-RISC 2.0 will probably not run under PA-RISC 1.1
@ -262,7 +263,7 @@ Building from source code under Unix:
automatically aren't included in the generated Makefiles unless you run
configure with --enable-maintainer-mode.
The CVS Makefiles and configure script were built using Automake 1.7.5 and
The CVS Makefiles and configure script were built using Automake 1.7.9 and
Autoconf 2.58, respectively.
There is a known bug in Autoconf 2.57 that will prevent the configure
@ -455,7 +456,11 @@ Building from source code under Windows NT/95/98/2000:
You may find interesting information in windows-NT/README.
1) Using Microsoft Visual C++ 5.x, open the project `cvsnt.dsp',
* Using Microsoft Visual C++ 5.x (this is currently broken - someone with
MVC++ 5.x needs to regenerate the project files, but the builds using `nmake'
below will work).
1) Using Microsoft Visual C++ 5.x, open the project `cvsnt.dsw',
in the top directory of the CVS distribution. If you have an older
version of Visual C++, take a look at windows-NT/README.
2) Choose "Build cvs.exe" from the "Project" menu.
@ -470,7 +475,7 @@ following also works:
* Using the Cygwin development environment <http://cygwin.com>, Windows clients
and servers can be built using the instructions for building on UNIX. For
deploying the CVS server on Windows NT, see the `cygrunserv' executable that
deploying the CVS server on Windows NT, see the `cygrunsrv' executable that
comes with Cygwin.
* You might also try <http://wincvs.org> & <http://www.cvsnt.org>.
@ -491,18 +496,4 @@ For a Java client, see jCVS (which is a separate package from CVS
itself, but which might be preferable to the Macintosh port mentioned
above, for example).
**** ****
Builds are breaking on some systems (notably,
BSD/OS thor.sdrc.com 4.0.1 BSDI BSD/OS 4.0.1 Kernel #3: Thu Mar 9 11:29:16 EST 2000
) due to Automake's dependency tracking code. The work around for this is to
comile without it by passing the '--disable-dependency-tracking' option to
configure:
$ ./configure --disable-dependency-tracking
This will allow a compile but make will no longer be tracking header
dependencies. This means that if you make any changes to header files you may
have to run 'make clean' before running a 'make' to get everything to compile.
-------------------------------------------------------------------------------

View File

@ -164,7 +164,8 @@ EXTRA_DIST = \
cvsnt.dsp \
cvsnt.dsw \
cvsnt.mak \
cvs.spec
cvs.spec \
mktemp.sh
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4

154
gnu/dist/cvs/NEWS vendored
View File

@ -1,8 +1,160 @@
Changes since 1.11.10:
Changes since 1.11.14:
**********************
SERVER SECURITY ISSUES
* Piped checkouts of paths above $CVSROOT no longer work. Previously, clients
could have requested the contents of RCS archive files anywhere on a CVS
server.
CLIENT SECURITY ISSUES
* Clients now check paths from the server to verify that they are within one of
the sandboxes the user requested be updated. Previously, a trojan server
could have written or overwritten files anywhere the user had access,
presenting a serious security risk.
GENERAL USER ISSUES
* Method options (used by WinCVS & CVS 1.12.7+) in CVSROOTs are ignored.
* Configure no longer checks the $TMPDIR, $TMP, & $TEMP variables to set the
default temporary directory.
* CVS on Cygwin correctly handles X:\ style paths.
* Import now uses backslash rather than slash on Windows when checking for
"CVS" directories to ignore in import commands.
* Relative paths containing up-references (`..') should now work in
client/server mode (client fix).
* A race condition between the ordering of messages from CVS and messages from
called scripts in client/server mode has been removed (server fix).
* Resurrected files now get their modes and timestamps set correctly and a
longstanding bug involving resurrection of an uncommitted removal has been
fixed (server fix).
* Some resurrection (cvs add) status messages have changed slightly.
* `cvs release' now works with Kerberos or GSSAPI encryption enabled (server
fix).
* File resurrection from a previously existing revision no longer just reports
that it works (server fix).
* Misc error & status message corrections.
* Diffing of locally added files against arbitrary revisions in an RCS archive
is now allowed when a file of the same name exists or used to exist on some
branch (server fix).
* Misc documentation fixes.
Changes from 1.11.13 to 1.11.14:
********************************
GENERAL USER ISSUES
* Imports will now always ignore directories and files named `CVS' to avoid
violating assumptions made by other parts of CVS.
* A problem with `cvs release' of subdirs that could corrupt CVS/Entries files
has been fixed (client/server).
* The CVS server's protocol check for unused data from the client is no longer
called automatically at program exit in order to avoid potential recursive
calls to error when the first close is due to memory allocation or similar
problems that cause calls to error() to fail. The check is still made when
the server program exits normally.
* The spec file has been updated to work with more recent versions of RPM.
* Several memory leaks have been plugged (client/server).
DEVELOPER ISSUES
* Misc cosmetic, readability, and commenting fixes.
Changes from 1.11.12 to 1.11.13:
********************************
GENERAL USER ISSUES
* Several memory leaks have been plugged.
* Thanks to Ville Skyttä the man page has a few less spelling errors and is
slightly more accurate.
* An unlikely potential segfault when using the :fork: connection method has
been fixed.
* The CVS server has had the protocol check for unused data from the client
partially restored.
* A fix has been included that should avoid a very rare race condition that
could cause a CVS server to exit with a "broken pipe" message.
* A minor problem with the nmake build file that was preventing the source from
compiling under Windows has been fixed.
* Tests have been added to the test suite.
DEVELOPER ISSUES
* Misc cosmetic, readability, and commenting fixes.
Changes from 1.11.11 to 1.11.12:
********************************
GENERAL USER ISSUES
* Infinite alias loops in the modules file are now checked for and avoided.
* Clients on case insensitive systems now preserve the case of directories in
CVS/Entries, in addition to files, for use in communications with the CVS
server.
* Some previously untested behavior is now being tested.
* Server support for case insensitive clients has been removed in favor of the
server relying on the client to preserve the case of checked out files, as
per the CVS client/server protocol spec. This is not as drastic as it may
sound, as all of the current tests still pass without modification when run
from a case insensitive client to a case sensitive server. This change
disables little previous functionality, enables access to more of the
possible namespace to users on systems with case insensitive file systems,
fixes a few bugs, and in the end this should provide a major stability
improvement.
* Thanks to Ville Skyttä the man page is a bit more accurate.
* Thanks to Ville Skyttä some unused variables were removed from the log_accum
Perl script in contrib.
* Thanks to Alexey Mahotkin, a bug that prevented CVS from being compiled with
Kerberos 4 authentication enabled has been fixed.
* A minor bug that caused CVS to fail to report an inifinte alias loop in the
modules file when portions of the alias definition contained trailing slashes
has been fixed.
* A bug in the gzip code that could cause heap corruption and segfaults in CVS
servers talking to clients less than 1.8 and some modern third-party CVS
clients has been fixed.
* mktemp.sh is now included with the source distribution so that the rcs2log
and cvsbug executables may be run on systems which do not contain an
implementation of mktemp.
* Misc documentation fixes.
Changes from 1.11.10 to 1.11.11:
********************************
SERVER SECURITY ISSUES
* pserver can no longer be configured to run as root via the
$CVSROOT/CVSROOT/passwd file, so if your passwd file is compromised, it no
longer leads directly to a root hack. Attempts to root will also be logged

3
gnu/dist/cvs/README vendored
View File

@ -3,6 +3,9 @@
Copyright (c) 1993-1994 Brian Berliner
Copyright (c) 1992 Brian Berliner and Jeff Polk
Copyright (c) 1989-1992, Brian Berliner
Copyright (c) 1998-2004 Free Software Foundation,
Derek Price,
& Ximbiot <http://ximbiot.com>
All Rights Reserved
This program is free software; you can redistribute it and/or modify

24
gnu/dist/cvs/TODO vendored
View File

@ -780,10 +780,6 @@ send differences instead of entire files. In the degenerate case
(e.g. "cvs diff" without arguments) the required network traffic is
reduced to zero, and the client need not even contact the server.
196. Using a CVSROOT with a trailing slash will confuse CVS. I think
we need to add a call to strip_trailing_slashes in root.c
(parse_cvsroot), but I haven't considered all of the ramifications.
197. Analyze the difference between CVS_UNLINK & unlink_file. As far as I
can tell, unlink_file aborts in noexec mode and CVS_UNLINK does not. I'm not
sure it would be possible to remove even the use of temp files in noexec mode,
@ -852,24 +848,12 @@ glibc version.
216. Avoid command-line keyword expansion modes overriding binary mode
(or make binary mode completely separate from keyword expansion mode).
217. Fix assertion failures that occur when CVSROOT is a symlink to the
actual repository location.
218. Fix "checkout -d ." in client/server mode.
219. Fix "checkout -d multi/level/dir" in client/server mode.
220. Send correct Max-dotdot in client/server mode (broken by change to
support multiple repositories).
221. Handle spaces in file/directory names. (Most, if not all, of the
internal infrastructure already handles them correctly, but most of the
administrative file interfaces do not.)
222. Fix assertion failure (*rcsnode == NULL in commit.c, line 2056)
when adding a file from a case-insensitive client that matches an Attic
file with case differences.
223. Internationalization support. This probably means using some kind
of universal character set (ISO 10646?) internally and converting on
input and output, which opens the locale can of worms.
@ -889,11 +873,6 @@ local time string according to the localization settings before printing it.
225. Add support for --allow-root to server command.
226. Add support for upgrading read locks to write locks and use it to
avoid holding potentially long-term write locks (for example, in tag and
commit). Note that avoiding deadlock is tricky if two read lock holders
both want to upgrade to write.
227. 'cvs release' should use the CVS/Root in the directory being released
when such is specified rather than $CVSROOT. In my work directory with no CVS
dir, a release of subdirectories causes the released projects to be tested
@ -906,3 +885,6 @@ the other CVSROOT. This happens a lot with my copies of the ccvs project.
229. Improve the locking code to use a random delay with exponential
backoff ala Ethernet and separate the notification interval from the
wait interval.
230. Support for options like compression as part of the CVSROOT might be
nice. This should be fairly easy to implement now using the method options.

View File

@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.58 for Concurrent Versions System (CVS) 1.11.11.
# Generated by GNU Autoconf 2.58 for Concurrent Versions System (CVS) 1.11.15.
#
# Report bugs to <bug-cvs@gnu.org>.
#
@ -269,8 +269,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='Concurrent Versions System (CVS)'
PACKAGE_TARNAME='cvs'
PACKAGE_VERSION='1.11.11'
PACKAGE_STRING='Concurrent Versions System (CVS) 1.11.11'
PACKAGE_VERSION='1.11.15'
PACKAGE_STRING='Concurrent Versions System (CVS) 1.11.15'
PACKAGE_BUGREPORT='bug-cvs@gnu.org'
ac_unique_file="src/cvs.h"
@ -784,7 +784,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.11 to adapt to many kinds of systems.
\`configure' configures Concurrent Versions System (CVS) 1.11.15 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -846,7 +846,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.11:";;
short | recursive ) echo "Configuration of Concurrent Versions System (CVS) 1.11.15:";;
esac
cat <<\_ACEOF
@ -1031,7 +1031,7 @@ fi
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
Concurrent Versions System (CVS) configure 1.11.11
Concurrent Versions System (CVS) configure 1.11.15
generated by GNU Autoconf 2.58
Copyright (C) 2003 Free Software Foundation, Inc.
@ -1045,7 +1045,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.11, which was
It was created by Concurrent Versions System (CVS) $as_me 1.11.15, which was
generated by GNU Autoconf 2.58. Invocation command line was
$ $0 $@
@ -1657,7 +1657,7 @@ fi
# Define the identity of the package.
PACKAGE='cvs'
VERSION='1.11.11'
VERSION='1.11.15'
# Some tools Automake needs.
@ -4139,7 +4139,7 @@ echo "${ECHO_T}no" >&6
fi
if test x"$MKTEMP" = xmktemp; then
MKTEMP_SH_FUNCTION=mktemp.sh
MKTEMP_SH_FUNCTION=$srcdir/mktemp.sh
else
MKTEMP_SH_FUNCTION=/dev/null
fi
@ -10975,7 +10975,7 @@ fi;
echo "$as_me:$LINENO: checking for temporary directory" >&5
echo $ECHO_N "checking for temporary directory... $ECHO_C" >&6
if test -z "$with_tmpdir" || test yes = "$with_tmpdir"; then
for with_tmpdir in "$TMPDIR" "$TMP" "$TEMP" /tmp /var/tmp no; do
for with_tmpdir in /tmp /var/tmp no; do
if test -d "$with_tmpdir" && test -x "$with_tmpdir" \
&& test -w "$with_tmpdir" && test -r "$with_tmpdir"; then
break
@ -11109,9 +11109,9 @@ cat >>confdefs.h <<\_ACEOF
_ACEOF
else
{ echo "$as_me:$LINENO: WARNING: --enable-password-authenticated-server is meaningless with
{ echo "$as_me:$LINENO: WARNING: --enable-password-authenticated-client is meaningless with
the CVS client disabled (--disable-client)" >&5
echo "$as_me: WARNING: --enable-password-authenticated-server is meaningless with
echo "$as_me: WARNING: --enable-password-authenticated-client is meaningless with
the CVS client disabled (--disable-client)" >&2;}
fi
fi
@ -11402,9 +11402,9 @@ cat >>confdefs.h <<\_ACEOF
_ACEOF
else
{ echo "$as_me:$LINENO: WARNING: --enable-encryption is meaningless with neither the CVS client
{ echo "$as_me:$LINENO: WARNING: --enable-encryption is meaningless when neither the CVS client
nor the CVS server is enabled (--disable-client and --disable-server)." >&5
echo "$as_me: WARNING: --enable-encryption is meaningless with neither the CVS client
echo "$as_me: WARNING: --enable-encryption is meaningless when neither the CVS client
nor the CVS server is enabled (--disable-client and --disable-server)." >&2;}
fi
fi
@ -11947,7 +11947,7 @@ _ASBOX
} >&5
cat >&5 <<_CSEOF
This file was extended by Concurrent Versions System (CVS) $as_me 1.11.11, which was
This file was extended by Concurrent Versions System (CVS) $as_me 1.11.15, which was
generated by GNU Autoconf 2.58. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -12013,7 +12013,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
Concurrent Versions System (CVS) config.status 1.11.11
Concurrent Versions System (CVS) config.status 1.11.15
configured by $0, generated by GNU Autoconf 2.58,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"

View File

@ -1,5 +1,5 @@
dnl configure.in for cvs
AC_INIT([Concurrent Versions System (CVS)],[1.11.11],[bug-cvs@gnu.org],[cvs])
AC_INIT([Concurrent Versions System (CVS)],[1.11.15],[bug-cvs@gnu.org],[cvs])
AC_CONFIG_SRCDIR(src/cvs.h)
AM_INIT_AUTOMAKE([gnu 1.7.9 dist-bzip2 no-define])
AC_PREREQ(2.58)
@ -75,7 +75,7 @@ AC_PATH_PROG(CSH, csh, no)
# for contrib/rcs2log.sh & src/cvsbug.in.
AC_PATH_PROG(MKTEMP, mktemp, mktemp)
if test x"$MKTEMP" = xmktemp; then
MKTEMP_SH_FUNCTION=mktemp.sh
MKTEMP_SH_FUNCTION=$srcdir/mktemp.sh
else
MKTEMP_SH_FUNCTION=/dev/null
fi
@ -508,7 +508,7 @@ AC_ARG_WITH(
AC_MSG_CHECKING([for temporary directory])
if test -z "$with_tmpdir" || test yes = "$with_tmpdir"; then
for with_tmpdir in "$TMPDIR" "$TMP" "$TEMP" /tmp /var/tmp no; do
for with_tmpdir in /tmp /var/tmp no; do
if test -d "$with_tmpdir" && test -x "$with_tmpdir" \
&& test -w "$with_tmpdir" && test -r "$with_tmpdir"; then
break
@ -687,7 +687,7 @@ if test no != "$enable_password_authenticated_client"; then
method in the CVS client (default)])
else
AC_MSG_WARN(
[--enable-password-authenticated-server is meaningless with
[--enable-password-authenticated-client is meaningless with
the CVS client disabled (--disable-client)])
fi
fi
@ -878,7 +878,7 @@ if test "$enable_encryption" = yes; then
[Define to enable encryption support.])
else
AC_MSG_WARN(
[--enable-encryption is meaningless with neither the CVS client
[--enable-encryption is meaningless when neither the CVS client
nor the CVS server is enabled (--disable-client and --disable-server).])
fi
fi

View File

@ -1,3 +1,9 @@
2004-01-30 Derek Price <derek@ximbiot.com>
Close issue #155.
* log_accum.in: Remove unused variables.
(Patch from (Ville Skyttä <scop@cvshome.org>.)
2003-10-14 Derek Price <derek@ximbiot.com>
Port to pedantic POSIX 1003.1-2001 hosts, such as Debian GNU/Linux

View File

@ -1,3 +1,8 @@
2004-03-20 Derek Price <derek@ximbiot.com>
* diff.c (diff_run): Update string arg to const.
* diffrun.h: Update prototype to match.
2003-07-12 Larry Jones <lawrence.jones@eds.com>
* io.c (find_identical_ends): Update to match current diffutils

View File

@ -233,11 +233,13 @@ static struct option const longopts[] =
{0, 0, 0, 0}
};
int
diff_run (argc, argv, out, callbacks_arg)
int argc;
char *argv[];
char *out;
const char *out;
const struct diff_callbacks *callbacks_arg;
{
int val;

View File

@ -56,7 +56,7 @@ struct diff_callbacks
/* Run a diff. */
extern int diff_run DIFFPARAMS((int, char **, char *,
extern int diff_run DIFFPARAMS((int, char **, const char *,
const struct diff_callbacks *));
/* Run a diff3. */

View File

@ -1,3 +1,46 @@
2004-04-06 Larry Jones <lawrence.jones@ugsplm.com>
* cvs.texinfo (Assigning revisions): Note that client/server mode
only considers files sent to the server to determine the major
revision for new files.
(Reported by Krzysztof GORBIEL <Krzysztof_GORBIEL@raiffeisen.pl>.)
* stamp-vti, version.texi: Regenerated.
2004-03-15 Derek Price <derek@ximbiot.com>
* stamp-vti, version.texi: Regenerated.
2004-03-11 Larry Jones <lawrence.jones@ugsplm.com>
* cvs.texinfo (loginfo, Error messages): Note that not reading all of
the log info can result in a broken pipe signal.
(Reported by Steven Nicoloso <spn@nwmail.wh.lucent.com>.)
* stamp-vti, version.texi: Regenerated.
2004-02-04 Derek Price <derek@ximbiot.com>
* cvs.texinfo (File Permissions): Clarify index entry.
* stamp-vti, version.texi: Regenerated.
2004-01-22 Derek Price <derek@ximbiot.com>
* stamp-vti, version.texi: Regenerated.
2004-01-08 Larry Jones <lawrence.jones@ugsplm.com>
* cvs.texinfo (user-defined logging): Move taginfo stuff from here...
(Administrative files): ...to its own node under here.
2003-12-18 Derek Price <derek@ximbiot.com>
* stamp-1, stamp-vti, version-client.texi, version.texi: Regenerated
for 1.11.11.1.
2003-12-18 Derek Price <derek@ximbiot.com>
* stamp-1, stamp-vti, version-client.texi, version.texi: Regenerated
for 1.11.11.
2003-12-05 Derek Price <derek@ximbiot.com>
* stamp-1, stamp-vti, version-client.texi, version.texi: Regenerated.
@ -532,7 +575,7 @@
* Makefile.in: Regenerated.
* stamp-1: New file.
* version-client.texi: Ditto.
(Reportred by Alexey Mahotkin <alexm@hsys.msk.ru>.)
(Reported by Alexey Mahotkin <alexm@hsys.msk.ru>.)
2001-09-04 Derek Price <dprice@collab.net>

View File

@ -1,3 +1,32 @@
2004-04-07 Derek Price <derek@ximbiot.com>
* regex.c: Revise "FREE_VAR" macro to eliminate C4090/C4022 warnings
in Windows build with Visual C++ 6.0 compiler.
(Original patch from Conrad T. Pino <Conrad@Pino.com>.)
2004-04-04 Derek Price <derek@ximbiot.com>
* system.h: Correct comment.
2004-04-04 Derek Price <derek@ximbiot.com>
* system.h: Restore complete path folding for Cygwin under Windows.
Add ISABSOLUTE macro for determining whether a path is absolute to
handle X:\ style paths under Windows (& Cygwin).
2004-03-25 Derek Price <derek@ximbiot.com>
* system.h: No longer fold back slashes in paths into slashes.
2004-03-20 Derek Price <derek@ximbiot.com>
* mkdir.c (mkdir): Declare string args const.
2004-03-19 Derek Price <derek@ximbiot.com>
* .cvsignore: Add fnmatch.h for Windows and other platforms which build
it.
2003-12-09 Derek Price <derek@ximbiot.com>
* system.h: Correct spelling in comment.

View File

@ -37,7 +37,7 @@ extern int errno;
int
mkdir (dpath, dmode)
char *dpath;
const char *dpath;
int dmode;
{
int cpid, status;

View File

@ -4001,7 +4001,7 @@ static boolean alt_match_null_string_p (),
/* Free everything we malloc. */
#ifdef MATCH_MAY_ALLOCATE
#define FREE_VAR(var) if (var) { REGEX_FREE (var); var = NULL; } else
#define FREE_VAR(var) if (var) { (void)REGEX_FREE ((void *)var); var = NULL; } else
#define FREE_VARIABLES() \
do { \
REGEX_FREE_STACK (fail_stack.stack); \

View File

@ -457,7 +457,7 @@ extern int errno;
#define CVS_FNMATCH fnmatch
#endif
#if defined (__CYGWIN32__) || defined (WIN32)
#ifdef WIN32
/*
* According to GNU conventions, we should avoid referencing any macro
* containing "WIN" as a reference to Microsoft Windows, as we would like to
@ -470,8 +470,7 @@ extern int errno;
* convention, and reference only tested features of the system.
*/
# define WOE32 1
#endif /* defined (__CYGWIN32__) || defined (WIN32) */
#endif /* WIN32 */
#ifdef WOE32
@ -483,7 +482,7 @@ extern int errno;
#ifdef FILENAMES_CASE_INSENSITIVE
# ifdef WOE32
# if defined (__CYGWIN32__) || defined (WOE32)
/* Under Windows NT, filenames are case-insensitive, and both / and \
are path component separators. */
# define FOLD_FN_CHAR(c) (WNT_filename_classes[(unsigned char) (c)])
@ -491,15 +490,18 @@ extern unsigned char WNT_filename_classes[];
/* Is the character C a path name separator? Under
Windows NT, you can use either / or \. */
# define ISDIRSEP(c) (FOLD_FN_CHAR(c) == '/')
# define ISABSOLUTE(s) (ISDIRSEP(s[0]) || FOLD_FN_CHAR(s[0]) >= 'a' && FOLD_FN_CHAR(s[0]) <= 'z' && s[1] == ':' && ISDIRSEP(s[2]))
# else /* ! WOE32 */
/* The only system that I know of that gets FILENAME_CASE_INSENSITIVE
* defined that isn't WOE32 is currently Macintosh OS X.
/* As far as I know, both Cygwin and Macintosh OS X can make it here,
* but since the OS X fold just folds a-z into A-Z or visa-versa, I'm just
* using it for Cygwin too. The var name below could probably use a
* rename.
*
* Under Mac OS X, filenames are case-insensitive.
* Under Mac OS X & Cygwin, filenames are case-insensitive.
*/
# define FOLD_FN_CHAR(c) (OSX_filename_classes[(unsigned char) (c)])
extern unsigned char OSX_filename_classes[];
# endif /* WOE32 */
# endif /* __CYGWIN32__ || WOE32 */
/* The following need to be declared for all case insensitive filesystems.
* When not FOLD_FN_CHAR is not #defined, a default definition for these
@ -521,15 +523,22 @@ extern void fnfold (char *FILENAME);
to lower case. Under Windows NT, / and \ are both path component
separators, so FOLD_FN_CHAR would map them both to /. */
#ifndef FOLD_FN_CHAR
#define FOLD_FN_CHAR(c) (c)
#define fnfold(filename) (filename)
#define fncmp strcmp
# define FOLD_FN_CHAR(c) (c)
# define fnfold(filename) (filename)
# define fncmp strcmp
#endif
/* Different file systems have different path component separators.
For the VMS port we might need to abstract further back than this. */
#ifndef ISDIRSEP
#define ISDIRSEP(c) ((c) == '/')
# define ISDIRSEP(c) ((c) == '/')
#endif
/* Different file systems can have different naming patterns which designate
* a path as absolute
*/
#ifndef ISABSOLUTE
# define ISABSOLUTE(s) ISDIRSEP(s[0])
#endif

View File

@ -1,3 +1,22 @@
2004-02-12 Derek Price <derek@ximbiot.com>
Close issue #162.
* cvs.1: Remove references to the removed global -l option.
(Original patch from Ville Skyttä <scop@cvshome.org>.)
2004-02-12 Derek Price <derek@ximbiot.com>
Close issue #161.
* cvs.1, cvs.5: A couple of spelling fixes.
(Patch from Ville Skyttä <scop@cvshome.org>.)
2004-01-30 Derek Price <derek@ximbiot.com>
Close issue #146.
* cvs.1: Reference `cvs --help diff' rather than the rcsdiff man page.
Use consistent spelling of `initialization'.
(Patch from Ville Skyttä <scop@cvshome.org>.)
2003-05-21 Derek Price <derek@ximbiot.com>
* Makefile.in: Regenerate with Automake version 1.7.5.

View File

@ -284,7 +284,7 @@ containing the logging forms) rather than command templates.
The `\|editinfo\|' file allows you to execute a script \fIbefore the
commit starts\fP, but after the log information is recorded. These
"edit" scripts can verify information recorded in the log file. If
the edit script exits wth a non-zero exit status, the commit is aborted.
the edit script exits with a non-zero exit status, the commit is aborted.
.SP
The `\|loginfo\|' file contains commands to execute \fIat the end\fP
of a commit. The text specified as a commit log message is piped

39
gnu/dist/cvs/mktemp.sh vendored Normal file
View File

@ -0,0 +1,39 @@
# mktemp
# Copyright (c) Derek Price, Ximbiot <http://ximbiot.com>, and the
# Free Software Foundation, Inc. <http://gnu.org>
# 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.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# This Bourne Shell scriptlet is intended as a simple replacement for
# the BSD mktemp function for systems that do not support mktemp. It
# currently does not check that the files it is creating did not exist
# previously and it does not verify that it successfully creates the
# files it returns the names of.
mktemp() {
if test x"$1" = x-d; then
tmp=`echo $2 |sed "s/XXXXXX/$$/"`
(umask 077 && exec mkdir $tmp) || return 1
else
tmp=`echo $1 |sed "s/XXXXXX/$$/"`
(umask 077 && touch $tmp) || return 1
fi
echo $tmp
return 0
}

View File

@ -1,3 +1,621 @@
2004-04-11 Derek Price <derek@ximbiot.com>
* client.c (call_in_directory): Check paths the server sends us to make
sure they are within a sandbox the user requested be updated.
(is_valid_client_path, path_list_prefixed): New functions.
2004-04-11 Derek Price <derek@ximbiot.com>
* modules.c (do_module): Don't allow up-level references in paths to
step out of the repository.
* sanity.sh (multiroot3): Update tests and add a few more.
2004-04-07 Derek Price <derek@ximbiot.com>
* sanity.sh (parseroot): Replace hard path with $HOME.
2004-04-07 Derek Price <derek@ximbiot.com>
* sanity.sh (parseroot): s/oberon/$username/.
2004-04-07 Derek Price <derek@ximbiot.com>
* client.c (start_tcp_server): Use xstrdup rather than
xmalloc(strlen)/strcpy.
2004-04-07 Derek Price <derek@ximbiot.com>
* root.c (parse_cvsroot): Ignore method options.
* sanity.sh (parseroot): Verify that method options are ignored.
2004-04-06 Derek Price <derek@ximbiot.com>
* root.h (cvsroot_t): Move username, password, hostname, port inside
CLIENT_SUPPORT ifdefs.
* buffer.c, root.c, server.c: Add #ifdefs as necessary so that this
will compile without client support and the root.h change. Some
gratuitous restyling.
2004-04-06 Derek Price <derek@ximbiot.com>
* log.c, tag.c: Gratuitous restyling.
2004-04-04 Derek Price <derek@ximbiot.com>
* filesubr.c (isabsolute): Move...
* subr.c: ...here and use new ISABSOLUTE macro.
2004-04-04 Derek Price <derek@ximbiot.com>
* client.c (send_file_names): Cast out an unneeded const to avoid a
warning.
2004-04-03 Larry Jones <lawrence.jones@ugsplm.com>
* client.c (send_file_names): Remove unused variables.
2004-04-02 Derek Price <derek@ximbiot.com>
* sanity.sh (client): Honor $keep.
2004-04-02 Derek Price <derek@ximbiot.com>
* log.c, patch.c, rcs.c: Gratuitous restyling.
2004-04-02 Derek Price <derek@ximbiot.com>
* import.c (import): Use ISDIRSEP rather than testing paths against `/'
directly. Some gratuitos reformatting.
2004-04-02 Derek Price <derek@ximbiot.com>
* sanity.sh: Note the effectiveness of `tail -f check.log' in providing
running status.
2004-04-02 Derek Price <derek@ximbiot.com>
* client.c (send_file_names): Move code which calculates and sends
Max-dotdot...
(send_max_dotdot): ...to this new function.
(send_files): Call send_max_dotdot.
* sanity.sh (files-14): Expect .. in paths to work now.
(status): Add a few new tests using `..'.
2004-04-01 Derek Price <derek@ximbiot.com>
* lock.c: Gratuitous restyling.
2004-04-01 Derek Price <derek@ximbiot.com>
* cvs.h, server.c: Gratuitous restyling.
* run.c (run_exec): Ditto, plus call cvs_flush{out,err}() instead of
flushing stderr & stdout directly.
2004-03-29 Derek Price <derek@ximbiot.com>
* server.c: Gratuitous restyling.
2004-03-29 Derek Price <derek@ximbiot.com>
* login.c: Gratuitous restyling.
2004-03-22 Derek Price <derek@ximbiot.com>
* sanity.sh (toplevel): Remove FIXME type comment and unneeded
Emtptydir removal.
2004-03-22 Derek Price <derek@ximbiot.com>
* update.c: Some minor style cleanup.
2004-03-22 Derek Price <derek@ximbiot.com>
* sanity.sh (top-level): Don't match most of the assertion since this
string is often system dependent.
(Thanks to Larry Jones <lawrence.jones@ugsplm.com>.)
2004-03-22 Derek Price <derek@ximbiot.com>
* sanity.sh (top-level): Don't match the assertion's line number.
2004-03-22 Derek Price <derek@ximbiot.com>
* sanity.sh (top-level): New test to confirm assertion failure.
2004-03-22 Derek Price <derek@ximbiot.com>
* sanity.sh: Only verify argument to -f when -f was passed. Check for
$TMPDIR/cvsXXXXXX temp files after each test.
2004-03-22 Derek Price <derek@ximbiot.com>
* sanity.sh: Verify that the argument to -f is really a test.
2004-03-20 Larry Jones <lawrence.jones@ugsplm.com>
* cvs.h: Change command_name to cvs_command_name to avoid conflict
on HP-UX (incredibly, it declares a global command_name in prot.h,
which is included from shadow.h, which we include in server.c).
Change all references.
* subr.c (previous_rev): Fix == vs = typo.
* buffer.h: Add prototype for buf_empty.
* add.c (add): Remove unused variable.
2004-03-20 Derek Price <derek@ximbiot.com>
* add.c (add, add_directory, build_entry), admin.c (admin_dirproc),
checkin.c (Checkin), checkout.c (safe_location, build_dirs_and_chdir),
client.c (add_prune_candidate, send_repository, send_a_repository,
send_to_server, start_rsh_server, send_arg, send_modified,
send_ignproc, send_filesdone_proc, send_dirent_proc,
send_dirleave_proc, client_notify), commit.c (check_direntproc,
check_filesdoneproc, checkaddfile, commit_direntproc,
commit_dirleaveproc, lock_RCS, precommit_proc, find_data,
find_dirent_proc, find_ignproc, find_filesdoneproc), create_adm.c
(Create_Admin), cvsrc.c (read_cvsrc), diff.c (diff_dirproc,
diff_filesdoneproc, diff_dirleaveproc), edit.c (onoff_filesdoneproc,
mark_up_to_date, editor_set, notify_proc_args, notify_proc, notify_do,
notify_check), entries.c (Scratch_Entry, Register, WriteTag),
expand_path.c (expand_variable, expand_path), fileattr.c
(fileattr_startdir), filesubr.c (mkdir_if_needed, xchmod,
last_component), history.c (history_write), ignore.c (ignore_directory,
ignore_files), import.c (get_comment, add_rcs_file, expand_at_signs),xi
lock.c (lock_filesdoneproc), log.c (log_dirproc), logmsg.c
(logfile_write, rcsinfo_proc, update_logfile_proc, editinfo_proc,
verifymsg_proc, do_editor, do_verify, Update_Logfile), main.c (main
program_name, program_path, command_name), parseinfo.c (Parse_Info),
patch.c (patch_dirproc), rcs.c (RCS_getdatebranch, rcs_lockfilename,
RCS_parse, RCS_setattic, RCS_getversion, RCS_gettag, RCS_getbranch,
RCS_getdate, RCS_datecmp, RCS_getrevtime, RCS_setexpand,
expand_keywords, RCS_checkout, RCS_addbranch, RCS_checkin, RCS_lock,
RCS_cmp_file, RCS_deltas, rcs_lockfilename, make_file_label),
rcscmds.c (RCS_output_diff_options, call_diff, RCS_merge,
RCS_exec_rcsdiff, diff_exec), recurse.c (start_recursion, do_recursion,
do_file_proc), remove.c (remove_dirproc), repos.c (Name_Repository,
Short_Repository), root.c (Name_Root, Create_Root), run.c
(piped_child), server.c (output_dir, server_register,
server_checked_in, server_update_entries, server_copy_file,
server_set_entstat, server_clear_entstat, server_set_sticky,
server_template, cvs_output_tagged), status.c (status_dirproc), subr.c
(make_message_rcslegal), tag.c (pretag_proc, tag_dirproc,
check_fileproc, check_filesdoneproc, tag_fileproc, val_direntproc),
update.c (update_dirent_proc, update_dirleave_proc, update_ignproc,
update_filesdone_proc, isemptydir), vers_ts.c (time_stamp_server,
time_stamp), watch.c (watch_modify_watchers, addremove_filesdoneproc),
zlib.c (read_and_gzip): Make most string args const, mainly in the
interest of preserving repository & updatedir but including some
collateral damage. Update a few functions to comply with new
requirement. Some style fixes.
* client.h, cvs.h, edit.h, fileattr.h, rcs.h, server.h, update.h,
watch.h: Update prototypes to match.
2004-03-20 Derek Price <derek@ximbiot.com>
* sanity.sh (conflicts2): s/cvs/$testcvs/.
2004-03-20 Derek Price <derek@ximbiot.com>
* add.c (add): Correct longstanding resurrection bugs. Remove FIXME
comment to this effect. Set mode and Entries timestamps of resurrected
files correctly.
* sanity.sh (basica, binfiles, conflicts2, recase, resurrection,
update-p): Update tests to compensate. Remove FIXCVS comments.
2004-03-19 Mark D. Baushke <mdb@cvshome.org>
* server.c (gserver_authenticate_connection): Handle large
GSSAPI packets dynamically.
(Bug report from Douglas Engert <DEEngert@anl.gov>)
2004-03-19 Derek Price <derek@ximbiot.com>
* cvs.h (pathname_levels, previous_rev): Remove leading underscore from
prototype arguments to avoid potential conflicts with implementations.
2004-03-18 Derek Price <derek@ximbiot.com>
* cvs.h (pathname_levels): Make string argument const.
* subr.c (pathname_levels): Simplify function.
2004-03-17 Derek Price <derek@ximbiot.com>
* subr.c (pathname_levels): Get it right this time.
2004-03-17 Derek Price <derek@ximbiot.com>
* subr.c (pathname_levels): Remove incorrect assertion and just
return 0 when pathname is NULL.
2004-03-17 Derek Price <derek@ximbiot.com>
* subr.c (pathname_levels): Use ISDIRSEP() instead of strchr('/')
and remove FIXME comment to that effect.
2004-03-16 Derek Price <derek@ximbiot.com>
* main.c (main): Update the --version Copyright (c) string to
include 2004.
2004-03-15 Mark D. Baushke <mdb@cvshome.org>
* release.c (release): Add missing xmalloc of update_cmd.
2004-03-15 Derek Price <derek@ximbiot.com>
* release.c (release): Enable authentication and encryption for a child
update process when necessary.
(Original patch from Dan Russell <russelld@aol.net> via Hal Mahaffey
<HMahaffey@aol.com>.)
2004-03-14 Derek Price <derek@ximbiot.com>
* add.c (add): Only call server_updated() when we actual have a new
resurrected file for the client.
2004-03-14 Derek Price <derek@ximbiot.com>
* cvs.h (previous_rev, write_letter): New prototypes.
(struct file_info): Move to before the write_letter prototype.
* add.c (add): Allow resurrection of files which used to exist on a
branch.
* subr.c (previous_rev): New function.
* update.c: Consolidate like pragmas.
(write_letter): Remove prototype. Remove static declaration.
* sanity.sh (resurrection): New tests.
2004-03-14 Derek Price <derek@ximbiot.com>
* commit.c (remove_file): Print the actual previous revision instead of
a branch number.
* sanity.sh: Update to match.
2004-03-14 Derek Price <derek@ximbiot.com>
* rcs.c (RCS_cmp_file): Print the actual name of the file we failed to
open in the error message.
2004-03-14 Derek Price <derek@ximbiot.com>
* diff.c (diff_fileproc): Allow diffing of new files against arbitrary
revisions instead of assuming that there is no RCS archive file.
2004-03-03 Derek Price <derek@ximbiot.com>
* import.c (import): Check that the module name specified by the user
does not contain `CVS' as a directory name.
* ignore.c (ign_add): Never cease ignoring "CVS" - it is a reserved
name.
(Original patch from Dan Peterson <dbpete@aol.com>.)
* sanity.sh (import-CVS): New tests for the above.
2004-02-29 Larry Jones <lawrence.jones@ugsplm.com>
* import.c (expand_at_signs): Change type of len to size_t.
* subr.c (resolve_symlink): Move declaration of newname inside
#ifdef, clean up coding style.
* zlib.c (gunzip_and_write): Fix up potential overlow problems.
(read_and_gzip): Add explicit casts to placate paranoid compilers.
2004-02-28 Larry Jones <lawrence.jones@ugsplm.com>
* sanity.sh (join6): New tests for previous fix.
* update.c (join_file): One more fix to avoid dereferencing NULL.
(Reported by Steve McIntyre <steve@einval.com>.)
* sanity.sh (join6): New tests for above.
2004-02-25 Larry Jones <lawrence.jones@ugsplm.com>
* update.c (join_file): Fix optimization to avoid dereferencing NULL.
(Reported by Steve McIntyre <steve@einval.com>.)
2004-02-25 Derek Price <derek@ximbiot.com>
* buffer.c (buf_empty): New function.
* server.c (server): Check for unread data in buffer before closing.
2004-02-25 Derek Price <derek@ximbiot.com>
* release.c (release): Restore the initial directory before and after
calling various sections of code that expect it to prevent corruption
of CVS/Entries files on release of a subdir and tell unedit() what to
release.
* sanity.sh: Add test case for release.c fix.
(Original patch from Matthew Ogilvie <mmo9317bd@mailcan.com>.)
* client.c (last_entries): Move global variable...
(call_in_directory): ...here (now a local variable). Remove test that
always evaluates to true.
(last_dir_name): Remove unused global variable.
2004-02-24 Larry Jones <lawrence.jones@ugsplm.com>
* filesubr.c (xresolvepath): Fix crash in error case.
(Reported by Reinhard Zierke <zierke@informatik.uni-hamburg.de>.)
2004-02-24 Derek Price <derek@ximbiot.com>
* sanity.sh (crerepos): Minor stylistic changes to previous change.
2004-02-24 Derek Price <derek@ximbiot.com>
* sanity.sh (crerepos): Fix it so that it ignores the user's
.cvsrc file (.cvsrc "checkout -r" used to cause the "rm -r 1"
command to print warnings and wait for input).
(Original patch from Matthew Ogilvie <mmo9317bd@mailcan.com>.)
* sanity.sh (reposmv, parseroot, devcom3, binwrap3):
s/_SAVED\>/_save/ for consistency.
2004-02-20 Derek Price <derek@ximbiot.com>
* subr.c (set_nonblock_fd): Move back to...
* server.c: ...here.
* cvs.h: Remove protos for the above two functions.
* buffer.c (stdio_buffer_shutdown): Remove unexessary and possibly
dangerous check for unread data on a pipe with a nonblock read.
2004-02-20 Derek Price <derek@ximbiot.com>
* ChangeLog, commit.c, filesubr.c, rcs.c, root.c, sanity.sh, subr.c,
update.c: Remove VIM editor commands.
2004-02-20 Larry Jones <lawrence.jones@ugsplm.com>
* hash.h (struct node): Change data from char * to void *, change
all callers.
2004-02-19 Larry Jones <lawrence.jones@ugsplm.com>
* login.c (password_entry_operation): Initialize line.
2004-02-19 Derek Price <derek@ximbiot.com>
* sanity.sh (crerepos): Correct comment.
2004-02-19 Derek Price <derek@ximbiot.com>
* sanity.sh (crerepos): Don't create directories named `tmp' in
$TESTDIR to avoid conflicts with the default value of $TMPDIR.
2004-02-19 Derek Price <derek@ximbiot.com>
* sanity.sh (directory_cmp): Use $TESTDIR for temporary files, like the
dotest functions.
2004-02-19 Derek Price <derek@ximbiot.com>
* sanity.sh: No longer allow user override of $tmp. Set $TMPDIR to a
directory under $TESTDIR, as for $HOME, but still allowing for user
override. Check for cvs-serv* directories under $TMPDIR rather than
$tmp at the end of the script.
2004-02-17 Derek Price <derek@ximbiot.com>
* sanity.sh: Check for $PWD != $TESTDIR after each set of tests rather
than once at the end. Check that there are no cvs-serv* directories in
$tmp after each set of remote tests.
2004-02-17 Derek Price <derek@ximbiot.com>
* sanity.sh: Don't check for an empty $TESTDIR - if $TESTDIR was empty
then the preceding call to mkdir would have failed anyhow.
2004-02-17 Larry Jones <lawrence.jones@ugsplm.com>
* log.c (rlog_proc): Fix (harmless) uninitialized variable.
* sanity.sh (basicc): Add tests pointing out defective handling
of the Entries file.
2004-02-17 Derek Price <derek@ximbiot.com>
* checkout.c (build_dir_and_chdir): Expand header comment.
2004-02-15 Mark D. Baushke <mdb@cvshome.org>
* annotate.c (rannotate_proc): Plug a memory leak.
* log.c (log_fileproc): Ditto.
* tag.c (tag_fileproc): Ditto.
* update.c (checkout_file): Ditto.
* server.c (server_updated): Do not buf_free (filebuf) here.
2004-02-13 Larry Jones <lawrence.jones@ugsplm.com>
* rcs.c (locate_rcs): Remove unused variables.
2004-02-12 Mark D. Baushke <mdb@cvshome.org>
* lock.c (readers_exist): Plug a memory leak.
2004-02-12 Mark D. Baushke <mdb@cvshome.org>
* server.c (do_cvs_command): Plug a memory leak.
2004-02-12 Derek Price <derek@ximbiot.com>
* modules.c: Reformat comment and line to fit in 80 chars.
2004-02-12 Larry Jones <lawrence.jones@ugsplm.com>
* modules.c (_do_module): Rename to my_module to avoid reserved name.
* stack.c (_push, _pop, _unshift, _shift): Rename to do_*.
2004-02-11 Larry Jones <lawrence.jones@ugsplm.com>
* root.c (parse_cvsroot): Set hostname in fork mode for error messages.
* buffer.c (stdio_buffer_shutdown): Undo previous change.
2004-02-11 Mark D. Baushke <mdb@cvshome.org>
* buffer.c (buf_free): Plug a memory leak.
* commit.c (checkaddfile): Ditto.
* server.c (fd_buffer_shutdown): Avoid a double free().
* parseinfo.c (parse_config): Fix comments.
2004-02-11 Derek Price <derek@ximbiot.com>
* buffer.c (stdio_buffer_shutdown): Add logic to avoid attempting to
print current_parsed_root->hostname when using the fork method.
2004-02-11 Derek Price <derek@ximbiot.com>
* server.c (do_cvs_command): Simplify stream & pipe closing.
(Suggestion from Eric Siegerman <erics@telepres.com>.)
* cvs.h, subr.c (set_block_fd): Remove this unnecessary function.
2004-02-11 Derek Price <derek@ximbiot.com>
* checkout.c (checkout_proc): s/is_absolute/isabsolute/.
2004-02-11 Derek Price <derek@ximbiot.com>
* checkout.c (checkout_proc): Remove unneeded variable and enclosing
block.
* modules.c (_do_modules): Minor whitespace change.
2004-02-10 Derek Price <derek@ximbiot.com>
* server.c (do_cvs_command): s/FIXCVS/FIXME/ in comment.
(set_block_fd, set_nonblock_fd): Move to...
* subr.c: ...here.
* cvs.h: Add protos for the above two functions.
* buffer.c (stdio_buffer_shutdown): Replace fgetc() which checked for
unread data on a pipe with a nonblock read.
2004-02-10 Derek Price <derek@ximbiot.com>
* server.c (do_cvs_command): Have the server child close all the pipes
but the flow control pipe and wait on an EOF on the flow control pipe
from the parent when done to avoid a race condition that could
otherwise generate a SIGPIPE for the parent before the SIGCHILD when
the other pipes were so full after a child exited that the parent
attempted to write a stop byte to the flow control pipe.
(Original report from <jesse_off@stchome.com>.)
2004-02-10 Derek Price <derek@ximbiot.com>
* buffer.c (stdio_buffer_shutdown): Add a helpful comment.
2004-02-09 Derek Price <derek@ximbiot.com>
* sanity.sh (co-d): Update comments and tests to reflect the current
state of my side of my discussion with Larry Jones on how these
commands should behave.
2004-02-09 Derek Price <derek@ximbiot.com>
* sanity.sh (emptydir): Add two new tests for how modules -d behaves
when a directory already exists in the user's workspace.
(emptydir): Add --keep functionality.
2004-02-09 Derek Price <derek@ximbiot.com>
* sanity.sh (co-d): New test to prove `co -d' failure case.
2004-02-05 Derek Price <derek@ximbiot.com>
* sanity.sh (recase): Fix typo that creeped in somehow between my last
test run and my commit.
2004-02-04 Derek Price <derek@ximbiot.com>
* stack.c (shift, shift_string): Make sure these functions return their
result.
2004-02-04 Derek Price <derek@ximbiot.com>
* modules.c (do_modules): Move content to and make this function a
wrapper for...
(_do_modules): ...this new function which can watch for infinite loops
in alias modules.
* stack.c (_push, _pop, _unshift, _shift, push_string, pop_string,
unshift_string, shift_string): New
functions.
* stack.h (push_string, pop_string, unshift_string, shift_string: New
prototypes.
* sanity.sh (modules): Add check for nested alias loops.
2004-02-04 Derek Price <derek@ximbiot.com>
* sanity.sh (recase): Update test names and comments for clarity and
consistency.
2004-02-03 Derek Price <derek@ximbiot.com>
Preserve the case of checked out directories in a path as well as file
names for client communication with the server.
* Makefile.am (cvs_SOURCES): Add stack.c & stack.h.
* stack.c, stack.h: New files.
* cvs.h: Include stack.h.
* client.c (send_file_names): Preserve the case of directories in a
path as well as file names for communication with the server.
* Makefile.in: Regenerated.
2004-02-02 Derek Price <derek@ximbiot.com>
* sanity.sh (join-rm): New test for issue #104 & #159.
2004-02-02 Derek Price <derek@ximbiot.com>
Continue removal from server of handling of case insensitive clients.
* cvs.h: Remove extern declaration of ign_case.
* ignore.c (ign_case): Remove declaration.
(ign_name): Remove support for ign_case.
* server.c (serve_case): Ditto.
(requests): No longer support the "Case" request.
* rcs.c (locate_rcs): Remove reference to GLOBAL in function header
comment.
2004-02-02 Derek Price <derek@ximbiot.com>
* add.c, client.c, cvs.h, rcs.c, subr.c: Remove server support for case
insensitivity.
2004-01-25 Derek Price <derek@ximbiot.com>
* server.c (kserver_authenticate_connection): Fix call to
switch_to_user().
(Original patch from Alexey Mahotkin <alexm@hsys.msk.ru>.)
2004-01-22 Derek Price <derek@ximbiot.com>
* modules.c (do_module): Strip trailing slashes before checking for
infinite alias loops.
* sanity.sh (modules): Tests for response to infinite alias loops.
2004-01-17 Mark D. Baushke <mdb@cvshome.org>
* logmsg.c (do_verify): Eliminate double-free bug.
(Original patch from Gerald Combs.)
2004-01-07 Larry Jones <lawrence.jones@ugsplm.com>
* checkout.c (safe_location): Remove unused variable(s).
* lock.c (lock_tree_for_write): Ditto.
* rcs.c (RCS_checkin): Ditto.
* subr.c (compare_revnums): Ditto.
* tag.c (tag_check_valid): Ditto.
* mkmodules.c (init): Initialize err and return it rather than 0.
* server.c (do_cvs_command): Only define and set max_command_fd if
we're actually going to use it.
2004-01-01 Larry Jones <lawrence.jones@ugsplm.com>
* zlib.c (read_and_gzip, gunzip_and_write): Fix potential buffer
overruns, use names for magic numbers.
(Original patch from Jeff Downs <heydowns@borg.com>.)
2003-12-18 Derek Price <derek@ximbiot.com>
* server.c (switch_to_user): SysLog attempts to root from pserver.

View File

@ -197,6 +197,7 @@ cvs_SOURCES = \
run.c \
scramble.c \
server.c \
stack.c \
status.c \
subr.c \
tag.c \
@ -219,6 +220,7 @@ cvs_SOURCES = \
rcs.h \
root.h \
server.h \
stack.h \
update.h \
watch.h
@ -265,9 +267,10 @@ am_cvs_OBJECTS = add.$(OBJEXT) admin.$(OBJEXT) annotate.$(OBJEXT) \
patch.$(OBJEXT) rcs.$(OBJEXT) rcscmds.$(OBJEXT) \
recurse.$(OBJEXT) release.$(OBJEXT) remove.$(OBJEXT) \
repos.$(OBJEXT) root.$(OBJEXT) run.$(OBJEXT) scramble.$(OBJEXT) \
server.$(OBJEXT) status.$(OBJEXT) subr.$(OBJEXT) tag.$(OBJEXT) \
update.$(OBJEXT) version.$(OBJEXT) vers_ts.$(OBJEXT) \
watch.$(OBJEXT) wrapper.$(OBJEXT) zlib.$(OBJEXT)
server.$(OBJEXT) stack.$(OBJEXT) status.$(OBJEXT) \
subr.$(OBJEXT) tag.$(OBJEXT) update.$(OBJEXT) version.$(OBJEXT) \
vers_ts.$(OBJEXT) watch.$(OBJEXT) wrapper.$(OBJEXT) \
zlib.$(OBJEXT)
cvs_OBJECTS = $(am_cvs_OBJECTS)
cvs_DEPENDENCIES = ../diff/libdiff.a ../lib/libcvs.a ../zlib/libz.a
cvs_LDFLAGS =
@ -299,11 +302,12 @@ am__depfiles_maybe = depfiles
@AMDEP_TRUE@ ./$(DEPDIR)/release.Po ./$(DEPDIR)/remove.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/repos.Po ./$(DEPDIR)/root.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/run.Po ./$(DEPDIR)/scramble.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/server.Po ./$(DEPDIR)/status.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/subr.Po ./$(DEPDIR)/tag.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/update.Po ./$(DEPDIR)/vers_ts.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/version.Po ./$(DEPDIR)/watch.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/wrapper.Po ./$(DEPDIR)/zlib.Po
@AMDEP_TRUE@ ./$(DEPDIR)/server.Po ./$(DEPDIR)/stack.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/status.Po ./$(DEPDIR)/subr.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/tag.Po ./$(DEPDIR)/update.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/vers_ts.Po ./$(DEPDIR)/version.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/watch.Po ./$(DEPDIR)/wrapper.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/zlib.Po
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
@ -422,6 +426,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scramble.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/server.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/status.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/subr.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tag.Po@am__quote@

271
gnu/dist/cvs/src/add.c vendored
View File

@ -24,13 +24,15 @@
* file to be resurrected.
*/
#include <assert.h>
#include "cvs.h"
#include "savecwd.h"
#include "fileattr.h"
static int add_directory PROTO ((struct file_info *finfo));
static int build_entry PROTO((char *repository, char *user, char *options,
char *message, List * entries, char *tag));
static int build_entry PROTO((const char *repository, const char *user,
const char *options, const char *message,
List * entries, const char *tag));
static const char *const add_usage[] =
{
@ -211,7 +213,10 @@ add (argc, argv)
error_exit ();
filedir = xstrdup (argv[j]);
p = last_component (filedir);
/* Deliberately discard the const below since we know we just
* allocated filedir and can do what we like with it.
*/
p = (char *)last_component (filedir);
if (p == filedir)
{
update_dir = "";
@ -289,11 +294,7 @@ add (argc, argv)
int begin_added_files = added_files;
#endif
struct file_info finfo;
char *p;
#if defined (SERVER_SUPPORT) && !defined (FILENAMES_CASE_INSENSITIVE)
char *found_name = NULL;
int restore_case = 0;
#endif
char *filename, *p;
memset (&finfo, 0, sizeof finfo);
@ -301,8 +302,12 @@ add (argc, argv)
error_exit ();
finfo.fullname = xstrdup (argv[i]);
p = last_component (argv[i]);
if (p == argv[i])
filename = xstrdup (argv[i]);
/* We know we can discard the const below since we just allocated
* filename and can do as we like with it.
*/
p = (char *)last_component (filename);
if (p == filename)
{
finfo.update_dir = "";
finfo.file = p;
@ -310,7 +315,7 @@ add (argc, argv)
else
{
p[-1] = '\0';
finfo.update_dir = argv[i];
finfo.update_dir = filename;
finfo.file = p;
if (CVS_CHDIR (finfo.update_dir) < 0)
error (1, errno, "could not chdir to %s", finfo.update_dir);
@ -326,7 +331,8 @@ add (argc, argv)
repository = Name_Repository (NULL, finfo.update_dir);
/* don't add stuff to Emptydir */
if (strncmp (repository, current_parsed_root->directory, cvsroot_len) == 0
if (strncmp (repository, current_parsed_root->directory,
cvsroot_len) == 0
&& ISDIRSEP (repository[cvsroot_len])
&& strncmp (repository + cvsroot_len + 1,
CVSROOTADM,
@ -341,78 +347,12 @@ add (argc, argv)
finfo.repository = repository;
finfo.entries = entries;
#if defined (SERVER_SUPPORT) && !defined (FILENAMES_CASE_INSENSITIVE)
if (ign_case)
{
/* Need to check whether there is a directory with the
same name but different case. We'll check for files
with the same name later (when Version_TS calls
RCS_parse which calls locate_rcs). If CVS some day
records directories in the RCS files, then we should be
able to skip the separate check here, which would be
cleaner. */
DIR *dirp;
struct dirent *dp;
dirp = CVS_OPENDIR (finfo.repository);
if (dirp == NULL)
error (1, errno, "cannot read directory %s", finfo.repository);
errno = 0;
while ((dp = CVS_READDIR (dirp)) != NULL)
{
if (cvs_casecmp (dp->d_name, finfo.file) == 0)
{
if (found_name != NULL)
error (1, 0, "%s is ambiguous; could mean %s or %s",
finfo.file, dp->d_name, found_name);
found_name = xstrdup (dp->d_name);
}
}
if (errno != 0)
error (1, errno, "cannot read directory %s", finfo.repository);
CVS_CLOSEDIR (dirp);
if (found_name != NULL)
{
/* OK, we are about to patch up the name, so patch up
the temporary directory too to match. The isdir
should "always" be true (since files have ,v), but
I guess we might as well make some attempt to not
get confused by stray files in the repository. */
if (isdir (finfo.file))
{
if (CVS_MKDIR (found_name, 0777) < 0
&& errno != EEXIST)
error (0, errno, "cannot create %s", finfo.file);
}
/* OK, we found a directory with the same name, maybe in
a different case. Treat it as if the name were the
same. */
finfo.file = found_name;
}
else
{
/* We didn't find a directory match. Turn off ign_case so that
* file names are looked up case sensitively. We do this so
* that file adds always use the case specified by the user.
*/
ign_case = 0;
restore_case = 1;
}
}
#endif /* SERVER_SUPPORT && !FILENAMES_CASE_INSENSITIVE */
/* We pass force_tag_match as 1. If the directory has a
sticky branch tag, and there is already an RCS file which
does not have that tag, then the head revision is
meaningless to us. */
vers = Version_TS (&finfo, options, NULL, NULL, 1, 0);
#if defined (SERVER_SUPPORT) && !defined (FILENAMES_CASE_INSENSITIVE)
ign_case = restore_case;
#endif /* SERVER_SUPPORT && !FILENAMES_CASE_INSENSITIVE */
if (vers->vn_user == NULL)
{
/* No entry available, ts_rcs is invalid */
@ -521,24 +461,90 @@ same name already exists in the repository.");
}
else
{
char *timestamp = NULL;
if (vers->ts_user == NULL)
{
/* If this file does not exist locally, assume that
* the last version on the branch is being
* resurrected.
*
* Compute previous revision. We assume that it
* exists and that it is not a revision on the
* trunk of the form X.1 (1.1, 2.1, 3.1, ...). We
* also assume that it is not dead, which seems
* fair since we know vers->vn_rcs is dead
* and we shouldn't see two dead revisions in a
* row.
*/
char *prev = previous_rev (vers->srcfile,
vers->vn_rcs);
int status;
assert (prev != NULL);
if (!quiet)
error (0, 0,
"Resurrecting file `%s' from revision %s.",
finfo.fullname, prev);
status = RCS_checkout (vers->srcfile, finfo.file,
prev, vers->tag,
vers->options, RUN_TTY,
NULL, NULL);
xchmod (finfo.file, 1);
if (status != 0)
{
error (0, 0, "Failed to resurrect revision %s",
prev);
err++;
}
else
{
/* I don't actually set vers->ts_user here
* because it would confuse server_update().
*/
timestamp = time_stamp (finfo.file);
if (!really_quiet)
write_letter (&finfo, 'U');
}
free (prev);
}
if (!quiet)
{
if (vers->tag)
error (0, 0, "\
file `%s' will be added on branch `%s' from version %s",
finfo.fullname, vers->tag, vers->vn_rcs);
error (0, 0,
"file `%s' will be added on branch `%s' from version %s",
finfo.fullname, vers->tag,
vers->vn_rcs);
else
/* I'm not sure that mentioning
vers->vn_rcs makes any sense here; I
can't think of a way to word the
message which is not confusing. */
error (0, 0, "\
re-adding file `%s' (in place of dead revision %s)",
finfo.fullname, vers->vn_rcs);
error (0, 0,
"Re-adding file `%s' (in place of dead revision %s).",
finfo.fullname, vers->vn_rcs);
}
Register (entries, finfo.file, "0", vers->ts_user,
vers->options,
vers->tag, NULL, NULL);
Register (entries, finfo.file, "0",
timestamp ? timestamp : vers->ts_user,
vers->options, vers->tag, vers->date, NULL);
if (timestamp) free (timestamp);
#ifdef SERVER_SUPPORT
if (server_active && vers->ts_user == NULL)
{
/* If we resurrected the file from the archive, we
* need to tell the client about it.
*/
server_updated (&finfo, vers,
SERVER_UPDATED,
(mode_t) -1, NULL, NULL);
/* This is kinda hacky or, at least, it renders the
* name "begin_added_files" obsolete, but we want
* the added_files to be counted without triggering
* the check that causes server_checked_in() to be
* called below since we have already called
* server_updated() to complete the resurrection.
*/
++begin_added_files;
}
#endif
++added_files;
}
}
@ -584,37 +590,56 @@ cannot resurrect %s; RCS file removed by second party", finfo.fullname);
}
else
{
int status;
/*
* There is an RCS file, so remove the "-" from the
* version number and restore the file
*/
char *tmp = xmalloc( strlen( vers->vn_user ) );
char *tmp = xmalloc (strlen (vers->vn_user));
(void) strcpy (tmp, vers->vn_user + 1);
(void) strcpy (vers->vn_user, tmp);
free( tmp );
tmp = xmalloc( strlen( finfo.file ) + 13 );
(void) sprintf (tmp, "Resurrected %s", finfo.file);
Register (entries, finfo.file, vers->vn_user, tmp,
vers->options,
vers->tag, vers->date, vers->ts_conflict);
free (tmp);
/* XXX - bugs here; this really resurrect the head */
/* Note that this depends on the Register above actually
having written Entries, or else it won't really
check the file out. */
if (update (2, argv + i - 1) == 0)
free(tmp);
status = RCS_checkout (vers->srcfile, finfo.file,
vers->vn_user, vers->tag,
vers->options, RUN_TTY,
NULL, NULL);
xchmod (finfo.file, 1);
if (status != 0)
{
error (0, 0, "%s, version %s, resurrected",
finfo.fullname,
error (0, 0, "Failed to resurrect revision %s",
vers->vn_user);
err++;
tmp = NULL;
}
else
{
error (0, 0, "could not resurrect %s", finfo.fullname);
err++;
/* I don't actually set vers->ts_user here because it
* would confuse server_update().
*/
tmp = time_stamp (finfo.file);
write_letter (&finfo, 'U');
if (!quiet)
error (0, 0, "%s, version %s, resurrected",
finfo.fullname, vers->vn_user);
}
Register (entries, finfo.file, vers->vn_user,
tmp, vers->options,
vers->tag, vers->date, NULL);
if (tmp) free (tmp);
#ifdef SERVER_SUPPORT
if (server_active)
{
/* If we resurrected the file from the archive, we
* need to tell the client about it.
*/
server_updated (&finfo, vers,
SERVER_UPDATED,
(mode_t) -1, NULL, NULL);
}
/* We don't increment added_files here because this isn't
* a change that needs to be committed.
*/
#endif
}
}
else
@ -657,11 +682,11 @@ cannot resurrect %s; RCS file removed by second party", finfo.fullname);
error_exit ();
free_cwd (&cwd);
free (finfo.fullname);
#if defined (SERVER_SUPPORT) && !defined (FILENAMES_CASE_INSENSITIVE)
if (found_name != NULL)
free (found_name);
#endif
/* It's okay to discard the const to free this - we allocated this
* above. The const is for everybody else.
*/
free ((char *) finfo.fullname);
free ((char *) filename);
}
if (added_files && !really_quiet)
error (0, 0, "use '%s commit' to add %s permanently",
@ -687,9 +712,9 @@ static int
add_directory (finfo)
struct file_info *finfo;
{
char *repository = finfo->repository;
const char *repository = finfo->repository;
List *entries = finfo->entries;
char *dir = finfo->file;
const char *dir = finfo->file;
char *rcsdir = NULL;
struct saved_cwd cwd;
@ -722,11 +747,11 @@ add_directory (finfo)
/* now, remember where we were, so we can get back */
if (save_cwd (&cwd))
return (1);
if ( CVS_CHDIR (dir) < 0)
return 1;
if (CVS_CHDIR (dir) < 0)
{
error (0, errno, "cannot chdir to %s", finfo->fullname);
return (1);
return 1;
}
#ifdef SERVER_SUPPORT
if (!server_active && isfile (CVSADM))
@ -815,7 +840,7 @@ add_directory (finfo)
li->type = T_TITLE;
li->tag = xstrdup (tag);
li->rev_old = li->rev_new = NULL;
p->data = (char *) li;
p->data = li;
(void) addnode (ulist, p);
Update_Logfile (rcsdir, message, (FILE *) NULL, ulist);
dellist (&ulist);
@ -853,18 +878,20 @@ out:
return (0);
}
/*
* Builds an entry for a new file and sets up "CVS/file",[pt] by
* interrogating the user. Returns non-zero on error.
*/
static int
build_entry (repository, user, options, message, entries, tag)
char *repository;
char *user;
char *options;
char *message;
const char *repository;
const char *user;
const char *options;
const char *message;
List *entries;
char *tag;
const char *tag;
{
char *fname;
char *line;

View File

@ -15,9 +15,9 @@
#endif
#include <assert.h>
static Dtype admin_dirproc PROTO ((void *callerdat, char *dir,
char *repos, char *update_dir,
List *entries));
static Dtype admin_dirproc PROTO ((void *callerdat, const char *dir,
const char *repos, const char *update_dir,
List *entries));
static int admin_fileproc PROTO ((void *callerdat, struct file_info *finfo));
static const char *const admin_usage[] =
@ -367,7 +367,7 @@ admin (argc, argv)
/* getopt will have printed an error message. */
usage_error:
/* Don't use command_name; it might be "server". */
/* Don't use cvs_cmd_name; it might be "server". */
error (1, 0, "specify %s -H admin for usage information",
program_name);
}
@ -784,7 +784,7 @@ admin_fileproc (callerdat, finfo)
error (0, 0,
"%s: symbolic name %s already bound to %s",
rcs->path,
tag, n->data);
tag, (char *)n->data);
status = 1;
free (tag);
continue;
@ -843,7 +843,7 @@ admin_fileproc (callerdat, finfo)
continue;
}
free (rev);
delta = (RCSVers *) n->data;
delta = n->data;
free (delta->state);
delta->state = tag;
break;
@ -882,7 +882,7 @@ admin_fileproc (callerdat, finfo)
*p = ':'; /* restore the full text of the -m argument */
free (rev);
delta = (RCSVers *) n->data;
delta = n->data;
if (delta->text == NULL)
{
delta->text = (Deltatext *) xmalloc (sizeof (Deltatext));
@ -931,9 +931,9 @@ admin_fileproc (callerdat, finfo)
static Dtype
admin_dirproc (callerdat, dir, repos, update_dir, entries)
void *callerdat;
char *dir;
char *repos;
char *update_dir;
const char *dir;
const char *repos;
const char *update_dir;
List *entries;
{
if (!quiet)

View File

@ -58,13 +58,10 @@ Checkin (type, finfo, rev, tag, options, message)
* if the RCS file hasn't already been parsed in one of the
* check functions.
*/
assert ( finfo->rcs != NULL );
assert (finfo->rcs != NULL);
switch ( RCS_checkin ( finfo->rcs,
finfo->file,
message,
rev,
RCS_FLAGS_KEEPFILE ) )
switch (RCS_checkin (finfo->rcs, finfo->file, message, rev,
RCS_FLAGS_KEEPFILE))
{
case 0: /* everything normal */
@ -185,5 +182,5 @@ Checkin (type, finfo, rev, tag, options, message)
mark_up_to_date (finfo->file);
freevers_ts (&vers);
return (0);
return 0;
}

View File

@ -266,7 +266,7 @@ Classify_File (finfo, tag, date, options, force_tag_match, aflag, versp,
* There is no user file, so note that it was lost and
* extract a new version
*/
/* Comparing the command_name against "update", in
/* Comparing the cvs_cmd_name against "update", in
addition to being an ugly way to operate, means
that this message does not get printed by the
server. That might be considered just a straight
@ -274,7 +274,7 @@ Classify_File (finfo, tag, date, options, force_tag_match, aflag, versp,
gets hit when a patch fails and the client fetches
a file. I'm not sure there is currently any way
for the server to distinguish those two cases. */
if (strcmp (command_name, "update") == 0)
if (strcmp (cvs_cmd_name, "update") == 0)
if (!really_quiet)
error (0, 0, "warning: %s was lost", finfo->fullname);
ret = T_CHECKOUT;
@ -344,7 +344,7 @@ Classify_File (finfo, tag, date, options, force_tag_match, aflag, versp,
/* See comment at other "update" compare, for more
thoughts on this comparison. */
if (strcmp (command_name, "update") == 0)
if (strcmp (cvs_cmd_name, "update") == 0)
if (!really_quiet)
error (0, 0, "warning: %s was lost", finfo->fullname);
ret = T_CHECKOUT;

View File

@ -78,7 +78,7 @@ void connect_to_pserver PROTO ((cvsroot_t *,
# endif /* HAVE_KERBEROS */
/* Talking to the server. */
void send_to_server PROTO((char *str, size_t len));
void send_to_server PROTO((const char *str, size_t len));
void read_from_server PROTO((char *buf, size_t len));
/* Internal functions that handle client communication to server, etc. */
@ -125,7 +125,8 @@ send_arg PROTO((char *string));
void
send_option_string PROTO((char *string));
extern void send_a_repository PROTO ((char *, char *, char *));
extern void send_a_repository PROTO ((const char *, const char *,
const char *));
#endif /* CLIENT_SUPPORT */
@ -203,5 +204,6 @@ extern int client_process_import_file
int targc, char *targv[], char *repository, int all_files_binary,
int modtime));
extern void client_import_done PROTO((void));
extern void client_notify PROTO((char *, char *, char *, int, char *));
extern void client_notify PROTO((const char *, const char *, const char *, int,
const char *));
#endif /* CLIENT_SUPPORT */

View File

@ -24,11 +24,11 @@
int
Create_Admin (dir, update_dir, repository, tag, date, nonbranch, warn,
dotemplate)
char *dir;
char *update_dir;
char *repository;
char *tag;
char *date;
const char *dir;
const char *update_dir;
const char *repository;
const char *tag;
const char *date;
int nonbranch;
int warn;
int dotemplate;

View File

@ -30,7 +30,7 @@ void
read_cvsrc (argc, argv, cmdname)
int *argc;
char ***argv;
char *cmdname;
const char *cmdname;
{
char *homedir;
char *homeinit;

View File

@ -17,7 +17,8 @@ extern int watch_off PROTO ((int argc, char **argv));
/* Check to see if any notifications are sitting around in need of being
sent. These are the notifications stored in CVSADM_NOTIFY (edit,unedit);
commit calls notify_do directly. */
extern void notify_check PROTO ((char *repository, char *update_dir));
extern void notify_check PROTO ((const char *repository,
const char *update_dir));
#endif /* CLIENT_SUPPORT */
/* Issue a notification for file FILENAME. TYPE is 'E' for edit, 'U'
@ -25,14 +26,16 @@ extern void notify_check PROTO ((char *repository, char *update_dir));
For TYPE 'E', VAL is the time+host+directory data which goes in
_editors, and WATCHES is zero or more of E,U,C, in that order, to specify
what kinds of temporary watches to set. */
extern void notify_do PROTO ((int type, char *filename, char *who,
char *val, char *watches, char *repository));
extern void notify_do PROTO ((int type, const char *filename, const char *who,
const char *val, const char *watches,
const char *repository));
/* Set attributes to reflect the fact that EDITOR is editing FILENAME.
VAL is time+host+directory, or NULL if we are to say that EDITOR is
*not* editing FILENAME. */
extern void editor_set PROTO ((char *filename, char *editor, char *val));
extern void editor_set PROTO ((const char *filename, const char *editor,
const char *val));
/* Take note of the fact that FILE is up to date (this munges CVS/Base;
processing of CVS/Entries is done separately). */
extern void mark_up_to_date PROTO ((char *file));
extern void mark_up_to_date PROTO ((const char *file));

View File

@ -128,12 +128,12 @@ error (status, errnum, message, va_alist)
char buf[100];
cvs_outerr (program_name, 0);
if (command_name && *command_name)
if (cvs_cmd_name && *cvs_cmd_name)
{
cvs_outerr (" ", 1);
if (status != 0)
cvs_outerr ("[", 1);
cvs_outerr (command_name, 0);
cvs_outerr (cvs_cmd_name, 0);
if (status != 0)
cvs_outerr (" aborted]", 0);
}

View File

@ -15,9 +15,11 @@
#include "cvs.h"
#include <sys/types.h>
static char *expand_variable PROTO((char *env, char *file, int line));
static char *expand_variable PROTO((const char *env, const char *file,
int line));
/* User variables. */
List *variable_list = NULL;
@ -79,7 +81,9 @@ variable_set (nameval)
free (name);
}
}
/* This routine will expand the pathname to account for ~ and $
characters as described above. Returns a pointer to a newly
malloc'd string. If an error occurs, an error message is printed
@ -89,11 +93,11 @@ variable_set (nameval)
known. */
char *
expand_path (name, file, line)
char *name;
char *file;
const char *name;
const char *file;
int line;
{
char *s;
const char *s;
char *d;
char *mybuf = NULL;
@ -179,8 +183,9 @@ expand_path (name, file, line)
if (*s++ == '~')
{
char *t;
char *p=s;
if (*s=='/' || *s==0)
char *p, *pstart;
pstart = p = xstrdup (s);
if (*pstart=='/' || *pstart==0)
t = get_homedir ();
else
{
@ -201,14 +206,14 @@ expand_path (name, file, line)
for (; *p!='/' && *p; p++)
;
*p = 0;
ps = getpwnam (s);
ps = getpwnam (pstart);
if (ps == 0)
{
if (line != 0)
error (0, 0, "%s:%d: no such user %s",
file, line, s);
file, line, pstart);
else
error (0, 0, "%s: no such user %s", file, s);
error (0, 0, "%s: no such user %s", file, pstart);
return NULL;
}
t = ps->pw_dir;
@ -227,9 +232,8 @@ expand_path (name, file, line)
d = buf + doff;
}
--d;
if (*p == 0)
*p = '/'; /* always add / */
s=p;
s+=p-pstart;
free (pstart);
}
else
--s;
@ -267,8 +271,8 @@ expand_path (name, file, line)
static char *
expand_variable (name, file, line)
char *name;
char *file;
const char *name;
const char *file;
int line;
{
if (strcmp (name, CVSROOT_ENV) == 0)

View File

@ -43,7 +43,7 @@ static struct unrecog *unrecog_head;
no open(), no nothing. */
void
fileattr_startdir (repos)
char *repos;
const char *repos;
{
assert (fileattr_stored_repos == NULL);
fileattr_stored_repos = xstrdup (repos);

View File

@ -56,7 +56,7 @@
/* Prepare for a new directory with repository REPOS. If REPOS is NULL,
then prepare for a "non-directory"; the caller can call fileattr_write
and fileattr_free, but must not call fileattr_get or fileattr_set. */
extern void fileattr_startdir PROTO ((char *repos));
extern void fileattr_startdir PROTO ((const char *repos));
/* Get the attribute ATTRNAME for file FILENAME. The return value
points into memory managed by the fileattr_* routines, should not

View File

@ -87,7 +87,7 @@ lookup_file_by_inode (filepath)
hp = getnode ();
hp->type = NT_UNKNOWN;
hp->key = inodestr;
hp->data = (char *) getlist();
hp->data = getlist();
hp->delproc = dellist;
(void) addnode (hardlist, hp);
}
@ -96,14 +96,14 @@ lookup_file_by_inode (filepath)
free (inodestr);
}
p = findnode ((List *) hp->data, filepath);
p = findnode (hp->data, filepath);
if (p == NULL)
{
p = getnode();
p->type = NT_UNKNOWN;
p->key = xstrdup (filepath);
p->data = NULL;
(void) addnode ((List *) hp->data, p);
(void) addnode (hp->data, p);
}
return p;
@ -143,8 +143,8 @@ update_hardlink_info (file)
}
if (n->data == NULL)
n->data = (char *) xmalloc (sizeof (struct hardlink_info));
hlinfo = (struct hardlink_info *) n->data;
n->data = xmalloc (sizeof (struct hardlink_info));
hlinfo = n->data;
hlinfo->status = T_UPTODATE;
hlinfo->checked_out = 1;
}
@ -197,10 +197,10 @@ list_linked_files_on_disk (file)
/* Make sure the files linked to this inode are sorted. */
n = findnode (hardlist, inodestr);
sortlist ((List *) n->data, fsortcmp);
sortlist (n->data, fsortcmp);
free (inodestr);
return (List *) n->data;
return n->data;
}
/* Compare the files in the `key' fields of two lists, returning 1 if
@ -292,7 +292,7 @@ find_checkedout_proc (node, data)
return 0;
}
hlinfo = (struct hardlink_info *) link->data;
hlinfo = link->data;
if (hlinfo->checked_out)
{
/* This file has been checked out recently, so it's safe to

View File

@ -195,7 +195,7 @@ freenode_mem (p)
free (p->key);
/* to be safe, re-initialize these */
p->key = p->data = (char *) NULL;
p->key = p->data = NULL;
p->delproc = (void (*) ()) NULL;
}
@ -493,7 +493,7 @@ printnode (node, closure)
(void) printf("Node at %p: type = %s, key = %p = \"%s\", data = %p, next = %p, prev = %p\n",
(void *)node, nodetypestring(node->type),
(void *)node->key, node->key, (void *)node->data,
(void *)node->key, node->key, node->data,
(void *)node->next, (void *)node->prev);
return(0);

View File

@ -30,7 +30,7 @@ struct node
struct node *hashnext;
struct node *hashprev;
char *key;
char *data;
void *data;
void (*delproc) ();
};
typedef struct node Node;

View File

@ -20,7 +20,7 @@
#include "savecwd.h"
#include <assert.h>
static char *get_comment PROTO((char *user));
static char *get_comment PROTO((const char *user));
static int add_rev PROTO((char *message, RCSNode *rcs, char *vfile,
char *vers));
static int add_tags PROTO((RCSNode *rcs, char *vfile, char *vtag, int targc,
@ -91,7 +91,7 @@ import (argc, argv)
#endif
error (1, 0,
"-q or -Q must be specified before \"%s\"",
command_name);
cvs_cmd_name);
break;
case 'd':
#ifdef SERVER_SUPPORT
@ -157,6 +157,21 @@ import (argc, argv)
use_file_modtime = 1;
#endif
/* Don't allow "CVS" as any directory in module path.
*
* Could abstract this to valid_module_path, but I don't think we'll need
* to call it from anywhere else.
*/
if ((cp = strstr(argv[0], "CVS")) && /* path contains "CVS" AND ... */
((cp == argv[0]) || ISDIRSEP(*(cp-1))) && /* /^CVS/ OR m#/CVS# AND ... */
((*(cp+3) == '\0') || ISDIRSEP(*(cp+3))) /* /CVS$/ OR m#CVS/# */
)
{
error (0, 0,
"The word `CVS' is reserved by CVS and may not be used");
error (1, 0, "as a directory in a path or as a file name.");
}
for (i = 1; i < argc; i++) /* check the tags for validity */
{
int j;
@ -168,8 +183,7 @@ import (argc, argv)
}
/* XXX - this should be a module, not just a pathname */
if (! isabsolute (argv[0])
&& pathname_levels (argv[0]) == 0)
if (!isabsolute (argv[0]) && pathname_levels (argv[0]) == 0)
{
if (current_parsed_root == NULL)
{
@ -379,7 +393,7 @@ import (argc, argv)
li->type = T_TITLE;
li->tag = xstrdup (vbranch);
li->rev_old = li->rev_new = NULL;
p->data = (char *) li;
p->data = li;
(void) addnode (ulist, p);
Update_Logfile (repository, message, logfp, ulist);
dellist (&ulist);
@ -573,7 +587,8 @@ process_import_file (message, vfile, vtag, targc, targv)
node = findnode_fn (entries, vfile);
if (node != NULL)
{
Entnode *entdata = (Entnode *) node->data;
Entnode *entdata = node->data;
if (entdata->type == ENT_FILE)
{
assert (entdata->options[0] == '-'
@ -933,7 +948,7 @@ static const struct compair comtable[] =
static char *
get_comment (user)
char *user;
const char *user;
{
char *cp, *suffix;
char *suffix_path;
@ -989,34 +1004,34 @@ add_rcs_file (message, rcs, user, add_vhead, key_opt,
add_vbranch, vtag, targc, targv,
desctext, desclen, add_logfp)
/* Log message for the addition. Not used if add_vhead == NULL. */
char *message;
const char *message;
/* Filename of the RCS file to create. */
char *rcs;
const char *rcs;
/* Filename of the file to serve as the contents of the initial
revision. Even if add_vhead is NULL, we use this to determine
the modes to give the new RCS file. */
char *user;
const char *user;
/* Revision number of head that we are adding. Normally 1.1 but
could be another revision as long as ADD_VBRANCH is a branch
from it. If NULL, then just add an empty file without any
revisions (similar to the one created by "rcs -i"). */
char *add_vhead;
const char *add_vhead;
/* Keyword expansion mode, e.g., "b" for binary. NULL means the
default behavior. */
char *key_opt;
const char *key_opt;
/* Vendor branch to import to, or NULL if none. If non-NULL, then
vtag should also be non-NULL. */
char *add_vbranch;
char *vtag;
const char *add_vbranch;
const char *vtag;
int targc;
char *targv[];
/* If non-NULL, description for the file. If NULL, the description
will be empty. */
char *desctext;
const char *desctext;
size_t desclen;
/* Write errors to here as well as via error (), or NULL if we should
@ -1032,8 +1047,7 @@ add_rcs_file (message, rcs, user, add_vhead, key_opt,
int i, ierrno, err = 0;
mode_t mode;
char *tocvsPath;
char *userfile;
char *local_opt = key_opt;
const char *userfile;
char *free_opt = NULL;
mode_t file_type;
@ -1047,11 +1061,11 @@ add_rcs_file (message, rcs, user, add_vhead, key_opt,
or the other. Before making a change of this sort, should think
about what is best, document it (in cvs.texinfo and NEWS), &c. */
if (local_opt == NULL)
if (key_opt == NULL)
{
if (wrap_name_has (user, WRAP_RCSOPTION))
{
local_opt = free_opt = wrap_rcsoption (user, 0);
key_opt = free_opt = wrap_rcsoption (user, 0);
}
}
@ -1088,7 +1102,7 @@ add_rcs_file (message, rcs, user, add_vhead, key_opt,
if (!preserve_perms || file_type == S_IFREG)
{
fpuser = CVS_FOPEN (userfile,
((local_opt != NULL && strcmp (local_opt, "b") == 0)
((key_opt != NULL && strcmp (key_opt, "b") == 0)
? "rb"
: "r")
);
@ -1158,9 +1172,9 @@ add_rcs_file (message, rcs, user, add_vhead, key_opt,
goto write_error;
}
if (local_opt != NULL && strcmp (local_opt, "kv") != 0)
if (key_opt != NULL && strcmp (key_opt, "kv") != 0)
{
if (fprintf (fprcs, "expand @%s@;\012", local_opt) < 0)
if (fprintf (fprcs, "expand @%s@;\012", key_opt) < 0)
{
goto write_error;
}
@ -1464,19 +1478,16 @@ read_error:
*/
int
expand_at_signs (buf, size, fp)
char *buf;
const char *buf;
off_t size;
FILE *fp;
{
register char *cp, *next;
register const char *cp, *next;
cp = buf;
while ((next = memchr (cp, '@', size)) != NULL)
{
int len;
++next;
len = next - cp;
size_t len = ++next - cp;
if (fwrite (cp, 1, len, fp) != len)
return EOF;
if (putc ('@', fp) == EOF)

123
gnu/dist/cvs/src/log.c vendored
View File

@ -115,9 +115,10 @@ struct log_data_and_rcs
static int rlog_proc PROTO((int argc, char **argv, char *xwhere,
char *mwhere, char *mfile, int shorten,
int local_specified, char *mname, char *msg));
static Dtype log_dirproc PROTO ((void *callerdat, char *dir,
char *repository, char *update_dir,
List *entries));
static Dtype log_dirproc PROTO ((void *callerdat, const char *dir,
const char *repository,
const char *update_dir,
List *entries));
static int log_fileproc PROTO ((void *callerdat, struct file_info *finfo));
static struct option_revlist *log_parse_revlist PROTO ((const char *));
static void log_parse_date PROTO ((struct log_data *, const char *));
@ -224,7 +225,7 @@ cvslog (argc, argv)
int local = 0;
struct option_revlist **prl;
is_rlog = (strcmp (command_name, "rlog") == 0);
is_rlog = (strcmp (cvs_cmd_name, "rlog") == 0);
if (argc == -1)
usage (log_usage);
@ -486,39 +487,46 @@ rlog_proc (argc, argv, xwhere, mwhere, mfile, shorten, local, mname, msg)
if (is_rlog)
{
repository = xmalloc (strlen (current_parsed_root->directory) + strlen (argv[0])
repository = xmalloc (strlen (current_parsed_root->directory)
+ strlen (argv[0])
+ (mfile == NULL ? 0 : strlen (mfile) + 1) + 2);
(void) sprintf (repository, "%s/%s", current_parsed_root->directory, argv[0]);
where = xmalloc (strlen (argv[0]) + (mfile == NULL ? 0 : strlen (mfile) + 1)
(void)sprintf (repository, "%s/%s",
current_parsed_root->directory, argv[0]);
where = xmalloc (strlen (argv[0])
+ (mfile == NULL ? 0 : strlen (mfile) + 1)
+ 1);
(void) strcpy (where, argv[0]);
/* if mfile isn't null, we need to set up to do only part of the module */
/* If mfile isn't null, we need to set up to do only part of theu
* module.
*/
if (mfile != NULL)
{
char *cp;
char *path;
/* if the portion of the module is a path, put the dir part on repos */
/* If the portion of the module is a path, put the dir part on
* repos.
*/
if ((cp = strrchr (mfile, '/')) != NULL)
{
*cp = '\0';
(void) strcat (repository, "/");
(void) strcat (repository, mfile);
(void) strcat (where, "/");
(void) strcat (where, mfile);
(void)strcat (repository, "/");
(void)strcat (repository, mfile);
(void)strcat (where, "/");
(void)strcat (where, mfile);
mfile = cp + 1;
}
/* take care of the rest */
path = xmalloc (strlen (repository) + strlen (mfile) + 5);
(void) sprintf (path, "%s/%s", repository, mfile);
(void)sprintf (path, "%s/%s", repository, mfile);
if (isdir (path))
{
/* directory means repository gets the dir tacked on */
(void) strcpy (repository, path);
(void) strcat (where, "/");
(void) strcat (where, mfile);
(void)strcpy (repository, path);
(void)strcat (where, "/");
(void)strcat (where, mfile);
}
else
{
@ -531,12 +539,12 @@ rlog_proc (argc, argv, xwhere, mwhere, mfile, shorten, local, mname, msg)
}
/* cd to the starting repository */
if ( CVS_CHDIR (repository) < 0)
if (CVS_CHDIR (repository) < 0)
{
error (0, errno, "cannot chdir to %s", repository);
free (repository);
free( where );
return (1);
free (where);
return 1;
}
/* End section which is identical to patch_proc. */
@ -544,6 +552,7 @@ rlog_proc (argc, argv, xwhere, mwhere, mfile, shorten, local, mname, msg)
}
else
{
repository = NULL;
where = NULL;
which = W_LOCAL | W_REPOS | W_ATTIC;
}
@ -553,17 +562,17 @@ rlog_proc (argc, argv, xwhere, mwhere, mfile, shorten, local, mname, msg)
argc - 1, argv + 1, local, which, 0, CVS_LOCK_READ,
where, 1, repository);
if ( ! ( which & W_LOCAL ) ) free (repository);
if( where ) free( where );
if (!(which & W_LOCAL)) free (repository);
if (where) free (where);
return err;
}
/*
* Parse a revision list specification.
*/
static struct option_revlist *
log_parse_revlist (argstring)
const char *argstring;
@ -787,6 +796,8 @@ printlock_proc (lock, foo)
return 0;
}
/*
* Do an rlog on a file
*/
@ -800,7 +811,7 @@ log_fileproc (callerdat, finfo)
int selrev = -1;
RCSNode *rcsfile;
char buf[50];
struct revlist *revlist;
struct revlist *revlist = NULL;
struct log_data_and_rcs log_data_and_rcs;
if ((rcsfile = finfo->rcs) == NULL)
@ -809,22 +820,21 @@ log_fileproc (callerdat, finfo)
p = findnode (finfo->entries, finfo->file);
if (p != NULL)
{
Entnode *e;
e = (Entnode *) p->data;
Entnode *e = p->data;
if (e->version[0] == '0' && e->version[1] == '\0')
{
if (!really_quiet)
error (0, 0, "%s has been added, but not committed",
finfo->file);
return(0);
return 0;
}
}
if (!really_quiet)
error (0, 0, "nothing known about %s", finfo->file);
return (1);
return 1;
}
if (log_data->sup_header || !log_data->nameonly)
@ -837,7 +847,8 @@ log_fileproc (callerdat, finfo)
revisions. */
revlist = log_expand_revlist (rcsfile, log_data->revlist,
log_data->default_branch);
if (log_data->sup_header || (!log_data->header && !log_data->long_header))
if (log_data->sup_header
|| (!log_data->header && !log_data->long_header))
{
log_data_and_rcs.log_data = log_data;
log_data_and_rcs.revlist = revlist;
@ -850,11 +861,15 @@ log_fileproc (callerdat, finfo)
start date for each specific revision. */
if (log_data->singledatelist != NULL)
walklist (rcsfile->versions, log_fix_singledate,
(void *) &log_data_and_rcs);
(void *)&log_data_and_rcs);
selrev = walklist (rcsfile->versions, log_count_print,
(void *) &log_data_and_rcs);
if (log_data->sup_header && selrev == 0) return 0;
(void *)&log_data_and_rcs);
if (log_data->sup_header && selrev == 0)
{
log_free_revlist (revlist);
return 0;
}
}
}
@ -863,6 +878,7 @@ log_fileproc (callerdat, finfo)
{
cvs_output (rcsfile->path, 0);
cvs_output ("\n", 1);
log_free_revlist (revlist);
return 0;
}
@ -919,7 +935,7 @@ log_fileproc (callerdat, finfo)
cvs_output ("\n\t", 2);
cp2 = cp;
while (! isspace ((unsigned char) *cp2) && *cp2 != '\0')
while (!isspace ((unsigned char) *cp2) && *cp2 != '\0')
++cp2;
cvs_output (cp, cp2 - cp);
cp = cp2;
@ -928,7 +944,7 @@ log_fileproc (callerdat, finfo)
}
}
if (! log_data->notags)
if (!log_data->notags)
{
List *syms;
@ -956,14 +972,14 @@ log_fileproc (callerdat, finfo)
cvs_output ("\n", 1);
if (! log_data->header || log_data->long_header)
if (!log_data->header || log_data->long_header)
{
cvs_output ("description:\n", 0);
if (rcsfile->desc != NULL)
cvs_output (rcsfile->desc, 0);
}
if (! log_data->header && ! log_data->long_header && rcsfile->head != NULL)
if (!log_data->header && ! log_data->long_header && rcsfile->head != NULL)
{
p = findnode (rcsfile->versions, rcsfile->head);
if (p == NULL)
@ -971,9 +987,8 @@ log_fileproc (callerdat, finfo)
finfo->fullname);
while (p != NULL)
{
RCSVers *vers;
RCSVers *vers = p->data;
vers = (RCSVers *) p->data;
log_version (log_data, revlist, rcsfile, vers, 1);
if (vers->next == NULL)
p = NULL;
@ -1013,6 +1028,8 @@ log_fileproc (callerdat, finfo)
return 0;
}
/*
* Fix up a revision list in order to compare it against versions.
* Expand any symbolic revisions.
@ -1376,6 +1393,8 @@ log_version_requested (log_data, revlist, rcs, vnode)
return 1;
}
/*
* Output a single symbol. This is called via walklist.
*/
@ -1392,6 +1411,8 @@ log_symbol (p, closure)
return 0;
}
/*
* Count the number of entries on a list. This is called via walklist.
*/
@ -1404,6 +1425,8 @@ log_count (p, closure)
return 1;
}
/*
* Sort out a single date specification by narrowing down the date
* until we find the specific selected revision.
@ -1423,7 +1446,7 @@ log_fix_singledate (p, closure)
if (pv == NULL)
error (1, 0, "missing version `%s' in RCS file `%s'",
p->key, data->rcs->path);
vnode = (RCSVers *) pv->data;
vnode = pv->data;
/* We are only interested if this revision passes any other tests.
Temporarily clear log_data->singledatelist to avoid confusing
@ -1463,6 +1486,8 @@ log_fix_singledate (p, closure)
return 0;
}
/*
* Count the number of revisions we are going to print.
*/
@ -1479,7 +1504,7 @@ log_count_print (p, closure)
error (1, 0, "missing version `%s' in RCS file `%s'",
p->key, data->rcs->path);
if (log_version_requested (data->log_data, data->revlist, data->rcs,
(RCSVers *) pv->data))
pv->data))
return 1;
else
return 0;
@ -1503,7 +1528,7 @@ log_tree (log_data, revlist, rcs, ver)
if (p == NULL)
error (1, 0, "missing version `%s' in RCS file `%s'",
ver, rcs->path);
vnode = (RCSVers *) p->data;
vnode = p->data;
if (vnode->next != NULL)
log_tree (log_data, revlist, rcs, vnode->next);
if (vnode->branches != NULL)
@ -1539,7 +1564,7 @@ log_abranch (log_data, revlist, rcs, ver)
if (p == NULL)
error (1, 0, "missing version `%s' in RCS file `%s'",
ver, rcs->path);
vnode = (RCSVers *) p->data;
vnode = p->data;
if (vnode->next != NULL)
log_abranch (log_data, revlist, rcs, vnode->next);
log_version (log_data, revlist, rcs, vnode, 0);
@ -1610,7 +1635,7 @@ log_version (log_data, revlist, rcs, ver, trunk)
if (nextp == NULL)
error (1, 0, "missing version `%s' in `%s'", ver->next,
rcs->path);
nextver = (RCSVers *) nextp->data;
nextver = nextp->data;
pdel = findnode (nextver->other, ";add");
padd = findnode (nextver->other, ";delete");
}
@ -1639,14 +1664,14 @@ log_version (log_data, revlist, rcs, ver, trunk)
would be the p == NULL case would mean an RCS file which was
missing the "log" keyword (which is illegal according to
rcsfile.5). */
if (p == NULL || p->data == NULL || p->data[0] == '\0')
if (p == NULL || p->data == NULL || *(char *)p->data == '\0')
cvs_output ("*** empty log message ***\n", 0);
else
{
/* FIXME: Technically, the log message could contain a null
byte. */
cvs_output (p->data, 0);
if (p->data[strlen (p->data) - 1] != '\n')
if (((char *)p->data)[strlen (p->data) - 1] != '\n')
cvs_output ("\n", 1);
}
}
@ -1684,9 +1709,9 @@ log_branch (p, closure)
static Dtype
log_dirproc (callerdat, dir, repository, update_dir, entries)
void *callerdat;
char *dir;
char *repository;
char *update_dir;
const char *dir;
const char *repository;
const char *update_dir;
List *entries;
{
if (!isdir (dir))

View File

@ -220,8 +220,10 @@ password_entry_parseline (cvsroot_canonical, warn, linenumber, linebuf)
*
* Mode Action
* password_entry_lookup Return the password
* password_entry_delete Delete the entry from the file, if it exists
* password_entry_add Replace the line with the new one, else append it
* password_entry_delete Delete the entry from the file, if it
* exists.
* password_entry_add Replace the line with the new one, else
* append it.
*
* Because the user might be accessing multiple repositories, with
* different passwords for each one, the format of ~/.cvspass is:
@ -282,7 +284,7 @@ password_entry_operation (operation, root, newpassword)
char *cvsroot_canonical = NULL;
char *password = NULL;
int line_length;
long line;
long line = -1;
char *linebuf = NULL;
size_t linebuf_len;
char *p;
@ -290,7 +292,8 @@ password_entry_operation (operation, root, newpassword)
if (root->method != pserver_method)
{
error (0, 0, "internal error: can only call password_entry_operation with pserver method");
error (0, 0, "\
internal error: can only call password_entry_operation with pserver method");
error (1, 0, "CVSROOT: %s", root->original);
}
@ -314,7 +317,8 @@ password_entry_operation (operation, root, newpassword)
while ((line_length = getline (&linebuf, &linebuf_len, fp)) >= 0)
{
line++;
password = password_entry_parseline(cvsroot_canonical, 1, line, linebuf);
password = password_entry_parseline (cvsroot_canonical, 1, line,
linebuf);
if (password != NULL)
/* this is it! break out and deal with linebuf */
break;
@ -364,7 +368,8 @@ process:
* add
*/
if (!noexec && password != NULL && (operation == password_entry_delete
|| (operation == password_entry_add && strcmp (password, newpassword))))
|| (operation == password_entry_add
&& strcmp (password, newpassword))))
{
long found_at = line;
char *tmp_name;
@ -385,7 +390,8 @@ process:
line++;
if (line < found_at
|| (line != found_at
&& !password_entry_parseline(cvsroot_canonical, 0, line, linebuf)))
&& !password_entry_parseline (cvsroot_canonical, 0, line,
linebuf)))
{
if (fprintf (tmp_fp, "%s", linebuf) == EOF)
{
@ -551,7 +557,8 @@ login (argc, argv)
connect_to_pserver (current_parsed_root, NULL, NULL, 1, 0);
password_entry_operation (password_entry_add, current_parsed_root, typed_password);
password_entry_operation (password_entry_add, current_parsed_root,
typed_password);
memset (typed_password, 0, strlen (typed_password));
free (typed_password);
@ -563,6 +570,8 @@ login (argc, argv)
return 0;
}
/* Returns the _scrambled_ password. The server must descramble
before hashing and comparing. If password file not found, or
password not found in the file, just return NULL. */
@ -570,7 +579,7 @@ char *
get_cvs_password ()
{
if (current_parsed_root->password)
return (scramble(current_parsed_root->password));
return scramble (current_parsed_root->password);
/* If someone (i.e., login()) is calling connect_to_pserver() out of
context, then assume they have supplied the correct, scrambled
@ -598,9 +607,12 @@ get_cvs_password ()
error (1, 0, "CVSROOT: %s", current_parsed_root->original);
}
return password_entry_operation (password_entry_lookup, current_parsed_root, NULL);
return password_entry_operation (password_entry_lookup,
current_parsed_root, NULL);
}
static const char *const logout_usage[] =
{
"Usage: %s %s\n",

View File

@ -181,12 +181,12 @@ mydbm_store (db, key, value, flags)
node->type = NDBMNODE;
node->key = xmalloc (key.dsize + 1);
strncpy (node->key, key.dptr, key.dsize);
node->key[key.dsize] = '\0';
*node->key = '\0';
strncat (node->key, key.dptr, key.dsize);
node->data = xmalloc (value.dsize + 1);
strncpy (node->data, value.dptr, value.dsize);
node->data[value.dsize] = '\0';
*(char *)node->data = '\0';
strncat (node->data, value.dptr, value.dsize);
db->modified = 1;
if (addnode (db->dbm_list, node) == -1)

View File

@ -71,7 +71,7 @@ No_Difference (finfo, vers)
/* update the entdata pointer in the vers_ts structure */
p = findnode (finfo->entries, finfo->file);
vers->entdata = (Entnode *) p->data;
vers->entdata = p->data;
ret = 0;
}

View File

@ -192,42 +192,45 @@ void RCS_reparsercsfile PROTO((RCSNode *, FILE **, struct rcsbuffer *));
extern int RCS_setattic PROTO ((RCSNode *, int));
char *RCS_check_kflag PROTO((const char *arg));
char *RCS_getdate PROTO((RCSNode * rcs, char *date, int force_tag_match));
char *RCS_gettag PROTO((RCSNode * rcs, char *symtag, int force_tag_match,
int *simple_tag));
char *RCS_getdate PROTO((RCSNode * rcs, const char *date,
int force_tag_match));
char *RCS_gettag PROTO((RCSNode * rcs, const char *symtag, int force_tag_match,
int *simple_tag));
int RCS_exist_rev PROTO((RCSNode *rcs, char *rev));
int RCS_exist_tag PROTO((RCSNode *rcs, char *tag));
char *RCS_tag2rev PROTO((RCSNode *rcs, char *tag));
char *RCS_getversion PROTO((RCSNode * rcs, char *tag, char *date,
int force_tag_match, int *simple_tag));
char *RCS_getversion PROTO((RCSNode * rcs, const char *tag, const char *date,
int force_tag_match, int *simple_tag));
char *RCS_magicrev PROTO((RCSNode *rcs, char *rev));
int RCS_isbranch PROTO((RCSNode *rcs, const char *rev));
int RCS_nodeisbranch PROTO((RCSNode *rcs, const char *tag));
char *RCS_whatbranch PROTO((RCSNode *rcs, const char *tag));
char *RCS_head PROTO((RCSNode * rcs));
int RCS_datecmp PROTO((char *date1, char *date2));
time_t RCS_getrevtime PROTO((RCSNode * rcs, char *rev, char *date, int fudge));
int RCS_datecmp PROTO((const char *date1, const char *date2));
time_t RCS_getrevtime PROTO((RCSNode * rcs, const char *rev, char *date,
int fudge));
List *RCS_symbols PROTO((RCSNode *rcs));
void RCS_check_tag PROTO((const char *tag));
int RCS_valid_rev PROTO ((char *rev));
List *RCS_getlocks PROTO((RCSNode *rcs));
void freercsnode PROTO((RCSNode ** rnodep));
char *RCS_getbranch PROTO((RCSNode * rcs, char *tag, int force_tag_match));
char *RCS_getbranch PROTO((RCSNode * rcs, const char *tag,
int force_tag_match));
char *RCS_branch_head PROTO ((RCSNode *rcs, char *rev));
int RCS_isdead PROTO((RCSNode *, const char *));
char *RCS_getexpand PROTO ((RCSNode *));
void RCS_setexpand PROTO ((RCSNode *, char *));
int RCS_checkout PROTO ((RCSNode *, char *, char *, char *, char *, char *,
RCSCHECKOUTPROC, void *));
int RCS_checkin PROTO ((RCSNode *rcs, char *workfile, char *message,
char *rev, int flags));
int RCS_cmp_file PROTO(( RCSNode *, char *, char **, char *, char *,
const char * ));
void RCS_setexpand PROTO ((RCSNode *, const char *));
int RCS_checkout PROTO ((RCSNode *, const char *, const char *, const char *,
const char *, const char *, RCSCHECKOUTPROC, void *));
int RCS_checkin PROTO ((RCSNode *rcs, const char *workfile,
const char *message, const char *rev, int flags));
int RCS_cmp_file PROTO((RCSNode *, const char *, char **, const char *,
const char *, const char *));
int RCS_settag PROTO ((RCSNode *, const char *, const char *));
int RCS_deltag PROTO ((RCSNode *, const char *));
int RCS_setbranch PROTO((RCSNode *, const char *));
int RCS_lock PROTO ((RCSNode *, char *, int));
int RCS_lock PROTO ((RCSNode *, const char *, int));
int RCS_unlock PROTO ((RCSNode *, char *, int));
int RCS_delete_revs PROTO ((RCSNode *, char *, char *, int));
void RCS_addaccess PROTO ((RCSNode *, char *));
@ -238,14 +241,15 @@ void RCS_rewrite PROTO ((RCSNode *, Deltatext *, char *));
void RCS_abandon PROTO ((RCSNode *));
int rcs_change_text PROTO ((const char *, char *, size_t, const char *,
size_t, char **, size_t *));
void RCS_deltas PROTO ((RCSNode *, FILE *, struct rcsbuffer *, char *,
void RCS_deltas PROTO ((RCSNode *, FILE *, struct rcsbuffer *, const char *,
enum rcs_delta_op, char **, size_t *,
char **, size_t *));
char *make_file_label PROTO ((char *, char *, RCSNode *));
char *make_file_label PROTO ((const char *, const char *, RCSNode *));
extern int preserve_perms;
/* From import.c. */
extern int add_rcs_file PROTO ((char *, char *, char *, char *, char *,
char *, char *, int, char **,
char *, size_t, FILE *));
extern int add_rcs_file PROTO ((const char *, const char *, const char *,
const char *, const char *, const char *,
const char *, int, char **, const char *,
size_t, FILE *));

View File

@ -51,7 +51,8 @@
On a related note, see the comments at diff_exec, later in this file,
for more on the diff library. */
static void RCS_output_diff_options PROTO ((char *, char *, char *, char *));
static void RCS_output_diff_options PROTO ((const char *, const char *,
const char *, const char *));
/* Stuff to deal with passing arguments the way libdiff.a wants to deal
@ -74,7 +75,7 @@ static int call_diff_argc_allocated;
static void call_diff_add_arg PROTO ((const char *));
static void call_diff_setup PROTO ((const char *prog));
static int call_diff PROTO ((char *out));
static int call_diff PROTO ((const char *out));
static int call_diff3 PROTO ((char *out));
static void call_diff_write_output PROTO((const char *, size_t));
@ -204,9 +205,11 @@ static struct diff_callbacks call_diff_file_callbacks =
call_diff_error
};
static int
call_diff (out)
char *out;
const char *out;
{
if (out == RUN_TTY)
return diff_run (call_diff_argc, call_diff_argv, NULL,
@ -216,6 +219,8 @@ call_diff (out)
&call_diff_file_callbacks);
}
static int
call_diff3 (out)
char *out;
@ -235,11 +240,11 @@ call_diff3 (out)
int
RCS_merge(rcs, path, workfile, options, rev1, rev2)
RCSNode *rcs;
char *path;
char *workfile;
char *options;
char *rev1;
char *rev2;
const char *path;
const char *workfile;
const char *options;
const char *rev1;
const char *rev2;
{
char *xrev1, *xrev2;
char *tmp1, *tmp2;
@ -377,21 +382,21 @@ RCS_merge(rcs, path, workfile, options, rev1, rev2)
about this--any such features are undocumented in the context of
CVS, and I'm not sure how important to users. */
int
RCS_exec_rcsdiff( rcsfile, opts, options, rev1, rev1_cache, rev2,
label1, label2, workfile )
RCS_exec_rcsdiff(rcsfile, opts, options, rev1, rev1_cache, rev2,
label1, label2, workfile )
RCSNode *rcsfile;
char *opts;
char *options;
char *rev1;
char *rev1_cache;
char *rev2;
char *label1;
char *label2;
char *workfile;
const char *opts;
const char *options;
const char *rev1;
const char *rev1_cache;
const char *rev2;
const char *label1;
const char *label2;
const char *workfile;
{
char *tmpfile1 = NULL;
char *tmpfile2 = NULL;
char *use_file1, *use_file2;
const char *use_file1, *use_file2;
int status, retval;
@ -411,13 +416,13 @@ RCS file: ", 0);
cvs_output (rev1, 0);
cvs_output ("\n", 1);
if( rev1_cache != NULL )
if (rev1_cache != NULL)
use_file1 = rev1_cache;
else
{
tmpfile1 = cvs_temp_name();
status = RCS_checkout( rcsfile, NULL, rev1, NULL, options, tmpfile1,
(RCSCHECKOUTPROC)0, NULL );
status = RCS_checkout (rcsfile, NULL, rev1, NULL, options, tmpfile1,
(RCSCHECKOUTPROC)0, NULL);
if (status > 0)
{
retval = status;
@ -504,6 +509,7 @@ RCS file: ", 0);
}
/* Show differences between two files. This is the start of a diff library.
Some issues:
@ -540,12 +546,12 @@ RCS file: ", 0);
int
diff_exec (file1, file2, label1, label2, options, out)
char *file1;
char *file2;
char *label1;
char *label2;
char *options;
char *out;
const char *file1;
const char *file2;
const char *label1;
const char *label2;
const char *options;
const char *out;
{
char *args;
@ -606,10 +612,10 @@ diff_exec (file1, file2, label1, label2, options, out)
static void
RCS_output_diff_options (opts, rev1, rev2, workfile)
char *opts;
char *rev1;
char *rev2;
char *workfile;
const char *opts;
const char *rev1;
const char *rev2;
const char *workfile;
{
char *tmp;

View File

@ -94,7 +94,7 @@ release (argc, argv)
case 'q':
error (1, 0,
"-q or -Q must be specified before \"%s\"",
command_name);
cvs_cmd_name);
break;
case 'd':
delete_flag++;
@ -116,12 +116,17 @@ release (argc, argv)
* up to the user to take note of them, at least currently
* (ignore-193 in testsuite)).
*/
/* Construct the update command. */
/* Construct the update command. Be sure to add authentication and
encryption if we are using them currently, else our child process may
not be able to communicate with the server. */
update_cmd = xmalloc (strlen (program_path)
+ strlen (current_parsed_root->original)
+ 20);
sprintf (update_cmd, "%s -n -q -d %s update",
program_path, current_parsed_root->original);
+ strlen (current_parsed_root->original)
+ 1 + 3 + 3 + 16 + 1);
sprintf (update_cmd, "%s %s%s-n -q -d %s update",
program_path,
cvsauthenticate ? "-a " : "",
cvsencrypt ? "-x " : "",
current_parsed_root->original);
#ifdef CLIENT_SUPPORT
/* Start the server; we'll close it after looping. */
@ -216,7 +221,7 @@ release (argc, argv)
if (c) /* "No" */
{
(void) fprintf (stderr, "** `%s' aborted by user choice.\n",
command_name);
cvs_cmd_name);
free (repository);
if (restore_cwd (&cwd, NULL))
error_exit ();
@ -224,6 +229,17 @@ release (argc, argv)
}
}
/* Note: client.c doesn't like to have other code
changing the current directory on it. So a fair amount
of effort is needed to make sure it doesn't get confused
about the directory and (for example) overwrite
CVS/Entries file in the wrong directory. See release-17
through release-23. */
free (repository);
if (restore_cwd (&cwd, NULL))
exit (EXIT_FAILURE);
if (1
#ifdef CLIENT_SUPPORT
&& !(current_parsed_root->isremote
@ -232,13 +248,14 @@ release (argc, argv)
#endif
)
{
/* We are chdir'ed into the directory in question.
So don't pass args to unedit. */
int argc = 1;
int argc = 2;
char *argv[3];
argv[0] = "dummy";
argv[1] = NULL;
argv[1] = thisarg;
argv[2] = NULL;
err += unedit (argc, argv);
if (restore_cwd (&cwd, NULL))
exit (EXIT_FAILURE);
}
#ifdef CLIENT_SUPPORT
@ -255,11 +272,6 @@ release (argc, argv)
history_write ('F', thisarg, "", thisarg, ""); /* F == Free */
}
free (repository);
if (restore_cwd (&cwd, NULL))
error_exit ();
if (delete_flag)
{
/* FIXME? Shouldn't this just delete the CVS-controlled
@ -272,7 +284,17 @@ release (argc, argv)
#ifdef CLIENT_SUPPORT
if (current_parsed_root->isremote)
err += get_server_responses ();
{
/* FIXME:
* Is there a good reason why get_server_responses() isn't
* responsible for restoring its initial directory itself when
* finished?
*/
err += get_server_responses ();
if (restore_cwd (&cwd, NULL))
exit (EXIT_FAILURE);
}
#endif /* CLIENT_SUPPORT */
}

File diff suppressed because it is too large Load Diff

View File

@ -57,8 +57,9 @@ extern void server_pathname_check PROTO ((char *));
/* We have a new Entries line for a file. TAG or DATE can be NULL. */
extern void server_register
PROTO((char *name, char *version, char *timestamp,
char *options, char *tag, char *date, char *conflict));
PROTO((const char *name, const char *version, const char *timestamp,
const char *options, const char *tag, const char *date,
const char *conflict));
/* Set the modification time of the next file sent. This must be
followed by a call to server_updated on the same file. */
@ -69,7 +70,7 @@ extern void server_modtime PROTO ((struct file_info *finfo,
* We want to nuke the Entries line for a file, and (unless
* server_scratch_entry_only is subsequently called) the file itself.
*/
extern void server_scratch PROTO((char *name));
extern void server_scratch PROTO((const char *name));
/*
* The file which just had server_scratch called on it needs to have only
@ -83,10 +84,11 @@ extern void server_scratch_entry_only PROTO((void));
* repository.
*/
extern void server_checked_in
PROTO((char *file, char *update_dir, char *repository));
PROTO((const char *file, const char *update_dir, const char *repository));
extern void server_copy_file
PROTO((char *file, char *update_dir, char *repository, char *newfile));
PROTO((const char *file, const char *update_dir, const char *repository,
const char *newfile));
/* Send the appropriate responses for a file described by FINFO and
VERS. This is called after server_register or server_scratch. In
@ -121,18 +123,21 @@ extern void server_updated
extern int server_use_rcs_diff PROTO((void));
/* Set the Entries.Static flag. */
extern void server_set_entstat PROTO((char *update_dir, char *repository));
extern void server_set_entstat PROTO((const char *update_dir,
const char *repository));
/* Clear it. */
extern void server_clear_entstat PROTO((char *update_dir, char *repository));
extern void server_clear_entstat PROTO((const char *update_dir,
const char *repository));
/* Set or clear a per-directory sticky tag or date. */
extern void server_set_sticky PROTO((char *update_dir, char *repository,
char *tag, char *date, int nonbranch));
extern void server_set_sticky PROTO((const char *update_dir,
const char *repository, const char *tag,
const char *date, int nonbranch));
/* Send Template response. */
extern void server_template PROTO ((char *, char *));
extern void server_template PROTO ((const char *, const char *));
extern void server_update_entries
PROTO((char *file, char *update_dir, char *repository,
PROTO((const char *file, const char *update_dir, const char *repository,
enum server_updated_arg4 updated));
/* Pointer to a malloc'd string which is the directory which
@ -193,5 +198,5 @@ extern struct request requests[];
/* Gzip library, see zlib.c. */
extern int gunzip_and_write PROTO ((int, char *, unsigned char *, size_t));
extern int read_and_gzip PROTO ((int, char *, unsigned char **, size_t *,
size_t *, int));
extern int read_and_gzip PROTO ((int, const char *, unsigned char **, size_t *,
size_t *, int));

187
gnu/dist/cvs/src/stack.c vendored Normal file
View File

@ -0,0 +1,187 @@
/*
* Copyright (c) 2004, Free Software Foundation,
* Derek Price,
* & Ximbiot <http://ximbiot.com>.
*
* You may distribute under the terms of the GNU General Public License as
* specified in the README file that comes with the CVS source distribution.
*
* This module uses the hash.c module to implement a stack.
*/
#include "cvs.h"
#include <assert.h>
static void
do_push (stack, elem, isstring)
List *stack;
void *elem;
int isstring;
{
Node *p = getnode();
if (isstring)
p->key = elem;
else
p->data = elem;
addnode(stack, p);
}
void
push (stack, elem)
List *stack;
void *elem;
{
do_push (stack, elem, 0);
}
void
push_string (stack, elem)
List *stack;
char *elem;
{
do_push (stack, elem, 1);
}
static void *
do_pop (stack, isstring)
List *stack;
int isstring;
{
void *elem;
if (isempty (stack)) return NULL;
if (isstring)
{
elem = stack->list->prev->key;
stack->list->prev->key = NULL;
}
else
{
elem = stack->list->prev->data;
stack->list->prev->data = NULL;
}
delnode (stack->list->prev);
return elem;
}
void *
pop (stack)
List *stack;
{
return do_pop (stack, 0);
}
char *
pop_string (stack)
List *stack;
{
return do_pop (stack, 1);
}
static void
do_unshift (stack, elem, isstring)
List *stack;
void *elem;
int isstring;
{
Node *p = getnode();
if (isstring)
p->key = elem;
else
p->data = elem;
addnode_at_front(stack, p);
}
void
unshift (stack, elem)
List *stack;
void *elem;
{
do_unshift (stack, elem, 0);
}
void
unshift_string (stack, elem)
List *stack;
char *elem;
{
do_unshift (stack, elem, 1);
}
static void *
do_shift (stack, isstring)
List *stack;
int isstring;
{
void *elem;
if (isempty (stack)) return NULL;
if (isstring)
{
elem = stack->list->next->key;
stack->list->next->key = NULL;
}
else
{
elem = stack->list->next->data;
stack->list->next->data = NULL;
}
delnode (stack->list->next);
return elem;
}
void *
shift (stack)
List *stack;
{
return do_shift (stack, 0);
}
char *
shift_string (stack)
List *stack;
{
return do_shift (stack, 1);
}
int
isempty (stack)
List *stack;
{
if (stack->list == stack->list->next)
return 1;
return 0;
}

18
gnu/dist/cvs/src/stack.h vendored Normal file
View File

@ -0,0 +1,18 @@
/*
* Copyright (c) 2004, Free Software Foundation,
* Derek Price,
* & Ximbiot <http://ximbiot.com>.
*
* You may distribute under the terms of the GNU General Public License as
* specified in the README file that comes with the CVS source distribution.
*/
void push PROTO((List *_stack, void *_elem));
void *pop PROTO((List *_stack));
void unshift PROTO((List *_stack, void *_elem));
void *shift PROTO((List *_stack));
void push_string PROTO((List *_stack, char *_elem));
char *pop_string PROTO((List *_stack));
void unshift_string PROTO((List *_stack, char *_elem));
char *shift_string PROTO((List *_stack));
int isempty PROTO((List *_stack));

View File

@ -10,8 +10,8 @@
#include "cvs.h"
static Dtype status_dirproc PROTO ((void *callerdat, char *dir,
char *repos, char *update_dir,
static Dtype status_dirproc PROTO ((void *callerdat, const char *dir,
const char *repos, const char *update_dir,
List *entries));
static int status_fileproc PROTO ((void *callerdat, struct file_info *finfo));
static int tag_list_proc PROTO((Node * p, void *closure));
@ -323,9 +323,9 @@ status_fileproc (callerdat, finfo)
static Dtype
status_dirproc (callerdat, dir, repos, update_dir, entries)
void *callerdat;
char *dir;
char *repos;
char *update_dir;
const char *dir;
const char *repos;
const char *update_dir;
List *entries;
{
if (!quiet)
@ -351,7 +351,7 @@ tag_list_proc (p, closure)
+ (branch ? strlen (branch) : strlen (p->data)));
sprintf (buf, "\t%-25s\t(%s: %s)\n", p->key,
branch ? "branch" : "revision",
branch ? branch : p->data);
branch ? branch : (char *)p->data);
cvs_output (buf, 0);
free (buf);

View File

@ -16,4 +16,4 @@ int do_update PROTO((int argc, char *argv[], char *xoptions, char *xtag,
char *xjoin_rev1, char *xjoin_rev2, char *preload_update_dir,
int xdotemplate, char *repository));
int joining PROTO((void));
extern int isemptydir PROTO ((char *dir, int might_not_exist));
extern int isemptydir PROTO ((const char *dir, int might_not_exist));

View File

@ -9,9 +9,11 @@
#include "cvs.h"
#ifdef SERVER_SUPPORT
static void time_stamp_server PROTO((char *, Vers_TS *, Entnode *));
static void time_stamp_server PROTO((const char *, Vers_TS *, Entnode *));
#endif
/* Fill in and return a Vers_TS structure for the file FINFO. TAG and
DATE are from the command line. */
@ -55,13 +57,13 @@ Version_TS (finfo, options, tag, date, force_tag_match, set_time)
else
{
p = findnode_fn (finfo->entries, finfo->file);
sdtp = (struct stickydirtag *) finfo->entries->list->data; /* list-private */
sdtp = finfo->entries->list->data; /* list-private */
}
entdata = NULL;
if (p != NULL)
{
entdata = (Entnode *) p->data;
entdata = p->data;
if (entdata->type == ENT_SUBDIR)
{
@ -260,7 +262,7 @@ Version_TS (finfo, options, tag, date, force_tag_match, set_time)
static void
time_stamp_server (file, vers_ts, entdata)
char *file;
const char *file;
Vers_TS *vers_ts;
Entnode *entdata;
{
@ -326,7 +328,7 @@ time_stamp_server (file, vers_ts, entdata)
*/
char *
time_stamp (file)
char *file;
const char *file;
{
struct stat sb;
char *cp;

View File

@ -33,7 +33,7 @@ static struct addremove_args the_args;
void
watch_modify_watchers (file, what)
char *file;
const char *file;
struct addremove_args *what;
{
char *curattr = fileattr_get0 (file, "_watchers");
@ -226,15 +226,17 @@ addremove_fileproc (callerdat, finfo)
return 0;
}
static int addremove_filesdoneproc PROTO ((void *, int, char *, char *,
List *));
static int addremove_filesdoneproc PROTO ((void *, int, const char *,
const char *, List *));
static int
addremove_filesdoneproc (callerdat, err, repository, update_dir, entries)
void *callerdat;
int err;
char *repository;
char *update_dir;
const char *repository;
const char *update_dir;
List *entries;
{
if (the_args.setting_default)

View File

@ -45,7 +45,7 @@ struct addremove_args {
/* Modify the watchers for FILE. *WHAT tells what to do to them.
If FILE is NULL, modify default args (WHAT->SETTING_DEFAULT is
not used). */
extern void watch_modify_watchers PROTO ((char *file,
extern void watch_modify_watchers PROTO ((const char *file,
struct addremove_args *what));
extern int watch_add PROTO ((int argc, char **argv));

View File

@ -431,6 +431,20 @@ compress_buffer_shutdown_output (buf)
/* Here is our librarified gzip implementation. It is very minimal
but attempts to be RFC1952 compliant. */
/* GZIP ID byte values */
#define GZIP_ID1 31
#define GZIP_ID2 139
/* Compression methods */
#define GZIP_CDEFLATE 8
/* Flags */
#define GZIP_FTEXT 1
#define GZIP_FHCRC 2
#define GZIP_FEXTRA 4
#define GZIP_FNAME 8
#define GZIP_FCOMMENT 16
/* BUF should contain SIZE bytes of gzipped data (RFC1952/RFC1951).
We are to uncompress the data and write the result to the file
descriptor FD. If something goes wrong, give a nonfatal error message
@ -450,28 +464,78 @@ gunzip_and_write (fd, fullname, buf, size)
unsigned char outbuf[32768];
unsigned long crc;
if (buf[0] != 31 || buf[1] != 139)
if (size < 10)
{
error (0, 0, "gzipped data too small - lacks complete header");
return 1;
}
if (buf[0] != GZIP_ID1 || buf[1] != GZIP_ID2)
{
error (0, 0, "gzipped data does not start with gzip identification");
return 1;
}
if (buf[2] != 8)
if (buf[2] != GZIP_CDEFLATE)
{
error (0, 0, "only the deflate compression method is supported");
return 1;
}
/* Skip over the fixed header, and then skip any of the variable-length
fields. */
fields. As we skip each field, we keep pos <= size. The checks
on positions and lengths are really checks for malformed or
incomplete gzip data. */
pos = 10;
if (buf[3] & 4)
if (buf[3] & GZIP_FEXTRA)
{
if (pos + 2 >= size)
{
error (0, 0, "%s lacks proper gzip XLEN field", fullname);
return 1;
}
pos += buf[pos] + (buf[pos + 1] << 8) + 2;
if (buf[3] & 8)
pos += strlen ((char *) buf + pos) + 1;
if (buf[3] & 16)
pos += strlen ((char *) buf + pos) + 1;
if (buf[3] & 2)
if (pos > size)
{
error (0, 0, "%s lacks proper gzip \"extra field\"", fullname);
return 1;
}
}
if (buf[3] & GZIP_FNAME)
{
unsigned char *p = memchr(buf + pos, '\0', size - pos);
if (p == NULL)
{
error (0, 0, "%s has bad gzip filename field", fullname);
return 1;
}
pos = p - buf + 1;
}
if (buf[3] & GZIP_FCOMMENT)
{
unsigned char *p = memchr(buf + pos, '\0', size - pos);
if (p == NULL)
{
error (0, 0, "%s has bad gzip comment field", fullname);
return 1;
}
pos = p - buf + 1;
}
if (buf[3] & GZIP_FHCRC)
{
pos += 2;
if (pos > size)
{
error (0, 0, "%s has bad gzip CRC16 field", fullname);
return 1;
}
}
/* There could be no data to decompress - check and short circuit. */
if (pos >= size)
{
error (0, 0, "gzip data incomplete for %s (no data)", fullname);
return 1;
}
memset (&zstr, 0, sizeof zstr);
/* Passing a negative argument tells zlib not to look for a zlib
@ -513,19 +577,29 @@ gunzip_and_write (fd, fullname, buf, size)
if (zstatus != Z_OK)
compress_error (0, zstatus, &zstr, fullname);
if (crc != (buf[zstr.total_in + 10]
+ (buf[zstr.total_in + 11] << 8)
+ (buf[zstr.total_in + 12] << 16)
+ (buf[zstr.total_in + 13] << 24)))
/* Check that there is still 8 trailer bytes remaining (CRC32
and ISIZE). Check total decomp. data, plus header len (pos)
against input buffer total size. */
pos += zstr.total_in;
if (size - pos != 8)
{
error (0, 0, "gzip data incomplete for %s (no trailer)", fullname);
return 1;
}
if (crc != ((unsigned long)buf[pos]
+ ((unsigned long)buf[pos + 1] << 8)
+ ((unsigned long)buf[pos + 2] << 16)
+ ((unsigned long)buf[pos + 3] << 24)))
{
error (0, 0, "CRC error uncompressing %s", fullname);
return 1;
}
if (zstr.total_out != (buf[zstr.total_in + 14]
+ (buf[zstr.total_in + 15] << 8)
+ (buf[zstr.total_in + 16] << 16)
+ (buf[zstr.total_in + 17] << 24)))
if (zstr.total_out != ((unsigned long)buf[pos + 4]
+ ((unsigned long)buf[pos + 5] << 8)
+ ((unsigned long)buf[pos + 6] << 16)
+ ((unsigned long)buf[pos + 7] << 24)))
{
error (0, 0, "invalid length uncompressing %s", fullname);
return 1;
@ -544,7 +618,7 @@ gunzip_and_write (fd, fullname, buf, size)
int
read_and_gzip (fd, fullname, buf, size, len, level)
int fd;
char *fullname;
const char *fullname;
unsigned char **buf;
size_t *size;
size_t *len;
@ -569,9 +643,9 @@ read_and_gzip (fd, fullname, buf, size, len, level)
}
*buf = newbuf;
}
(*buf)[0] = 31;
(*buf)[1] = 139;
(*buf)[2] = 8;
(*buf)[0] = GZIP_ID1;
(*buf)[1] = GZIP_ID2;
(*buf)[2] = GZIP_CDEFLATE;
(*buf)[3] = 0;
(*buf)[4] = (*buf)[5] = (*buf)[6] = (*buf)[7] = 0;
/* Could set this based on level, but why bother? */
@ -587,7 +661,10 @@ read_and_gzip (fd, fullname, buf, size, len, level)
compress_error (0, zstatus, &zstr, fullname);
return 1;
}
zstr.avail_out = *size;
/* Adjust for 10-byte output header (filled in above) */
zstr.total_out = 10;
zstr.avail_out = *size - 10;
zstr.next_out = *buf + 10;
while (1)
@ -609,8 +686,6 @@ read_and_gzip (fd, fullname, buf, size, len, level)
do
{
size_t offset;
/* I don't see this documented anywhere, but deflate seems
to tend to dump core sometimes if we pass it Z_FINISH and
a small (e.g. 2147 byte) avail_out. So we insist on at
@ -620,7 +695,8 @@ read_and_gzip (fd, fullname, buf, size, len, level)
{
unsigned char *newbuf;
offset = zstr.next_out - *buf;
assert(zstr.avail_out + zstr.total_out == *size);
assert(zstr.next_out == *buf + zstr.total_out);
*size *= 2;
newbuf = xrealloc (*buf, *size);
if (newbuf == NULL)
@ -629,8 +705,10 @@ read_and_gzip (fd, fullname, buf, size, len, level)
return 1;
}
*buf = newbuf;
zstr.next_out = *buf + offset;
zstr.avail_out = *size - offset;
zstr.next_out = *buf + zstr.total_out;
zstr.avail_out = *size - zstr.total_out;
assert(zstr.avail_out + zstr.total_out == *size);
assert(zstr.next_out == *buf + zstr.total_out);
}
zstatus = deflate (&zstr, finish ? Z_FINISH : 0);
@ -641,17 +719,45 @@ read_and_gzip (fd, fullname, buf, size, len, level)
} while (zstr.avail_out == 0);
}
done:
*(*buf + zstr.total_out + 10) = crc & 0xff;
*(*buf + zstr.total_out + 11) = (crc >> 8) & 0xff;
*(*buf + zstr.total_out + 12) = (crc >> 16) & 0xff;
*(*buf + zstr.total_out + 13) = (crc >> 24) & 0xff;
/* Need to add the CRC information (8 bytes)
to the end of the gzip'd output.
Ensure there is enough space in the output buffer
to do so. */
if (zstr.avail_out < 8)
{
unsigned char *newbuf;
*(*buf + zstr.total_out + 14) = zstr.total_in & 0xff;
*(*buf + zstr.total_out + 15) = (zstr.total_in >> 8) & 0xff;
*(*buf + zstr.total_out + 16) = (zstr.total_in >> 16) & 0xff;
*(*buf + zstr.total_out + 17) = (zstr.total_in >> 24) & 0xff;
assert(zstr.avail_out + zstr.total_out == *size);
assert(zstr.next_out == *buf + zstr.total_out);
*size += 8 - zstr.avail_out;
newbuf = realloc (*buf, *size);
if (newbuf == NULL)
{
error (0, 0, "out of memory");
return 1;
}
*buf = newbuf;
zstr.next_out = *buf + zstr.total_out;
zstr.avail_out = *size - zstr.total_out;
assert(zstr.avail_out + zstr.total_out == *size);
assert(zstr.next_out == *buf + zstr.total_out);
}
*zstr.next_out++ = (unsigned char)(crc & 0xff);
*zstr.next_out++ = (unsigned char)((crc >> 8) & 0xff);
*zstr.next_out++ = (unsigned char)((crc >> 16) & 0xff);
*zstr.next_out++ = (unsigned char)((crc >> 24) & 0xff);
*len = zstr.total_out + 18;
*zstr.next_out++ = (unsigned char)(zstr.total_in & 0xff);
*zstr.next_out++ = (unsigned char)((zstr.total_in >> 8) & 0xff);
*zstr.next_out++ = (unsigned char)((zstr.total_in >> 16) & 0xff);
*zstr.next_out++ = (unsigned char)((zstr.total_in >> 24) & 0xff);
zstr.total_out += 8;
zstr.avail_out -= 8;
assert(zstr.avail_out + zstr.total_out == *size);
assert(zstr.next_out == *buf + zstr.total_out);
*len = zstr.total_out;
zstatus = deflateEnd (&zstr);
if (zstatus != Z_OK)