summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2020-08-31 18:12:49 +0100
committerGitHub <noreply@github.com>2020-08-31 18:12:49 +0100
commit82b71881d8625f26a86a0a892aa0f6d94924c61d (patch)
tree6e4eb19185b53c7482e826cd8986fc0bd6b48851
parent807a41ca9ac7fb0b8b6c506f526986df5c354216 (diff)
downloadgitea-82b71881d8625f26a86a0a892aa0f6d94924c61d.tar.gz
gitea-82b71881d8625f26a86a0a892aa0f6d94924c61d.zip
Ensure repoNames are lowercased in serv (#12668)
#12624 missed lowering the provided repoPath. (Additionally make a few fixes to the way the debug flag works.) Fix #12659 Fix #12667 Signed-off-by: Andrew Thornton <art27@cantab.net>
-rw-r--r--cmd/serv.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/cmd/serv.go b/cmd/serv.go
index f260685400..2c035111d8 100644
--- a/cmd/serv.go
+++ b/cmd/serv.go
@@ -51,8 +51,9 @@ var CmdServ = cli.Command{
}
func setup(logPath string, debug bool) {
- if !debug {
- _ = log.DelLogger("console")
+ _ = log.DelLogger("console")
+ if debug {
+ _ = log.NewLogger(1000, "console", "console", `{"level":"trace","stacktracelevel":"NONE","stderr":true}`)
}
setting.NewContext()
if debug {
@@ -117,6 +118,8 @@ func runServ(c *cli.Context) error {
}
println("If this is unexpected, please log in with password and setup Gitea under another user.")
return nil
+ } else if c.Bool("debug") {
+ log.Debug("SSH_ORIGINAL_COMMAND: %s", os.Getenv("SSH_ORIGINAL_COMMAND"))
}
words, err := shellquote.Split(cmd)
@@ -145,6 +148,9 @@ func runServ(c *cli.Context) error {
}
}
+ // LowerCase and trim the repoPath as that's how they are stored.
+ repoPath = strings.ToLower(strings.TrimSpace(repoPath))
+
rr := strings.SplitN(repoPath, "/", 2)
if len(rr) != 2 {
fail("Invalid repository path", "Invalid repository path: %v", repoPath)