merge conflicts.

XXX: hack configure so that it works with the removal with the tools and
other os's. Perhaps in the future we should not do such cleanup.
This commit is contained in:
christos 2006-06-23 22:44:10 +00:00
parent 88d4285ac6
commit 831d7fa82a
24 changed files with 642 additions and 365 deletions

View File

@ -1,133 +1,48 @@
2006-06-07 Mark D. Baushke <mdb@gnu.org>
2006-06-09 Derek Price <derek@ximbiot.com>
* modules.c (my_module): Remove unused variable xvalue.
[Fixes NetBSD coverity cid-705.]
* NEWS: Note client/server conflict fix.
2006-05-31 Mark D. Baushke <mdb@gnu.org>
2006-05-25 Derek Price <derek@ximbiot.com>
* add.c (add): Fix memory leak.
[Fixes NetBSD coverity cid-3751.]
(add_directory): Fix memory leak.
[Fixes NetBSD coverity cid-3640.]
* configure.in: Accept --with-rsh argument to set RSH_DFLT in config.h.
Prefer `remsh' to `rsh' when autodetecting and comment rationale.
* commit.c (remove_file): Fix memory leak.
[Fixes NetBSD coverity cid-3752.]
2006-04-27 Derek Price <derek@ximbiot.com>
* checkin.c (Checkin): Avoid possible NULL dereference.
[Fixes NetBSD coverity cid-2425.]
* acinclude.m4 (ACX_WITH_GSSAPI): Detect libgss for HP-UX.
* NEWS: Note that GSSAPI builds under HP-UX.
(Report from Larry Jones <lawrence.jones@ugs.com>.)
* client.c (auth_server): Fix memory leak.
[Fixes NetBSD coverity cid-3404.]
2006-03-07 Derek Price <derek@ximbiot.com>
* rcs.c (RCS_checkin): Add assert (tip).
[Fixes NetBSD coverity cid-2424.]
* NEWS: Note rtag fixes.
2006-05-25 Mark D. Baushke <mdb@gnu.org>
2006-02-26 Derek Price <derek@ximbiot.com>
* add.c (add): Do not leak memory.
[Fixes NetBSD coverity cid-2199.]
* NEWS: Note CVSADM fix as an efficiency improvement.
* edit.c (onoff_fileproc): Do not leak memory.
[Fixes NetBSD coverity cid-2201.]
2006-02-01 Derek Price <derek@ximbiot.com>
* edit.c (onoff_filesdoneproc): Do not leak memory.
[Fixes NetBSD coverity cid-2202.]
* NEWS: Note unconditional val-tags lock removal.
* lock.c (readers_exist): Add assert (lockdir).
[Fixes NetBSD coverity cid-2411.]
* NEWS: Note history buffer overflow fix.
* rcs.c (RCS_findlock_or_tip): Do not leak memory.
[Fixes NetBSD coverity cid-2198.]
2006-01-30 Derek Price <derek@ximbiot.com>
* rcs.c (RCS_getdate): Avoid possible NULL dereference.
[Fixes NetBSD coverity cid-2412.]
* NEWS: Note nonblocking flow control pipe fix.
* server.c (serve_sticky): Do not leak file descriptors.
[Fixes NetBSD coverity cid-2197.]
2005-12-09 Derek Price <derek@ximbiot.com>
* server.c (do_cvs_command): Do not leak memory.
[Fixes NetBSD coverity cid-2204.]
* server.c (do_cvs_command): Protect close (dev_null_fd) against
invalid fd value in error_exit.
[Fixes NetBSD coverity cid-1307.]
* NEWS: Note misc doc & bug fixes.
* tag.c (add_to_val_tags): Do not leak memory. Be sure to
clear_val_tags_lock before returning.
[Fixes NetBSD coverity cid-2071.]
2005-12-07 Derek Price <derek@ximbiot.com>
2006-05-12 Mark D. Baushke <mdb@gnu.org>
* NEWS: Note recognition of :extssh:.
* rcs.c (RCS_isdead): Assert that the first argument is not NULL.
[Fixes NetBSD cid-1058.]
2005-10-18 Derek Price <derek@ximbiot.com>
* commit.c (checkaddfile): Do not dereference NULL on call to
error().
[Fixes NetBSD cid-1061.]
* log.c (cvslog): Assert p->start && p->end instead of masking the
problem.
* server.c (server_updated): Assert findnode_fn results instead of
masking the problem.
* add.c (add_directory): Revert previous change. The xstrdup()
function already deals a NULL argument.
* client.c (handle_mt): Ditto.
* entries.c (Entnode_Create): Ditto.
(Entries_Open): Ditto.
* logmsg.c (fmt_proc): Ditto.
* vers_ts.c (Version_TS): Ditto.
2006-05-11 Mark D. Baushke <mdb@gnu.org>
* add.c (add_directory): Protect tag from NULL dereference.
[Fixes NetBSD cid-1054.]
* client.c (handle_mt): Deal with missing text argument.
[Fixes NetBSD cid-924.]
* entries.c (Entnode_Create): Protect date, tag and ts_conflict
from possible NULL dereference.
[Fixes NetBSD coverity cid-994, cid-995, cid-1055, cid-1057.]
* entries.c (Entries_Open): Protect dirtag and dirdate from
possible NULL dereference.
[Fixes NetBSD coverity cid-996.]
* log.c (cvslog): Validate start and end args to
date_to_internet().
[Fixes NetBSD coverity cid-2427 and cid-2428.]
* logmsg.c (fmt_proc): Protect li->tag from NULL dereference.
[Fixes NetBSD coverity cid-997.]
* vers_ts.c (Version_TS): Protect tag and vers_ts->tag from NULL
dereference.
[Fixes NetBSD coverity cid-1053.]
2006-05-04 Mark D. Baushke <mdb@gnu.org>
* filesubr.c (cvs_temp_file): Avoid keeping pointers to free()'d
storage laying around.
* commit.c (commit): Handle possible NULL filename values
returned from cvs_temp_file().
* filesubr.c (cvs_temp_name): Ditto.
* import.c (import): Ditto.
* login.c (password_entry_operation): Ditto.
* logmsg.c (do_verify): Ditto.
* patch.c (patch_fileproc): Ditto.
[Fixes NetBSD coverity cid-2545.]
* buffer.c (packetizing_buffer_output): Initialize outdata.
[Fixes NetBSD coverity cid-2474.]
* server.c (server_updated): Fix NetBSD coverity cid-1352
NetBSD-sparc64 of 2006-May-02 03:02:46.
* server.c (server_updated): Fix NetBSD coverity cid-1352
NetBSD-sparc64 of 2006-May-02 03:02:46.
2005-09-26 Conrad T. Pino <Conrad@Pino.com>
* rcs.c: Use "#ifdef HAVE_FSYNC" just like every where else.
* KEYS: New file, suggested by Antoine Lexy-Lambert <antoine@gmx.de>.
* README: Mention KEYS file.
2005-09-26 Derek Price <derek@ximbiot.com>

