diff options
author | Dominic Hofer <6570912+dominichofer@users.noreply.github.com> | 2024-08-09 22:27:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-09 13:27:07 -0700 |
commit | da33c12ad4d70c39dce99885c64bb755d6fce2e6 (patch) | |
tree | 60fa819016a2e8dec658f492d9b395d3f4990f5b | |
parent | c30979ed6672cf20e32fb889e4d6b184c0c940fc (diff) | |
download | spack-da33c12ad4d70c39dce99885c64bb755d6fce2e6.tar.gz spack-da33c12ad4d70c39dce99885c64bb755d6fce2e6.tar.bz2 spack-da33c12ad4d70c39dce99885c64bb755d6fce2e6.tar.xz spack-da33c12ad4d70c39dce99885c64bb755d6fce2e6.zip |
Remove execution permission from setup-env.sh (#45641)
`setup-env.sh` is meant to be sourced, not executed directly.
By revoking execution permissions, users who accidentally execute
the script will receive an error instead of seeing no effect.
* Remove execution permission from `setup-env.sh` and friends
* Don't make output file executable in `spack commands --update-completion`
---------
Co-authored-by: Todd Gamblin <tgamblin@llnl.gov>
Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
-rw-r--r-- | lib/spack/spack/cmd/commands.py | 4 | ||||
-rw-r--r--[-rwxr-xr-x] | share/spack/setup-env.csh | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | share/spack/setup-env.fish | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | share/spack/setup-env.sh | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | share/spack/setup-tutorial-env.sh | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | share/spack/spack-completion.bash | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | share/spack/spack-completion.fish | 0 |
7 files changed, 0 insertions, 4 deletions
diff --git a/lib/spack/spack/cmd/commands.py b/lib/spack/spack/cmd/commands.py index f9979339ed..c6e775dd43 100644 --- a/lib/spack/spack/cmd/commands.py +++ b/lib/spack/spack/cmd/commands.py @@ -11,7 +11,6 @@ import sys from argparse import ArgumentParser, Namespace from typing import IO, Any, Callable, Dict, Iterable, List, Optional, Sequence, Set, Tuple, Union -import llnl.util.filesystem as fs import llnl.util.tty as tty from llnl.util.argparsewriter import ArgparseRstWriter, ArgparseWriter, Command from llnl.util.tty.colify import colify @@ -867,9 +866,6 @@ def _commands(parser: ArgumentParser, args: Namespace) -> None: prepend_header(args, f) formatter(args, f) - if args.update_completion: - fs.set_executable(args.update) - else: prepend_header(args, sys.stdout) formatter(args, sys.stdout) diff --git a/share/spack/setup-env.csh b/share/spack/setup-env.csh index 14dcee56b7..14dcee56b7 100755..100644 --- a/share/spack/setup-env.csh +++ b/share/spack/setup-env.csh diff --git a/share/spack/setup-env.fish b/share/spack/setup-env.fish index a7aac67430..a7aac67430 100755..100644 --- a/share/spack/setup-env.fish +++ b/share/spack/setup-env.fish diff --git a/share/spack/setup-env.sh b/share/spack/setup-env.sh index f3e87fe514..f3e87fe514 100755..100644 --- a/share/spack/setup-env.sh +++ b/share/spack/setup-env.sh diff --git a/share/spack/setup-tutorial-env.sh b/share/spack/setup-tutorial-env.sh index 6979da5329..6979da5329 100755..100644 --- a/share/spack/setup-tutorial-env.sh +++ b/share/spack/setup-tutorial-env.sh diff --git a/share/spack/spack-completion.bash b/share/spack/spack-completion.bash index 7a33021f4c..7a33021f4c 100755..100644 --- a/share/spack/spack-completion.bash +++ b/share/spack/spack-completion.bash diff --git a/share/spack/spack-completion.fish b/share/spack/spack-completion.fish index a2ffebda7c..a2ffebda7c 100755..100644 --- a/share/spack/spack-completion.fish +++ b/share/spack/spack-completion.fish |