Skip to content

Commit

Permalink
sec: do not append session envs to git run (#544)
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
  • Loading branch information
caarlos0 authored Jul 30, 2024
1 parent b5f5721 commit 4daebdd
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions pkg/ssh/cmd/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,6 @@ func gitRunE(cmd *cobra.Command, args []string) error {
)
}

// Add ssh session & config environ
s := sshutils.SessionFromContext(ctx)
envs = append(envs, s.Environ()...)

This comment has been minimized.

Copy link
@aymanbagabas

aymanbagabas Jul 31, 2024

Member

Now that I think about this, this is gonna be a problem for git protocol v1 and v2. We need to pass at least GIT_PROTOCOL environment variable to the command to tell git which protocol to speak

This comment has been minimized.

Copy link
@aymanbagabas

aymanbagabas Jul 31, 2024

Member

Fixed in main

envs = append(envs, cfg.Environ()...)

repoPath := filepath.Join(reposDir, repoDir)
Expand Down

0 comments on commit 4daebdd

Please # to comment.