diff options
author | Sandro Santilli <strk@kbt.io> | 2019-06-03 10:07:03 +0200 |
---|---|---|
committer | zeripath <art27@cantab.net> | 2019-06-03 09:07:03 +0100 |
commit | 45f588e85dbd3004334718dc9fbbb27675814ee0 (patch) | |
tree | 2a50f33218c604491b77b3c375c3d1e968cbef8c /cmd/serv.go | |
parent | 9002c5157b352afb944d0c6a5065deee1e8b113d (diff) | |
download | gitea-45f588e85dbd3004334718dc9fbbb27675814ee0.tar.gz gitea-45f588e85dbd3004334718dc9fbbb27675814ee0.zip |
Avoid arbitrary format strings upon calling fail() function (#7112)
Diffstat (limited to 'cmd/serv.go')
-rw-r--r-- | cmd/serv.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd/serv.go b/cmd/serv.go index aa068d4cf6..0b0a4e8efb 100644 --- a/cmd/serv.go +++ b/cmd/serv.go @@ -53,7 +53,7 @@ func checkLFSVersion() { //Needs at least git v2.1.2 binVersion, err := git.BinVersion() if err != nil { - fail(fmt.Sprintf("Error retrieving git version: %v", err), fmt.Sprintf("Error retrieving git version: %v", err)) + fail("LFS server error", "Error retrieving git version: %v", err) } if !version.Compare(binVersion, "2.1.2", ">=") { @@ -199,12 +199,12 @@ func runServ(c *cli.Context) error { if private.IsErrServCommand(err) { errServCommand := err.(private.ErrServCommand) if errServCommand.StatusCode != http.StatusInternalServerError { - fail("Unauthorized", errServCommand.Error()) + fail("Unauthorized", "%s", errServCommand.Error()) } else { - fail("Internal Server Error", errServCommand.Error()) + fail("Internal Server Error", "%s", errServCommand.Error()) } } - fail("Internal Server Error", err.Error()) + fail("Internal Server Error", "%s", err.Error()) } os.Setenv(models.EnvRepoIsWiki, strconv.FormatBool(results.IsWiki)) os.Setenv(models.EnvRepoName, results.RepoName) |