All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Return a different error if unavailable keytype is used
@ 2004-09-23  9:52 David Howells
  0 siblings, 0 replies; only message in thread
From: David Howells @ 2004-09-23  9:52 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel


The attached patch causes the add_key() syscall to return a different error if
the key type is unavailable to distinguish between that and an error
indicating the keyring to add to is unavailable.

Signed-Off-By: David Howells <dhowells@redhat.com>
---

 key.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -uNrp linux-2.6.9-rc2-mm1/security/keys/key.c linux-2.6.9-rc2-mm1-afskey/security/keys/key.c
--- linux-2.6.9-rc2-mm1/security/keys/key.c	2004-09-16 12:09:57.000000000 +0100
+++ linux-2.6.9-rc2-mm1-afskey/security/keys/key.c	2004-09-22 16:14:03.000000000 +0100
@@ -744,7 +744,7 @@ struct key *key_create_or_update(struct 
 	 * types */
 	ktype = key_type_lookup(type);
 	if (IS_ERR(ktype)) {
-		key = ERR_PTR(PTR_ERR(ktype));
+		key = ERR_PTR(-ENODEV);
 		goto error;
 	}
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-09-23  9:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-23  9:52 [PATCH] Return a different error if unavailable keytype is used David Howells

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.