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

Collapse All | Expand All

(-)a/channels.c (-4 / +10 lines)
Lines 138-143 static int num_adm_permitted_opens = 0; Link Here
138
/* special-case port number meaning allow any port */
138
/* special-case port number meaning allow any port */
139
#define FWD_PERMIT_ANY_PORT	0
139
#define FWD_PERMIT_ANY_PORT	0
140
140
141
/* special-case port number meaning allow any host */
142
#define FWD_PERMIT_ANY_HOST	"*"
143
141
/*
144
/*
142
 * If this is true, all opens are permitted.  This is the case on the server
145
 * If this is true, all opens are permitted.  This is the case on the server
143
 * on which we have to trust the client anyway, and the user could do
146
 * on which we have to trust the client anyway, and the user could do
Lines 3296-3305 open_match(ForwardPermission *allowed_open, const char *requestedhost, Link Here
3296
	if (allowed_open->host_to_connect == NULL)
3299
	if (allowed_open->host_to_connect == NULL)
3297
		return 0;
3300
		return 0;
3298
	if (allowed_open->port_to_connect != FWD_PERMIT_ANY_PORT &&
3301
	if (allowed_open->port_to_connect != FWD_PERMIT_ANY_PORT &&
3299
	    allowed_open->port_to_connect != requestedport)
3302
		allowed_open->port_to_connect != requestedport)
3300
		return 0;
3303
			return 0;
3301
	if (strcmp(allowed_open->host_to_connect, requestedhost) != 0)
3304
3302
		return 0;
3305
	if (strcmp(allowed_open->host_to_connect, FWD_PERMIT_ANY_HOST) != 0 &&
3306
		strcmp(allowed_open->host_to_connect, requestedhost) != 0)
3307
			return 0;
3308
3303
	return 1;
3309
	return 1;
3304
}
3310
}
3305
3311

Return to bug 2582