diff options
Diffstat (limited to 'auth-options.c')
-rw-r--r-- | auth-options.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/auth-options.c b/auth-options.c index 3fa236eb8..9ab1880d9 100644 --- a/auth-options.c +++ b/auth-options.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: auth-options.c,v 1.65 2015/01/14 10:30:34 markus Exp $ */ | 1 | /* $OpenBSD: auth-options.c,v 1.67 2015/05/01 03:20:54 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 |
@@ -220,8 +220,7 @@ auth_parse_options(struct passwd *pw, char *opts, char *file, u_long linenum) | |||
220 | goto next_option; | 220 | goto next_option; |
221 | } | 221 | } |
222 | cp = "environment=\""; | 222 | cp = "environment=\""; |
223 | if (options.permit_user_env && | 223 | if (strncasecmp(opts, cp, strlen(cp)) == 0) { |
224 | strncasecmp(opts, cp, strlen(cp)) == 0) { | ||
225 | char *s; | 224 | char *s; |
226 | struct envstring *new_envstring; | 225 | struct envstring *new_envstring; |
227 | 226 | ||
@@ -247,13 +246,19 @@ auth_parse_options(struct passwd *pw, char *opts, char *file, u_long linenum) | |||
247 | goto bad_option; | 246 | goto bad_option; |
248 | } | 247 | } |
249 | s[i] = '\0'; | 248 | s[i] = '\0'; |
250 | auth_debug_add("Adding to environment: %.900s", s); | ||
251 | debug("Adding to environment: %.900s", s); | ||
252 | opts++; | 249 | opts++; |
253 | new_envstring = xcalloc(1, sizeof(struct envstring)); | 250 | if (options.permit_user_env) { |
254 | new_envstring->s = s; | 251 | auth_debug_add("Adding to environment: " |
255 | new_envstring->next = custom_environment; | 252 | "%.900s", s); |
256 | custom_environment = new_envstring; | 253 | debug("Adding to environment: %.900s", s); |
254 | new_envstring = xcalloc(1, | ||
255 | sizeof(*new_envstring)); | ||
256 | new_envstring->s = s; | ||
257 | new_envstring->next = custom_environment; | ||
258 | custom_environment = new_envstring; | ||
259 | s = NULL; | ||
260 | } | ||
261 | free(s); | ||
257 | goto next_option; | 262 | goto next_option; |
258 | } | 263 | } |
259 | cp = "from=\""; | 264 | cp = "from=\""; |
@@ -620,7 +625,7 @@ auth_cert_options(struct sshkey *k, struct passwd *pw) | |||
620 | &cert_source_address_done) == -1) | 625 | &cert_source_address_done) == -1) |
621 | return -1; | 626 | return -1; |
622 | if (parse_option_list(k->cert->extensions, pw, | 627 | if (parse_option_list(k->cert->extensions, pw, |
623 | OPTIONS_EXTENSIONS, 1, | 628 | OPTIONS_EXTENSIONS, 0, |
624 | &cert_no_port_forwarding_flag, | 629 | &cert_no_port_forwarding_flag, |
625 | &cert_no_agent_forwarding_flag, | 630 | &cert_no_agent_forwarding_flag, |
626 | &cert_no_x11_forwarding_flag, | 631 | &cert_no_x11_forwarding_flag, |