mirror of
https://github.com/slicer69/doas
synced 2024-10-04 15:10:15 +00:00
Revert keeping LANG variable of original user when switching to
another user. LANG is not kept unless explicitly passed in the doas.conf file.
This commit is contained in:
parent
6613c9d10c
commit
014d8655fe
2
doas.c
2
doas.c
|
@ -529,7 +529,7 @@ main(int argc, char **argv)
|
|||
LOGIN_SETUSER) != 0)
|
||||
errx(1, "failed to set user context for target");
|
||||
}
|
||||
/* No imulated login, skip setting target environment */
|
||||
/* No simulated login, skip setting target environment */
|
||||
else
|
||||
{
|
||||
if (setusercontext(NULL, target_pw, target,
|
||||
|
|
7
env.c
7
env.c
|
@ -117,7 +117,6 @@ createenv(struct rule *rule, struct passwd *original, struct passwd *target)
|
|||
{
|
||||
struct env *env;
|
||||
u_int i;
|
||||
char *language = NULL;
|
||||
|
||||
env = malloc(sizeof(*env));
|
||||
if (!env)
|
||||
|
@ -134,10 +133,6 @@ createenv(struct rule *rule, struct passwd *original, struct passwd *target)
|
|||
addnode(env, "PATH", GLOBAL_PATH);
|
||||
addnode(env, "SHELL", target->pw_shell);
|
||||
addnode(env, "USER", target->pw_name);
|
||||
/* avoid dropping language of original user */
|
||||
language = getenv("LANG");
|
||||
if (language)
|
||||
addnode(env, "LANG", language);
|
||||
|
||||
if (rule->options & KEEPENV) {
|
||||
#ifndef linux
|
||||
|
@ -200,7 +195,7 @@ fillenv(struct env *env, const char **envlist)
|
|||
struct envnode *node, key;
|
||||
const char *e, *eq;
|
||||
const char *val;
|
||||
char name[1024];
|
||||
char name[MAX_ENV_LENGTH];
|
||||
u_int i;
|
||||
size_t len;
|
||||
|
||||
|
|
Loading…
Reference in a new issue