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

Collapse All | Expand All

(-)openssh-3.7.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.7.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.7.1p2-orig/servconf.c (+15 lines)
Lines 95-100 Link Here
95
	options->max_startups_rate = -1;
95
	options->max_startups_rate = -1;
96
	options->max_startups = -1;
96
	options->max_startups = -1;
97
	options->banner = NULL;
97
	options->banner = NULL;
98
	options->software_version = NULL;
99
	options->version_comments = NULL;
98
	options->use_dns = -1;
100
	options->use_dns = -1;
99
	options->client_alive_interval = -1;
101
	options->client_alive_interval = -1;
100
	options->client_alive_count_max = -1;
102
	options->client_alive_count_max = -1;
Lines 262-267 Link Here
262
	sBanner, sUseDNS, sHostbasedAuthentication,
264
	sBanner, sUseDNS, sHostbasedAuthentication,
263
	sHostbasedUsesNameFromPacketOnly, sClientAliveInterval,
265
	sHostbasedUsesNameFromPacketOnly, sClientAliveInterval,
264
	sClientAliveCountMax, sAuthorizedKeysFile, sAuthorizedKeysFile2,
266
	sClientAliveCountMax, sAuthorizedKeysFile, sAuthorizedKeysFile2,
267
	sSoftwareVersion, sVersionComments,
265
	sGssAuthentication, sGssCleanupCreds,
268
	sGssAuthentication, sGssCleanupCreds,
266
	sUsePrivilegeSeparation,
269
	sUsePrivilegeSeparation,
267
	sDeprecated, sUnsupported
270
	sDeprecated, sUnsupported
Lines 347-352 Link Here
347
	{ "subsystem", sSubsystem },
350
	{ "subsystem", sSubsystem },
348
	{ "maxstartups", sMaxStartups },
351
	{ "maxstartups", sMaxStartups },
349
	{ "banner", sBanner },
352
	{ "banner", sBanner },
353
	{ "softwareversion", sSoftwareVersion},
354
	{ "versioncomments", sVersionComments},
350
	{ "usedns", sUseDNS },
355
	{ "usedns", sUseDNS },
351
	{ "verifyreversemapping", sDeprecated },
356
	{ "verifyreversemapping", sDeprecated },
352
	{ "reversemappingcheck", sDeprecated },
357
	{ "reversemappingcheck", sDeprecated },
Lines 665-670 Link Here
665
		intptr = &options->x11_display_offset;
670
		intptr = &options->x11_display_offset;
666
		goto parse_int;
671
		goto parse_int;
667
672
673
	case sSoftwareVersion:
674
		arg = strdelim(&cp);
675
		options->software_version = xstrdup(arg);
676
		break;
677
678
	case sVersionComments:
679
		arg = strlineend(&cp);
680
		options->version_comments = xstrdup(arg);
681
		break;
682
668
	case sX11UseLocalhost:
683
	case sX11UseLocalhost:
669
		intptr = &options->x11_use_localhost;
684
		intptr = &options->x11_use_localhost;
670
		goto parse_flag;
685
		goto parse_flag;
(-)openssh-3.7.1p2-orig/servconf.h (+4 lines)
Lines 105-110 Link Here
105
	char   *subsystem_name[MAX_SUBSYSTEMS];
105
	char   *subsystem_name[MAX_SUBSYSTEMS];
106
	char   *subsystem_command[MAX_SUBSYSTEMS];
106
	char   *subsystem_command[MAX_SUBSYSTEMS];
107
107
108
	/* allow configurable version information overrides */
109
	char   *software_version;
110
	char   *version_comments;
111
108
	int	max_startups_begin;
112
	int	max_startups_begin;
109
	int	max_startups_rate;
113
	int	max_startups_rate;
110
	int	max_startups;
114
	int	max_startups;
(-)openssh-3.7.1p2-orig/sshd.c (-1 / +12 lines)
Lines 352-357 Link Here
352
	int i, mismatch;
352
	int i, mismatch;
353
	int remote_major, remote_minor;
353
	int remote_major, remote_minor;
354
	int major, minor;
354
	int major, minor;
355
	char *software_version=SSH_VERSION;
356
	char *version_comments=NULL;
355
	char *s;
357
	char *s;
356
	char buf[256];			/* Must not be larger than remote_version. */
358
	char buf[256];			/* Must not be larger than remote_version. */
357
	char remote_version[256];	/* Must be at least as big as buf. */
359
	char remote_version[256];	/* Must be at least as big as buf. */
Lines 367-373 Link Here
367
		major = PROTOCOL_MAJOR_1;
369
		major = PROTOCOL_MAJOR_1;
368
		minor = PROTOCOL_MINOR_1;
370
		minor = PROTOCOL_MINOR_1;
369
	}
371
	}
370
	snprintf(buf, sizeof buf, "SSH-%d.%d-%.100s\n", major, minor, SSH_VERSION);
372
	if (options.software_version) {
373
		software_version = options.software_version;
374
	}
375
	if (options.version_comments) {
376
		version_comments = options.version_comments;
377
	}
378
	snprintf(buf, sizeof buf, "SSH-%d.%d-%s%s%s\n", major, minor,
379
			software_version,
380
			version_comments ? " " : "",
381
			version_comments ? version_comments : "");
371
	server_version_string = xstrdup(buf);
382
	server_version_string = xstrdup(buf);
372
383
373
	/* Send our protocol version identification. */
384
	/* Send our protocol version identification. */
(-)openssh-3.7.1p2-orig/sshd_config (+4 lines)
Lines 94-96 Link Here
94
94
95
# override default of no subsystems
95
# override default of no subsystems
96
Subsystem	sftp	/usr/libexec/sftp-server
96
Subsystem	sftp	/usr/libexec/sftp-server
97
98
# override reported version information
99
#SoftwareVersion OpenSSH_3.6.1p2
100
#VersionComments Your friendly neighborhood SSH server
(-)openssh-3.7.1p2-orig/sshd_config.5 (+6 lines)
Lines 554-559 Link Here
554
.It Cm ServerKeyBits
554
.It Cm ServerKeyBits
555
Defines the number of bits in the ephemeral protocol version 1 server key.
555
Defines the number of bits in the ephemeral protocol version 1 server key.
556
The minimum value is 512, and the default is 768.
556
The minimum value is 512, and the default is 768.
557
.It Cm SoftwareVersion
558
Specifies the software version claimed in the handshake banner.
559
The default is the true software version.
557
.It Cm StrictModes
560
.It Cm StrictModes
558
Specifies whether
561
Specifies whether
559
.Nm sshd
562
.Nm sshd
Lines 625-630 Link Here
625
escalation by containing any corruption within the unprivileged processes.
628
escalation by containing any corruption within the unprivileged processes.
626
The default is
629
The default is
627
.Dq yes .
630
.Dq yes .
631
.It Cm VersionComments
632
Specifies the text following the software version in the handshake banner.
633
The default is empty.
628
.It Cm X11DisplayOffset
634
.It Cm X11DisplayOffset
629
Specifies the first display number available for
635
Specifies the first display number available for
630
.Nm sshd Ns 's
636
.Nm sshd Ns 's

Return to bug 764