mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 09:00:22 +00:00
Shell: Don't execute scripts interactively.
The following example should illustrate one issue arising from this: $ echo 'exit 1' > example.sh $ Shell example.sh Good-bye! This message is meant to be shown to an interactive user, but not in a shell script.
This commit is contained in:
parent
d3d7ea7e75
commit
afa2523724
Notes:
sideshowbarker
2024-07-19 02:08:46 +09:00
Author: https://github.com/asynts Commit: https://github.com/SerenityOS/serenity/commit/afa2523724c Pull-request: https://github.com/SerenityOS/serenity/pull/3627
1 changed files with 2 additions and 0 deletions
|
@ -873,6 +873,8 @@ NonnullRefPtrVector<Job> Shell::run_commands(Vector<AST::Command>& commands)
|
|||
bool Shell::run_file(const String& filename, bool explicitly_invoked)
|
||||
{
|
||||
TemporaryChange script_change { current_script, filename };
|
||||
TemporaryChange interactive_change { m_is_interactive, false };
|
||||
|
||||
auto file_result = Core::File::open(filename, Core::File::ReadOnly);
|
||||
if (file_result.is_error()) {
|
||||
if (explicitly_invoked)
|
||||
|
|
Loading…
Reference in a new issue