-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
ssh: add trust checks before sourcing env vars #1395
base: master
Are you sure you want to change the base?
Conversation
modules/ssh/init.zsh
Outdated
@@ -16,6 +16,19 @@ _ssh_dir="$HOME/.ssh" | |||
# Set the path to the environment file if not set by another module. | |||
_ssh_agent_env="${_ssh_agent_env:-${TMPDIR:-/tmp}/ssh-agent.env.$UID}" | |||
|
|||
# Due to the predictability of the env file, check the env file exists and is | |||
# owned by current EUID before trusting it. | |||
if [ -f "$_ssh_agent_env" -a ! -O "$_ssh_agent_env" ]; then |
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.
Please use [[
rather than [
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.
fixed
0d8d91b
to
66bdc9c
Compare
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.
Looks good to me.
Note that #1394 should be resolved first, as this PR is based off of that PR.
66bdc9c
to
3cf374f
Compare
* Remove persistent SSH auth socket. * Make ps|grep more robust and POSIX compliant. * On macOS, use `-A` switch to "add identities to the agent using any passphrase stored in the user's keychain."
If the user defines identities in `:prezto:module:ssh:load`, always try to load them, even on macOS. On macOS, also try to load Keychain managed identities. (Assume if a user adds an identity to Keychain then the use would want those identities automatically loaded.)
3cf374f
to
84ad1f3
Compare
Since commit ff91c8d unnecessary. |
Proposed Changes