Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 201843
b: refs/heads/master
c: 9156235
h: refs/heads/master
i:
  201841: b083741
  201839: 75acf6e
v: v3
  • Loading branch information
David Howells authored and James Morris committed Aug 2, 2010
1 parent f45d827 commit ad33001
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 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: 57c2590fb7fd38bd52708ff2716a577d0c2b3c5a
refs/heads/master: 9156235b3427d6f01c5c95022f72f381f07583f5
17 changes: 16 additions & 1 deletion trunk/security/keys/keyctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1091,18 +1091,33 @@ long keyctl_set_reqkey_keyring(int reqkey_defl)
long keyctl_set_timeout(key_serial_t id, unsigned timeout)
{
struct timespec now;
struct key *key;
struct key *key, *instkey;
key_ref_t key_ref;
time_t expiry;
long ret;

key_ref = lookup_user_key(id, KEY_LOOKUP_CREATE | KEY_LOOKUP_PARTIAL,
KEY_SETATTR);
if (IS_ERR(key_ref)) {
/* setting the timeout on a key under construction is permitted
* if we have the authorisation token handy */
if (PTR_ERR(key_ref) == -EACCES) {
instkey = key_get_instantiation_authkey(id);
if (!IS_ERR(instkey)) {
key_put(instkey);
key_ref = lookup_user_key(id,
KEY_LOOKUP_PARTIAL,
0);
if (!IS_ERR(key_ref))
goto okay;
}
}

ret = PTR_ERR(key_ref);
goto error;
}

okay:
key = key_ref_to_ptr(key_ref);

/* make the changes with the locks held to prevent races */
Expand Down

0 comments on commit ad33001

Please sign in to comment.