Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 23517
b: refs/heads/master
c: 1d9b7d9
h: refs/heads/master
i:
  23515: 8ed639c
v: v3
  • Loading branch information
David Howells authored and Linus Torvalds committed Mar 25, 2006
1 parent 2c8eb39 commit 9ab9353
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3dccff8dc00994428777f483922058c554db85bd
refs/heads/master: 1d9b7d97d6661edb44ce08f17e47c66d4ac20e34
14 changes: 9 additions & 5 deletions trunk/security/keys/key.c
Original file line number Diff line number Diff line change
Expand Up @@ -795,12 +795,16 @@ key_ref_t key_create_or_update(key_ref_t keyring_ref,
goto error_3;
}

/* search for an existing key of the same type and description in the
* destination keyring
/* if it's possible to update this type of key, search for an existing
* key of the same type and description in the destination keyring and
* update that instead if possible
*/
key_ref = __keyring_search_one(keyring_ref, ktype, description, 0);
if (!IS_ERR(key_ref))
goto found_matching_key;
if (ktype->update) {
key_ref = __keyring_search_one(keyring_ref, ktype, description,
0);
if (!IS_ERR(key_ref))
goto found_matching_key;
}

/* decide on the permissions we want */
perm = KEY_POS_VIEW | KEY_POS_SEARCH | KEY_POS_LINK | KEY_POS_SETATTR;
Expand Down

0 comments on commit 9ab9353

Please sign in to comment.