Skip to content

Commit 2186a99

Browse files
aswildzeripath
authored andcommitted
cmd/serv: actually exit after fatal errors (#7458)
Regression in 356854f, 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: #7457 Signed-off-by: Allen Wild <[email protected]>
1 parent 50d8d17 commit 2186a99

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

cmd/serv.go

-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ func fail(userMessage, logMessage string, args ...interface{}) {
7373
if !setting.ProdMode {
7474
fmt.Fprintf(os.Stderr, logMessage+"\n", args...)
7575
}
76-
return
7776
}
7877

7978
os.Exit(1)

0 commit comments

Comments
 (0)