Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-shell
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kazuhiko Shiozaki
gitlab-shell
Commits
c11c923c
Commit
c11c923c
authored
Apr 10, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent keys with a very specific comment from accidentally being deleted.
parent
fcb6bb46
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
3 deletions
+10
-3
CHANGELOG
CHANGELOG
+3
-0
VERSION
VERSION
+1
-1
lib/gitlab_keys.rb
lib/gitlab_keys.rb
+6
-2
No files found.
CHANGELOG
View file @
c11c923c
v2.6.3
- Prevent keys with a very specific comment from accidentally being deleted.
v2.6.2
- Include ecdsa keys in `gitlab_keys list-keys`.
- Refactor logic around GL_ID
...
...
VERSION
View file @
c11c923c
2.6.
2
2.6.
3
lib/gitlab_keys.rb
View file @
c11c923c
...
...
@@ -71,8 +71,12 @@ class GitlabKeys
$stdin
end
def
key_command
(
key_id
)
"
#{
ROOT_PATH
}
/bin/gitlab-shell
#{
key_id
}
"
end
def
key_line
(
key_id
,
public_key
)
auth_line
=
"command=
\"
#{
ROOT_PATH
}
/bin/gitlab-shell
#{
key_id
}
\"
,no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty
#{
public_key
}
"
auth_line
=
"command=
\"
#{
key_command
(
key_id
)
}
\"
,no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty
#{
public_key
}
"
end
def
rm_key
...
...
@@ -81,7 +85,7 @@ class GitlabKeys
Tempfile
.
open
(
'authorized_keys'
)
do
|
temp
|
open
(
auth_file
,
'r+'
)
do
|
current
|
current
.
each
do
|
line
|
temp
.
puts
(
line
)
unless
line
.
include?
(
"/bin/gitlab-shell
#{
@key_id
}
\"
"
)
temp
.
puts
(
line
)
unless
line
.
start_with?
(
"command=
\"
#{
key_command
(
@key_id
)
}
\"
"
)
end
end
temp
.
close
...
...
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