aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/cvs/src/client.c
diff options
context:
space:
mode:
authorDavid E. O'Brien <obrien@FreeBSD.org>2008-03-19 14:46:59 +0000
committerDavid E. O'Brien <obrien@FreeBSD.org>2008-03-19 14:46:59 +0000
commit76fd2245b5dc6793b57cc7c3bf4fc6af7a352563 (patch)
tree0ae354b8af76926a31947d53202545980b36afe4 /contrib/cvs/src/client.c
parent274835303c48ac29e7fd30a670e7a02fe78595e2 (diff)
downloadsrc-76fd2245b5dc6793b57cc7c3bf4fc6af7a352563.tar.gz
src-76fd2245b5dc6793b57cc7c3bf4fc6af7a352563.zip
Import of 1.11 branch snapshot - using the 10-March-2008 code base.vendor/misc-GNU/cvs
Notes
Notes: svn path=/vendor/cvs/dist/; revision=177391
Diffstat (limited to 'contrib/cvs/src/client.c')
-rw-r--r--contrib/cvs/src/client.c46
1 files changed, 31 insertions, 15 deletions
diff --git a/contrib/cvs/src/client.c b/contrib/cvs/src/client.c
index 22384ede5056..78fc98915ef5 100644
--- a/contrib/cvs/src/client.c
+++ b/contrib/cvs/src/client.c
@@ -160,17 +160,22 @@ is_arg_a_parent_or_listed_dir (n, d)
void *d;
{
char *directory = n->key; /* name of the dir sent to server */
- char *this_argv_elem = (char *) d; /* this argv element */
+ char *this_argv_elem = xstrdup (d); /* this argv element */
+ int retval;
/* Say we should send this argument if the argument matches the
beginning of a directory name sent to the server. This way,
the server will know to start at the top of that directory
hierarchy and descend. */
+ strip_trailing_slashes (this_argv_elem);
if (strncmp (directory, this_argv_elem, strlen (this_argv_elem)) == 0)
- return 1;
+ retval = 1;
+ else
+ retval = 0;
- return 0;
+ free (this_argv_elem);
+ return retval;
}
static int arg_should_not_be_sent_to_server PROTO((char *));
@@ -2778,7 +2783,8 @@ send_repository (dir, repos, update_dir)
send_to_server (repos, 0);
send_to_server ("\012", 1);
- if (supported_request ("Static-directory"))
+ if (strcmp (cvs_cmd_name, "import")
+ && supported_request ("Static-directory"))
{
adm_name[0] = '\0';
if (dir[0] != '\0')
@@ -2792,7 +2798,8 @@ send_repository (dir, repos, update_dir)
send_to_server ("Static-directory\012", 0);
}
}
- if (supported_request ("Sticky"))
+ if (strcmp (cvs_cmd_name, "import")
+ && supported_request ("Sticky"))
{
FILE *f;
if (dir[0] == '\0')
@@ -3835,7 +3842,7 @@ auth_server (root, lto_server, lfrom_server, verify_only, do_gssapi, hostinfo)
int do_gssapi;
struct hostent *hostinfo;
{
- char *username; /* the username we use to connect */
+ char *username = ""; /* the username we use to connect */
char no_passwd = 0; /* gets set if no password found */
/* FIXME!!!!!!!!!!!!!!!!!!
@@ -3919,9 +3926,8 @@ auth_server (root, lto_server, lfrom_server, verify_only, do_gssapi, hostinfo)
send_to_server(end, 0);
send_to_server("\012", 1);
- /* Paranoia. */
- memset (password, 0, strlen (password));
- free (password);
+ free_cvs_password (password);
+ password = NULL;
# else /* ! AUTH_CLIENT_SUPPORT */
error (1, 0, "INTERNAL ERROR: This client does not support pserver authentication");
# endif /* AUTH_CLIENT_SUPPORT */
@@ -4720,15 +4726,20 @@ start_rsh_server (root, to_server, from_server)
/* If you're working through firewalls, you can set the
CVS_RSH environment variable to a script which uses rsh to
invoke another rsh on a proxy machine. */
- char *cvs_rsh = getenv ("CVS_RSH");
+ char *env_cvs_rsh = getenv ("CVS_RSH");
+ char *env_cvs_ssh = getenv ("CVS_SSH");
+ char *cvs_rsh;
char *cvs_server = getenv ("CVS_SERVER");
int i = 0;
/* This needs to fit "rsh", "-b", "-l", "USER", "host",
"cmd (w/ args)", and NULL. We leave some room to grow. */
char *rsh_argv[10];
- if (!cvs_rsh)
- cvs_rsh = RSH_DFLT;
+ if (root->method == extssh_method)
+ cvs_rsh = env_cvs_ssh ? env_cvs_ssh : SSH_DFLT;
+ else
+ cvs_rsh = env_cvs_rsh ? env_cvs_rsh : RSH_DFLT;
+
if (!cvs_server)
cvs_server = "cvs";
@@ -4782,14 +4793,19 @@ start_rsh_server (root, to_server, from_server)
/* If you're working through firewalls, you can set the
CVS_RSH environment variable to a script which uses rsh to
invoke another rsh on a proxy machine. */
- char *cvs_rsh = getenv ("CVS_RSH");
+ char *env_cvs_rsh = getenv ("CVS_RSH");
+ char *env_cvs_ssh = getenv ("CVS_SSH");
+ char *cvs_rsh;
char *cvs_server = getenv ("CVS_SERVER");
char *command;
int tofd, fromfd;
int child_pid;
- if (!cvs_rsh)
- cvs_rsh = "rsh";
+ if (root->method == extssh_method)
+ cvs_rsh = env_cvs_ssh ? env_cvs_ssh : SSH_DFLT;
+ else
+ cvs_rsh = env_cvs_rsh ? env_cvs_rsh : RSH_DFLT;
+
if (!cvs_server)
cvs_server = "cvs";