Skip to content

Commit 9224405

Browse files
fabian-zlunny
authored andcommitted
LFS: Fix SSH authentication for trailing arguments (#1328)
Fixes #1296
1 parent c05bd17 commit 9224405

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

cmd/serv.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ func runServ(c *cli.Context) error {
123123
fail("Unknown git command", "LFS authentication request over SSH denied, LFS support is disabled")
124124
}
125125

126-
if strings.Contains(args, " ") {
127-
argsSplit := strings.SplitN(args, " ", 2)
126+
argsSplit := strings.Split(args, " ")
127+
if len(argsSplit) >= 2 {
128128
args = strings.TrimSpace(argsSplit[0])
129129
lfsVerb = strings.TrimSpace(argsSplit[1])
130130
}
@@ -179,8 +179,10 @@ func runServ(c *cli.Context) error {
179179
if verb == lfsAuthenticateVerb {
180180
if lfsVerb == "upload" {
181181
requestedMode = models.AccessModeWrite
182-
} else {
182+
} else if lfsVerb == "download" {
183183
requestedMode = models.AccessModeRead
184+
} else {
185+
fail("Unknown LFS verb", "Unkown lfs verb %s", lfsVerb)
184186
}
185187
}
186188

0 commit comments

Comments
 (0)