View File

@ -13277,10 +13277,9 @@ fi
ac_config_files="$ac_config_files src/cvsbug"
ac_config_files="$ac_config_files windows-NT/fix-msvc-mak:windows-NT/fix-msvc-mak-head.pl:windows-NT/fix-msvc-mak.pl"
ac_config_files="$ac_config_files Makefile contrib/Makefile cvs.spec diff/Makefile doc/Makefile emx/Makefile lib/Makefile man/Makefile os2/Makefile src/Makefile tools/Makefile vms/Makefile windows-NT/Makefile windows-NT/SCC/Makefile zlib/Makefile"
ac_config_files="$ac_config_files Makefile contrib/Makefile cvs.spec diff/Makefile doc/Makefile lib/Makefile man/Makefile src/Makefile"
cat >confcache <<\_ACEOF
@ -13863,22 +13862,14 @@ do
"contrib/sccs2rcs" ) CONFIG_FILES="$CONFIG_FILES contrib/sccs2rcs" ;;
"doc/mkman" ) CONFIG_FILES="$CONFIG_FILES doc/mkman:doc/mkman.pl" ;;
"src/cvsbug" ) CONFIG_FILES="$CONFIG_FILES src/cvsbug" ;;
"windows-NT/fix-msvc-mak" ) CONFIG_FILES="$CONFIG_FILES windows-NT/fix-msvc-mak:windows-NT/fix-msvc-mak-head.pl:windows-NT/fix-msvc-mak.pl" ;;
"Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"contrib/Makefile" ) CONFIG_FILES="$CONFIG_FILES contrib/Makefile" ;;
"cvs.spec" ) CONFIG_FILES="$CONFIG_FILES cvs.spec" ;;
"diff/Makefile" ) CONFIG_FILES="$CONFIG_FILES diff/Makefile" ;;
"doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
"emx/Makefile" ) CONFIG_FILES="$CONFIG_FILES emx/Makefile" ;;
"lib/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;;
"man/Makefile" ) CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;
"os2/Makefile" ) CONFIG_FILES="$CONFIG_FILES os2/Makefile" ;;
"src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
"tools/Makefile" ) CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;;
"vms/Makefile" ) CONFIG_FILES="$CONFIG_FILES vms/Makefile" ;;
"windows-NT/Makefile" ) CONFIG_FILES="$CONFIG_FILES windows-NT/Makefile" ;;
"windows-NT/SCC/Makefile" ) CONFIG_FILES="$CONFIG_FILES windows-NT/SCC/Makefile" ;;
"zlib/Makefile" ) CONFIG_FILES="$CONFIG_FILES zlib/Makefile" ;;
"lib/fnmatch.h" ) CONFIG_LINKS="$CONFIG_LINKS lib/fnmatch.h:lib/fnmatch.h.in" ;;
"depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
"config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
@ -14286,7 +14277,6 @@ s,@INSTALL@,$ac_INSTALL,;t t
contrib/sccs2rcs ) chmod +x contrib/sccs2rcs ;;
doc/mkman ) chmod +x doc/mkman ;;
src/cvsbug ) chmod +x src/cvsbug ;;
windows-NT/fix-msvc-mak ) chmod +x windows-NT/fix-msvc-mak ;;
esac
done
_ACEOF

View File

@ -1,17 +0,0 @@
Makefile
check_cvs
clmerge
cln_hist
commit_prep
cvs2vendor
cvs_acls
cvscheck
debug_check_log
log
log_accum
mfpipe
pvcs2rcs
rcs-to-cvs
rcs2log
rcslock
sccs2rcs

View File

@ -1,4 +0,0 @@
.deps
Makefile
WinDebug
WinRel

View File

@ -1,40 +0,0 @@
*.dvi
Makefile
cvs-paper.pdf
cvs-paper.ps
cvs.aux
cvs.cp
cvs.cps
cvs.dvi
cvs.fn
cvs.fns
cvs.info
cvs.info-*
cvs.ky
cvs.log
cvs.pdf
cvs.pg
cvs.ps
cvs.tmp
cvs.toc
cvs.tp
cvs.txt
cvs.vr
cvsclient.info
cvsclient.aux
cvsclient.cp
cvsclient.cps
cvsclient.dvi
cvsclient.fn
cvsclient.info
cvsclient.info-*
cvsclient.ky
cvsclient.log
cvsclient.pdf
cvsclient.pg
cvsclient.ps
cvsclient.toc
cvsclient.tp
cvsclient.txt
cvsclient.vr
mkman

View File

@ -1,7 +0,0 @@
.deps
.pure
Makefile
fnmatch.h
getdate
WinDebug
WinRel

View File

@ -1 +0,0 @@
Makefile

View File

@ -1,9 +0,0 @@
.deps
.pure
Makefile
TAGS
check.log
check.plog
cvs
cvsbug
mkmodules

View File

