rcolebaugh / rpms / openssh

Forked from rpms/openssh 2 years ago
Clone

Blame SOURCES/openssh-7.4p1-authorized_keys_command.patch

9a9eba
From ddd3d34e5c7979ca6f4a3a98a7d219a4ed3d98c2 Mon Sep 17 00:00:00 2001
9a9eba
From: "djm@openbsd.org" <djm@openbsd.org>
9a9eba
Date: Fri, 30 Dec 2016 22:08:02 +0000
9a9eba
Subject: [PATCH] upstream commit
9a9eba
9a9eba
fix deadlock when keys/principals command produces a lot of
9a9eba
output and a key is matched early; bz#2655, patch from jboning AT gmail.com
9a9eba
9a9eba
Upstream-ID: e19456429bf99087ea994432c16d00a642060afe
9a9eba
---
9a9eba
 auth2-pubkey.c | 8 +++++++-
9a9eba
 1 file changed, 7 insertions(+), 1 deletion(-)
9a9eba
9a9eba
diff --git a/auth2-pubkey.c b/auth2-pubkey.c
9a9eba
index 20f3309e1..70c021589 100644
9a9eba
--- a/auth2-pubkey.c
9a9eba
+++ b/auth2-pubkey.c
9a9eba
@@ -727,6 +727,9 @@ match_principals_command(struct passwd *user_pw, const struct sshkey *key)
9a9eba
 
9a9eba
 	ok = process_principals(f, NULL, pw, cert);
9a9eba
 
9a9eba
+	fclose(f);
9a9eba
+	f = NULL;
9a9eba
+
9a9eba
 	if (exited_cleanly(pid, "AuthorizedPrincipalsCommand", command) != 0)
9a9eba
 		goto out;
9a9eba
 
9a9eba
@@ -1050,6 +1053,9 @@ user_key_command_allowed2(struct passwd *user_pw, Key *key)
9a9eba
 
9a9eba
 	ok = check_authkeys_file(f, options.authorized_keys_command, key, pw);
9a9eba
 
9a9eba
+	fclose(f);
9a9eba
+	f = NULL;
9a9eba
+
9a9eba
 	if (exited_cleanly(pid, "AuthorizedKeysCommand", command) != 0)
9a9eba
 		goto out;
9a9eba
 
9a9eba