|
Lines 3444-3449
channel_request_rforward_cancel(struct Forward *fwd)
Link Here
|
| 3444 |
} |
3444 |
} |
| 3445 |
|
3445 |
|
| 3446 |
/* |
3446 |
/* |
|
|
3447 |
* checks if host/port are allowed for remote forward |
| 3448 |
*/ |
| 3449 |
int |
| 3450 |
channel_permitted_remote_fwd(char *host, int port) |
| 3451 |
{ |
| 3452 |
int i; |
| 3453 |
if(all_opens_permitted){ |
| 3454 |
debug("no rule found for permitopen, allowed by default"); |
| 3455 |
return 1; |
| 3456 |
} |
| 3457 |
for (i = 0; i < num_permitted_opens; i++) { |
| 3458 |
if((permitted_opens[i].port_to_connect==port) |
| 3459 |
&&(strcmp(permitted_opens[i].host_to_connect,host)==0) |
| 3460 |
){ |
| 3461 |
debug("allowed host: %s port %i",host,port); |
| 3462 |
return 1; |
| 3463 |
} |
| 3464 |
} |
| 3465 |
return 0; |
| 3466 |
} |
| 3467 |
/* |
| 3447 |
* Permits opening to any host/port if permitted_opens[] is empty. This is |
3468 |
* Permits opening to any host/port if permitted_opens[] is empty. This is |
| 3448 |
* usually called by the server, because the user could connect to any port |
3469 |
* usually called by the server, because the user could connect to any port |
| 3449 |
* anyway, and the server has no way to know but to trust the client anyway. |
3470 |
* anyway, and the server has no way to know but to trust the client anyway. |