From 4d67431f80b1b822f0286afc9123ee453eac7334 Mon Sep 17 00:00:00 2001
From: David Howells <dhowells@redhat.com>
Date: Mon, 13 Jun 2011 22:33:52 +0100
Subject: KEYS: Don't return EAGAIN to keyctl_assume_authority()

Don't return EAGAIN to keyctl_assume_authority() to indicate that a key could
not be found (ENOKEY is only returned if a negative key is found).  Instead
return ENOKEY in both cases.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: James Morris <jmorris@namei.org>
---
 security/keys/request_key_auth.c | 2 ++
 1 file changed, 2 insertions(+)

(limited to 'security/keys/request_key_auth.c')

diff --git a/security/keys/request_key_auth.c b/security/keys/request_key_auth.c
index 6cff37529b8..60d4e3f5e4b 100644
--- a/security/keys/request_key_auth.c
+++ b/security/keys/request_key_auth.c
@@ -251,6 +251,8 @@ struct key *key_get_instantiation_authkey(key_serial_t target_id)
 
 	if (IS_ERR(authkey_ref)) {
 		authkey = ERR_CAST(authkey_ref);
+		if (authkey == ERR_PTR(-EAGAIN))
+			authkey = ERR_PTR(-ENOKEY);
 		goto error;
 	}
 
-- 
cgit v1.2.3-70-g09d2