aboutsummaryrefslogtreecommitdiffstats
path: root/security/keys/keyring.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2005-12-01 03:51:18 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-12-01 18:48:56 -0500
commitdb1d1d57e97700b4131fe80556dc6ef976d534c4 (patch)
treeabdc78339b1c1bd4e37cb496c68424d9d7d98592 /security/keys/keyring.c
parent5c72c343719a8c5dba675cd1b27b63c06bfe23d1 (diff)
[PATCH] Keys: Fix permissions check for update vs add
Permit add_key() to once again update a matching key rather than adding a new one if a matching key already exists in the target keyring. This bug causes add_key() to always add a new key, displacing the old from the target keyring. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'security/keys/keyring.c')
-rw-r--r--security/keys/keyring.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/security/keys/keyring.c b/security/keys/keyring.c
index c7a0ab1cfda3..4e9fa8be44b8 100644
--- a/security/keys/keyring.c
+++ b/security/keys/keyring.c
@@ -526,7 +526,7 @@ key_ref_t __keyring_search_one(key_ref_t keyring_ref,
526 (!key->type->match || 526 (!key->type->match ||
527 key->type->match(key, description)) && 527 key->type->match(key, description)) &&
528 key_permission(make_key_ref(key, possessed), 528 key_permission(make_key_ref(key, possessed),
529 perm) < 0 && 529 perm) == 0 &&
530 !test_bit(KEY_FLAG_REVOKED, &key->flags) 530 !test_bit(KEY_FLAG_REVOKED, &key->flags)
531 ) 531 )
532 goto found; 532 goto found;