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

Collapse All | Expand All

(-)openssh-3.6.1p2-orig/misc.c (-1 / +26 lines)
Lines 111-117 Link Here
111
}
111
}
112
112
113
/* Characters considered whitespace in strsep calls. */
113
/* Characters considered whitespace in strsep calls. */
114
#define WHITESPACE " \t\r\n"
114
#define LINEEND    "\r\n"
115
#define WHITESPACE " \t" LINEEND
115
116
116
/* return next token in configuration line */
117
/* return next token in configuration line */
117
char *
118
char *
Lines 141-146 Link Here
141
	return (old);
142
	return (old);
142
}
143
}
143
144
145
char *
146
strlineend(char **s)
147
{
148
	char *old;
149
	int wspace = 0;
150
151
	if (*s == NULL)
152
		return NULL;
153
154
	old = *s;
155
156
	*s = strpbrk(*s, LINEEND);
157
	if (*s == NULL)
158
		return (old);
159
160
	*s[0] = '\0';
161
162
	*s += strspn(*s + 1, LINEEND) + 1;
163
	if (*s[0] == '=' && !wspace)
164
		*s += strspn(*s + 1, LINEEND) + 1;
165
166
	return (old);
167
}
168
144
struct passwd *
169
struct passwd *
145
pwcopy(struct passwd *pw)
170
pwcopy(struct passwd *pw)
146
{
171
{
(-)openssh-3.6.1p2-orig/misc.h (+1 lines)
Lines 14-19 Link Here
14
14
15
char	*chop(char *);
15
char	*chop(char *);
16
char	*strdelim(char **);
16
char	*strdelim(char **);
17
char	*strlineend(char **);
17
void	 set_nonblock(int);
18
void	 set_nonblock(int);
18
void	 unset_nonblock(int);
19
void	 unset_nonblock(int);
19
void	 set_nodelay(int);
20
void	 set_nodelay(int);
(-)openssh-3.6.1p2-orig/servconf.c (+28 lines)
Lines 118-123 Link Here
118
	options->max_startups_rate = -1;
118
	options->max_startups_rate = -1;
119
	options->max_startups = -1;
119
	options->max_startups = -1;
120
	options->banner = NULL;
120
	options->banner = NULL;
121
	options->proto_version_minor = -1;
122
	options->proto_version_major = -1;
123
	options->software_version = NULL;
124
	options->version_comments = NULL;
121
	options->verify_reverse_mapping = -1;
125
	options->verify_reverse_mapping = -1;
122
	options->client_alive_interval = -1;
126
	options->client_alive_interval = -1;
123
	options->client_alive_count_max = -1;
127
	options->client_alive_count_max = -1;
Lines 301-306 Link Here
301
	sBanner, sVerifyReverseMapping, sHostbasedAuthentication,
305
	sBanner, sVerifyReverseMapping, sHostbasedAuthentication,
302
	sHostbasedUsesNameFromPacketOnly, sClientAliveInterval,
306
	sHostbasedUsesNameFromPacketOnly, sClientAliveInterval,
303
	sClientAliveCountMax, sAuthorizedKeysFile, sAuthorizedKeysFile2,
307
	sClientAliveCountMax, sAuthorizedKeysFile, sAuthorizedKeysFile2,
308
	sProtoVersionMinor, sProtoVersionMajor,
309
	sSoftwareVersion, sVersionComments,
304
	sUsePrivilegeSeparation,
310
	sUsePrivilegeSeparation,
305
	sDeprecated
311
	sDeprecated
306
} ServerOpCodes;
312
} ServerOpCodes;
Lines 380-385 Link Here
380
	{ "authorizedkeysfile", sAuthorizedKeysFile },
386
	{ "authorizedkeysfile", sAuthorizedKeysFile },
381
	{ "authorizedkeysfile2", sAuthorizedKeysFile2 },
387
	{ "authorizedkeysfile2", sAuthorizedKeysFile2 },
382
	{ "useprivilegeseparation", sUsePrivilegeSeparation},
388
	{ "useprivilegeseparation", sUsePrivilegeSeparation},
389
	{ "protoversionminor", sProtoVersionMinor},
390
	{ "protoversionmajor", sProtoVersionMajor},
391
	{ "softwareversion", sSoftwareVersion},
392
	{ "versioncomments", sVersionComments},
383
	{ NULL, sBadOption }
393
	{ NULL, sBadOption }
384
};
394
};
385
395
Lines 697-702 Link Here
697
		intptr = &options->x11_display_offset;
707
		intptr = &options->x11_display_offset;
698
		goto parse_int;
708
		goto parse_int;
699
709
710
	case sProtoVersionMajor:
711
		intptr = &options->proto_version_major;
712
		goto parse_int;
713
714
	case sProtoVersionMinor:
715
		intptr = &options->proto_version_minor;
716
		goto parse_int;
717
718
	case sSoftwareVersion:
719
		arg = strdelim(&cp);
720
		options->software_version = xstrdup(arg);
721
		break;
722
723
	case sVersionComments:
724
		arg = strlineend(&cp);
725
		options->version_comments = xstrdup(arg);
726
		break;
727
700
	case sX11UseLocalhost:
728
	case sX11UseLocalhost:
