Deleted Added
sdiff udiff text old ( 102843 ) new ( 107487 )
full compact
1/* JT thinks BeOS is worth the trouble. */
2
3/* CVS client-related stuff.
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2, or (at your option)
8 any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. */
14
15/*
16 * $FreeBSD: head/contrib/cvs/src/client.c 107487 2002-12-02 03:17:49Z peter $
17 */
18
19#ifdef HAVE_CONFIG_H
20# include "config.h"
21#endif /* HAVE_CONFIG_H */
22
23#include <assert.h>
24#include "cvs.h"

--- 221 unchanged lines hidden (view full) ---

246 files on disk. */
247 this_root = Name_Root (arg, (char *) NULL);
248 *t = c;
249 }
250 else
251 {
252 /* We're at the beginning of the string. Look at the
253 CVSADM files in cwd. */
254 this_root = (CVSroot_cmdline ? xstrdup(CVSroot_cmdline)
255 : Name_Root ((char *) NULL, (char *) NULL));
256 }
257
258 /* Now check the value for root. */
259 if (CVSroot_cmdline == NULL && this_root && current_parsed_root
260 && (strcmp (this_root, current_parsed_root->original) != 0))
261 {
262 /* Don't send this, since the CVSROOTs don't match. */
263 free (this_root);

--- 1056 unchanged lines hidden (view full) ---

1320 }
1321
1322 } while (dirp != NULL);
1323 free (dir);
1324 /* Now it better work. */
1325 if ( CVS_CHDIR (dir_name) < 0)
1326 error (1, errno, "could not chdir to %s", dir_name);
1327 }
1328 else if (strcmp (command_name, "export") == 0)
1329 /* Don't create CVSADM directories if this is export. */
1330 ;
1331 else if (!isdir (CVSADM))
1332 {
1333 /*
1334 * Put repository in CVS/Repository. For historical
1335 * (pre-CVS/Root) reasons, this is an absolute pathname,
1336 * but what really matters is the part of it which is
1337 * relative to cvsroot.
1338 */

--- 2273 unchanged lines hidden (view full) ---

3612 /* First we shut down TO_SERVER. That tells the server that its input is
3613 * finished. It then shuts down the buffer it is sending to us, at which
3614 * point our shut down of FROM_SERVER will complete.
3615 */
3616
3617 status = buf_shutdown (to_server);
3618 if (status != 0)
3619 error (0, status, "shutting down buffer to server");
3620 buf_free (to_server);
3621 to_server = NULL;
3622
3623 status = buf_shutdown (from_server);
3624 if (status != 0)
3625 error (0, status, "shutting down buffer from server");
3626 buf_free (from_server);
3627 from_server = NULL;
3628 server_started = 0;
3629
3630 /* see if we need to sleep before returning to avoid time-stamp races */
3631 if (last_register_time)
3632 {
3633 sleep_past (last_register_time);
3634 }
3635

--- 89 unchanged lines hidden (view full) ---

3725
3726
3727/* get the port number for a client to connect to based on the port
3728 * and method of a cvsroot_t.
3729 *
3730 * we do this here instead of in parse_cvsroot so that we can keep network
3731 * code confined to a localized area and also to delay the lookup until the
3732 * last possible moment so it remains possible to run cvs client commands that
3733 * skip opening connections to the server (i.e. skip network operations
3734 * entirely)
3735 *
3736 * and yes, I know none of the commands do that now, but here's to planning
3737 * for the future, eh? cheers.
3738 *
3739 * FIXME - We could cache the port lookup safely right now as we never change
3740 * it for a single root on the fly, but we'd have to un'const some other
3741 * functions - REMOVE_FIXME? This may be unecessary. We're talking about,
3742 * what, usually one, sometimes two lookups of the port per invocation. I
3743 * think twice is by far the rarer of the two cases - only the login function
3744 * will need to do it to save the canonical CVSROOT. -DRP
3745 */
3746int
3747get_cvs_port_number (root)
3748 const cvsroot_t *root;
3749{
3750
3751 if (root->port) return root->port;
3752

--- 163 unchanged lines hidden (view full) ---

3916
3917 if (verify_only)
3918 {
3919 int status;
3920
3921 status = buf_shutdown (to_server);
3922 if (status != 0)
3923 error (0, status, "shutting down buffer to server");
3924 buf_free (to_server);
3925 to_server = NULL;
3926
3927 status = buf_shutdown (from_server);
3928 if (status != 0)
3929 error (0, status, "shutting down buffer from server");
3930 buf_free (from_server);
3931 from_server = NULL;
3932
3933 /* Don't need to set server_started = 0 since we don't set it to 1
3934 * until returning from this call.
3935 */
3936 }
3937 else
3938 {
3939 *to_server_p = to_server;

--- 28 unchanged lines hidden (view full) ---

3968 */
3969 to_server = lto_server;
3970 from_server = lfrom_server;
3971
3972 /* Run the authorization mini-protocol before anything else. */
3973 if (do_gssapi)
3974 {
3975#ifdef HAVE_GSSAPI
3976 FILE *fp = stdio_buffer_get_file(lto_server);
3977 int fd = fp ? fileno(fp) : -1;
3978 struct stat s;
3979
3980 if ((fd < 0) || (fstat (fd, &s) < 0) || !S_ISSOCK(s.st_mode))
3981 {
3982 error (1, 0, "gserver currently only enabled for socket connections");
3983 }
3984
3985 if (! connect_to_gserver (root, fd, hostinfo))
3986 {
3987 error (1, 0,
3988 "authorization failed: server %s rejected access to %s",

--- 1642 unchanged lines hidden (view full) ---

5631 */
5632 args.build_dirs = flags & SEND_BUILD_DIRS;
5633 args.force = flags & SEND_FORCE;
5634 args.no_contents = flags & SEND_NO_CONTENTS;
5635 args.backup_modified = flags & BACKUP_MODIFIED_FILES;
5636 err = start_recursion
5637 (send_fileproc, send_filesdoneproc,
5638 send_dirent_proc, send_dirleave_proc, (void *) &args,
5639 argc, argv, local, W_LOCAL, aflag, LOCK_NONE, (char *)NULL, 0);
5640 if (err)
5641 error_exit ();
5642 if (toplevel_repos == NULL)
5643 /*
5644 * This happens if we are not processing any files,
5645 * or for checkouts in directories without any existing stuff
5646 * checked out. The following assignment is correct for the
5647 * latter case; I don't think toplevel_repos matters for the

--- 308 unchanged lines hidden ---