aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/keys.go
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2021-07-14 15:43:13 +0100
committerGitHub <noreply@github.com>2021-07-14 10:43:13 -0400
commit3dcb3e9073d825a4ada184f832892cf4bd5836a3 (patch)
treeaab77b7726f0e20f34b452df166113950ff5fc62 /cmd/keys.go
parentee43d70a0c237ef9c02b99b9b49d1af348840319 (diff)
downloadgitea-3dcb3e9073d825a4ada184f832892cf4bd5836a3.tar.gz
gitea-3dcb3e9073d825a4ada184f832892cf4bd5836a3.zip
Second attempt at preventing zombies (#16326)
* Second attempt at preventing zombies * Ensure that the pipes are closed in ssh.go * Ensure that a cancellable context is passed up in cmd/* http requests * Make cmd.fail return properly so defers are obeyed * Ensure that something is sent to stdout in case of blocks here Signed-off-by: Andrew Thornton <art27@cantab.net> * placate lint Signed-off-by: Andrew Thornton <art27@cantab.net> * placate lint 2 Signed-off-by: Andrew Thornton <art27@cantab.net> * placate lint 3 Signed-off-by: Andrew Thornton <art27@cantab.net> * fixup Signed-off-by: Andrew Thornton <art27@cantab.net> * Apply suggestions from code review Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'cmd/keys.go')
-rw-r--r--cmd/keys.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/cmd/keys.go b/cmd/keys.go
index 7456815cd7..684aca64e2 100644
--- a/cmd/keys.go
+++ b/cmd/keys.go
@@ -62,9 +62,12 @@ func runKeys(c *cli.Context) error {
return errors.New("No key type and content provided")
}
+ ctx, cancel := installSignals()
+ defer cancel()
+
setup("keys.log", false)
- authorizedString, err := private.AuthorizedPublicKeyByContent(content)
+ authorizedString, err := private.AuthorizedPublicKeyByContent(ctx, content)
if err != nil {
return err
}