version 1.19, 2001/06/24 05:25:09 |
version 1.20, 2001/08/30 20:36:34 |
|
|
#include "channels.h" |
#include "channels.h" |
#include "auth-options.h" |
#include "auth-options.h" |
#include "servconf.h" |
#include "servconf.h" |
|
#include "misc.h" |
|
|
/* Flags set authorized_keys flags */ |
/* Flags set authorized_keys flags */ |
int no_port_forwarding_flag = 0; |
int no_port_forwarding_flag = 0; |
|
|
} |
} |
cp = "permitopen=\""; |
cp = "permitopen=\""; |
if (strncasecmp(opts, cp, strlen(cp)) == 0) { |
if (strncasecmp(opts, cp, strlen(cp)) == 0) { |
|
char host[256], sport[6]; |
u_short port; |
u_short port; |
char *c, *ep; |
|
char *patterns = xmalloc(strlen(opts) + 1); |
char *patterns = xmalloc(strlen(opts) + 1); |
|
|
opts += strlen(cp); |
opts += strlen(cp); |
|
|
} |
} |
patterns[i] = 0; |
patterns[i] = 0; |
opts++; |
opts++; |
c = strchr(patterns, ':'); |
if (sscanf(patterns, "%255[^:]:%5[0-9]", host, sport) != 2 && |
if (c == NULL) { |
sscanf(patterns, "%255[^/]/%5[0-9]", host, sport) != 2) { |
debug("%.100s, line %lu: permitopen: missing colon <%.100s>", |
debug("%.100s, line %lu: Bad permitopen specification " |
file, linenum, patterns); |
"<%.100s>", file, linenum, patterns); |
packet_send_debug("%.100s, line %lu: missing colon", |
packet_send_debug("%.100s, line %lu: " |
file, linenum); |
"Bad permitopen specification", file, linenum); |
xfree(patterns); |
xfree(patterns); |
goto bad_option; |
goto bad_option; |
} |
} |
*c = 0; |
if ((port = a2port(sport)) == 0) { |
c++; |
debug("%.100s, line %lu: Bad permitopen port <%.100s>", |
port = strtol(c, &ep, 0); |
file, linenum, sport); |
if (c == ep) { |
packet_send_debug("%.100s, line %lu: " |
debug("%.100s, line %lu: permitopen: missing port <%.100s>", |
"Bad permitopen port", file, linenum); |
file, linenum, patterns); |
|
packet_send_debug("%.100s, line %lu: missing port", |
|
file, linenum); |
|
xfree(patterns); |
xfree(patterns); |
goto bad_option; |
goto bad_option; |
} |
} |
if (options.allow_tcp_forwarding) |
if (options.allow_tcp_forwarding) |
channel_add_permitted_opens(patterns, port); |
channel_add_permitted_opens(host, port); |
xfree(patterns); |
xfree(patterns); |
goto next_option; |
goto next_option; |
} |
} |