summaryrefslogtreecommitdiff
path: root/auth-options.c
diff options
context:
space:
mode:
Diffstat (limited to 'auth-options.c')
-rw-r--r--auth-options.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/auth-options.c b/auth-options.c
index 7eb87b352..ccdd0b20a 100644
--- a/auth-options.c
+++ b/auth-options.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: auth-options.c,v 1.72 2016/11/30 02:57:40 djm Exp $ */ 1/* $OpenBSD: auth-options.c,v 1.74 2017/09/12 06:32:07 djm Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -65,6 +65,8 @@ int logged_cert_hostip = 0;
65 65
66extern ServerOptions options; 66extern ServerOptions options;
67 67
68/* XXX refactor to be stateless */
69
68void 70void
69auth_start_parse_options(void) 71auth_start_parse_options(void)
70{ 72{
@@ -75,6 +77,8 @@ auth_start_parse_options(void)
75void 77void
76auth_clear_options(void) 78auth_clear_options(void)
77{ 79{
80 struct ssh *ssh = active_state; /* XXX */
81
78 no_agent_forwarding_flag = 0; 82 no_agent_forwarding_flag = 0;
79 no_port_forwarding_flag = 0; 83 no_port_forwarding_flag = 0;
80 no_pty_flag = 0; 84 no_pty_flag = 0;
@@ -92,7 +96,7 @@ auth_clear_options(void)
92 free(authorized_principals); 96 free(authorized_principals);
93 authorized_principals = NULL; 97 authorized_principals = NULL;
94 forced_tun_device = -1; 98 forced_tun_device = -1;
95 channel_clear_permitted_opens(); 99 channel_clear_permitted_opens(ssh);
96} 100}
97 101
98/* 102/*
@@ -128,9 +132,11 @@ match_flag(const char *opt, int allow_negate, char **optsp, const char *msg)
128/* 132/*
129 * return 1 if access is granted, 0 if not. 133 * return 1 if access is granted, 0 if not.
130 * side effect: sets key option flags 134 * side effect: sets key option flags
135 * XXX remove side effects; fill structure instead.
131 */ 136 */
132int 137int
133auth_parse_options(struct passwd *pw, char *opts, char *file, u_long linenum) 138auth_parse_options(struct passwd *pw, char *opts, const char *file,
139 u_long linenum)
134{ 140{
135 struct ssh *ssh = active_state; /* XXX */ 141 struct ssh *ssh = active_state; /* XXX */
136 const char *cp; 142 const char *cp;
@@ -393,7 +399,7 @@ auth_parse_options(struct passwd *pw, char *opts, char *file, u_long linenum)
393 goto bad_option; 399 goto bad_option;
394 } 400 }
395 if ((options.allow_tcp_forwarding & FORWARD_LOCAL) != 0) 401 if ((options.allow_tcp_forwarding & FORWARD_LOCAL) != 0)
396 channel_add_permitted_opens(host, port); 402 channel_add_permitted_opens(ssh, host, port);
397 free(patterns); 403 free(patterns);
398 goto next_option; 404 goto next_option;
399 } 405 }