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

Collapse All | Expand All

(-)a/servconf.c (+13 lines)
Lines 805-810 get_connection_info(int populate, int use_dns) Link Here
805
	ci.address = ssh_remote_ipaddr(ssh);
805
	ci.address = ssh_remote_ipaddr(ssh);
806
	ci.laddress = ssh_local_ipaddr(ssh);
806
	ci.laddress = ssh_local_ipaddr(ssh);
807
	ci.lport = ssh_local_port(ssh);
807
	ci.lport = ssh_local_port(ssh);
808
	ci.rdomain = ssh_packet_rdomain_in(ssh);
808
	return &ci;
809
	return &ci;
809
}
810
}
810
811
Lines 988-993 match_cfg_line(char **condition, int line, struct connection_info *ci) Link Here
988
				    ci->laddress, port, line);
989
				    ci->laddress, port, line);
989
			else
990
			else
990
				result = 0;
991
				result = 0;
992
		} else if (strcasecmp(attrib, "rdomain") == 0) {
993
			if (ci == NULL || ci->rdomain == NULL) {
994
				result = 0;
995
				continue;
996
			}
997
			if (match_pattern_list(ci->rdomain, arg, 0) != 1)
998
				result = 0;
999
			else
1000
				debug("user %.100s matched 'RDomain %.100s' at "
1001
				    "line %d", ci->rdomain, arg, line);
991
		} else {
1002
		} else {
992
			error("Unsupported Match attribute %s", attrib);
1003
			error("Unsupported Match attribute %s", attrib);
993
			return -1;
1004
			return -1;
Lines 2024-2029 int parse_server_match_testspec(struct connection_info *ci, char *spec) Link Here
2024
			ci->user = xstrdup(p + 5);
2035
			ci->user = xstrdup(p + 5);
2025
		} else if (strncmp(p, "laddr=", 6) == 0) {
2036
		} else if (strncmp(p, "laddr=", 6) == 0) {
2026
			ci->laddress = xstrdup(p + 6);
2037
			ci->laddress = xstrdup(p + 6);
2038
		} else if (strncmp(p, "rdomain=", 8) == 0) {
2039
			ci->rdomain = xstrdup(p + 8);
2027
		} else if (strncmp(p, "lport=", 6) == 0) {
2040
		} else if (strncmp(p, "lport=", 6) == 0) {
2028
			ci->lport = a2port(p + 6);
2041
			ci->lport = a2port(p + 6);
2029
			if (ci->lport == -1) {
2042
			if (ci->lport == -1) {
(-)a/servconf.h (+1 lines)
Lines 216-221 struct connection_info { Link Here
216
	const char *address; 	/* remote address */
216
	const char *address; 	/* remote address */
217
	const char *laddress;	/* local address */
217
	const char *laddress;	/* local address */
218
	int lport;		/* local port */
218
	int lport;		/* local port */
219
	const char *rdomain;	/* routing domain if available */
219
};
220
};
220
221
221
222
(-)a/sshd.8 (+1 lines)
Lines 109-114 The keywords are Link Here
109
.Dq host ,
109
.Dq host ,
110
.Dq laddr ,
110
.Dq laddr ,
111
.Dq lport ,
111
.Dq lport ,
112
.Dq rdomain
112
and
113
and
113
.Dq addr .
114
.Dq addr .
114
All are required and may be supplied in any order, either with multiple
115
All are required and may be supplied in any order, either with multiple
(-)a/sshd.c (-3 / +7 lines)
Lines 1328-1334 main(int ac, char **av) Link Here
1328
	extern int optind;
1328
	extern int optind;
1329
	int r, opt, on = 1, already_daemon, remote_port;
1329
	int r, opt, on = 1, already_daemon, remote_port;
1330
	int sock_in = -1, sock_out = -1, newsock = -1;
1330
	int sock_in = -1, sock_out = -1, newsock = -1;
1331
	const char *remote_ip;
1331
	const char *remote_ip, *rdomain;
1332
	char *fp, *line, *laddr, *logfile = NULL;
1332
	char *fp, *line, *laddr, *logfile = NULL;
1333
	int config_s[2] = { -1 , -1 };
1333
	int config_s[2] = { -1 , -1 };
1334
	u_int i, j;
1334
	u_int i, j;
Lines 1866-1875 main(int ac, char **av) Link Here
1866
	 */
1866
	 */
1867
	remote_ip = ssh_remote_ipaddr(ssh);
1867
	remote_ip = ssh_remote_ipaddr(ssh);
1868
1868
1869
	rdomain = ssh_packet_rdomain_in(ssh);
1870
1869
	/* Log the connection. */
1871
	/* Log the connection. */
1870
	laddr = get_local_ipaddr(sock_in);
1872
	laddr = get_local_ipaddr(sock_in);
1871
	verbose("Connection from %s port %d on %s port %d",
1873
	verbose("Connection from %s port %d on %s port %d%s%s",
1872
	    remote_ip, remote_port, laddr,  ssh_local_port(ssh));
1874
	    remote_ip, remote_port, laddr,  ssh_local_port(ssh),
1875
	    rdomain == NULL ? "" : " rdomain ",
1876
	    rdomain == NULL ? "" : rdomain);
1873
	free(laddr);
1877
	free(laddr);
1874
1878
1875
	/*
1879
	/*
(-)a/sshd_config.5 (-2 / +8 lines)
Lines 1055-1062 The available criteria are Link Here
1055
.Cm Host ,
1055
.Cm Host ,
1056
.Cm LocalAddress ,
1056
.Cm LocalAddress ,
1057
.Cm LocalPort ,
1057
.Cm LocalPort ,
1058
.Cm RDomain ,
1058
and
1059
and
1059
.Cm Address .
1060
.Cm Address
1061
(with
1062
.Cm RDomain
1063
representing the
1064
.Xr rdomain 4
1065
on which the connection was received.)
1066
.Pp
1060
The match patterns may consist of single entries or comma-separated
1067
The match patterns may consist of single entries or comma-separated
1061
lists and may use the wildcard and negation operators described in the
1068
lists and may use the wildcard and negation operators described in the
1062
.Sx PATTERNS
1069
.Sx PATTERNS
1063
- 

Return to bug 2784