From 6b557e9df29c86c5b7533d94916f6d981d037c4b Mon Sep 17 00:00:00 2001 From: Allen Wild Date: Sat, 13 Jul 2019 13:26:12 -0400 Subject: [PATCH] cmd/serv: actuall exit after fatal errors Regression in 356854fc5f8d7d1a7e4d68c9e00929e9ce8aa867, where a log.Fatal call was removed. log.Fatal calls os.Exit(1) as intended, but without it the fail() function returns normally and execution continues past the fatal error, causing a panic. This is visible as a go panic log and stack trace returned to the SSH client, which is not only ugly, it leaks server and build system information. Fix by removing the stray return statement so that the fail() function always calls os.Exit(1). Fixes: https://github.com/go-gitea/gitea/issues/7457 Signed-off-by: Allen Wild --- cmd/serv.go | 1 - 1 file changed, 1 deletion(-) diff --git a/cmd/serv.go b/cmd/serv.go index 32dd8cbd3e6f7..6409cb08765b7 100644 --- a/cmd/serv.go +++ b/cmd/serv.go @@ -73,7 +73,6 @@ func fail(userMessage, logMessage string, args ...interface{}) { if !setting.ProdMode { fmt.Fprintf(os.Stderr, logMessage+"\n", args...) } - return } os.Exit(1)