|
Lines 821-827
process_permitopen_list(struct ssh *ssh,
Link Here
|
| 821 |
{ |
821 |
{ |
| 822 |
u_int i; |
822 |
u_int i; |
| 823 |
int port; |
823 |
int port; |
| 824 |
char *host, *arg, *oarg; |
824 |
char *host, *arg, *oarg, ch; |
| 825 |
int where = opcode == sPermitOpen ? FORWARD_LOCAL : FORWARD_REMOTE; |
825 |
int where = opcode == sPermitOpen ? FORWARD_LOCAL : FORWARD_REMOTE; |
| 826 |
const char *what = lookup_opcode_name(opcode); |
826 |
const char *what = lookup_opcode_name(opcode); |
| 827 |
|
827 |
|
|
Lines 839-846
process_permitopen_list(struct ssh *ssh,
Link Here
|
| 839 |
/* Otherwise treat it as a list of permitted host:port */ |
839 |
/* Otherwise treat it as a list of permitted host:port */ |
| 840 |
for (i = 0; i < num_opens; i++) { |
840 |
for (i = 0; i < num_opens; i++) { |
| 841 |
oarg = arg = xstrdup(opens[i]); |
841 |
oarg = arg = xstrdup(opens[i]); |
| 842 |
host = hpdelim(&arg); |
842 |
host = hpdelim2(&arg, &ch); |
| 843 |
if (host == NULL) |
843 |
if (host == NULL || ch == '/') |
| 844 |
fatal("%s: missing host in %s", __func__, what); |
844 |
fatal("%s: missing host in %s", __func__, what); |
| 845 |
host = cleanhostname(host); |
845 |
host = cleanhostname(host); |
| 846 |
if (arg == NULL || ((port = permitopen_port(arg)) < 0)) |
846 |
if (arg == NULL || ((port = permitopen_port(arg)) < 0)) |
|
Lines 1251-1258
process_server_config_line(ServerOptions
Link Here
|
| 1251 |
port = 0; |
1251 |
port = 0; |
| 1252 |
p = arg; |
1252 |
p = arg; |
| 1253 |
} else { |
1253 |
} else { |
| 1254 |
p = hpdelim(&arg); |
1254 |
char ch; |
| 1255 |
if (p == NULL) |
1255 |
arg2 = NULL; |
|
|
1256 |
p = hpdelim2(&arg, &ch); |
| 1257 |
if (p == NULL || ch == '/') |
| 1256 |
fatal("%s line %d: bad address:port usage", |
1258 |
fatal("%s line %d: bad address:port usage", |
| 1257 |
filename, linenum); |
1259 |
filename, linenum); |
| 1258 |
p = cleanhostname(p); |
1260 |
p = cleanhostname(p); |
|
Lines 1879-1887
process_server_config_line(ServerOptions
Link Here
|
| 1879 |
*/ |
1881 |
*/ |
| 1880 |
xasprintf(&arg2, "*:%s", arg); |
1882 |
xasprintf(&arg2, "*:%s", arg); |
| 1881 |
} else { |
1883 |
} else { |
|
|
1884 |
char ch; |
| 1885 |
|
| 1882 |
arg2 = xstrdup(arg); |
1886 |
arg2 = xstrdup(arg); |
| 1883 |
p = hpdelim(&arg); |
1887 |
p = hpdelim2(&arg, &ch); |
| 1884 |
if (p == NULL) { |
1888 |
if (p == NULL || ch == '/') { |
| 1885 |
fatal("%s line %d: missing host in %s", |
1889 |
fatal("%s line %d: missing host in %s", |
| 1886 |
filename, linenum, |
1890 |
filename, linenum, |
| 1887 |
lookup_opcode_name(opcode)); |
1891 |
lookup_opcode_name(opcode)); |