version 1.382, 2021/09/06 00:36:01 |
version 1.383, 2022/02/08 08:59:12 |
|
|
{ |
{ |
u_int i; |
u_int i; |
int port; |
int port; |
char *host, *arg, *oarg, ch; |
char *host, *arg, *oarg; |
int where = opcode == sPermitOpen ? FORWARD_LOCAL : FORWARD_REMOTE; |
int where = opcode == sPermitOpen ? FORWARD_LOCAL : FORWARD_REMOTE; |
const char *what = lookup_opcode_name(opcode); |
const char *what = lookup_opcode_name(opcode); |
|
|
|
|
/* Otherwise treat it as a list of permitted host:port */ |
/* Otherwise treat it as a list of permitted host:port */ |
for (i = 0; i < num_opens; i++) { |
for (i = 0; i < num_opens; i++) { |
oarg = arg = xstrdup(opens[i]); |
oarg = arg = xstrdup(opens[i]); |
ch = '\0'; |
host = hpdelim(&arg); |
host = hpdelim2(&arg, &ch); |
if (host == NULL) |
if (host == NULL || ch == '/') |
|
fatal_f("missing host in %s", what); |
fatal_f("missing host in %s", what); |
host = cleanhostname(host); |
host = cleanhostname(host); |
if (arg == NULL || ((port = permitopen_port(arg)) < 0)) |
if (arg == NULL || ((port = permitopen_port(arg)) < 0)) |
|
|
struct connection_info *connectinfo, int *inc_flags, int depth, |
struct connection_info *connectinfo, int *inc_flags, int depth, |
struct include_list *includes) |
struct include_list *includes) |
{ |
{ |
char ch, *str, ***chararrayptr, **charptr, *arg, *arg2, *p, *keyword; |
char *str, ***chararrayptr, **charptr, *arg, *arg2, *p, *keyword; |
int cmdline = 0, *intptr, value, value2, n, port, oactive, r, found; |
int cmdline = 0, *intptr, value, value2, n, port, oactive, r, found; |
SyslogFacility *log_facility_ptr; |
SyslogFacility *log_facility_ptr; |
LogLevel *log_level_ptr; |
LogLevel *log_level_ptr; |
|
|
p = arg; |
p = arg; |
} else { |
} else { |
arg2 = NULL; |
arg2 = NULL; |
ch = '\0'; |
p = hpdelim(&arg); |
p = hpdelim2(&arg, &ch); |
if (p == NULL) |
if (p == NULL || ch == '/') |
|
fatal("%s line %d: bad address:port usage", |
fatal("%s line %d: bad address:port usage", |
filename, linenum); |
filename, linenum); |
p = cleanhostname(p); |
p = cleanhostname(p); |
|
|
xasprintf(&arg2, "*:%s", arg); |
xasprintf(&arg2, "*:%s", arg); |
} else { |
} else { |
arg2 = xstrdup(arg); |
arg2 = xstrdup(arg); |
ch = '\0'; |
p = hpdelim(&arg); |
p = hpdelim2(&arg, &ch); |
if (p == NULL) { |
if (p == NULL || ch == '/') { |
|
fatal("%s line %d: %s missing host", |
fatal("%s line %d: %s missing host", |
filename, linenum, keyword); |
filename, linenum, keyword); |
} |
} |