Skip to content

Conversation

@slarew
Copy link
Contributor

@slarew slarew commented Jul 22, 2017

Proposed Changes

  • Add ownership test before attempting to source environment variables in SSH module. If the file is not owned by the current user, its contents should not be trusted. The default path is predictable and thus subject to abuse.


# 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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use [[ rather than [

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Copy link
Collaborator

@jeffwidman jeffwidman left a 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.

* 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.)
@Shea690901
Copy link

Since commit ff91c8d unnecessary.
From this commit on, the env-file is stored within the XDG_CACHE_HOME directory (alternative in ${HOME}/.cache) and as such isn't be stored in a world writeable location (at least I hope nobody has that location writable for anybody except oneself).
The same goes for the gpg-agent.env which, depending of the configuration, might be used instead of the ssh one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants