As we reevaluate how to best support and maintain Staging Ref in the future, we encourage development teams using this environment to highlight their use cases in the following issue: https://gitlab.com/gitlab-com/gl-infra/software-delivery/framework/software-delivery-framework-issue-tracker/-/issues/36.

Skip to content
Snippets Groups Projects
Unverified Commit d8565cff authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Escape repository path

parent a0104118
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -43,7 +43,7 @@ class GitlabShell
def parse_cmd
args = Shellwords.shellwords(@origin_cmd)
@git_cmd = args[0]
@repo_name = args[1]
@repo_name = escape_path(args[1])
end
def git_cmds
Loading
Loading
@@ -86,4 +86,12 @@ class GitlabShell
def log_username
@config.audit_usernames ? username : "user with key #{@key_id}"
end
def escape_path(path)
if File.absolute_path(path, repos_path) == File.join(repos_path, path)
path
else
raise "Wrong repository path"
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment