mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-27 07:44:29 +02:00
upstream commit
Don't make parsing of authorized_keys' environment= option conditional on PermitUserEnv - always parse it, but only use the result if the option is enabled. This prevents the syntax of authorized_keys changing depending on which sshd_config options were enabled. bz#2329; based on patch from coladict AT gmail.com, ok dtucker@
This commit is contained in:
parent
e661a86353
commit
a42d67be65
@ -1,4 +1,4 @@
|
|||||||
/* $OpenBSD: auth-options.c,v 1.66 2015/04/22 01:24:01 djm Exp $ */
|
/* $OpenBSD: auth-options.c,v 1.67 2015/05/01 03:20:54 djm Exp $ */
|
||||||
/*
|
/*
|
||||||
* Author: Tatu Ylonen <ylo@cs.hut.fi>
|
* Author: Tatu Ylonen <ylo@cs.hut.fi>
|
||||||
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
|
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
|
||||||
@ -209,8 +209,7 @@ auth_parse_options(struct passwd *pw, char *opts, char *file, u_long linenum)
|
|||||||
goto next_option;
|
goto next_option;
|
||||||
}
|
}
|
||||||
cp = "environment=\"";
|
cp = "environment=\"";
|
||||||
if (options.permit_user_env &&
|
if (strncasecmp(opts, cp, strlen(cp)) == 0) {
|
||||||
strncasecmp(opts, cp, strlen(cp)) == 0) {
|
|
||||||
char *s;
|
char *s;
|
||||||
struct envstring *new_envstring;
|
struct envstring *new_envstring;
|
||||||
|
|
||||||
@ -236,13 +235,19 @@ auth_parse_options(struct passwd *pw, char *opts, char *file, u_long linenum)
|
|||||||
goto bad_option;
|
goto bad_option;
|
||||||
}
|
}
|
||||||
s[i] = '\0';
|
s[i] = '\0';
|
||||||
auth_debug_add("Adding to environment: %.900s", s);
|
|
||||||
debug("Adding to environment: %.900s", s);
|
|
||||||
opts++;
|
opts++;
|
||||||
new_envstring = xcalloc(1, sizeof(struct envstring));
|
if (options.permit_user_env) {
|
||||||
new_envstring->s = s;
|
auth_debug_add("Adding to environment: "
|
||||||
new_envstring->next = custom_environment;
|
"%.900s", s);
|
||||||
custom_environment = new_envstring;
|
debug("Adding to environment: %.900s", s);
|
||||||
|
new_envstring = xcalloc(1,
|
||||||
|
sizeof(*new_envstring));
|
||||||
|
new_envstring->s = s;
|
||||||
|
new_envstring->next = custom_environment;
|
||||||
|
custom_environment = new_envstring;
|
||||||
|
s = NULL;
|
||||||
|
}
|
||||||
|
free(s);
|
||||||
goto next_option;
|
goto next_option;
|
||||||
}
|
}
|
||||||
cp = "from=\"";
|
cp = "from=\"";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user