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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user