@ -1,21 +1,325 @@
2006-06-08 Derek Price <derek@ximbiot.com>
* sanity.sh (conflicts4): Test that the client honors Empty-conflicts.
* server.c (requests): Add "Empty-conflicts" marker.
* client.c (send_fileproc): Send contents of all files with conflicts
unless the server can handle the conflict marker in the Entry.
* sanity.sh (conflicts4): New tests.
(Original patch from Mark D. Baushke <mdb@gnu.org>.)
2006-06-07 Mark D. Baushke <mdb@gnu.org>
* modules.c (my_module): Remove unused variable xvalue.
[Fixes NetBSD coverity cid-705.]
2006-05-31 Mark D. Baushke <mdb@gnu.org>
* add.c (add): Fix memory leak.
[Fixes NetBSD coverity cid-3751.]
(add_directory): Fix memory leak.
[Fixes NetBSD coverity cid-3640.]
* checkin.c (Checkin): Avoid possible NULL dereference.
[Fixes NetBSD coverity cid-2425.]
* client.c (auth_server): Fix memory leak.
[Fixes NetBSD coverity cid-3404.]
* commit.c (remove_file): Fix memory leak.
[Fixes NetBSD coverity cid-3752.]
* rcs.c (RCS_checkin): Add assert (tip).
[Fixes NetBSD coverity cid-2424.]
2006-05-26 Mark D. Baushke <mdb@gnu.org>
* add.c (add): Do not leak memory.
[Fixes NetBSD coverity cid-2199.]
* edit.c (onoff_fileproc): Do not leak memory.
[Fixes NetBSD coverity cid-2201.]
* edit.c (onoff_filesdoneproc): Do not leak memory.
[Fixes NetBSD coverity cid-2202.]
* lock.c (readers_exist): Add assert (lockdir).
[Fixes NetBSD coverity cid-2411.]
* rcs.c (RCS_findlock_or_tip): Do not leak memory.
[Fixes NetBSD coverity cid-2198.]
* rcs.c (RCS_getdate): Avoid possible NULL dereference.
[Fixes NetBSD coverity cid-2412.]
* server.c (serve_sticky): Do not leak file descriptors.
[Fixes NetBSD coverity cid-2197.]
* server.c (do_cvs_command): Do not leak memory.
[Fixes NetBSD coverity cid-2204.]
* tag.c (add_to_val_tags): Do not leak memory.
[Fixes NetBSD coverity cid-2071.]
2006-05-25 Derek Price <derek@ximbiot.com>
* client.c (start_rsh_server): Default rsh client to RSH_DFLT. Remove
verbose comment attempting to justify the previous default.
2006-05-24 Larry Jones <lawrence.jones@ugs.com>
* sanity.sh: Add -v|--verbose option to echo test names. Clean
up help message.
Remove val-tags files for cleanup instead of truncating since the
truncation code doesn't work right on Solaris. Always use -f when
removing val-tags.
2006-05-22 Derek Price <derek@ximbiot.com>
* rcs.c (RCS_reparsercsfile, RCS_fully_parse, RCS_checkout, RCS_deltas,
RCS_getdeltatext, RCS_copydeltas): Verify input revision numbers.
(rcs6): Update to compensate.
* sanity.sh (rcs6): New test.
2006-05-16 Derek Price <derek@ximbiot.com>
* main.c: Update copyright for 2006.
2006-05-12 Mark D. Baushke <mdb@gnu.org>
* log.c (log_expand_revlist): Add assert (r->first). It should
only be possible for both r->first == NULL && r->last == NULL
which would have been handled.
[Fixes NetBSD coverity cid-1063.]
* server.c (do_cvs_command): Protect close (dev_null_fd) against
invalid fd value in error_exit.
[Fixes NetBSD coverity cid-1307.]
* rcs.c (RCS_isdead): Assert that the first argument is not NULL.
[Fixes NetBSD coverity cid-1058.]
* commit.c (checkaddfile): Do not dereference NULL on call to
error().
[Fixes NetBSD coverity cid-1061.]
* log.c (cvslog): Assert p->start && p->end instead of masking the
problem.
* server.c (server_updated): Assert findnode_fn results instead of
masking the problem.
* add.c (add_directory): Revert previous change. The xstrdup()
function already deals a NULL argument.
* client.c (handle_mt): Ditto.
* entries.c (Entnode_Create): Ditto.
(Entries_Open): Ditto.
* logmsg.c (fmt_proc): Ditto.
* vers_ts.c (Version_TS): Ditto.
2006-05-11 Mark D. Baushke <mdb@gnu.org>
* add.c (add_directory): Protect tag from NULL dereference.
[Fixes NetBSD cid-1054.]
* client.c (handle_mt): Deal with missing text argument.
[Fixes NetBSD cid-924.]
* entries.c (Entnode_Create): Protect date, tag and ts_conflict
from possible NULL dereference.
[Fixes NetBSD coverity cid-994, cid-995, cid-1055, cid-1057.]
* entries.c (Entries_Open): Protect dirtag and dirdate from
possible NULL dereference.
[Fixes NetBSD coverity cid-996.]
* log.c (cvslog): Validate start and end args to
date_to_internet().
[Fixes NetBSD coverity cid-2427 and cid-2428.]
* logmsg.c (fmt_proc): Protect li->tag from NULL dereference.
[Fixes NetBSD coverity cid-997.]
* vers_ts.c (Version_TS): Protect tag and vers_ts->tag from NULL
dereference.
[Fixes NetBSD coverity cid-1053.]
2006-05-04 Mark D. Baushke <mdb@gnu.org>
* filesubr.c (cvs_temp_file): Avoid keeping pointers to free()'d
storage laying around.
* commit.c (commit): Handle possible NULL filename values
returned from cvs_temp_file().
* filesubr.c (cvs_temp_name): Ditto.
* import.c (import): Ditto.
* login.c (password_entry_operation): Ditto.
* logmsg.c (do_verify): Ditto.
* patch.c (patch_fileproc): Ditto.
[Fixes NetBSD coverity cid-2545.]
* filesubr.c (cvs_temp_file): Avoid keeping pointers to free()'d
storage laying around.
* commit.c (commit): Handle possible NULL filename values
returned from cvs_temp_file().
* filesubr.c (cvs_temp_name): Ditto.
* import.c (import): Ditto.
* login.c (password_entry_operation): Ditto.
* logmsg.c (do_verify): Ditto.
* patch.c (patch_fileproc): Ditto.
[Fixes NetBSD coverity cid-2545.]
* buffer.c (packetizing_buffer_output): Initialize outdata.
[Fixes NetBSD coverity cid-2474.]
* buffer.c (packetizing_buffer_output): Initialize outdata.
[Fixes NetBSD coverity cid-2474.]
* server.c (server_updated): Fix NetBSD coverity cid-1352
NetBSD-sparc64 of 2006-May-02 03:02:46.
* server.c (server_updated): Check for NULL return from
findnode_fn(). [Fixes NetBSD coverity cid-1352.]
2006-04-19 Larry Jones <lawrence.jones@ugs.com>
* history.c (sort_order): Back out previous change - not needed.
2006-04-15 Larry Jones <lawrence.jones@ugs.com>
* history.c (sort_order): Add prototype.
* server.c (template_proc): Add prototype and make args const.
* update.c (RegisterMerge): Make static to match prototype.
2006-04-07 Derek Price <derek@ximbiot.com>
* client.c (strto_file_size): New function which checks for errors when
parsing protocol input.
(read_counted_file, update_entries, handle_mbinary): Use new function.
Remove FIXME.
(Thanks to a report from Brendan Harrison
<brendan.harrison@klocwork.com>.)
* client.c (send_a_repository): Add assertion.
(Thanks to an incorrect report from Brendan Harrison
<brendan.harrison@klocwork.com>.)
2006-04-06 Derek Price <derek@ximbiot.com>
* filesubr.c (last_component, expand_wild), rcs.c (RCS_deltas,
RCS_rewrite), server.c (server_checked_in): Add assertions.
(Thanks to an incorrect report from Brendan Harrison
<brendan.harrison@klocwork.com>.)
2006-03-31 Mark D. Baushke <mdb@gnu.org>
* cvsrc.c (read_cvsrc): Deal with \r\n (DOS) line endings in
.cvsrc files.
2006-03-07 Derek Price <derek@ximbiot.com>
* tag.c (rtag_proc): Search the Attic when -F is used.
* sanity.sh (tests): Run death-rtag.
(death-rtag): Expect success.
* sanity.sh (death-rtag): Add failing force tag move test.
2006-03-06 Derek Price <derek@ximbiot.com>
* tag.c (rtag_proc): Always search in the attic when -r is used.
* sanity.sh (death-rtag): New test.
(Original report from C. Michael Pilato <cmpilato@collab.net>.)
2006-03-01 Derek Price <derek@ximbiot.com>
* sanity.sh: Set MALLOC_CHECK_ in hopes of exposing common memory
errors when CVS is linked with glibc 2.x.
2006-02-27 Derek Price <derek@ximbiot.com>
* lock.c (internal_lock): Back out previous change, we don't change
user visible output on stable unless absolutely necessary.
* lock.c (internal_lock): Improve error message.
2006-02-26 Derek Price <derek@ximbiot.com>
* client.c (call_in_directory): Remove unneeded code.
* sanity.sh (toplevel-12): Compensate by failing to expect a redundant
error message.
2006-02-24 Mark D. Baushke <mdb@gnu.org>
* client.c (gzip_level): Move to...
* main.c (gzip_level): ...here.
(main): Revert previous change in '-z' argument processing and
remove CLIENT_SUPPORT ifdef/endif.
* sanity.h (crerepos-6a): Deal with --disable-client output.
* main.c (main): Validate the gzip compression level for
--disable-client configurations.
2006-02-13 Derek Price <derek@ximbiot.com>
* server.c (do_cvs_command): Skip server_cleanup in the child process.
* sanity.sh (sshstdio-6): Rewrite using more portable sed script.
2006-02-02 Derek Price <derek@ximbiot.com>
* sanity.sh (sshstdio): Attempt to ignore spurious SSH output.
* main.c (main), release.c (release), server.c (do_cvs_command): Always
call the cleanup hooks before exit.
2006-02-01 Derek Price <derek@ximbiot.com>
* tag.c (add_to_val_tags): When a tag turns out to exist in the db when
it isn't expected, release the lock.
* history.c (save_user, save_file, save_mod, read_hrecs): Avoid
overflow.
2006-01-30 Derek Price <derek@ximbiot.com>
* server.c (do_cvs_command): Set flow control pipe to blocking mode
before waiting for it to close.
(set_block_fd): New function.
(Original patch from Garrett Rooney <grooney@collab.net>.)
2006-01-13 Larry Jones <lawrence.jones@ugs.com>
* mkmodules.c (config_contents): Change SystemAuth to yes to match
the default value. Add missing newline in RereadLogAfterVerify.
2006-01-09 Larry Jones <lawrence.jones@ugs.com>
* commit.c (remove_file): Record correct revision in history file.
(Reported by Chris Reed <cr@progress.com>.)
2005-12-07 Derek Price <derek@ximbiot.com>
* client.c (start_server), root.c (method_names), root.h (CVSmethod):
Handle :extssh: as a kindness to Eclipse users.
(Suggestion from Joseph P. Skudlarek <Jskud@Jskud.com>.)
2005-12-06 Mark D. Baushke <mdb@gnu.org>
* buffer.c (stdio_buffer_shutdown): No longer assert() the
fstat(). Use error (0, ...) instead of error (1, ...) to avoid
infinite loops. (patch #4678)
Patch adapted from "Allan L. Bazinet" <allan.bazinet@gmail.com>
2005-11-10 Larry Jones <lawrence.jones@ugs.com>
* commit.c (commit): Complain about obsolete -n option if not in
server mode.
2005-11-09 Derek Price <derek@ximbiot.com>
* sanity.sh (pserver-4.2): Accept a "no such sytem user" message when
a root attempt is made.
2005-09-30 Larry Jones <lawrence.jones@ugs.com>
* expand_path.c (expand_path): Fix memory leaks.
2005-09-29 Paul Eggert <eggert@CS.UCLA.EDU>
Derek Price <derek@ximbiot.com>
* client.c (handle_m, handle_e): Remove incomplete workaround for
O_NONBLOCK problem; no longer needed because of the fix below.
(start_rsh_server): We need the O_NONBLOCK fix, so pass 'true' to
piped_child to enable the workaround.
* cvs.h (piped_child): New bool argument saying whether O_NONBLOCK
fix is needed. All uses changed.
* run.c (work_around_openssh_glitch): New function.
(piped_child): Use it if the fix is requested. Avoid call call to
vfork with undefined behavior.
2005-09-26 Conrad T. Pino <Conrad@Pino.com>

View File

@ -1422,10 +1422,16 @@ stdio_buffer_shutdown (buf)
{
struct stdio_buffer_closure *bc = buf->closure;
struct stat s;
int closefp = 1;
int closefp, statted;
/* Must be a pipe or a socket. What could go wrong? */
assert (fstat (fileno (bc->fp), &s) != -1);
/* Must be a pipe or a socket. What could go wrong?
* Well, apparently for disconnected clients under AIX, the
* fstat() will return -1 on the server if the client has gone
* away.
*/
if (fstat(fileno(bc->fp), &s) == -1) statted = 0;
else statted = 1;
closefp = statted;
/* Flush the buffer if we can */
if (buf->flush)
@ -1448,7 +1454,7 @@ stdio_buffer_shutdown (buf)
# ifndef NO_SOCKET_TO_FD
{
/* shutdown() sockets */
if (S_ISSOCK (s.st_mode))
if (statted && S_ISSOCK (s.st_mode))
shutdown (fileno (bc->fp), 0);
}
# endif /* NO_SOCKET_TO_FD */
@ -1456,7 +1462,7 @@ stdio_buffer_shutdown (buf)
/* Can't be set with SHUTDOWN_SERVER defined */
else if (pclose (bc->fp) == EOF)
{
error (1, errno, "closing connection to %s",
error (0, errno, "closing connection to %s",
current_parsed_root->hostname);
closefp = 0;
}
@ -1476,7 +1482,7 @@ stdio_buffer_shutdown (buf)
# endif
# ifndef NO_SOCKET_TO_FD
/* shutdown() sockets */
if (S_ISSOCK (s.st_mode))
if (statted && S_ISSOCK (s.st_mode))
shutdown (fileno (bc->fp), 1);
# else
{
@ -1489,15 +1495,19 @@ stdio_buffer_shutdown (buf)
buf->output = NULL;
}
if (closefp && fclose (bc->fp) == EOF)
if (statted && closefp && fclose (bc->fp) == EOF)
{
if (server_active)
{
/* Syslog this? */
}
# ifdef CLIENT_SUPPORT
/* We are already closing the connection.
* On error, print a warning and try to
* continue to avoid infinte loops.
*/
else
error (1, errno,
error (0, errno,
"closing down connection to %s",
current_parsed_root->hostname);
# endif /* CLIENT_SUPPORT */
@ -1511,8 +1521,13 @@ stdio_buffer_shutdown (buf)
do
w = waitpid (bc->child_pid, (int *) 0, 0);
while (w == -1 && errno == EINTR);
/* We are already closing the connection.
* On error, print a warning and try to
* continue to avoid infinte loops.
*/
if (w == -1)
error (1, errno, "waiting for process %d", bc->child_pid);
error (0, errno, "waiting for process %d", bc->child_pid);
}
return 0;
}

View File

@ -892,12 +892,6 @@ read_line (resultp)
#if defined(CLIENT_SUPPORT) || defined(SERVER_SUPPORT)
/*
* Zero if compression isn't supported or requested; non-zero to indicate
* a compression level to request from gzip.
*/
int gzip_level;
/*
* Level of compression to use when running gzip on a single file.
*/
@ -1203,49 +1197,6 @@ call_in_directory (pathname, func, data)
if (CVS_CHDIR (toplevel_wd) < 0)
error (1, errno, "could not chdir to %s", toplevel_wd);
/* Create the CVS directory at the top level if needed. The
isdir seems like an unneeded system call, but it *does*
need to be called both if the CVS_CHDIR below succeeds
(e.g. "cvs co .") or if it fails (e.g. basicb-1a in
testsuite). We only need to do this for the "." case,
since the server takes care of forcing this directory to be
created in all other cases. If we don't create CVSADM
here, the call to Entries_Open below will fail. FIXME:
perhaps this means that we should change our algorithm
below that calls Create_Admin instead of having this code
here? */
if (/* I think the reposdirname_absolute case has to do with
things like "cvs update /foo/bar". In any event, the
code below which tries to put toplevel_repos into
CVS/Repository is almost surely unsuited to
the reposdirname_absolute case. */
!reposdirname_absolute
&& (strcmp (dir_name, ".") == 0)
&& ! isdir (CVSADM))
{
char *repo;
char *r;
newdir = 1;
/* If toplevel_repos doesn't have at least one character, then the
* reference to r[-1] below could be out of bounds.
*/
assert (*toplevel_repos);
repo = xmalloc (strlen (toplevel_repos)
+ 10);
strcpy (repo, toplevel_repos);
r = repo + strlen (repo);
if (r[-1] != '.' || r[-2] != '/')
strcpy (r, "/.");
Create_Admin (".", ".", repo, (char *) NULL,
(char *) NULL, 0, 1, 1);
free (repo);
}
if (CVS_CHDIR (dir_name) < 0)
{
char *dir;
@ -1506,7 +1457,44 @@ handle_copy_file (args, len)
{
call_in_directory (args, copy_a_file, (char *)NULL);
}
/* Attempt to read a file size from a string. Accepts base 8 (0N), base 16
* (0xN), or base 10. Exits on error.
*
* RETURNS
* The file size, in a size_t.
*
* FATAL ERRORS
* 1. As strtoul().
* 2. If the number read exceeds SIZE_MAX.
*/
static size_t
strto_file_size (const char *s)
{
unsigned long tmp;
char *endptr;
/* Read it. */
errno = 0;
tmp = strtoul (s, &endptr, 0);
/* Check for errors. */
if (errno || endptr == s)
error (1, errno, "Server sent invalid file size `%s'", s);
if (*endptr != '\0')
error (1, 0,
"Server sent trailing characters in file size `%s'",
endptr);
if (tmp > SIZE_MAX)
error (1, 0, "Server sent file size exceeding client max.");
/* Return it. */
return (size_t)tmp;
}
static void read_counted_file PROTO ((const char *, const char *));
@ -1539,9 +1527,7 @@ read_counted_file (filename, fullname)
if (size_string[0] == 'z')
error (1, 0, "\
protocol error: compressed files not supported for that operation");
/* FIXME: should be doing more error checking, probably. Like using
strtoul and making sure we used up the whole line. */
size = atoi (size_string);
size = strto_file_size (size_string);
free (size_string);
/* A more sophisticated implementation would use only a limited amount
@ -1823,11 +1809,12 @@ update_entries (data_arg, ent_list, short_pathname, filename)
{
char *size_string;
char *mode_string;
int size;
size_t size;
char *buf;
char *temp_filename;
int use_gzip;
int patch_failed;
char *s;
read_line (&mode_string);
@ -1835,13 +1822,14 @@ update_entries (data_arg, ent_list, short_pathname, filename)
if (size_string[0] == 'z')
{
use_gzip = 1;
size = atoi (size_string+1);
s = size_string + 1;
}
else
{
use_gzip = 0;
size = atoi (size_string);
s = size_string;
}
size = strto_file_size (s);
free (size_string);
/* Note that checking this separately from writing the file is
@ -2853,7 +2841,10 @@ send_a_repository (dir, repository, update_dir_in)
const char *repository;
const char *update_dir_in;
{
char *update_dir = xstrdup (update_dir_in);
char *update_dir;
assert (update_dir_in);
update_dir = xstrdup (update_dir_in);
if (toplevel_repos == NULL && repository != NULL)
{
@ -3084,9 +3075,6 @@ handle_m (args, len)
char *args;
int len;
{
fd_set wfds;
int s;
/* In the case where stdout and stderr point to the same place,
fflushing stderr will make output happen in the correct order.
Often stderr will be line-buffered and this won't be needed,
@ -3094,12 +3082,6 @@ handle_m (args, len)
based on being confused between default buffering between
stdout and stderr. But I'm not sure). */
fflush (stderr);
FD_ZERO (&wfds);
FD_SET (STDOUT_FILENO, &wfds);
errno = 0;
s = select (STDOUT_FILENO+1, NULL, &wfds, NULL, NULL);
if (s < 1 && errno != 0)
perror ("cannot write to stdout");
fwrite (args, len, sizeof (*args), stdout);
putc ('\n', stdout);
}
@ -3122,7 +3104,7 @@ handle_mbinary (args, len)
/* Get the size. */
read_line (&size_string);
size = atoi (size_string);
size = strto_file_size (size_string);
free (size_string);
/* OK, now get all the data. The algorithm here is that we read
@ -3147,24 +3129,9 @@ handle_e (args, len)
char *args;
int len;
{
fd_set wfds;
int s;
/* In the case where stdout and stderr point to the same place,
fflushing stdout will make output happen in the correct order. */
fflush (stdout);
FD_ZERO (&wfds);
FD_SET (STDERR_FILENO, &wfds);
errno = 0;
s = select (STDERR_FILENO+1, NULL, &wfds, NULL, NULL);
/*
* If stderr has problems, then adding a call to
* perror ("cannot write to stderr")
* will not work. So, try to write a message on stdout and
* terminate cvs.
*/
if (s < 1 && errno != 0)
fperrmsg (stdout, 1, errno, "cannot write to stderr");
fwrite (args, len, sizeof (*args), stderr);
putc ('\n', stderr);
}
@ -4085,7 +4052,7 @@ connect_to_forked_server (to_server, from_server)
fprintf (stderr, " -> Forking server: %s %s\n", command[0], command[1]);
}
child_pid = piped_child (command, &tofd, &fromfd);
child_pid = piped_child (command, &tofd, &fromfd, 0);
if (child_pid < 0)
error (1, 0, "could not fork server process");
@ -4393,6 +4360,7 @@ start_server ()
#endif /* HAVE_GSSAPI */
case ext_method:
case extssh_method:
#ifdef NO_EXT_METHOD
error (0, 0, ":ext: method not supported by this port of CVS");
error (1, 0, "try :server: instead");
@ -4787,7 +4755,7 @@ start_rsh_server (root, to_server, from_server)
char *rsh_argv[10];
if (!cvs_rsh)
cvs_rsh = "ssh";
cvs_rsh = RSH_DFLT;
if (!cvs_server)
cvs_server = "cvs";
@ -4892,7 +4860,7 @@ start_rsh_server (root, to_server, from_server)
fprintf (stderr, "%s ", argv[i]);
putc ('\n', stderr);
}
child_pid = piped_child (argv, &tofd, &fromfd);
child_pid = piped_child (argv, &tofd, &fromfd, 1);
if (child_pid < 0)
error (1, errno, "cannot start server via rsh");
@ -5207,6 +5175,7 @@ warning: ignoring -k options due to server limitations");
else if (vers->ts_rcs == NULL
|| args->force
|| strcmp (vers->ts_conflict
&& supported_request ("Empty-conflicts")
? vers->ts_conflict : vers->ts_rcs, vers->ts_user)
|| (vers->ts_conflict && !strcmp (cvs_cmd_name, "diff")))
{

View File

@ -412,6 +412,7 @@ commit (argc, argv)
/* Silently ignore -n for compatibility with old
* clients.
*/
if (!server_active) error(0, 0, "the `-n' option is obsolete");
break;
#endif /* SERVER_SUPPORT */
case 'm':
@ -1752,7 +1753,9 @@ remove_file (finfo, tag, message)
}
/* At this point, the file has been committed as removed. We should
probably tell the history file about it */
history_write ('R', NULL, finfo->rcs->head, finfo->file, finfo->repository);
corev = rev ? RCS_getbranch (finfo->rcs, rev, 1) : RCS_head (finfo->rcs);
history_write ('R', NULL, corev, finfo->file, finfo->repository);
free (corev);
if (rev != NULL)
free (rev);

