Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gitea serv doesn't respect git's binary path in config(app.ini): #23137

Closed
wxiaoguang opened this issue Feb 25, 2023 · 0 comments · Fixed by #23138
Closed

gitea serv doesn't respect git's binary path in config(app.ini): #23137

wxiaoguang opened this issue Feb 25, 2023 · 0 comments · Fixed by #23138
Labels

Comments

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Feb 25, 2023

Description

gitea serv doesn't respect git's binary path in config(app.ini):

gitea/cmd/serv.go

Lines 293 to 304 in 10cdcb9

// Special handle for Windows.
if setting.IsWindows {
verb = strings.Replace(verb, "-", " ", 1)
}
var gitcmd *exec.Cmd
verbs := strings.Split(verb, " ")
if len(verbs) == 2 {
gitcmd = exec.CommandContext(ctx, verbs[0], verbs[1], repoPath)
} else {
gitcmd = exec.CommandContext(ctx, verb, repoPath)
}

If a user has different git versions, this code might execute an incorrect git.

jolheiser pushed a commit that referenced this issue Feb 28, 2023
Close #23137

The old code is too old (8-9 years ago)

Let's try to execute the git commands from git bin home directly.

The verb has been checked above, it could only be:
* git-upload-pack
* git-upload-archive
* git-receive-pack
* git-lfs-authenticate
GiteaBot pushed a commit to GiteaBot/gitea that referenced this issue Feb 28, 2023
Close go-gitea#23137

The old code is too old (8-9 years ago)

Let's try to execute the git commands from git bin home directly.

The verb has been checked above, it could only be:
* git-upload-pack
* git-upload-archive
* git-receive-pack
* git-lfs-authenticate
GiteaBot pushed a commit to GiteaBot/gitea that referenced this issue Feb 28, 2023
Close go-gitea#23137

The old code is too old (8-9 years ago)

Let's try to execute the git commands from git bin home directly.

The verb has been checked above, it could only be:
* git-upload-pack
* git-upload-archive
* git-receive-pack
* git-lfs-authenticate
jolheiser pushed a commit that referenced this issue Feb 28, 2023
Backport #23138

Close #23137

The old code is too old (8-9 years ago)

Let's try to execute the git commands from git bin home directly.

The verb has been checked above, it could only be:
* git-upload-pack
* git-upload-archive
* git-receive-pack
* git-lfs-authenticate

Co-authored-by: wxiaoguang <[email protected]>
jolheiser pushed a commit that referenced this issue Feb 28, 2023
Backport #23138

Close #23137

The old code is too old (8-9 years ago)

Let's try to execute the git commands from git bin home directly.

The verb has been checked above, it could only be:
* git-upload-pack
* git-upload-archive
* git-receive-pack
* git-lfs-authenticate

Co-authored-by: wxiaoguang <[email protected]>
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant