version 1.139, 2005/03/10 22:01:05 |
version 1.139.2.2, 2006/02/03 02:53:44 |
|
|
Cipher none |
Cipher none |
PasswordAuthentication no |
PasswordAuthentication no |
|
|
|
Host vpn.fake.com |
|
Tunnel yes |
|
TunnelDevice 3 |
|
|
# Defaults for various options |
# Defaults for various options |
Host * |
Host * |
ForwardAgent no |
ForwardAgent no |
|
|
oAddressFamily, oGssAuthentication, oGssDelegateCreds, |
oAddressFamily, oGssAuthentication, oGssDelegateCreds, |
oServerAliveInterval, oServerAliveCountMax, oIdentitiesOnly, |
oServerAliveInterval, oServerAliveCountMax, oIdentitiesOnly, |
oSendEnv, oControlPath, oControlMaster, oHashKnownHosts, |
oSendEnv, oControlPath, oControlMaster, oHashKnownHosts, |
|
oTunnel, oTunnelDevice, oLocalCommand, oPermitLocalCommand, |
oDeprecated, oUnsupported |
oDeprecated, oUnsupported |
} OpCodes; |
} OpCodes; |
|
|
|
|
{ "controlpath", oControlPath }, |
{ "controlpath", oControlPath }, |
{ "controlmaster", oControlMaster }, |
{ "controlmaster", oControlMaster }, |
{ "hashknownhosts", oHashKnownHosts }, |
{ "hashknownhosts", oHashKnownHosts }, |
|
{ "tunnel", oTunnel }, |
|
{ "tunneldevice", oTunnelDevice }, |
|
{ "localcommand", oLocalCommand }, |
|
{ "permitlocalcommand", oPermitLocalCommand }, |
{ NULL, oBadOption } |
{ NULL, oBadOption } |
}; |
}; |
|
|
|
|
xfree(options->remote_forwards[i].connect_host); |
xfree(options->remote_forwards[i].connect_host); |
} |
} |
options->num_remote_forwards = 0; |
options->num_remote_forwards = 0; |
|
options->tun_open = SSH_TUNMODE_NO; |
} |
} |
|
|
/* |
/* |
|
|
int *activep) |
int *activep) |
{ |
{ |
char *s, **charptr, *endofnumber, *keyword, *arg, *arg2, fwdarg[256]; |
char *s, **charptr, *endofnumber, *keyword, *arg, *arg2, fwdarg[256]; |
int opcode, *intptr, value; |
int opcode, *intptr, value, value2; |
size_t len; |
size_t len; |
Forward fwd; |
Forward fwd; |
|
|
|
|
goto parse_string; |
goto parse_string; |
|
|
case oProxyCommand: |
case oProxyCommand: |
|
charptr = &options->proxy_command; |
|
parse_command: |
if (s == NULL) |
if (s == NULL) |
fatal("%.200s line %d: Missing argument.", filename, linenum); |
fatal("%.200s line %d: Missing argument.", filename, linenum); |
charptr = &options->proxy_command; |
|
len = strspn(s, WHITESPACE "="); |
len = strspn(s, WHITESPACE "="); |
if (*activep && *charptr == NULL) |
if (*activep && *charptr == NULL) |
*charptr = xstrdup(s + len); |
*charptr = xstrdup(s + len); |
|
|
fwd.listen_host = cleanhostname(fwd.listen_host); |
fwd.listen_host = cleanhostname(fwd.listen_host); |
} else { |
} else { |
fwd.listen_port = a2port(fwd.listen_host); |
fwd.listen_port = a2port(fwd.listen_host); |
fwd.listen_host = ""; |
fwd.listen_host = NULL; |
} |
} |
if (fwd.listen_port == 0) |
if (fwd.listen_port == 0) |
fatal("%.200s line %d: Badly formatted port number.", |
fatal("%.200s line %d: Badly formatted port number.", |
|
|
|
|
case oAddressFamily: |
case oAddressFamily: |
arg = strdelim(&s); |
arg = strdelim(&s); |
|
if (!arg || *arg == '\0') |
|
fatal("%s line %d: missing address family.", |
|
filename, linenum); |
intptr = &options->address_family; |
intptr = &options->address_family; |
if (strcasecmp(arg, "inet") == 0) |
if (strcasecmp(arg, "inet") == 0) |
value = AF_INET; |
value = AF_INET; |
|
|
|
|
case oControlMaster: |
case oControlMaster: |
intptr = &options->control_master; |
intptr = &options->control_master; |
goto parse_yesnoask; |
arg = strdelim(&s); |
|
if (!arg || *arg == '\0') |
|
fatal("%.200s line %d: Missing ControlMaster argument.", |
|
filename, linenum); |
|
value = 0; /* To avoid compiler warning... */ |
|
if (strcmp(arg, "yes") == 0 || strcmp(arg, "true") == 0) |
|
value = SSHCTL_MASTER_YES; |
|
else if (strcmp(arg, "no") == 0 || strcmp(arg, "false") == 0) |
|
value = SSHCTL_MASTER_NO; |
|
else if (strcmp(arg, "auto") == 0) |
|
value = SSHCTL_MASTER_AUTO; |
|
else if (strcmp(arg, "ask") == 0) |
|
value = SSHCTL_MASTER_ASK; |
|
else if (strcmp(arg, "autoask") == 0) |
|
value = SSHCTL_MASTER_AUTO_ASK; |
|
else |
|
fatal("%.200s line %d: Bad ControlMaster argument.", |
|
filename, linenum); |
|
if (*activep && *intptr == -1) |
|
*intptr = value; |
|
break; |
|
|
case oHashKnownHosts: |
case oHashKnownHosts: |
intptr = &options->hash_known_hosts; |
intptr = &options->hash_known_hosts; |
goto parse_flag; |
goto parse_flag; |
|
|
|
case oTunnel: |
|
intptr = &options->tun_open; |
|
arg = strdelim(&s); |
|
if (!arg || *arg == '\0') |
|
fatal("%s line %d: Missing yes/point-to-point/" |
|
"ethernet/no argument.", filename, linenum); |
|
value = 0; /* silence compiler */ |
|
if (strcasecmp(arg, "ethernet") == 0) |
|
value = SSH_TUNMODE_ETHERNET; |
|
else if (strcasecmp(arg, "point-to-point") == 0) |
|
value = SSH_TUNMODE_POINTOPOINT; |
|
else if (strcasecmp(arg, "yes") == 0) |
|
value = SSH_TUNMODE_DEFAULT; |
|
else if (strcasecmp(arg, "no") == 0) |
|
value = SSH_TUNMODE_NO; |
|
else |
|
fatal("%s line %d: Bad yes/point-to-point/ethernet/" |
|
"no argument: %s", filename, linenum, arg); |
|
if (*activep) |
|
*intptr = value; |
|
break; |
|
|
|
case oTunnelDevice: |
|
arg = strdelim(&s); |
|
if (!arg || *arg == '\0') |
|
fatal("%.200s line %d: Missing argument.", filename, linenum); |
|
value = a2tun(arg, &value2); |
|
if (value == SSH_TUNID_ERR) |
|
fatal("%.200s line %d: Bad tun device.", filename, linenum); |
|
if (*activep) { |
|
options->tun_local = value; |
|
options->tun_remote = value2; |
|
} |
|
break; |
|
|
|
case oLocalCommand: |
|
charptr = &options->local_command; |
|
goto parse_command; |
|
|
|
case oPermitLocalCommand: |
|
intptr = &options->permit_local_command; |
|
goto parse_flag; |
|
|
case oDeprecated: |
case oDeprecated: |
debug("%s line %d: Deprecated option \"%s\"", |
debug("%s line %d: Deprecated option \"%s\"", |
filename, linenum, keyword); |
filename, linenum, keyword); |
|
|
/* Check that there is no garbage at end of line. */ |
/* Check that there is no garbage at end of line. */ |
if ((arg = strdelim(&s)) != NULL && *arg != '\0') { |
if ((arg = strdelim(&s)) != NULL && *arg != '\0') { |
fatal("%.200s line %d: garbage at end of line; \"%.200s\".", |
fatal("%.200s line %d: garbage at end of line; \"%.200s\".", |
filename, linenum, arg); |
filename, linenum, arg); |
} |
} |
return 0; |
return 0; |
} |
} |
|
|
options->control_path = NULL; |
options->control_path = NULL; |
options->control_master = -1; |
options->control_master = -1; |
options->hash_known_hosts = -1; |
options->hash_known_hosts = -1; |
|
options->tun_open = -1; |
|
options->tun_local = -1; |
|
options->tun_remote = -1; |
|
options->local_command = NULL; |
|
options->permit_local_command = -1; |
} |
} |
|
|
/* |
/* |
|
|
options->control_master = 0; |
options->control_master = 0; |
if (options->hash_known_hosts == -1) |
if (options->hash_known_hosts == -1) |
options->hash_known_hosts = 0; |
options->hash_known_hosts = 0; |
|
if (options->tun_open == -1) |
|
options->tun_open = SSH_TUNMODE_NO; |
|
if (options->tun_local == -1) |
|
options->tun_local = SSH_TUNID_ANY; |
|
if (options->tun_remote == -1) |
|
options->tun_remote = SSH_TUNID_ANY; |
|
if (options->permit_local_command == -1) |
|
options->permit_local_command = 0; |
|
/* options->local_command should not be set by default */ |
/* options->proxy_command should not be set by default */ |
/* options->proxy_command should not be set by default */ |
/* options->user will be set in the main program if appropriate */ |
/* options->user will be set in the main program if appropriate */ |
/* options->hostname will be set in the main program if appropriate */ |
/* options->hostname will be set in the main program if appropriate */ |