View | Details | Raw Unified | Return to bug 866 | Differences between
and this patch

Collapse All | Expand All

(-)readconf.c (-8 / +25 lines)
Lines 131-138 typedef enum { Link Here
131
	oHashKnownHosts,
131
	oHashKnownHosts,
132
	oTunnel, oTunnelDevice, oLocalCommand, oPermitLocalCommand,
132
	oTunnel, oTunnelDevice, oLocalCommand, oPermitLocalCommand,
133
	oVisualHostKey, oUseRoaming, oZeroKnowledgePasswordAuthentication,
133
	oVisualHostKey, oUseRoaming, oZeroKnowledgePasswordAuthentication,
134
	oKexAlgorithms, oIPQoS, oRequestTTY,
134
	oKexAlgorithms, oIPQoS, oRequestTTY, oIgnoreUnknown,
135
	oDeprecated, oUnsupported
135
	oIgnoredUnknownOption, oDeprecated, oUnsupported
136
} OpCodes;
136
} OpCodes;
137
137
138
/* Textual representations of the tokens. */
138
/* Textual representations of the tokens. */
Lines 243-248 static struct { Link Here
243
	{ "kexalgorithms", oKexAlgorithms },
243
	{ "kexalgorithms", oKexAlgorithms },
244
	{ "ipqos", oIPQoS },
244
	{ "ipqos", oIPQoS },
245
	{ "requesttty", oRequestTTY },
245
	{ "requesttty", oRequestTTY },
246
	{ "ignoreunknown", oIgnoreUnknown },
246
247
247
	{ NULL, oBadOption }
248
	{ NULL, oBadOption }
248
};
249
};
Lines 347-360 add_identity_file(Options *options, cons Link Here
347
 */
348
 */
348
349
349
static OpCodes
350
static OpCodes
350
parse_token(const char *cp, const char *filename, int linenum)
351
parse_token(const char *cp, const char *filename, int linenum,
352
    const char *ignored_unknown)
351
{
353
{
352
	u_int i;
354
	int i;
353
355
354
	for (i = 0; keywords[i].name; i++)
356
	for (i = 0; keywords[i].name; i++)
355
		if (strcasecmp(cp, keywords[i].name) == 0)
357
		if (strcmp(cp, keywords[i].name) == 0)
356
			return keywords[i].opcode;
358
			return keywords[i].opcode;
357
359
	if (ignored_unknown != NULL && match_pattern_list(cp, ignored_unknown,
360
	    strlen(ignored_unknown), 1) == 1)
361
		return oIgnoredUnknownOption;
358
	error("%s: line %d: Bad configuration option: %s",
362
	error("%s: line %d: Bad configuration option: %s",
359
	    filename, linenum, cp);
363
	    filename, linenum, cp);
360
	return oBadOption;
364
	return oBadOption;
Lines 373-379 process_config_line(Options *options, co Link Here
373
{
377
{
374
	char *s, **charptr, *endofnumber, *keyword, *arg, *arg2;
378
	char *s, **charptr, *endofnumber, *keyword, *arg, *arg2;
375
	char **cpptr, fwdarg[256];
379
	char **cpptr, fwdarg[256];
376
	u_int *uintptr, max_entries = 0;
380
	u_int i, *uintptr, max_entries = 0;
377
	int negated, opcode, *intptr, value, value2, scale;
381
	int negated, opcode, *intptr, value, value2, scale;
378
	LogLevel *log_level_ptr;
382
	LogLevel *log_level_ptr;
379
	long long orig, val64;
383
	long long orig, val64;
Lines 396-409 process_config_line(Options *options, co Link Here
396
		keyword = strdelim(&s);
400
		keyword = strdelim(&s);
397
	if (keyword == NULL || !*keyword || *keyword == '\n' || *keyword == '#')
401
	if (keyword == NULL || !*keyword || *keyword == '\n' || *keyword == '#')
398
		return 0;
402
		return 0;
403
	/* Match lowercase keyword */
404
	for (i = 0; i < strlen(keyword); i++)
405
		keyword[i] = tolower(keyword[i]);
399
406
400
	opcode = parse_token(keyword, filename, linenum);
407
	opcode = parse_token(keyword, filename, linenum,
408
	    options->ignored_unknown);
401
409
402
	switch (opcode) {
410
	switch (opcode) {
403
	case oBadOption:
411
	case oBadOption:
404
		/* don't panic, but count bad options */
412
		/* don't panic, but count bad options */
405
		return -1;
413
		return -1;
406
		/* NOTREACHED */
414
		/* NOTREACHED */
415
	case oIgnoredUnknownOption:
416
		debug("%s line %d: Ignored unknown option \"%s\"",
417
		    filename, linenum, keyword);
418
		return 0;
407
	case oConnectTimeout:
419
	case oConnectTimeout:
408
		intptr = &options->connection_timeout;
420
		intptr = &options->connection_timeout;
409
parse_time:
421
parse_time:
Lines 1058-1063 parse_int: Link Here
1058
			*intptr = value;
1070
			*intptr = value;
1059
		break;
1071
		break;
1060
1072
1073
	case oIgnoreUnknown:
1074
		charptr = &options->ignored_unknown;
1075
		goto parse_string;
1076
1061
	case oDeprecated:
1077
	case oDeprecated:
1062
		debug("%s line %d: Deprecated option \"%s\"",
1078
		debug("%s line %d: Deprecated option \"%s\"",
1063
		    filename, linenum, keyword);
1079
		    filename, linenum, keyword);
Lines 1218-1223 initialize_options(Options * options) Link Here
1218
	options->ip_qos_interactive = -1;
1234
	options->ip_qos_interactive = -1;
1219
	options->ip_qos_bulk = -1;
1235
	options->ip_qos_bulk = -1;
1220
	options->request_tty = -1;
1236
	options->request_tty = -1;
1237
	options->ignored_unknown = NULL;
1221
}
1238
}
1222
1239
1223
/*
1240
/*
(-)readconf.h (+2 lines)
Lines 136-141 typedef struct { Link Here
136
	int	use_roaming;
136
	int	use_roaming;
137
137
138
	int	request_tty;
138
	int	request_tty;
139
140
	char	*ignored_unknown; /* Pattern list of unknown tokens to ignore */
139
}       Options;
141
}       Options;
140
142
141
#define SSHCTL_MASTER_NO	0
143
#define SSHCTL_MASTER_NO	0
(-)ssh_config.5 (+11 lines)
Lines 597-602 The default is the name given on the com Link Here
597
Numeric IP addresses are also permitted (both on the command line and in
597
Numeric IP addresses are also permitted (both on the command line and in
598
.Cm HostName
598
.Cm HostName
599
specifications).
599
specifications).
600
.It Cm IgnoreUnknown
601
Specifies a pattern-list of unknown options to be ignored if they are
602
encountered in configuration parsing.
603
This may be used to suppress errors if
604
.Nm
605
contains options that are unrecognised by
606
.Xr ssh 1 .
607
It is recommended that
608
.Cm IgnoreUnknown
609
be listed early in the configuration file as it will not be applied
610
to unknown options that appear before it.
600
.It Cm IdentitiesOnly
611
.It Cm IdentitiesOnly
601
Specifies that
612
Specifies that
602
.Xr ssh 1
613
.Xr ssh 1

Return to bug 866