mirror of
git://anongit.mindrot.org/openssh.git
synced 2024-12-25 03:12:10 +00:00
- markus@cvs.openbsd.org 2001/04/11 10:59:01
[ssh.c] use strtol() for ports, thanks jakob@
This commit is contained in:
parent
23d9a6d38e
commit
146edb9832
@ -12,6 +12,9 @@
|
||||
- djm@cvs.openbsd.org 2001/04/11 07:06:22
|
||||
[sftp-int.c]
|
||||
'mget' and 'mput' aliases; ok markus@
|
||||
- markus@cvs.openbsd.org 2001/04/11 10:59:01
|
||||
[ssh.c]
|
||||
use strtol() for ports, thanks jakob@
|
||||
|
||||
20010410
|
||||
- OpenBSD CVS Sync
|
||||
@ -5005,4 +5008,4 @@
|
||||
- Wrote replacements for strlcpy and mkdtemp
|
||||
- Released 1.0pre1
|
||||
|
||||
$Id: ChangeLog,v 1.1097 2001/04/11 23:05:17 mouring Exp $
|
||||
$Id: ChangeLog,v 1.1098 2001/04/11 23:06:28 mouring Exp $
|
||||
|
16
ssh.c
16
ssh.c
@ -39,7 +39,7 @@
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
RCSID("$OpenBSD: ssh.c,v 1.108 2001/04/07 08:55:18 markus Exp $");
|
||||
RCSID("$OpenBSD: ssh.c,v 1.109 2001/04/11 10:59:01 markus Exp $");
|
||||
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/err.h>
|
||||
@ -243,7 +243,7 @@ main(int ac, char **av)
|
||||
{
|
||||
int i, opt, optind, exit_status, ok;
|
||||
u_short fwd_port, fwd_host_port;
|
||||
char *optarg, *cp, buf[256];
|
||||
char *optarg, *cp, *endofnumber, buf[256];
|
||||
struct stat st;
|
||||
struct passwd *pw;
|
||||
int dummy;
|
||||
@ -456,7 +456,11 @@ main(int ac, char **av)
|
||||
}
|
||||
break;
|
||||
case 'p':
|
||||
options.port = atoi(optarg);
|
||||
options.port = strtol(optarg, &endofnumber, 0);
|
||||
if (optarg == endofnumber) {
|
||||
fprintf(stderr, "Bad port '%s'\n", optarg);
|
||||
exit(1);
|
||||
}
|
||||
break;
|
||||
case 'l':
|
||||
options.user = optarg;
|
||||
@ -485,7 +489,11 @@ main(int ac, char **av)
|
||||
break;
|
||||
|
||||
case 'D':
|
||||
fwd_port = atoi(optarg);
|
||||
fwd_port = strtol(optarg, &endofnumber, 0);
|
||||
if (optarg == endofnumber) {
|
||||
fprintf(stderr, "Bad port '%s'\n", optarg);
|
||||
exit(1);
|
||||
}
|
||||
add_local_forward(&options, fwd_port, "socks4", 0);
|
||||
break;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user