Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 190198
b: refs/heads/master
c: 93b4a44
h: refs/heads/master
v: v3
  • Loading branch information
David Howells authored and Linus Torvalds committed Apr 24, 2010
1 parent ddf7e58 commit 4a30e50
Show file tree
Hide file tree
Showing 2 changed files with 9 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: ccdb40048b2972f10bdc944913c0e0ee26b5d1f2
refs/heads/master: 93b4a44f3ad69520d605aace3f3486b8eb754b96
13 changes: 8 additions & 5 deletions trunk/security/keys/request_key.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ static int call_sbin_request_key(struct key_construction *cons,
{
const struct cred *cred = current_cred();
key_serial_t prkey, sskey;
struct key *key = cons->key, *authkey = cons->authkey, *keyring;
struct key *key = cons->key, *authkey = cons->authkey, *keyring,
*session;
char *argv[9], *envp[3], uid_str[12], gid_str[12];
char key_str[12], keyring_str[3][12];
char desc[20];
Expand Down Expand Up @@ -112,10 +113,12 @@ static int call_sbin_request_key(struct key_construction *cons,
if (cred->tgcred->process_keyring)
prkey = cred->tgcred->process_keyring->serial;

if (cred->tgcred->session_keyring)
sskey = rcu_dereference(cred->tgcred->session_keyring)->serial;
else
sskey = cred->user->session_keyring->serial;
rcu_read_lock();
session = rcu_dereference(cred->tgcred->session_keyring);
if (!session)
session = cred->user->session_keyring;
sskey = session->serial;
rcu_read_unlock();

sprintf(keyring_str[2], "%d", sskey);

Expand Down

0 comments on commit 4a30e50

Please sign in to comment.