[PATCH] Re: scp remote path specification

Jan IVEN Jan.Iven at cern.ch
Wed Dec 20 18:23:18 EST 2000


>>>>> "B" == mouring  <mouring at etoh.eviladmin.org> writes:

 >> @@ -262,8 +265,21 @@
 >> addargs("-x");
 >> addargs("-oFallBackToRsh no");
 >> 
 >> +	/* check explicit path for ssh binary, default is SSH_PROGRAM */
 >> +	if ((argc > 0) &&
 >> +	    (argv[0] != NULL)) {
 >> +	  pathsep = strrchr(argv[0], '/');
 >> +	  if (pathsep != NULL) {
 >> +	    pathsep++;
 >> +	    *pathsep = 0; 
 >> +	    ssh_program = xmalloc(strlen(argv[0]) + 4); /* "../path" + "ssh\0" */
 >> +	    strcpy(ssh_program, argv[0]);
 >> +	    strcat(ssh_program, "ssh");
 >> +	  } 
 >> +	}
 >> +

 B> Why do we want to force ssh_program to adopt the the argv[0]'s path?  This
 B> seems like a bad practice to me. 

If you have to specify scp's path, it is highly probable that you'd
have to specify ssh's path as well since they normally get installed
in the same location. Also useful for testing - you don't want to have
your test version of scp call the installed version of ssh, but the
ssh test version. While you can specify the explicit path to ssh using
-S, this is a "convenience hack".

A similar feature exists in ssh-1.2.26, so in order to minimize
surprises on a transition from commercial ssh to openssh, I added this
hack.

Best regards
Jan





More information about the openssh-unix-dev mailing list