[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
CVS_RSH env-var feature patch
From: |
Daniel Hiltgen |
Subject: |
CVS_RSH env-var feature patch |
Date: |
Fri, 31 Aug 2001 12:24:46 -0700 |
User-agent: |
Mutt/0.96.1i |
Existing behavior: The entire environment variable is treated as
argv[0] for the fork, so you can not specify command arguments within
the variable.
Fix: Use strtok to tokenize the env-var so that multiple arguments
show up as argv[0], argv[1], etc. This also works for the scenario
where there is only a command and no arguments.
This is very useful for people who want to use ssh as the plumbing,
since ssh often requires multiple arguments to get the job done.
*** cvs-1.11/src/client.c Thu Jul 6 09:20:41 2000
--- cvs-1.11-args/src/client.c Thu Aug 30 10:49:17 2001
***************
*** 4792,4801 ****
sprintf (command, "%s server", cvs_server);
{
! char *argv[10];
char **p = argv;
! *p++ = cvs_rsh;
*p++ = CVSroot_hostname;
/* If the login names differ between client and server
--- 4792,4805 ----
sprintf (command, "%s server", cvs_server);
{
! char *argv[30];
char **p = argv;
! /* Check for flags in CVS_RSH */
! *p++ = strtok(cvs_rsh, " ");
! while(*p = strtok(0, " ")) {
! *p++;
! }
*p++ = CVSroot_hostname;
/* If the login names differ between client and server
--
Daniel Hiltgen (daniel.hiltgen@ebay.sun.com) (dtcm: dhiltgen@hiltgen)
Phone: 510-936-2264 (x12264) Fax: 510-936-2396 MS: UNWK16-101
Network Storage - Storage Utilities Software Development
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- CVS_RSH env-var feature patch,
Daniel Hiltgen <=