Commit 199b2251 authored by Max Krasnyansky's avatar Max Krasnyansky

Regex used in rm-key command is too lax

Basically the issue is that 'gitlab-shell rm-key key-2' removes all keys that match "key-2" pattern.
"key-20", "key-25", etc.
This change makes the regex used in the sed command more strict.
parent fc550205
......@@ -31,7 +31,7 @@ class GitlabKeys
end
def rm_key
cmd = "sed -i '/shell #{@key_id}/d' #{auth_file}"
cmd = "sed -i '/shell #{@key_id}\"/d' #{auth_file}"
system(cmd)
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment