-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not enable bash-preexec.sh
in non-interactive shells
#160
base: master
Are you sure you want to change the base?
Conversation
Maybe it's worth making environment variable overrides. Here's a snippet from if [ -z "${LMOD_ALLOW_ROOT_USE+x}" ]; then
LMOD_ALLOW_ROOT_USE=yes
fi
( [ -n "${USER_IS_ROOT:-}" ] || ( [ "${LMOD_ALLOW_ROOT_USE:-}" != yes ] && [ $(id -u) = 0 ] ) ) && return |
1bf3e25
to
3e1581c
Compare
What's that? These lines seem to be set up by |
Of course, that would also be possible, but maybe some standardization of override environment variables should be considered if that would be added. |
I understand that part, but the question is whether
As far as I see your explanation, it just seems like a loader of the Lmod framework on |
Yes, just that. Just having an interface like
Well, yes, we can carry the |
Thank you for your clarification. I've been misunderstanding the intent.
The interactive check can be included in
Compared to the variable for the non-interactive shells, the one for the root-user check may have use cases. However, I'm not convinced by that specific option, so I'm currently not thinking of including it in this PR (Of course, we can continue the discussion in another PR). The root user that I suggested in #159 (comment) is just one example. The problem of forcibly loading @LecrisUT Do you request this PR to include the root user check? I'm sorry to bother you, but I have to explicitly ask this because this project seems very strict about PRs; a PR won't be merged if PR has unresolved conversations. In this sense, every comment in PRs in |
Deferred, I trust your judgement on whether it is relevant to have an override for the interactive is needed or not. The root check can be addressed separately. |
Thanks. |
30e09cb
to
6b7a9be
Compare
@jparise I'd appreciate it if you could review this PR. In #152 (comment), the maintainers seem to require several external reviewers to leave reviews before merging (except for the trivial ones like #165), though there is no sufficient audience watching this repository. Recently, I'm the only reviewer regularly watching this repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code looks good to me. I think it might be nice to mention __bp_inside_test
in test/README.md
because users who want to test bash-preexec.sh
as part of their own tests would also need to set it.
Overall, though, I'm not clear if this is solving a known problem or if enforcing this restriction is more of a "correctness / precondition"?
6b7a9be
to
acc0aa5
Compare
@jparise Thanks for the suggestion! That makes sense. I updated it (
I think even without this condition, there wouldn't be a real problem. This is just for the cleanliness of the shell environment not to introduce random functions and variables that wouldn't be used. Some users put |
From the discussion in #159: