mirror of
git://anongit.mindrot.org/openssh.git
synced 2025-01-29 13:12:48 +00:00
- deraadt@cvs.openbsd.org 2005/03/31 18:39:21
[scp.c] copy argv[] element instead of smashing the one that ps will see; ok otto
This commit is contained in:
parent
de0de39082
commit
3dae15c611
@ -1,3 +1,9 @@
|
|||||||
|
20050403
|
||||||
|
- (djm) OpenBSD CVS Sync
|
||||||
|
- deraadt@cvs.openbsd.org 2005/03/31 18:39:21
|
||||||
|
[scp.c]
|
||||||
|
copy argv[] element instead of smashing the one that ps will see; ok otto
|
||||||
|
|
||||||
20050331
|
20050331
|
||||||
- (dtucker) OpenBSD CVS Sync
|
- (dtucker) OpenBSD CVS Sync
|
||||||
- jmc@cvs.openbsd.org 2005/03/16 11:10:38
|
- jmc@cvs.openbsd.org 2005/03/16 11:10:38
|
||||||
@ -2408,4 +2414,4 @@
|
|||||||
- (djm) Trim deprecated options from INSTALL. Mention UsePAM
|
- (djm) Trim deprecated options from INSTALL. Mention UsePAM
|
||||||
- (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu
|
- (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu
|
||||||
|
|
||||||
$Id: ChangeLog,v 1.3734 2005/03/31 13:52:04 dtucker Exp $
|
$Id: ChangeLog,v 1.3735 2005/04/03 00:16:11 djm Exp $
|
||||||
|
13
scp.c
13
scp.c
@ -71,7 +71,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
RCSID("$OpenBSD: scp.c,v 1.119 2005/01/24 10:22:06 dtucker Exp $");
|
RCSID("$OpenBSD: scp.c,v 1.120 2005/03/31 18:39:21 deraadt Exp $");
|
||||||
|
|
||||||
#include "xmalloc.h"
|
#include "xmalloc.h"
|
||||||
#include "atomicio.h"
|
#include "atomicio.h"
|
||||||
@ -361,20 +361,23 @@ void
|
|||||||
toremote(char *targ, int argc, char **argv)
|
toremote(char *targ, int argc, char **argv)
|
||||||
{
|
{
|
||||||
int i, len;
|
int i, len;
|
||||||
char *bp, *host, *src, *suser, *thost, *tuser;
|
char *bp, *host, *src, *suser, *thost, *tuser, *arg;
|
||||||
|
|
||||||
*targ++ = 0;
|
*targ++ = 0;
|
||||||
if (*targ == 0)
|
if (*targ == 0)
|
||||||
targ = ".";
|
targ = ".";
|
||||||
|
|
||||||
if ((thost = strrchr(argv[argc - 1], '@'))) {
|
arg = strdup(argv[argc - 1]);
|
||||||
|
if (!arg)
|
||||||
|
err(1, "malloc");
|
||||||
|
if ((thost = strrchr(arg, '@'))) {
|
||||||
/* user@host */
|
/* user@host */
|
||||||
*thost++ = 0;
|
*thost++ = 0;
|
||||||
tuser = argv[argc - 1];
|
tuser = arg;
|
||||||
if (*tuser == '\0')
|
if (*tuser == '\0')
|
||||||
tuser = NULL;
|
tuser = NULL;
|
||||||
} else {
|
} else {
|
||||||
thost = argv[argc - 1];
|
thost = arg;
|
||||||
tuser = NULL;
|
tuser = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user