Merge pull request #3695 from akarl10/user-shell-environment-fix
User shell environment fix
This commit is contained in:
@@ -257,9 +257,12 @@ start_window_manager(const struct login_info *login_info,
|
||||
}
|
||||
}
|
||||
|
||||
if (g_cfg->sec.allow_alternate_shell &&
|
||||
g_cfg->sec.pass_shell_as_env != NULL &&
|
||||
g_cfg->sec.pass_shell_as_env[0] != '0')
|
||||
if (s->shell[0] != '\0')
|
||||
{
|
||||
if (g_cfg->sec.allow_alternate_shell)
|
||||
{
|
||||
if (g_cfg->sec.pass_shell_as_env != NULL &&
|
||||
g_cfg->sec.pass_shell_as_env[0] != '\0')
|
||||
{
|
||||
// Pass the shell in to the standard startwm scripts
|
||||
// in an environment variable
|
||||
@@ -269,11 +272,9 @@ start_window_manager(const struct login_info *login_info,
|
||||
s->shell);
|
||||
g_setenv_log(g_cfg->sec.pass_shell_as_env, s->shell, 1);
|
||||
}
|
||||
else if (s->shell[0] != '\0')
|
||||
else
|
||||
{
|
||||
// Try to execute the shell directly (if permitted)
|
||||
if (g_cfg->sec.allow_alternate_shell)
|
||||
{
|
||||
if (g_strchr(s->shell, ' ') != 0 || g_strchr(s->shell, '\t') != 0)
|
||||
{
|
||||
LOG(LOG_LEVEL_INFO,
|
||||
@@ -291,6 +292,7 @@ start_window_manager(const struct login_info *login_info,
|
||||
g_execlp3(s->shell, s->shell, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(LOG_LEVEL_WARNING,
|
||||
|
||||
Reference in New Issue
Block a user