|
Lines 821-827
process_permitopen(struct ssh *ssh, ServerOptions *options)
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 |
|
825 |
|
| 826 |
channel_clear_adm_permitted_opens(ssh); |
826 |
channel_clear_adm_permitted_opens(ssh); |
| 827 |
if (options->num_permitted_opens == 0) |
827 |
if (options->num_permitted_opens == 0) |
|
Lines 839-846
process_permitopen(struct ssh *ssh, ServerOptions *options)
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 < options->num_permitted_opens; i++) { |
840 |
for (i = 0; i < options->num_permitted_opens; i++) { |
| 841 |
oarg = arg = xstrdup(options->permitted_opens[i]); |
841 |
oarg = arg = xstrdup(options->permitted_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 PermitOpen", __func__); |
844 |
fatal("%s: missing host in PermitOpen", __func__); |
| 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 1244-1251
process_server_config_line(ServerOptions *options, char *line,
Link Here
|
| 1244 |
port = 0; |
1244 |
port = 0; |
| 1245 |
p = arg; |
1245 |
p = arg; |
| 1246 |
} else { |
1246 |
} else { |
| 1247 |
p = hpdelim(&arg); |
1247 |
char ch; |
| 1248 |
if (p == NULL) |
1248 |
arg2 = NULL; |
|
|
1249 |
p = hpdelim2(&arg, &ch); |
| 1250 |
if (p == NULL || ch == '/') |
| 1249 |
fatal("%s line %d: bad address:port usage", |
1251 |
fatal("%s line %d: bad address:port usage", |
| 1250 |
filename, linenum); |
1252 |
filename, linenum); |
| 1251 |
p = cleanhostname(p); |
1253 |
p = cleanhostname(p); |
|
Lines 1815-1823
process_server_config_line(ServerOptions *options, char *line,
Link Here
|
| 1815 |
break; |
1817 |
break; |
| 1816 |
} |
1818 |
} |
| 1817 |
for (; arg != NULL && *arg != '\0'; arg = strdelim(&cp)) { |
1819 |
for (; arg != NULL && *arg != '\0'; arg = strdelim(&cp)) { |
|
|
1820 |
char ch; |
| 1818 |
arg2 = xstrdup(arg); |
1821 |
arg2 = xstrdup(arg); |
| 1819 |
p = hpdelim(&arg); |
1822 |
p = hpdelim2(&arg, &ch); |
| 1820 |
if (p == NULL) |
1823 |
if (p == NULL || ch == '/') |
| 1821 |
fatal("%s line %d: missing host in PermitOpen", |
1824 |
fatal("%s line %d: missing host in PermitOpen", |
| 1822 |
filename, linenum); |
1825 |
filename, linenum); |
| 1823 |
p = cleanhostname(p); |
1826 |
p = cleanhostname(p); |