701
		intptr = &options->x11_use_localhost;
729
		intptr = &options->x11_use_localhost;
702
		goto parse_flag;
730
		goto parse_flag;
(-)openssh-3.6.1p2-orig/servconf.h (+6 lines)
Lines 114-119 Link Here
114
	char   *subsystem_name[MAX_SUBSYSTEMS];
114
	char   *subsystem_name[MAX_SUBSYSTEMS];
115
	char   *subsystem_command[MAX_SUBSYSTEMS];
115
	char   *subsystem_command[MAX_SUBSYSTEMS];
116
116
117
	/* allow configurable version information overrides */
118
	int     proto_version_major;
119
	int     proto_version_minor;
120
	char   *software_version;
121
	char   *version_comments;
122
117
	int	max_startups_begin;
123
	int	max_startups_begin;
118
	int	max_startups_rate;
124
	int	max_startups_rate;
119
	int	max_startups;
125
	int	max_startups;
(-)openssh-3.6.1p2-orig/sshd.c (-1 / +18 lines)
Lines 353-358 Link Here
353
	int i, mismatch;
353
	int i, mismatch;
354
	int remote_major, remote_minor;
354
	int remote_major, remote_minor;
355
	int major, minor;
355
	int major, minor;
356
	char *software_version=SSH_VERSION;
357
	char *version_comments=NULL;
356
	char *s;
358
	char *s;
357
	char buf[256];			/* Must not be larger than remote_version. */
359
	char buf[256];			/* Must not be larger than remote_version. */
358
	char remote_version[256];	/* Must be at least as big as buf. */
360
	char remote_version[256];	/* Must be at least as big as buf. */
Lines 368-374 Link Here
368
		major = PROTOCOL_MAJOR_1;
370
		major = PROTOCOL_MAJOR_1;
369
		minor = PROTOCOL_MINOR_1;
371
		minor = PROTOCOL_MINOR_1;
370
	}
372
	}
371
	snprintf(buf, sizeof buf, "SSH-%d.%d-%.100s\n", major, minor, SSH_VERSION);
373
	if (options.proto_version_major>=0) {
374
		major = options.proto_version_major;
375
	}
376
	if (options.proto_version_minor>=0) {
377
		minor = options.proto_version_minor;
378
	}
379
	if (options.software_version) {
380
		software_version = options.software_version;
381
	}
382
	if (options.version_comments) {
383
		version_comments = options.version_comments;
384
	}
385
	snprintf(buf, sizeof buf, "SSH-%d.%d-%s%s%s\n", major, minor,
386
			software_version,
387
			version_comments ? " " : "",
388
			version_comments ? version_comments : "");
372
	server_version_string = xstrdup(buf);
389
	server_version_string = xstrdup(buf);
373
390
374
	if (client_version_string == NULL) {
391
	if (client_version_string == NULL) {
(-)openssh-3.6.1p2-orig/sshd_config (+6 lines)
Lines 91-93 Link Here
91
91
92
# override default of no subsystems
92
# override default of no subsystems
93
Subsystem	sftp	/usr/libexec/sftp-server
93
Subsystem	sftp	/usr/libexec/sftp-server
94
95
# override reported version information
96
#ProtoVersionMajor 1
97
#ProtoVersionMinor 99
98
#SoftwareVersion 3.6.1p2
99
#VersionComments Your friendly neighborhood SSH server
(-)openssh-3.6.1p2-orig/sshd_config.5 (+12 lines)
Lines 529-534 Link Here
529
.Dq 2,1
529
.Dq 2,1
530
is identical to
530
is identical to
531
.Dq 1,2 .
531
.Dq 1,2 .
532
.It Cm ProtoVersionMajor
533
Specifies the major version claimed in the handshake banner.
534
The default is the true major version.
535
.It Cm ProtoVersionMinor
536
Specifies the minor version claimed in the handshake banner.
537
The default is the true minor version.
532
.It Cm PubkeyAuthentication
538
.It Cm PubkeyAuthentication
533
Specifies whether public key authentication is allowed.
539
Specifies whether public key authentication is allowed.
534
The default is
540
The default is
Lines 559-564 Link Here
559
.It Cm ServerKeyBits
565
.It Cm ServerKeyBits
560
Defines the number of bits in the ephemeral protocol version 1 server key.
566
Defines the number of bits in the ephemeral protocol version 1 server key.
561
The minimum value is 512, and the default is 768.
567
The minimum value is 512, and the default is 768.
568
.It Cm SoftwareVersion
569
Specifies the software version claimed in the handshake banner.
570
The default is the true software version.
562
.It Cm StrictModes
571
.It Cm StrictModes
563
Specifies whether
572
Specifies whether
564
.Nm sshd
573
.Nm sshd
Lines 623-628 Link Here
623
very same IP address.
632
very same IP address.
624
The default is
633
The default is
625
.Dq no .
634
.Dq no .
635
.It Cm VersionComments
636
Specifies the text following the software version in the handshake banner.
637
The default is empty.
626
.It Cm X11DisplayOffset
638
.It Cm X11DisplayOffset
627
Specifies the first display number available for
639
Specifies the first display number available for
628
.Nm sshd Ns 's
640
.Nm sshd Ns 's

Return to bug 764