version 1.148, 2006/02/22 00:04:44 |
version 1.148.2.1, 2006/09/30 04:06:51 |
|
|
|
/* $OpenBSD$ */ |
/* |
/* |
* Author: Tatu Ylonen <ylo@cs.hut.fi> |
* Author: Tatu Ylonen <ylo@cs.hut.fi> |
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
|
|
* called by a name other than "ssh" or "Secure Shell". |
* called by a name other than "ssh" or "Secure Shell". |
*/ |
*/ |
|
|
#include "includes.h" |
|
RCSID("$OpenBSD$"); |
|
|
|
#include <sys/types.h> |
#include <sys/types.h> |
#include <sys/stat.h> |
#include <sys/stat.h> |
|
#include <sys/socket.h> |
|
|
|
#include <netinet/in.h> |
|
|
#include <ctype.h> |
#include <ctype.h> |
|
#include <errno.h> |
|
#include <netdb.h> |
|
#include <signal.h> |
|
#include <stdio.h> |
|
#include <string.h> |
|
#include <unistd.h> |
|
|
#include "ssh.h" |
|
#include "xmalloc.h" |
#include "xmalloc.h" |
|
#include "ssh.h" |
#include "compat.h" |
#include "compat.h" |
#include "cipher.h" |
#include "cipher.h" |
#include "pathnames.h" |
#include "pathnames.h" |
#include "log.h" |
#include "log.h" |
|
#include "key.h" |
#include "readconf.h" |
#include "readconf.h" |
#include "match.h" |
#include "match.h" |
#include "misc.h" |
#include "misc.h" |
|
#include "buffer.h" |
#include "kex.h" |
#include "kex.h" |
#include "mac.h" |
#include "mac.h" |
|
|
|
|
typedef enum { |
typedef enum { |
oBadOption, |
oBadOption, |
oForwardAgent, oForwardX11, oForwardX11Trusted, oGatewayPorts, |
oForwardAgent, oForwardX11, oForwardX11Trusted, oGatewayPorts, |
|
oExitOnForwardFailure, |
oPasswordAuthentication, oRSAAuthentication, |
oPasswordAuthentication, oRSAAuthentication, |
oChallengeResponseAuthentication, oXAuthLocation, |
oChallengeResponseAuthentication, oXAuthLocation, |
oIdentityFile, oHostName, oPort, oCipher, oRemoteForward, oLocalForward, |
oIdentityFile, oHostName, oPort, oCipher, oRemoteForward, oLocalForward, |
|
|
{ "forwardagent", oForwardAgent }, |
{ "forwardagent", oForwardAgent }, |
{ "forwardx11", oForwardX11 }, |
{ "forwardx11", oForwardX11 }, |
{ "forwardx11trusted", oForwardX11Trusted }, |
{ "forwardx11trusted", oForwardX11Trusted }, |
|
{ "exitonforwardfailure", oExitOnForwardFailure }, |
{ "xauthlocation", oXAuthLocation }, |
{ "xauthlocation", oXAuthLocation }, |
{ "gatewayports", oGatewayPorts }, |
{ "gatewayports", oGatewayPorts }, |
{ "useprivilegedport", oUsePrivilegedPort }, |
{ "useprivilegedport", oUsePrivilegedPort }, |
|
|
|
|
s = line; |
s = line; |
/* Get the keyword. (Each line is supposed to begin with a keyword). */ |
/* Get the keyword. (Each line is supposed to begin with a keyword). */ |
keyword = strdelim(&s); |
if ((keyword = strdelim(&s)) == NULL) |
|
return 0; |
/* Ignore leading whitespace. */ |
/* Ignore leading whitespace. */ |
if (*keyword == '\0') |
if (*keyword == '\0') |
keyword = strdelim(&s); |
keyword = strdelim(&s); |
|
|
intptr = &options->gateway_ports; |
intptr = &options->gateway_ports; |
goto parse_flag; |
goto parse_flag; |
|
|
|
case oExitOnForwardFailure: |
|
intptr = &options->exit_on_forward_failure; |
|
goto parse_flag; |
|
|
case oUsePrivilegedPort: |
case oUsePrivilegedPort: |
intptr = &options->use_privileged_port; |
intptr = &options->use_privileged_port; |
goto parse_flag; |
goto parse_flag; |
|
|
options->forward_agent = -1; |
options->forward_agent = -1; |
options->forward_x11 = -1; |
options->forward_x11 = -1; |
options->forward_x11_trusted = -1; |
options->forward_x11_trusted = -1; |
|
options->exit_on_forward_failure = -1; |
options->xauth_location = NULL; |
options->xauth_location = NULL; |
options->gateway_ports = -1; |
options->gateway_ports = -1; |
options->use_privileged_port = -1; |
options->use_privileged_port = -1; |
|
|
options->forward_x11 = 0; |
options->forward_x11 = 0; |
if (options->forward_x11_trusted == -1) |
if (options->forward_x11_trusted == -1) |
options->forward_x11_trusted = 0; |
options->forward_x11_trusted = 0; |
|
if (options->exit_on_forward_failure == -1) |
|
options->exit_on_forward_failure = 0; |
if (options->xauth_location == NULL) |
if (options->xauth_location == NULL) |
options->xauth_location = _PATH_XAUTH; |
options->xauth_location = _PATH_XAUTH; |
if (options->gateway_ports == -1) |
if (options->gateway_ports == -1) |