When running a login shell with a login_class specified, use

LOGIN_SETENV instead of rolling our own login.conf setenv support
since FreeBSD's login.conf has more than just setenv capabilities.
This requires us to swap the plugin-provided envp for the global
environ before calling setusercontext() and then stash the resulting
environ pointer back into the command details, which is kind of a
hack.
This commit is contained in:
Todd C. Miller
2011-12-08 17:17:25 -05:00
parent 27616d1f3e
commit a24d86b32c
10 changed files with 27 additions and 260 deletions

View File

@@ -98,6 +98,7 @@ struct environment {
/*
* Prototypes
*/
static void sudo_setenv(const char *, const char *, int);
static void sudo_putenv(char *, int, int);
/*
@@ -239,7 +240,7 @@ env_get(void)
* (not environ) and it always overwrites. The dupcheck param determines
* whether we need to verify that the variable is not already set.
*/
void
static void
sudo_setenv(const char *var, const char *val, int dupcheck)
{
char *estring;