View File

@ -717,7 +717,7 @@ int run_exec PROTO((const char *stin, const char *stout, const char *sterr,
/* other similar-minded stuff from run.c. */
FILE *run_popen PROTO((const char *, const char *));
int piped_child PROTO((const char **, int *, int *));
int piped_child PROTO((const char **, int *, int *, int));
void close_on_exec PROTO((int));
pid_t waitpid PROTO((pid_t, int *, int));

View File

@ -1005,7 +1005,8 @@ last_component (path)
const char *path;
{
const char *last = strrchr (path, '/');
assert (path);
if (last && (last != path))
return last + 1;
else
@ -1086,6 +1087,7 @@ expand_wild (argc, argv, pargc, pargv)
char ***pargv;
{
int i;
assert (argv || !argc);
if (size_overflow_p (xtimes (argc, sizeof (char *)))) {
*pargc = 0;
*pargv = NULL;

View File

@ -267,24 +267,24 @@ static struct hrec *last_backto;
we do. */
static char *rec_types;
static int hrec_count;
static int hrec_max;
static size_t hrec_count;
static size_t hrec_max;
static char **user_list; /* Ptr to array of ptrs to user names */
static int user_max; /* Number of elements allocated */
static int user_count; /* Number of elements used */
static size_t user_max; /* Number of elements allocated */
static size_t user_count; /* Number of elements used */
static struct file_list_str
{
char *l_file;
char *l_module;
} *file_list; /* Ptr to array file name structs */
static int file_max; /* Number of elements allocated */
static int file_count; /* Number of elements used */
static size_t file_max; /* Number of elements allocated */
static size_t file_count; /* Number of elements used */
static char **mod_list; /* Ptr to array of ptrs to module names */
static int mod_max; /* Number of elements allocated */
static int mod_count; /* Number of elements used */
static size_t mod_max; /* Number of elements allocated */
static size_t mod_count; /* Number of elements used */
static char *histfile; /* Ptr to the history file name */
@ -927,7 +927,8 @@ save_user (name)
if (user_count == user_max)
{
user_max = xsum (user_max, USER_INCREMENT);
if (size_overflow_p (xtimes (user_max, sizeof (char *))))
if (user_count == user_max
|| size_overflow_p (xtimes (user_max, sizeof (char *))))
{
error (0, 0, "save_user: too many users");
return;
@ -961,7 +962,8 @@ save_file (dir, name, module)
if (file_count == file_max)
{
file_max = xsum (file_max, FILE_INCREMENT);
if (size_overflow_p (xtimes (file_max, sizeof (*fl))))
if (file_count == file_max
|| size_overflow_p (xtimes (file_max, sizeof (*fl))))
{
error (0, 0, "save_file: too many files");
return;
@ -1008,7 +1010,8 @@ save_module (module)
if (mod_count == mod_max)
{
mod_max = xsum (mod_max, MODULE_INCREMENT);
if (size_overflow_p (xtimes (mod_max, sizeof (char *))))
if (mod_count == mod_max
|| size_overflow_p (xtimes (mod_max, sizeof (char *))))
{
error (0, 0, "save_module: too many modules");
return;
@ -1161,9 +1164,13 @@ read_hrecs (fname)
{
struct hrec *old_head = hrec_head;
hrec_max += HREC_INCREMENT;
hrec_head = xrealloc ((char *) hrec_head,
hrec_max * sizeof (struct hrec));
hrec_max = xsum (hrec_max, HREC_INCREMENT);
if (hrec_count == hrec_max
|| size_overflow_p (xtimes (hrec_max, sizeof (struct hrec))))
error (1, 0, "Too many history records in history file.");
hrec_head = xrealloc (hrec_head,
xtimes (hrec_max, sizeof (struct hrec)));
if (last_since_tag)
last_since_tag = hrec_head + (last_since_tag - old_head);
if (last_backto)

View File

@ -1092,6 +1092,8 @@ log_expand_revlist (rcs, baserev, revlist, default_branch)
{
char *branch;
assert (r->first != NULL);
/* Print just the head of the branch. */
if (isdigit ((unsigned char) r->first[0]))
nr->first = RCS_getbranch (rcs, r->first, 1);

View File

@ -1,7 +1,7 @@
/*
* Copyright (C) 1986-2005 The Free Software Foundation, Inc.
* Copyright (C) 1986-2006 The Free Software Foundation, Inc.
*
* Portions Copyright (C) 1998-2005 Derek Price, Ximbiot <http://ximbiot.com>,
* Portions Copyright (C) 1998-2006 Derek Price, Ximbiot <http://ximbiot.com>,
* and others.
*
* Portions Copyright (C) 1992, Brian Berliner and Jeff Polk
@ -49,6 +49,12 @@ int noexec = 0;
int nolock = 0;
int logoff = 0;
/*
* Zero if compression isn't supported or requested; non-zero to indicate
* a compression level to request from gzip.
*/
int gzip_level;
/* Set if we should be writing CVSADM directories at top level. At
least for now we'll make the default be off (the CVS 1.9, not CVS
1.9.2, behavior). */
@ -546,7 +552,7 @@ main (argc, argv)
version (0, (char **) NULL);
(void) fputs ("\n", stdout);
(void) fputs ("\
Copyright (C) 2005 Free Software Foundation, Inc.\n\
Copyright (C) 2006 Free Software Foundation, Inc.\n\
\n\
Senior active maintainers include Larry Jones, Derek R. Price,\n\
and Mark D. Baushke. Please see the AUTHORS and README files from the CVS\n\
@ -559,6 +565,12 @@ distribution kit for a complete list of contributors and copyrights.\n",
(void) fputs ("Specify the --help option for further information about CVS\n", stdout);
#ifdef SYSTEM_CLEANUP
/* Hook for OS-specific behavior, for example socket subsystems
* on NT and OS2 or dealing with windows and arguments on Mac.
*/
SYSTEM_CLEANUP ();
#endif
exit (0);
break;
case 'b':
@ -591,12 +603,10 @@ distribution kit for a complete list of contributors and copyrights.\n",
use_cvsrc = 0; /* unnecessary, since we've done it above */
break;
case 'z':
#ifdef CLIENT_SUPPORT
gzip_level = strtol (optarg, &end, 10);
if (*end != '\0' || gzip_level < 0 || gzip_level > 9)
error (1, 0,
"gzip compression level must be between 0 and 9");
#endif /* CLIENT_SUPPORT */
/* If no CLIENT_SUPPORT, we just silently ignore the gzip
* level, so that users can have it in their .cvsrc and not
* cause any trouble.

View File

@ -286,7 +286,7 @@ static const char *const modules_contents[] = {
static const char *const config_contents[] = {
"# Set this to \"no\" if pserver shouldn't check system users/passwords\n",
"#SystemAuth=no\n",
"#SystemAuth=yes\n",
"\n",
"# Put CVS lock files in this directory rather than directly in the repository.\n",
"#LockDir=/var/lock/cvs\n",
@ -307,7 +307,7 @@ static const char *const config_contents[] = {
"#LogHistory=" ALL_HISTORY_REC_TYPES "\n",
"\n",
"# Set `RereadLogAfterVerify' to `always' (the default) to allow the verifymsg\n",
"# script to change the log message. Set it to `stat' to force CVS to verify",
"# script to change the log message. Set it to `stat' to force CVS to verify\n",
"# that the file has changed before reading it (this can take up to an extra\n",
"# second per directory being committed, so it is not recommended for large\n",
"# repositories. Set it to `never' (the previous CVS behavior) to prevent\n",

View File

@ -616,14 +616,9 @@ RCS_reparsercsfile (rdata, pfp, rcsbufp)
q->key = vnode->version;
/* add the nodes to the list */
if (addnode (rdata->versions, q) != 0)
{
#if 0
purify_printf("WARNING: Adding duplicate version: %s (%s)\n",
q->key, rcsfile);
freenode (q);
#endif
}
if (addnode (rdata->versions, q))
error (1, 0, "Multiple %s revision deltas found in `%s'",
q->key, rcsfile);
}
/* Here KEY and VALUE are whatever caused getdelta to return NULL. */
@ -777,10 +772,10 @@ RCS_fully_parse (rcs)
break;
vers = findnode (rcs->versions, key);
if (vers == NULL)
if (!vers)
error (1, 0,
"mismatch in rcs file %s between deltas and deltatexts (%s)",
rcs->path, key);
"Delta text %s without revision information in `%s'.",
key, rcs->path);
vnode = vers->data;
@ -4249,6 +4244,11 @@ RCS_checkout (rcs, workfile, rev, nametag, options, sout, pfn, callerdat)
gothead = 0;
if (! rcsbuf_getrevnum (&rcsbuf, &key))
error (1, 0, "unexpected EOF reading %s", rcs->path);
if (!STREQ (rcs->head, key))
error (1, 0, "Expected head revision %s, found %s.",
rcs->head, key);
while (rcsbuf_getkey (&rcsbuf, &key, &value))
{
if (STREQ (key, "log"))
@ -7372,6 +7372,8 @@ RCS_deltas (rcs, fp, rcsbuf, version, op, text, len, log, loglen)
rcsbuf = &rcsbuf_local;
}
assert (rcsbuf);
if (log) *log = NULL;
ishead = 1;
@ -7401,6 +7403,13 @@ RCS_deltas (rcs, fp, rcsbuf, version, op, text, len, log, loglen)
if (! rcsbuf_getrevnum (rcsbuf, &key))
error (1, 0, "unexpected EOF reading RCS file %s", rcs->path);
/* look up the revision */
node = findnode (rcs->versions, key);
if (!node)
error (1, 0,
"Delta text %s without revision information in `%s'.",
key, rcs->path);
if (next != NULL && ! STREQ (next, key))
{
/* This is not the next version we need. It is a branch
@ -7412,13 +7421,6 @@ RCS_deltas (rcs, fp, rcsbuf, version, op, text, len, log, loglen)
{
isnext = 1;
/* look up the revision */
node = findnode (rcs->versions, key);
if (node == NULL)
error (1, 0,
"mismatch in rcs file %s between deltas and deltatexts (%s)",
rcs->path, key);
/* Stash the previous version. */
prev_vers = vers;
@ -7919,9 +7921,10 @@ RCS_getdeltatext (rcs, fp, rcsbuf)
}
p = findnode (rcs->versions, num);
if (p == NULL)
error (1, 0, "mismatch in rcs file %s between deltas and deltatexts (%s)",
rcs->path, num);
if (!p)
error (1, 0,
"Delta text %s without revision information in `%s'.",
num, rcs->path);
d = (Deltatext *) xmalloc (sizeof (Deltatext));
d->version = xstrdup (num);
@ -8349,6 +8352,11 @@ RCS_copydeltas (rcs, fin, rcsbufin, fout, newdtext, insertpt)
}
np = findnode (rcs->versions, dtext->version);
if (!np)
error (1, 0,
"Delta text %s without revision information in `%s'.",
dtext->version, rcs->path);
dadmin = np->data;
/* If this revision has been outdated, just skip it. */
@ -8716,6 +8724,8 @@ RCS_rewrite (rcs, newdtext, insertpt)
FILE *fin, *fout;
struct rcsbuffer rcsbufin;
assert (rcs);
if (noexec)
return;

View File

@ -23,7 +23,7 @@
const char method_names[][16] = {
"undefined", "local", "server (rsh)", "pserver",
"kserver", "gserver", "ext", "fork"
"kserver", "gserver", "ext", "extssh", "fork"
};
#ifndef DEBUG

View File

@ -424,11 +424,107 @@ run_popen (cmd, mode)
return (popen (cmd, mode));
}
/* Work around an OpenSSH problem: it can put its standard file
descriptors into nonblocking mode, which will mess us up if we
share file descriptions with it. The simplest workaround is
to create an intervening process between OpenSSH and the
actual stderr. */
static void
work_around_openssh_glitch (void)
{
pid_t pid;
int stderr_pipe[2];
struct stat sb;
/* Do nothing unless stderr is a file that is affected by
nonblocking mode. */
if (!(fstat (STDERR_FILENO, &sb) == 0
&& (S_ISFIFO (sb.st_mode) || S_ISSOCK (sb.st_mode)
|| S_ISCHR (sb.st_mode) || S_ISBLK (sb.st_mode))))
return;
if (pipe (stderr_pipe) < 0)
error (1, errno, "cannot create pipe");
pid = fork ();
if (pid < 0)
error (1, errno, "cannot fork");
if (pid != 0)
{
/* Still in child of original process. Act like "cat -u". */
char buf[1 << 13];
ssize_t inbytes;
pid_t w;
int status;
if (close (stderr_pipe[1]) < 0)
error (1, errno, "cannot close pipe");
while ((inbytes = read (stderr_pipe[0], buf, sizeof buf)) != 0)
{
size_t outbytes = 0;
if (inbytes < 0)
{
if (errno == EINTR)
continue;
error (1, errno, "reading from pipe");
}
do
{
ssize_t w = write (STDERR_FILENO,
buf + outbytes, inbytes - outbytes);
if (w < 0)
{
if (errno == EINTR)
w = 0;
if (w < 0)
_exit (1);
}
outbytes += w;
}
while (inbytes != outbytes);
}
/* Done processing output from grandchild. Propagate
its exit status back to the parent. */
while ((w = waitpid (pid, &status, 0)) == -1 && errno == EINTR)
continue;
if (w < 0)
error (1, errno, "waiting for child");
if (!WIFEXITED (status))
{
if (WIFSIGNALED (status))
raise (WTERMSIG (status));
error (1, errno, "child did not exit cleanly");
}
_exit (WEXITSTATUS (status));
}
/* Grandchild of original process. */
if (close (stderr_pipe[0]) < 0)
error (1, errno, "cannot close pipe");
if (stderr_pipe[1] != STDERR_FILENO)
{
if (dup2 (stderr_pipe[1], STDERR_FILENO) < 0)
error (1, errno, "cannot dup2 pipe");
if (close (stderr_pipe[1]) < 0)
error (1, errno, "cannot close pipe");
}
}
int
piped_child (command, tofdp, fromfdp)
piped_child (command, tofdp, fromfdp, fix_stderr)
const char **command;
int *tofdp;
int *fromfdp;
int fix_stderr;
{
int pid;
int to_child_pipe[2];
@ -446,11 +542,7 @@ piped_child (command, tofdp, fromfdp)
setmode (from_child_pipe[1], O_BINARY);
#endif
#ifdef HAVE_VFORK
pid = vfork ();
#else
pid = fork ();
#endif
if (pid < 0)
error (1, errno, "cannot fork");
if (pid == 0)
@ -464,7 +556,10 @@ piped_child (command, tofdp, fromfdp)
if (dup2 (from_child_pipe[1], STDOUT_FILENO) < 0)
error (1, errno, "cannot dup2 pipe");
/* Okay to cast out const below - execvp don't return anyhow. */
if (fix_stderr)
work_around_openssh_glitch ();
/* Okay to cast out const below - execvp don't return nohow. */
execvp ((char *)command[0], (char **)command);
error (1, errno, "cannot exec %s", command[0]);
}

View File

@ -2717,6 +2717,25 @@ set_nonblock_fd (fd)
/*
* Set buffer FD to blocking I/O. Returns 0 for success or errno code.
*/
int
set_block_fd (fd)
int fd;
{
int flags;
flags = fcntl (fd, F_GETFL, 0);
if (flags < 0)
return errno;
if (fcntl (fd, F_SETFL, flags & ~O_NONBLOCK) < 0)
return errno;
return 0;
}
static void
do_cvs_command (cmd_name, command)
char *cmd_name;
@ -2940,14 +2959,22 @@ error \n");
{
char junk;
ssize_t status;
while ((status = read (flowcontrol_pipe[0], &junk, 1)) > 0
|| (status == -1 && errno == EAGAIN));
set_block_fd (flowcontrol_pipe[0]);
while ((status = read (flowcontrol_pipe[0], &junk, 1)) > 0);
}
/* FIXME: No point in printing an error message with error(),
* as STDERR is already closed, but perhaps this could be syslogged?
*/
#endif
rcs_cleanup ();
Lock_Cleanup ();
/* Don't call server_cleanup - the parent will handle that. */
#ifdef SYSTEM_CLEANUP
/* Hook for OS-specific behavior, for example socket subsystems on
NT and OS2 or dealing with windows and arguments on Mac. */
SYSTEM_CLEANUP ();
#endif
exit (exitstatus);
}
@ -4557,10 +4584,13 @@ struct template_proc_data
a void * for it. */
static struct template_proc_data *tpd;
static int
template_proc PROTO((const char *repository, const char *template));
static int
template_proc (repository, template)
char *repository;
char *template;
const char *repository;
const char *template;
{
FILE *fp;
char buf[1024];
@ -4840,6 +4870,7 @@ struct request requests[] =
REQ_LINE("Checkin-time", serve_checkin_time, 0),
REQ_LINE("Modified", serve_modified, RQ_ESSENTIAL),
REQ_LINE("Is-modified", serve_is_modified, 0),
REQ_LINE("Empty-conflicts", serve_noop, 0),
/* The client must send this request to interoperate with CVS 1.5
through 1.9 servers. The server must support it (although it can
@ -5964,6 +5995,8 @@ pserver_authenticate_connection ()
printf ("I LOVE YOU\n");
fflush (stdout);
/* It's okay to skip rcs_cleanup() and Lock_Cleanup() here. */
#ifdef SYSTEM_CLEANUP
/* Hook for OS-specific behavior, for example socket subsystems on
NT and OS2 or dealing with windows and arguments on Mac. */

View File

@ -360,7 +360,7 @@ rtag_proc (argc, argv, xwhere, mwhere, mfile, shorten, local_specified,
}
/* End section which is identical to patch_proc. */
if (delete_flag || attic_too || (force_tag_match && numtag))
if (delete_flag || force_tag_move || attic_too || numtag)
which = W_REPOS | W_ATTIC;
else
which = W_REPOS;

View File

@ -1912,7 +1912,7 @@ write_letter (finfo, letter)
static void
RegisterMerge PROTO((struct file_info *finfo, Vers_TS *vers,
const char *backup, int has_conflicts));
void
static void
RegisterMerge (finfo, vers, backup, has_conflicts)
struct file_info *finfo;
Vers_TS *vers;