Skip to contentSkip to conversation

Return a different error if unavailable keytype is used

PATCH New David Howells 1 participant 1 message Sep 23, 2004

Subsystems (2)
lore
Share & tools
lore

David Howells

author maintainer
#0 lore raw

PATCH 1/1 Return a different error if unavailable keytype is used

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.

---

 key.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)
security/keys/key.c +1 -1
diff -uNrp linux-2.6.9-rc2-mm1/security/keys/key.c linux-2.6.9-rc2-mm1-afskey/security/keys/key.c
@@ -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;
 	}