diff options
author | Damien Miller <djm@mindrot.org> | 2005-04-03 10:16:11 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2005-04-03 10:16:11 +1000 |
commit | 3dae15c6111a90a4a7417a34fa47a1cfee16963e (patch) | |
tree | 7df77118a695fb7f287c0f43f0eb9f87e1290688 | |
parent | de0de39082ee971aa3ff442e0201d9eff5c75cca (diff) |
- 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
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | scp.c | 13 |
2 files changed, 15 insertions, 6 deletions
@@ -1,3 +1,9 @@ | |||
1 | 20050403 | ||
2 | - (djm) OpenBSD CVS Sync | ||
3 | - deraadt@cvs.openbsd.org 2005/03/31 18:39:21 | ||
4 | [scp.c] | ||
5 | copy argv[] element instead of smashing the one that ps will see; ok otto | ||
6 | |||
1 | 20050331 | 7 | 20050331 |
2 | - (dtucker) OpenBSD CVS Sync | 8 | - (dtucker) OpenBSD CVS Sync |
3 | - jmc@cvs.openbsd.org 2005/03/16 11:10:38 | 9 | - jmc@cvs.openbsd.org 2005/03/16 11:10:38 |
@@ -2408,4 +2414,4 @@ | |||
2408 | - (djm) Trim deprecated options from INSTALL. Mention UsePAM | 2414 | - (djm) Trim deprecated options from INSTALL. Mention UsePAM |
2409 | - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu | 2415 | - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu |
2410 | 2416 | ||
2411 | $Id: ChangeLog,v 1.3734 2005/03/31 13:52:04 dtucker Exp $ | 2417 | $Id: ChangeLog,v 1.3735 2005/04/03 00:16:11 djm Exp $ |
@@ -71,7 +71,7 @@ | |||
71 | */ | 71 | */ |
72 | 72 | ||
73 | #include "includes.h" | 73 | #include "includes.h" |
74 | RCSID("$OpenBSD: scp.c,v 1.119 2005/01/24 10:22:06 dtucker Exp $"); | 74 | RCSID("$OpenBSD: scp.c,v 1.120 2005/03/31 18:39:21 deraadt Exp $"); |
75 | 75 | ||
76 | #include "xmalloc.h" | 76 | #include "xmalloc.h" |
77 | #include "atomicio.h" | 77 | #include "atomicio.h" |
@@ -361,20 +361,23 @@ void | |||
361 | toremote(char *targ, int argc, char **argv) | 361 | toremote(char *targ, int argc, char **argv) |
362 | { | 362 | { |
363 | int i, len; | 363 | int i, len; |
364 | char *bp, *host, *src, *suser, *thost, *tuser; | 364 | char *bp, *host, *src, *suser, *thost, *tuser, *arg; |
365 | 365 | ||
366 | *targ++ = 0; | 366 | *targ++ = 0; |
367 | if (*targ == 0) | 367 | if (*targ == 0) |
368 | targ = "."; | 368 | targ = "."; |
369 | 369 | ||
370 | if ((thost = strrchr(argv[argc - 1], '@'))) { | 370 | arg = strdup(argv[argc - 1]); |
371 | if (!arg) | ||
372 | err(1, "malloc"); | ||
373 | if ((thost = strrchr(arg, '@'))) { | ||
371 | /* user@host */ | 374 | /* user@host */ |
372 | *thost++ = 0; | 375 | *thost++ = 0; |
373 | tuser = argv[argc - 1]; | 376 | tuser = arg; |
374 | if (*tuser == '\0') | 377 | if (*tuser == '\0') |
375 | tuser = NULL; | 378 | tuser = NULL; |
376 | } else { | 379 | } else { |
377 | thost = argv[argc - 1]; | 380 | thost = arg; |
378 | tuser = NULL; | 381 | tuser = NULL; |
379 | } | 382 | } |
380 | 383 | ||