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

Collapse All | Expand All

(-)misc.c (-1 / +1 lines)
Lines 531-537 put_host_port(const char *host, u_short Link Here
531
 * The delimiter char, if present, is stored in delim.
531
 * The delimiter char, if present, is stored in delim.
532
 * If this is the last field, *cp is set to NULL.
532
 * If this is the last field, *cp is set to NULL.
533
 */
533
 */
534
static char *
534
char *
535
hpdelim2(char **cp, char *delim)
535
hpdelim2(char **cp, char *delim)
536
{
536
{
537
	char *s, *old;
537
	char *s, *old;
(-)misc.h (+1 lines)
Lines 57-62 int timeout_connect(int, const struct s Link Here
57
int	 a2port(const char *);
57
int	 a2port(const char *);
58
int	 a2tun(const char *, int *);
58
int	 a2tun(const char *, int *);
59
char	*put_host_port(const char *, u_short);
59
char	*put_host_port(const char *, u_short);
60
char	*hpdelim2(char **, char *);
60
char	*hpdelim(char **);
61
char	*hpdelim(char **);
61
char	*cleanhostname(char *);
62
char	*cleanhostname(char *);
62
char	*colon(char *);
63
char	*colon(char *);
(-)servconf.c (-7 / +11 lines)
Lines 821-827 process_permitopen_list(struct ssh *ssh, Link Here
821
{
821
{
822
	u_int i;
822
	u_int i;
823
	int port;
823
	int port;
824
	char *host, *arg, *oarg;
824
	char *host, *arg, *oarg, ch;
825
	int where = opcode == sPermitOpen ? FORWARD_LOCAL : FORWARD_REMOTE;
825
	int where = opcode == sPermitOpen ? FORWARD_LOCAL : FORWARD_REMOTE;
826
	const char *what = lookup_opcode_name(opcode);
826
	const char *what = lookup_opcode_name(opcode);
827
827
Lines 839-846 process_permitopen_list(struct ssh *ssh, Link Here
839
	/* Otherwise treat it as a list of permitted host:port */
839
	/* Otherwise treat it as a list of permitted host:port */
840
	for (i = 0; i < num_opens; i++) {
840
	for (i = 0; i < num_opens; i++) {
841
		oarg = arg = xstrdup(opens[i]);
841
		oarg = arg = xstrdup(opens[i]);
842
		host = hpdelim(&arg);
842
		host = hpdelim2(&arg, &ch);
843
		if (host == NULL)
843
		if (host == NULL || ch == '/')
844
			fatal("%s: missing host in %s", __func__, what);
844
			fatal("%s: missing host in %s", __func__, what);
845
		host = cleanhostname(host);
845
		host = cleanhostname(host);
846
		if (arg == NULL || ((port = permitopen_port(arg)) < 0))
846
		if (arg == NULL || ((port = permitopen_port(arg)) < 0))
Lines 1251-1258 process_server_config_line(ServerOptions Link Here
1251
			port = 0;
1251
			port = 0;
1252
			p = arg;
1252
			p = arg;
1253
		} else {
1253
		} else {
1254
			p = hpdelim(&arg);
1254
			char ch;
1255
			if (p == NULL)
1255
			arg2 = NULL;
1256
			p = hpdelim2(&arg, &ch);
1257
			if (p == NULL || ch == '/')
1256
				fatal("%s line %d: bad address:port usage",
1258
				fatal("%s line %d: bad address:port usage",
1257
				    filename, linenum);
1259
				    filename, linenum);
1258
			p = cleanhostname(p);
1260
			p = cleanhostname(p);
Lines 1879-1887 process_server_config_line(ServerOptions Link Here
1879
				 */
1881
				 */
1880
				xasprintf(&arg2, "*:%s", arg);
1882
				xasprintf(&arg2, "*:%s", arg);
1881
			} else {
1883
			} else {
1884
				char ch;
1885
1882
				arg2 = xstrdup(arg);
1886
				arg2 = xstrdup(arg);
1883
				p = hpdelim(&arg);
1887
				p = hpdelim2(&arg, &ch);
1884
				if (p == NULL) {
1888
				if (p == NULL || ch == '/') {
1885
					fatal("%s line %d: missing host in %s",
1889
					fatal("%s line %d: missing host in %s",
1886
					    filename, linenum,
1890
					    filename, linenum,
1887
					    lookup_opcode_name(opcode));
1891
					    lookup_opcode_name(opcode));

Return to bug 2335