Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
ion-plugins
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
redox-os
ion-plugins
Commits
b490295a
Commit
b490295a
authored
Jul 24, 2019
by
AdminXVII
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into 'master'
Fix variable names to have underscores See merge request
!2
parents
b9783995
e127546c
Pipeline
#5456
passed with stages
in 1 minute and 3 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
12 deletions
+16
-12
tools/ssh-agent.ion
tools/ssh-agent.ion
+16
-12
No files found.
tools/ssh-agent.ion
View file @
b490295a
...
...
@@ -7,21 +7,21 @@
# To enable **agent forwarding support** add the following to your initrc file:
#
# ```
# let ssh
-agent-
forwarding = 1
# let ssh
_agent_
forwarding = 1
# ```
#
# To **load identities** use the `ssh
-agent-
identities` variable, For example:
# To **load identities** use the `ssh
_agent_
identities` variable, For example:
#
# ```
# let ssh
-agent-
identities = [ id_rsa id_rsa2 id_github ]
# let ssh
_agent_
identities = [ id_rsa id_rsa2 id_github ]
# ```
#
# To **set the maximum lifetime of the identities**, use the `ssh
-agent-
lifetime` variable.
# To **set the maximum lifetime of the identities**, use the `ssh
_agent_
lifetime` variable.
# The lifetime may be specified in seconds or as described in sshd_config(5)
# (see _TIME FORMATS_). If left unspecified, the default lifetime is forever.
#
# ```
# let ssh
-agent-
lifetime 4h
# let ssh
_agent_
lifetime 4h
# ```
#
# ## Security
...
...
@@ -53,7 +53,7 @@ fn _start_agent
end
# test if agent-forwarding is enabled
if exists -s ssh_agent_
agent_forwarding && bool $ssh_agent
_agent_forwarding && exists -s env::SSH_AUTH_SOCK
if exists -s ssh_agent_
forwarding && bool $ssh
_agent_forwarding && exists -s env::SSH_AUTH_SOCK
# Add a nifty symlink for screen/tmux if agent forwarding
if not test -L $SSH_AUTH_SOCK
ln -sf $SSH_AUTH_SOCK /tmp/ssh-agent-$USER-screen
...
...
@@ -79,17 +79,17 @@ if not test -d $HOME/.ssh
return
end
let identities ?= []
let
ssh_agent_
identities ?= []
let loaded_sigs loaded_ids not_loaded = [] [] []
# add default keys if no identities were set up via zstyle
# this is to mimic the call to ssh-add with no identities
if eq $len(@identities) 0
if eq $len(@
ssh_agent_
identities) 0
# key list found on `ssh-add` man page's DESCRIPTION section
for id in id_rsa id_dsa id_ecdsa id_ed25519 identity
# check if file exists
if test -f "$HOME/.ssh/$id"
let identities ::= $id
let
ssh_agent_
identities ::= $id
end
end
end
...
...
@@ -101,7 +101,7 @@ for line in @split($(ssh-add -l) '\n')
end
# add identities if not already loaded
for id in @identities
for id in @
ssh_agent_
identities
# check for filename match, otherwise try for signature match
if not contains $id @loaded_ids
let sig = $(ssh-keygen -lf "$HOME/.ssh/$id" | awk '{print $2}')
...
...
@@ -114,8 +114,12 @@ end
if not eq 0 $len(@not_loaded)
ssh-add @not_loaded
end
if exists -s ssh_agent_agent_forwarding
drop ssh_agent_agent_forwarding
if exists -s ssh_agent_identities
drop ssh_agent_identities
end
if exists -s ssh_agent_forwarding
drop ssh_agent_forwarding
end
if exists -s ssh_agent_lifetime
drop ssh_agent_lifetime
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment