summaryrefslogtreecommitdiffstats
path: root/crypto/openssh/readconf.c
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2003-04-23 16:53:02 +0000
committerdes <des@FreeBSD.org>2003-04-23 16:53:02 +0000
commit85b37b9574631df0f7e774dda373514195c74b29 (patch)
tree70033bf9d0551c1f485a8bf5c04d41148812e33a /crypto/openssh/readconf.c
parent099d1a58f7bc088a9f71af6d32542ca3949468a3 (diff)
downloadFreeBSD-src-85b37b9574631df0f7e774dda373514195c74b29.zip
FreeBSD-src-85b37b9574631df0f7e774dda373514195c74b29.tar.gz
Vendor import of OpenSSH-portable 3.6.1p1.
Diffstat (limited to 'crypto/openssh/readconf.c')
-rw-r--r--crypto/openssh/readconf.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/crypto/openssh/readconf.c b/crypto/openssh/readconf.c
index bae06be..1df5ce2 100644
--- a/crypto/openssh/readconf.c
+++ b/crypto/openssh/readconf.c
@@ -12,7 +12,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: readconf.c,v 1.100 2002/06/19 00:27:55 deraadt Exp $");
+RCSID("$OpenBSD: readconf.c,v 1.104 2003/04/01 10:22:21 markus Exp $");
#include "ssh.h"
#include "xmalloc.h"
@@ -114,6 +114,7 @@ typedef enum {
oDynamicForward, oPreferredAuthentications, oHostbasedAuthentication,
oHostKeyAlgorithms, oBindAddress, oSmartcardDevice,
oClearAllForwardings, oNoHostAuthenticationForLocalhost,
+ oEnableSSHKeysign,
oDeprecated
} OpCodes;
@@ -185,6 +186,7 @@ static struct {
{ "bindaddress", oBindAddress },
{ "smartcarddevice", oSmartcardDevice },
{ "clearallforwardings", oClearAllForwardings },
+ { "enablesshkeysign", oEnableSSHKeysign },
{ "nohostauthenticationforlocalhost", oNoHostAuthenticationForLocalhost },
{ NULL, oBadOption }
};
@@ -266,14 +268,16 @@ parse_token(const char *cp, const char *filename, int linenum)
* Processes a single option line as used in the configuration files. This
* only sets those values that have not already been set.
*/
+#define WHITESPACE " \t\r\n"
int
process_config_line(Options *options, const char *host,
char *line, const char *filename, int linenum,
int *activep)
{
- char buf[256], *s, *string, **charptr, *endofnumber, *keyword, *arg;
+ char buf[256], *s, **charptr, *endofnumber, *keyword, *arg;
int opcode, *intptr, value;
+ size_t len;
u_short fwd_port, fwd_host_port;
char sfwd_host_port[6];
@@ -486,16 +490,9 @@ parse_string:
case oProxyCommand:
charptr = &options->proxy_command;
- string = xstrdup("");
- while ((arg = strdelim(&s)) != NULL && *arg != '\0') {
- string = xrealloc(string, strlen(string) + strlen(arg) + 2);
- strcat(string, " ");
- strcat(string, arg);
- }
+ len = strspn(s, WHITESPACE "=");
if (*activep && *charptr == NULL)
- *charptr = string;
- else
- xfree(string);
+ *charptr = xstrdup(s + len);
return 0;
case oPort:
@@ -669,6 +666,10 @@ parse_int:
*intptr = value;
break;
+ case oEnableSSHKeysign:
+ intptr = &options->enable_ssh_keysign;
+ goto parse_flag;
+
case oDeprecated:
debug("%s line %d: Deprecated option \"%s\"",
filename, linenum, keyword);
@@ -792,6 +793,7 @@ initialize_options(Options * options)
options->preferred_authentications = NULL;
options->bind_address = NULL;
options->smartcard_device = NULL;
+ options->enable_ssh_keysign = - 1;
options->no_host_authentication_for_localhost = - 1;
}
@@ -907,6 +909,8 @@ fill_default_options(Options * options)
clear_forwardings(options);
if (options->no_host_authentication_for_localhost == - 1)
options->no_host_authentication_for_localhost = 0;
+ if (options->enable_ssh_keysign == -1)
+ options->enable_ssh_keysign = 0;
/* options->proxy_command should not be set by default */
/* options->user will be set in the main program if appropriate */
/* options->hostname will be set in the main program if appropriate */
OpenPOWER on IntegriCloud