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

Collapse All | Expand All

(-)servconf.c (-20 / +19 lines)
Lines 1695-1718 int server_match_spec_complete(struct co Link Here
1695
	return 0;	/* partial */
1695
	return 0;	/* partial */
1696
}
1696
}
1697
1697
1698
/* Helper macros */
1699
#define M_CP_INTOPT(n) do {\
1700
	if (src->n != -1) \
1701
		dst->n = src->n; \
1702
} while (0)
1703
#define M_CP_STROPT(n) do {\
1704
	if (src->n != NULL) { \
1705
		free(dst->n); \
1706
		dst->n = src->n; \
1707
	} \
1708
} while(0)
1709
#define M_CP_STRARRAYOPT(n, num_n) do {\
1710
	if (src->num_n != 0) { \
1711
		for (dst->num_n = 0; dst->num_n < src->num_n; dst->num_n++) \
1712
			dst->n[dst->num_n] = xstrdup(src->n[dst->num_n]); \
1713
	} \
1714
} while(0)
1715
1716
/*
1698
/*
1717
 * Copy any supported values that are set.
1699
 * Copy any supported values that are set.
1718
 *
1700
 *
Lines 1723-1728 int server_match_spec_complete(struct co Link Here
1723
void
1705
void
1724
copy_set_server_options(ServerOptions *dst, ServerOptions *src, int preauth)
1706
copy_set_server_options(ServerOptions *dst, ServerOptions *src, int preauth)
1725
{
1707
{
1708
#define M_CP_INTOPT(n) do {\
1709
	if (src->n != -1) \
1710
		dst->n = src->n; \
1711
} while (0)
1712
1726
	M_CP_INTOPT(password_authentication);
1713
	M_CP_INTOPT(password_authentication);
1727
	M_CP_INTOPT(gss_authentication);
1714
	M_CP_INTOPT(gss_authentication);
1728
	M_CP_INTOPT(rsa_authentication);
1715
	M_CP_INTOPT(rsa_authentication);
Lines 1732-1739 copy_set_server_options(ServerOptions *d Link Here
1732
	M_CP_INTOPT(hostbased_uses_name_from_packet_only);
1719
	M_CP_INTOPT(hostbased_uses_name_from_packet_only);
1733
	M_CP_INTOPT(kbd_interactive_authentication);
1720
	M_CP_INTOPT(kbd_interactive_authentication);
1734
	M_CP_INTOPT(zero_knowledge_password_authentication);
1721
	M_CP_INTOPT(zero_knowledge_password_authentication);
1735
	M_CP_STROPT(authorized_keys_command);
1736
	M_CP_STROPT(authorized_keys_command_user);
1737
	M_CP_INTOPT(permit_root_login);
1722
	M_CP_INTOPT(permit_root_login);
1738
	M_CP_INTOPT(permit_empty_passwd);
1723
	M_CP_INTOPT(permit_empty_passwd);
1739
1724
Lines 1751-1756 copy_set_server_options(ServerOptions *d Link Here
1751
	M_CP_INTOPT(ip_qos_bulk);
1736
	M_CP_INTOPT(ip_qos_bulk);
1752
	M_CP_INTOPT(rekey_limit);
1737
	M_CP_INTOPT(rekey_limit);
1753
	M_CP_INTOPT(rekey_interval);
1738
	M_CP_INTOPT(rekey_interval);
1739
1740
	/* M_CP_STROPT and M_CP_STRARRAYOPT should not appear before here */
1741
#define M_CP_STROPT(n) do {\
1742
	if (src->n != NULL && dst->n != src->n) { \
1743
		free(dst->n); \
1744
		dst->n = src->n; \
1745
	} \
1746
} while(0)
1747
#define M_CP_STRARRAYOPT(n, num_n) do {\
1748
	if (src->num_n != 0) { \
1749
		for (dst->num_n = 0; dst->num_n < src->num_n; dst->num_n++) \
1750
			dst->n[dst->num_n] = xstrdup(src->n[dst->num_n]); \
1751
	} \
1752
} while(0)
1754
1753
1755
	/* See comment in servconf.h */
1754
	/* See comment in servconf.h */
1756
	COPY_MATCH_STRING_OPTS();
1755
	COPY_MATCH_STRING_OPTS();
(-)servconf.h (+3 lines)
Lines 200-205 struct connection_info { Link Here
200
 * Match sub-config and the main config, and must be sent from the
200
 * Match sub-config and the main config, and must be sent from the
201
 * privsep slave to the privsep master. We use a macro to ensure all
201
 * privsep slave to the privsep master. We use a macro to ensure all
202
 * the options are copied and the copies are done in the correct order.
202
 * the options are copied and the copies are done in the correct order.
203
 *
204
 * NB. an option must appear in servconf.c:copy_set_server_options() or
205
 * COPY_MATCH_STRING_OPTS here but never both.
203
 */
206
 */
204
#define COPY_MATCH_STRING_OPTS() do { \
207
#define COPY_MATCH_STRING_OPTS() do { \
205
		M_CP_STROPT(banner); \
208
		M_CP_STROPT(banner); \

Return to bug 2161