diff options
author | Damien Miller <djm@mindrot.org> | 1999-12-06 11:47:28 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 1999-12-06 11:47:28 +1100 |
commit | aae6c614da614eb10ced16505f35410671c95d9d (patch) | |
tree | 441e578781d38e7de4c5f609a4f86695d937e640 /readconf.c | |
parent | dc33fc3910552c82518503b581efc1a51192fa76 (diff) |
- Merged OpenBSD CVS changes:
- [auth-krb4.c auth-passwd.c auth-skey.c ssh.
move skey-auth from auth-passwd.c to auth-s
- [auth-rsa.c]
warn only about mismatch if key is _used_
warn about keysize-mismatch with log() not
channels.c readconf.c readconf.h ssh.c ssh.
ports are u_short
- [hostfile.c]
indent, shorter warning
- [nchan.c]
use error() for internal errors
- [packet.c]
set loglevel for SSH_MSG_DISCONNECT to log(
serverloop.c
indent
- [ssh-add.1 ssh-add.c ssh.h]
document , reasonable default
- [ssh.1]
CheckHostIP is not available for connects v
- [sshconnect.c]
typo
easier to read client code for passwd and s
turn of checkhostip for proxy connects, sin
Diffstat (limited to 'readconf.c')
-rw-r--r-- | readconf.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/readconf.c b/readconf.c index 2c2705067..0ba78639e 100644 --- a/readconf.c +++ b/readconf.c | |||
@@ -14,7 +14,7 @@ | |||
14 | */ | 14 | */ |
15 | 15 | ||
16 | #include "includes.h" | 16 | #include "includes.h" |
17 | RCSID("$Id: readconf.c,v 1.6 1999/11/25 00:54:59 damien Exp $"); | 17 | RCSID("$Id: readconf.c,v 1.7 1999/12/06 00:47:29 damien Exp $"); |
18 | 18 | ||
19 | #include "ssh.h" | 19 | #include "ssh.h" |
20 | #include "cipher.h" | 20 | #include "cipher.h" |
@@ -164,13 +164,11 @@ static struct { | |||
164 | */ | 164 | */ |
165 | 165 | ||
166 | void | 166 | void |
167 | add_local_forward(Options *options, int port, const char *host, | 167 | add_local_forward(Options *options, u_short port, const char *host, |
168 | int host_port) | 168 | u_short host_port) |
169 | { | 169 | { |
170 | Forward *fwd; | 170 | Forward *fwd; |
171 | extern uid_t original_real_uid; | 171 | extern uid_t original_real_uid; |
172 | if ((port & 0xffff) != port) | ||
173 | fatal("Requested forwarding of nonexistent port %d.", port); | ||
174 | if (port < IPPORT_RESERVED && original_real_uid != 0) | 172 | if (port < IPPORT_RESERVED && original_real_uid != 0) |
175 | fatal("Privileged ports can only be forwarded by root.\n"); | 173 | fatal("Privileged ports can only be forwarded by root.\n"); |
176 | if (options->num_local_forwards >= SSH_MAX_FORWARDS_PER_DIRECTION) | 174 | if (options->num_local_forwards >= SSH_MAX_FORWARDS_PER_DIRECTION) |
@@ -187,8 +185,8 @@ add_local_forward(Options *options, int port, const char *host, | |||
187 | */ | 185 | */ |
188 | 186 | ||
189 | void | 187 | void |
190 | add_remote_forward(Options *options, int port, const char *host, | 188 | add_remote_forward(Options *options, u_short port, const char *host, |
191 | int host_port) | 189 | u_short host_port) |
192 | { | 190 | { |
193 | Forward *fwd; | 191 | Forward *fwd; |
194 | if (options->num_remote_forwards >= SSH_MAX_FORWARDS_PER_DIRECTION) | 192 | if (options->num_remote_forwards >= SSH_MAX_FORWARDS_PER_DIRECTION) |
@@ -230,7 +228,8 @@ process_config_line(Options *options, const char *host, | |||
230 | int *activep) | 228 | int *activep) |
231 | { | 229 | { |
232 | char buf[256], *cp, *string, **charptr, *cp2; | 230 | char buf[256], *cp, *string, **charptr, *cp2; |
233 | int opcode, *intptr, value, fwd_port, fwd_host_port; | 231 | int opcode, *intptr, value; |
232 | u_short fwd_port, fwd_host_port; | ||
234 | 233 | ||
235 | /* Skip leading whitespace. */ | 234 | /* Skip leading whitespace. */ |
236 | cp = line + strspn(line, WHITESPACE); | 235 | cp = line + strspn(line, WHITESPACE); |
@@ -467,7 +466,7 @@ parse_int: | |||
467 | if (!cp) | 466 | if (!cp) |
468 | fatal("%.200s line %d: Missing second argument.", | 467 | fatal("%.200s line %d: Missing second argument.", |
469 | filename, linenum); | 468 | filename, linenum); |
470 | if (sscanf(cp, "%255[^:]:%d", buf, &fwd_host_port) != 2) | 469 | if (sscanf(cp, "%255[^:]:%hu", buf, &fwd_host_port) != 2) |
471 | fatal("%.200s line %d: Badly formatted host:port.", | 470 | fatal("%.200s line %d: Badly formatted host:port.", |
472 | filename, linenum); | 471 | filename, linenum); |
473 | if (*activep) | 472 | if (*activep) |
@@ -486,7 +485,7 @@ parse_int: | |||
486 | if (!cp) | 485 | if (!cp) |
487 | fatal("%.200s line %d: Missing second argument.", | 486 | fatal("%.200s line %d: Missing second argument.", |
488 | filename, linenum); | 487 | filename, linenum); |
489 | if (sscanf(cp, "%255[^:]:%d", buf, &fwd_host_port) != 2) | 488 | if (sscanf(cp, "%255[^:]:%hu", buf, &fwd_host_port) != 2) |
490 | fatal("%.200s line %d: Badly formatted host:port.", | 489 | fatal("%.200s line %d: Badly formatted host:port.", |
491 | filename, linenum); | 490 | filename, linenum); |
492 | if (*activep) | 491 | if (*activep) |