diff options
author | Peter Wemm <peter@FreeBSD.org> | 2002-12-02 03:13:37 +0000 |
---|---|---|
committer | Peter Wemm <peter@FreeBSD.org> | 2002-12-02 03:13:37 +0000 |
commit | 6361f125fbebb7b3fba759b74fe02de24f44ebf6 (patch) | |
tree | 15f00bd8ebd718713d8c0a8707ebebfced99c550 /contrib/cvs/src/client.c | |
parent | b2b29aad0d0d63394479a7459a0f17936ce7c064 (diff) | |
download | src-6361f125fbebb7b3fba759b74fe02de24f44ebf6.tar.gz src-6361f125fbebb7b3fba759b74fe02de24f44ebf6.zip |
Import cvs-1.11.2.1 as of 2002/12/01 onto vendor branch. This fixes all
of the bugs that I know of. We've been running a slightly older version
of this on freefall/repoman, where it was afflicted by a silly merge error
on my part (fixed).
Approved by: re
Notes
Notes:
svn path=/vendor/cvs/dist/; revision=107484
Diffstat (limited to 'contrib/cvs/src/client.c')
-rw-r--r-- | contrib/cvs/src/client.c | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/contrib/cvs/src/client.c b/contrib/cvs/src/client.c index 4773b4f48e50..a5a15e1470f3 100644 --- a/contrib/cvs/src/client.c +++ b/contrib/cvs/src/client.c @@ -247,7 +247,8 @@ arg_should_not_be_sent_to_server (arg) { /* We're at the beginning of the string. Look at the CVSADM files in cwd. */ - this_root = Name_Root ((char *) NULL, (char *) NULL); + this_root = (CVSroot_cmdline ? xstrdup(CVSroot_cmdline) + : Name_Root ((char *) NULL, (char *) NULL)); } /* Now check the value for root. */ @@ -1320,6 +1321,9 @@ warning: server is not creating directories one at a time"); if ( CVS_CHDIR (dir_name) < 0) error (1, errno, "could not chdir to %s", dir_name); } + else if (strcmp (command_name, "export") == 0) + /* Don't create CVSADM directories if this is export. */ + ; else if (!isdir (CVSADM)) { /* @@ -3609,12 +3613,14 @@ get_responses_and_close () status = buf_shutdown (to_server); if (status != 0) error (0, status, "shutting down buffer to server"); + buf_free (to_server); + to_server = NULL; + status = buf_shutdown (from_server); if (status != 0) error (0, status, "shutting down buffer from server"); - - buf_free (to_server); buf_free (from_server); + from_server = NULL; server_started = 0; /* see if we need to sleep before returning to avoid time-stamp races */ @@ -3720,14 +3726,18 @@ get_port_number (envname, portname, defaultport) * we do this here instead of in parse_cvsroot so that we can keep network * code confined to a localized area and also to delay the lookup until the * last possible moment so it remains possible to run cvs client commands that - * skip opening connections to the server (i.e. skip network operations entirely) + * skip opening connections to the server (i.e. skip network operations + * entirely) * - * and yes, I know none of the the commands do that now, but here's to planning + * and yes, I know none of the commands do that now, but here's to planning * for the future, eh? cheers. * * FIXME - We could cache the port lookup safely right now as we never change * it for a single root on the fly, but we'd have to un'const some other - * functions + * functions - REMOVE_FIXME? This may be unecessary. We're talking about, + * what, usually one, sometimes two lookups of the port per invocation. I + * think twice is by far the rarer of the two cases - only the login function + * will need to do it to save the canonical CVSROOT. -DRP */ int get_cvs_port_number (root) @@ -3907,12 +3917,14 @@ connect_to_pserver (root, to_server_p, from_server_p, verify_only, do_gssapi) status = buf_shutdown (to_server); if (status != 0) error (0, status, "shutting down buffer to server"); + buf_free (to_server); + to_server = NULL; + status = buf_shutdown (from_server); if (status != 0) error (0, status, "shutting down buffer from server"); - - buf_free (to_server); buf_free (from_server); + from_server = NULL; /* Don't need to set server_started = 0 since we don't set it to 1 * until returning from this call. @@ -3957,10 +3969,11 @@ auth_server (root, lto_server, lfrom_server, verify_only, do_gssapi, hostinfo) if (do_gssapi) { #ifdef HAVE_GSSAPI - int fd = (int) lto_server->closure; + FILE *fp = stdio_buffer_get_file(lto_server); + int fd = fp ? fileno(fp) : -1; struct stat s; - if (fstat (fd, &s) < 0 || !S_ISSOCK(s.st_mode)) + if ((fd < 0) || (fstat (fd, &s) < 0) || !S_ISSOCK(s.st_mode)) { error (1, 0, "gserver currently only enabled for socket connections"); } @@ -5618,7 +5631,7 @@ send_files (argc, argv, local, aflag, flags) err = start_recursion (send_fileproc, send_filesdoneproc, send_dirent_proc, send_dirleave_proc, (void *) &args, - argc, argv, local, W_LOCAL, aflag, 0, (char *)NULL, 0); + argc, argv, local, W_LOCAL, aflag, LOCK_NONE, (char *)NULL, 0); if (err) error_exit (); if (toplevel_repos == NULL) |