mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-15 16:10:50 +02:00
fix obscure macOS issue where the Apple locale is set to something setlocale(3) doesn't understand; don't source .bash_logout if the shell is running setuid; fix for macOS issue with pipe size throttling and here-documents
This commit is contained in:
@@ -211,6 +211,9 @@ static int act_like_sh;
|
||||
/* Non-zero if we have already expanded and sourced $ENV. */
|
||||
static int sourced_env;
|
||||
|
||||
/* Non-zero if we have already sourced ~/.bash_logout. */
|
||||
static int sourced_logout;
|
||||
|
||||
/* Is this shell running setuid? */
|
||||
static int running_setuid;
|
||||
|
||||
@@ -1250,6 +1253,19 @@ run_startup_files (void)
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
bash_logout (void)
|
||||
{
|
||||
/* Run our `~/.bash_logout' file if it exists, and this is a login shell. */
|
||||
if (login_shell && sourced_logout++ == 0 && subshell_environment == 0 && running_setuid == 0)
|
||||
{
|
||||
maybe_execute_file ("~/.bash_logout", 1);
|
||||
#ifdef SYS_BASH_LOGOUT
|
||||
maybe_execute_file (SYS_BASH_LOGOUT, 1);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#if defined (RESTRICTED_SHELL)
|
||||
/* Return 1 if the shell should be a restricted one based on NAME or the
|
||||
value of `restricted'. Don't actually do anything, just return a
|
||||
|
||||
Reference in New Issue
Block a user